hyperbook 0.4.3 → 0.5.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.js
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(()=>{var t={6491:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},6325:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const c=10;const l=10;const u=o>c;const h=o===c&&a>=l;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},1659:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(4715);const a=i(8907);const c=i(3486);r.Settings=c.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},4715:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(3645);const a=i(5341);const c=i(6325);const l=i(946);const u=i(3253);function read(t,r,i){if(!r.stats&&c.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,c)=>{if(o!==null){callFailureCallback(i,o);return}const l=c.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,l);return}const h=l.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=l.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((c,h)=>{if(c!==null){callFailureCallback(i,c);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,c)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:l.fs.createDirentFromStats(i,c)};if(r.stats){u.stats=c}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},3253:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},8907:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(3645);const a=i(6325);const c=i(946);const l=i(3253);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:l.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=c.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=l.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:c.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},3486:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(3645);const c=i(6491);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=c.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},2926:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},946:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(2926);r.fs=o},2243:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},3645:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(6948);const a=i(6750);const c=i(1917);r.Settings=c.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},6948:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},6750:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},1917:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2243);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},4328:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(4306);const a=i(2686);const c=i(8918);const l=i(8831);r.Settings=l.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new c.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},4306:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1293);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2686:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(1293);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},8918:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9476);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},1293:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(1659);const c=i(4241);const l=i(1652);const u=i(8376);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=c(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!l.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=l.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(l.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&l.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},1652:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},8376:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1652);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},9476:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1659);const a=i(1652);const c=i(8376);class SyncReader extends c.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},8831:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(1659);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},8950:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(t){return i.includes(t)}const o=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...i];function isObjectTypeName(t){return o.includes(t)}const a=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(t){return a.includes(t)}function isOfType(t){return r=>typeof r===t}const{toString:c}=Object.prototype;const getObjectType=t=>{const r=c.call(t).slice(8,-1);if(/HTML\w+Element/.test(r)&&is.domElement(t)){return"HTMLElement"}if(isObjectTypeName(r)){return r}return undefined};const isObjectOfType=t=>r=>getObjectType(r)===t;function is(t){if(t===null){return"null"}switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(t)){return"Observable"}if(is.array(t)){return"Array"}if(is.buffer(t)){return"Buffer"}const r=getObjectType(t);if(r){return r}if(t instanceof String||t instanceof Boolean||t instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const l=isOfType("number");is.number=t=>l(t)&&!is.nan(t);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=t=>t===null;is.class_=t=>is.function_(t)&&t.toString().startsWith("class ");is.boolean=t=>t===true||t===false;is.symbol=isOfType("symbol");is.numericString=t=>is.string(t)&&!is.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));is.array=(t,r)=>{if(!Array.isArray(t)){return false}if(!is.function_(r)){return true}return t.every(r)};is.buffer=t=>{var r,i,o,a;return(a=(o=(i=(r=t)===null||r===void 0?void 0:r.constructor)===null||i===void 0?void 0:i.isBuffer)===null||o===void 0?void 0:o.call(i,t))!==null&&a!==void 0?a:false};is.blob=t=>isObjectOfType("Blob")(t);is.nullOrUndefined=t=>is.null_(t)||is.undefined(t);is.object=t=>!is.null_(t)&&(typeof t==="object"||is.function_(t));is.iterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.iterator])};is.asyncIterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.asyncIterator])};is.generator=t=>{var r,i;return is.iterable(t)&&is.function_((r=t)===null||r===void 0?void 0:r.next)&&is.function_((i=t)===null||i===void 0?void 0:i.throw)};is.asyncGenerator=t=>is.asyncIterable(t)&&is.function_(t.next)&&is.function_(t.throw);is.nativePromise=t=>isObjectOfType("Promise")(t);const hasPromiseAPI=t=>{var r,i;return is.function_((r=t)===null||r===void 0?void 0:r.then)&&is.function_((i=t)===null||i===void 0?void 0:i.catch)};is.promise=t=>is.nativePromise(t)||hasPromiseAPI(t);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=t=>getObjectType(t)==="AsyncGeneratorFunction";is.asyncFunction=t=>getObjectType(t)==="AsyncFunction";is.boundFunction=t=>is.function_(t)&&!t.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=t=>isObjectOfType("Map")(t);is.set=t=>isObjectOfType("Set")(t);is.weakMap=t=>isObjectOfType("WeakMap")(t);is.weakSet=t=>isObjectOfType("WeakSet")(t);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(t,r)=>Object.values(r).includes(t);is.directInstanceOf=(t,r)=>Object.getPrototypeOf(t)===r.prototype;is.urlInstance=t=>isObjectOfType("URL")(t);is.urlString=t=>{if(!is.string(t)){return false}try{new URL(t);return true}catch(t){return false}};is.truthy=t=>Boolean(t);is.falsy=t=>!t;is.nan=t=>Number.isNaN(t);is.primitive=t=>is.null_(t)||isPrimitiveTypeName(typeof t);is.integer=t=>Number.isInteger(t);is.safeInteger=t=>Number.isSafeInteger(t);is.plainObject=t=>{if(c.call(t)!=="[object Object]"){return false}const r=Object.getPrototypeOf(t);return r===null||r===Object.getPrototypeOf({})};is.typedArray=t=>isTypedArrayName(getObjectType(t));const isValidLength=t=>is.safeInteger(t)&&t>=0;is.arrayLike=t=>!is.nullOrUndefined(t)&&!is.function_(t)&&isValidLength(t.length);is.inRange=(t,r)=>{if(is.number(r)){return t>=Math.min(0,r)&&t<=Math.max(r,0)}if(is.array(r)&&r.length===2){return t>=Math.min(...r)&&t<=Math.max(...r)}throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};const u=1;const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=t=>is.object(t)&&t.nodeType===u&&is.string(t.nodeName)&&!is.plainObject(t)&&h.every((r=>r in t));is.observable=t=>{var r,i,o,a;if(!t){return false}if(t===((i=(r=t)[Symbol.observable])===null||i===void 0?void 0:i.call(r))){return true}if(t===((a=(o=t)["@@observable"])===null||a===void 0?void 0:a.call(o))){return true}return false};is.nodeStream=t=>is.object(t)&&is.function_(t.pipe)&&!is.observable(t);is.infinite=t=>t===Infinity||t===-Infinity;const isAbsoluteMod2=t=>r=>is.integer(r)&&Math.abs(r%2)===t;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=t=>is.array(t)&&t.length===0;is.nonEmptyArray=t=>is.array(t)&&t.length>0;is.emptyString=t=>is.string(t)&&t.length===0;const isWhiteSpaceString=t=>is.string(t)&&!/\S/.test(t);is.emptyStringOrWhitespace=t=>is.emptyString(t)||isWhiteSpaceString(t);is.nonEmptyString=t=>is.string(t)&&t.length>0;is.nonEmptyStringAndNotWhitespace=t=>is.string(t)&&!is.emptyStringOrWhitespace(t);is.emptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length===0;is.nonEmptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length>0;is.emptySet=t=>is.set(t)&&t.size===0;is.nonEmptySet=t=>is.set(t)&&t.size>0;is.emptyMap=t=>is.map(t)&&t.size===0;is.nonEmptyMap=t=>is.map(t)&&t.size>0;is.propertyKey=t=>is.any([is.string,is.number,is.symbol],t);is.formData=t=>isObjectOfType("FormData")(t);is.urlSearchParams=t=>isObjectOfType("URLSearchParams")(t);const predicateOnArray=(t,r,i)=>{if(!is.function_(r)){throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`)}if(i.length===0){throw new TypeError("Invalid number of values")}return t.call(i,r)};is.any=(t,...r)=>{const i=is.array(t)?t:[t];return i.some((t=>predicateOnArray(Array.prototype.some,t,r)))};is.all=(t,...r)=>predicateOnArray(Array.prototype.every,t,r);const assertType=(t,r,i,o={})=>{if(!t){const{multipleValues:t}=o;const a=t?`received values of types ${[...new Set(i.map((t=>`\`${is(t)}\``)))].join(", ")}`:`received value of type \`${is(i)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${a}.`)}};r.assert={undefined:t=>assertType(is.undefined(t),"undefined",t),string:t=>assertType(is.string(t),"string",t),number:t=>assertType(is.number(t),"number",t),bigint:t=>assertType(is.bigint(t),"bigint",t),function_:t=>assertType(is.function_(t),"Function",t),null_:t=>assertType(is.null_(t),"null",t),class_:t=>assertType(is.class_(t),"Class",t),boolean:t=>assertType(is.boolean(t),"boolean",t),symbol:t=>assertType(is.symbol(t),"symbol",t),numericString:t=>assertType(is.numericString(t),"string with a number",t),array:(t,r)=>{const i=assertType;i(is.array(t),"Array",t);if(r){t.forEach(r)}},buffer:t=>assertType(is.buffer(t),"Buffer",t),blob:t=>assertType(is.blob(t),"Blob",t),nullOrUndefined:t=>assertType(is.nullOrUndefined(t),"null or undefined",t),object:t=>assertType(is.object(t),"Object",t),iterable:t=>assertType(is.iterable(t),"Iterable",t),asyncIterable:t=>assertType(is.asyncIterable(t),"AsyncIterable",t),generator:t=>assertType(is.generator(t),"Generator",t),asyncGenerator:t=>assertType(is.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>assertType(is.nativePromise(t),"native Promise",t),promise:t=>assertType(is.promise(t),"Promise",t),generatorFunction:t=>assertType(is.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>assertType(is.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>assertType(is.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>assertType(is.boundFunction(t),"Function",t),regExp:t=>assertType(is.regExp(t),"RegExp",t),date:t=>assertType(is.date(t),"Date",t),error:t=>assertType(is.error(t),"Error",t),map:t=>assertType(is.map(t),"Map",t),set:t=>assertType(is.set(t),"Set",t),weakMap:t=>assertType(is.weakMap(t),"WeakMap",t),weakSet:t=>assertType(is.weakSet(t),"WeakSet",t),int8Array:t=>assertType(is.int8Array(t),"Int8Array",t),uint8Array:t=>assertType(is.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>assertType(is.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>assertType(is.int16Array(t),"Int16Array",t),uint16Array:t=>assertType(is.uint16Array(t),"Uint16Array",t),int32Array:t=>assertType(is.int32Array(t),"Int32Array",t),uint32Array:t=>assertType(is.uint32Array(t),"Uint32Array",t),float32Array:t=>assertType(is.float32Array(t),"Float32Array",t),float64Array:t=>assertType(is.float64Array(t),"Float64Array",t),bigInt64Array:t=>assertType(is.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>assertType(is.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>assertType(is.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>assertType(is.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>assertType(is.dataView(t),"DataView",t),enumCase:(t,r)=>assertType(is.enumCase(t,r),"EnumCase",t),urlInstance:t=>assertType(is.urlInstance(t),"URL",t),urlString:t=>assertType(is.urlString(t),"string with a URL",t),truthy:t=>assertType(is.truthy(t),"truthy",t),falsy:t=>assertType(is.falsy(t),"falsy",t),nan:t=>assertType(is.nan(t),"NaN",t),primitive:t=>assertType(is.primitive(t),"primitive",t),integer:t=>assertType(is.integer(t),"integer",t),safeInteger:t=>assertType(is.safeInteger(t),"integer",t),plainObject:t=>assertType(is.plainObject(t),"plain object",t),typedArray:t=>assertType(is.typedArray(t),"TypedArray",t),arrayLike:t=>assertType(is.arrayLike(t),"array-like",t),domElement:t=>assertType(is.domElement(t),"HTMLElement",t),observable:t=>assertType(is.observable(t),"Observable",t),nodeStream:t=>assertType(is.nodeStream(t),"Node.js Stream",t),infinite:t=>assertType(is.infinite(t),"infinite number",t),emptyArray:t=>assertType(is.emptyArray(t),"empty array",t),nonEmptyArray:t=>assertType(is.nonEmptyArray(t),"non-empty array",t),emptyString:t=>assertType(is.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>assertType(is.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>assertType(is.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>assertType(is.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>assertType(is.emptyObject(t),"empty object",t),nonEmptyObject:t=>assertType(is.nonEmptyObject(t),"non-empty object",t),emptySet:t=>assertType(is.emptySet(t),"empty set",t),nonEmptySet:t=>assertType(is.nonEmptySet(t),"non-empty set",t),emptyMap:t=>assertType(is.emptyMap(t),"empty map",t),nonEmptyMap:t=>assertType(is.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>assertType(is.propertyKey(t),"PropertyKey",t),formData:t=>assertType(is.formData(t),"FormData",t),urlSearchParams:t=>assertType(is.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>assertType(is.evenInteger(t),"even integer",t),oddInteger:t=>assertType(is.oddInteger(t),"odd integer",t),directInstanceOf:(t,r)=>assertType(is.directInstanceOf(t,r),"T",t),inRange:(t,r)=>assertType(is.inRange(t,r),"in range",t),any:(t,...r)=>assertType(is.any(t,...r),"predicate returns truthy for any value",r,{multipleValues:true}),all:(t,...r)=>assertType(is.all(t,...r),"predicate returns truthy for all values",r,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(r.assert,{class:{value:r.assert.class_},function:{value:r.assert.function_},null:{value:r.assert.null_}});r["default"]=is;t.exports=is;t.exports["default"]=is;t.exports.assert=r.assert},1176:(t,r,i)=>{var o=i(2012);function retry(t,r){function run(i,a){var c=r||{};var l;if(!("randomize"in c)){c.randomize=true}l=o.operation(c);function bail(t){a(t||new Error("Aborted"))}function onError(t,r){if(t.bail){bail(t);return}if(!l.retry(t)){a(l.mainError())}else if(c.onRetry){c.onRetry(t,r)}}function runAttempt(r){var o;try{o=t(bail,r)}catch(t){onError(t,r);return}Promise.resolve(o).then(i).catch((function catchIt(t){onError(t,r)}))}l.attempt(runAttempt)}return new Promise(run)}t.exports=retry},155:t=>{"use strict";t.exports=balanced;function balanced(t,r,i){if(t instanceof RegExp)t=maybeMatch(t,i);if(r instanceof RegExp)r=maybeMatch(r,i);var o=range(t,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+t.length,o[1]),post:i.slice(o[1]+r.length)}}function maybeMatch(t,r){var i=r.match(t);return i?i[0]:null}balanced.range=range;function range(t,r,i){var o,a,c,l,u;var h=i.indexOf(t);var d=i.indexOf(r,h+1);var p=h;if(h>=0&&d>0){if(t===r){return[h,d]}o=[];c=i.length;while(p>=0&&!u){if(p==h){o.push(p);h=i.indexOf(t,p+1)}else if(o.length==1){u=[o.pop(),d]}else{a=o.pop();if(a<c){c=a;l=d}d=i.indexOf(r,p+1)}p=h<d&&h>=0?h:d}if(o.length){u=[c,l]}}return u}},7847:(t,r,i)=>{var o=i(1062);var a=i(155);t.exports=expandTop;var c="\0SLASH"+Math.random()+"\0";var l="\0OPEN"+Math.random()+"\0";var u="\0CLOSE"+Math.random()+"\0";var h="\0COMMA"+Math.random()+"\0";var d="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(c).split("\\{").join(l).split("\\}").join(u).split("\\,").join(h).split("\\.").join(d)}function unescapeBraces(t){return t.split(c).join("\\").split(l).join("{").split(u).join("}").split(h).join(",").split(d).join(".")}function parseCommaParts(t){if(!t)return[""];var r=[];var i=a("{","}",t);if(!i)return t.split(",");var o=i.pre;var c=i.body;var l=i.post;var u=o.split(",");u[u.length-1]+="{"+c+"}";var h=parseCommaParts(l);if(l.length){u[u.length-1]+=h.shift();u.push.apply(u,h)}r.push.apply(r,u);return r}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function identity(t){return t}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,r){return t<=r}function gte(t,r){return t>=r}function expand(t,r){var i=[];var c=a("{","}",t);if(!c||/\$$/.test(c.pre))return[t];var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body);var h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body);var d=l||h;var p=c.body.indexOf(",")>=0;if(!d&&!p){if(c.post.match(/,.*\}/)){t=c.pre+"{"+c.body+u+c.post;return expand(t)}return[t]}var m;if(d){m=c.body.split(/\.\./)}else{m=parseCommaParts(c.body);if(m.length===1){m=expand(m[0],false).map(embrace);if(m.length===1){var g=c.post.length?expand(c.post,false):[""];return g.map((function(t){return c.pre+m[0]+t}))}}}var y=c.pre;var g=c.post.length?expand(c.post,false):[""];var b;if(d){var v=numeric(m[0]);var _=numeric(m[1]);var w=Math.max(m[0].length,m[1].length);var E=m.length==3?Math.abs(numeric(m[2])):1;var S=lte;var O=_<v;if(O){E*=-1;S=gte}var R=m.some(isPadded);b=[];for(var x=v;S(x,_);x+=E){var A;if(h){A=String.fromCharCode(x);if(A==="\\")A=""}else{A=String(x);if(R){var T=w-A.length;if(T>0){var k=new Array(T+1).join("0");if(x<0)A="-"+k+A.slice(1);else A=k+A}}}b.push(A)}}else{b=o(m,(function(t){return expand(t,false)}))}for(var C=0;C<b.length;C++){for(var P=0;P<g.length;P++){var I=y+b[C]+g[P];if(!r||d||I)i.push(I)}}return i}},1570:(t,r,i)=>{"use strict";const o=i(3625);const a=i(4666);const c=i(6183);const l=i(2467);const braces=(t,r={})=>{let i=[];if(Array.isArray(t)){for(let o of t){let t=braces.create(o,r);if(Array.isArray(t)){i.push(...t)}else{i.push(t)}}}else{i=[].concat(braces.create(t,r))}if(r&&r.expand===true&&r.nodupes===true){i=[...new Set(i)]}return i};braces.parse=(t,r={})=>l(t,r);braces.stringify=(t,r={})=>{if(typeof t==="string"){return o(braces.parse(t,r),r)}return o(t,r)};braces.compile=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}return a(t,r)};braces.expand=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}let i=c(t,r);if(r.noempty===true){i=i.filter(Boolean)}if(r.nodupes===true){i=[...new Set(i)]}return i};braces.create=(t,r={})=>{if(t===""||t.length<3){return[t]}return r.expand!==true?braces.compile(t,r):braces.expand(t,r)};t.exports=braces},4666:(t,r,i)=>{"use strict";const o=i(442);const a=i(2456);const compile=(t,r={})=>{let walk=(t,i={})=>{let c=a.isInvalidBrace(i);let l=t.invalid===true&&r.escapeInvalid===true;let u=c===true||l===true;let h=r.escapeInvalid===true?"\\":"";let d="";if(t.isOpen===true){return h+t.value}if(t.isClose===true){return h+t.value}if(t.type==="open"){return u?h+t.value:"("}if(t.type==="close"){return u?h+t.value:")"}if(t.type==="comma"){return t.prev.type==="comma"?"":u?t.value:"|"}if(t.value){return t.value}if(t.nodes&&t.ranges>0){let i=a.reduce(t.nodes);let c=o(...i,{...r,wrap:false,toRegex:true});if(c.length!==0){return i.length>1&&c.length>1?`(${c})`:c}}if(t.nodes){for(let r of t.nodes){d+=walk(r,t)}}return d};return walk(t)};t.exports=compile},487:t=>{"use strict";t.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},6183:(t,r,i)=>{"use strict";const o=i(442);const a=i(3625);const c=i(2456);const append=(t="",r="",i=false)=>{let o=[];t=[].concat(t);r=[].concat(r);if(!r.length)return t;if(!t.length){return i?c.flatten(r).map((t=>`{${t}}`)):r}for(let a of t){if(Array.isArray(a)){for(let t of a){o.push(append(t,r,i))}}else{for(let t of r){if(i===true&&typeof t==="string")t=`{${t}}`;o.push(Array.isArray(t)?append(a,t,i):a+t)}}}return c.flatten(o)};const expand=(t,r={})=>{let i=r.rangeLimit===void 0?1e3:r.rangeLimit;let walk=(t,l={})=>{t.queue=[];let u=l;let h=l.queue;while(u.type!=="brace"&&u.type!=="root"&&u.parent){u=u.parent;h=u.queue}if(t.invalid||t.dollar){h.push(append(h.pop(),a(t,r)));return}if(t.type==="brace"&&t.invalid!==true&&t.nodes.length===2){h.push(append(h.pop(),["{}"]));return}if(t.nodes&&t.ranges>0){let l=c.reduce(t.nodes);if(c.exceedsLimit(...l,r.step,i)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let u=o(...l,r);if(u.length===0){u=a(t,r)}h.push(append(h.pop(),u));t.nodes=[];return}let d=c.encloseBrace(t);let p=t.queue;let m=t;while(m.type!=="brace"&&m.type!=="root"&&m.parent){m=m.parent;p=m.queue}for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r];if(i.type==="comma"&&t.type==="brace"){if(r===1)p.push("");p.push("");continue}if(i.type==="close"){h.push(append(h.pop(),p,d));continue}if(i.value&&i.type!=="open"){p.push(append(p.pop(),i.value));continue}if(i.nodes){walk(i,t)}}return p};return c.flatten(walk(t))};t.exports=expand},2467:(t,r,i)=>{"use strict";const o=i(3625);const{MAX_LENGTH:a,CHAR_BACKSLASH:c,CHAR_BACKTICK:l,CHAR_COMMA:u,CHAR_DOT:h,CHAR_LEFT_PARENTHESES:d,CHAR_RIGHT_PARENTHESES:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_RIGHT_SQUARE_BRACKET:b,CHAR_DOUBLE_QUOTE:v,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:w,CHAR_ZERO_WIDTH_NOBREAK_SPACE:E}=i(487);const parse=(t,r={})=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}let i=r||{};let S=typeof i.maxLength==="number"?Math.min(a,i.maxLength):a;if(t.length>S){throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${S})`)}let O={type:"root",input:t,nodes:[]};let R=[O];let x=O;let A=O;let T=0;let k=t.length;let C=0;let P=0;let I;let L={};const advance=()=>t[C++];const push=t=>{if(t.type==="text"&&A.type==="dot"){A.type="text"}if(A&&A.type==="text"&&t.type==="text"){A.value+=t.value;return}x.nodes.push(t);t.parent=x;t.prev=A;A=t;return t};push({type:"bos"});while(C<k){x=R[R.length-1];I=advance();if(I===E||I===w){continue}if(I===c){push({type:"text",value:(r.keepEscaping?I:"")+advance()});continue}if(I===b){push({type:"text",value:"\\"+I});continue}if(I===y){T++;let t=true;let r;while(C<k&&(r=advance())){I+=r;if(r===y){T++;continue}if(r===c){I+=advance();continue}if(r===b){T--;if(T===0){break}}}push({type:"text",value:I});continue}if(I===d){x=push({type:"paren",nodes:[]});R.push(x);push({type:"text",value:I});continue}if(I===p){if(x.type!=="paren"){push({type:"text",value:I});continue}x=R.pop();push({type:"text",value:I});x=R[R.length-1];continue}if(I===v||I===_||I===l){let t=I;let i;if(r.keepQuotes!==true){I=""}while(C<k&&(i=advance())){if(i===c){I+=i+advance();continue}if(i===t){if(r.keepQuotes===true)I+=i;break}I+=i}push({type:"text",value:I});continue}if(I===m){P++;let t=A.value&&A.value.slice(-1)==="$"||x.dollar===true;let r={type:"brace",open:true,close:false,dollar:t,depth:P,commas:0,ranges:0,nodes:[]};x=push(r);R.push(x);push({type:"open",value:I});continue}if(I===g){if(x.type!=="brace"){push({type:"text",value:I});continue}let t="close";x=R.pop();x.close=true;push({type:t,value:I});P--;x=R[R.length-1];continue}if(I===u&&P>0){if(x.ranges>0){x.ranges=0;let t=x.nodes.shift();x.nodes=[t,{type:"text",value:o(x)}]}push({type:"comma",value:I});x.commas++;continue}if(I===h&&P>0&&x.commas===0){let t=x.nodes;if(P===0||t.length===0){push({type:"text",value:I});continue}if(A.type==="dot"){x.range=[];A.value+=I;A.type="range";if(x.nodes.length!==3&&x.nodes.length!==5){x.invalid=true;x.ranges=0;A.type="text";continue}x.ranges++;x.args=[];continue}if(A.type==="range"){t.pop();let r=t[t.length-1];r.value+=A.value+I;A=r;x.ranges--;continue}push({type:"dot",value:I});continue}push({type:"text",value:I})}do{x=R.pop();if(x.type!=="root"){x.nodes.forEach((t=>{if(!t.nodes){if(t.type==="open")t.isOpen=true;if(t.type==="close")t.isClose=true;if(!t.nodes)t.type="text";t.invalid=true}}));let t=R[R.length-1];let r=t.nodes.indexOf(x);t.nodes.splice(r,1,...x.nodes)}}while(R.length>0);push({type:"eos"});return O};t.exports=parse},3625:(t,r,i)=>{"use strict";const o=i(2456);t.exports=(t,r={})=>{let stringify=(t,i={})=>{let a=r.escapeInvalid&&o.isInvalidBrace(i);let c=t.invalid===true&&r.escapeInvalid===true;let l="";if(t.value){if((a||c)&&o.isOpenOrClose(t)){return"\\"+t.value}return t.value}if(t.value){return t.value}if(t.nodes){for(let r of t.nodes){l+=stringify(r)}}return l};return stringify(t)}},2456:(t,r)=>{"use strict";r.isInteger=t=>{if(typeof t==="number"){return Number.isInteger(t)}if(typeof t==="string"&&t.trim()!==""){return Number.isInteger(Number(t))}return false};r.find=(t,r)=>t.nodes.find((t=>t.type===r));r.exceedsLimit=(t,i,o=1,a)=>{if(a===false)return false;if(!r.isInteger(t)||!r.isInteger(i))return false;return(Number(i)-Number(t))/Number(o)>=a};r.escapeNode=(t,r=0,i)=>{let o=t.nodes[r];if(!o)return;if(i&&o.type===i||o.type==="open"||o.type==="close"){if(o.escaped!==true){o.value="\\"+o.value;o.escaped=true}}};r.encloseBrace=t=>{if(t.type!=="brace")return false;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}return false};r.isInvalidBrace=t=>{if(t.type!=="brace")return false;if(t.invalid===true||t.dollar)return true;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}if(t.open!==true||t.close!==true){t.invalid=true;return true}return false};r.isOpenOrClose=t=>{if(t.type==="open"||t.type==="close"){return true}return t.open===true||t.close===true};r.reduce=t=>t.reduce(((t,r)=>{if(r.type==="text")t.push(r.value);if(r.type==="range")r.type="text";return t}),[]);r.flatten=(...t)=>{const r=[];const flat=t=>{for(let i=0;i<t.length;i++){let o=t[i];Array.isArray(o)?flat(o,r):o!==void 0&&r.push(o)}return r};flat(t);return r}},9201:(t,r,i)=>{"use strict";const{V4MAPPED:o,ADDRCONFIG:a,ALL:c,promises:{Resolver:l},lookup:u}=i(9523);const{promisify:h}=i(3837);const d=i(2037);const p=Symbol("cacheableLookupCreateConnection");const m=Symbol("cacheableLookupInstance");const g=Symbol("expires");const y=typeof c==="number";const verifyAgent=t=>{if(!(t&&typeof t.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=t=>{for(const r of t){if(r.family===6){continue}r.address=`::ffff:${r.address}`;r.family=6}};const getIfaceInfo=()=>{let t=false;let r=false;for(const i of Object.values(d.networkInterfaces())){for(const o of i){if(o.internal){continue}if(o.family==="IPv6"){r=true}else{t=true}if(t&&r){return{has4:t,has6:r}}}}return{has4:t,has6:r}};const isIterable=t=>Symbol.iterator in t;const ignoreNoResultErrors=t=>t.catch((t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT"){return[]}throw t}));const b={ttl:true};const v={all:true};const _={all:true,family:4};const w={all:true,family:6};class CacheableLookup{constructor({cache:t=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:o=.15,resolver:a=new l,lookup:c=u}={}){this.maxTtl=r;this.errorTtl=o;this._cache=t;this._resolver=a;this._dnsLookup=c&&h(c);if(this._resolver instanceof l){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=h(this._resolver.resolve4.bind(this._resolver));this._resolve6=h(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=i;if(i>0){const t=setInterval((()=>{this._hostnamesToFallback.clear()}),i*1e3);if(t.unref){t.unref()}this._fallbackInterval=t}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(t){this.clear();this._resolver.setServers(t)}get servers(){return this._resolver.getServers()}lookup(t,r,i){if(typeof r==="function"){i=r;r={}}else if(typeof r==="number"){r={family:r}}if(!i){throw new Error("Callback must be a function.")}this.lookupAsync(t,r).then((t=>{if(r.all){i(null,t)}else{i(null,t.address,t.family,t.expires,t.ttl)}}),i)}async lookupAsync(t,r={}){if(typeof r==="number"){r={family:r}}let i=await this.query(t);if(r.family===6){const t=i.filter((t=>t.family===6));if(r.hints&o){if(y&&r.hints&c||t.length===0){map4to6(i)}else{i=t}}else{i=t}}else if(r.family===4){i=i.filter((t=>t.family===4))}if(r.hints&a){const{_iface:t}=this;i=i.filter((r=>r.family===6?t.has6:t.has4))}if(i.length===0){const r=new Error(`cacheableLookup ENOTFOUND ${t}`);r.code="ENOTFOUND";r.hostname=t;throw r}if(r.all){return i}return i[0]}async query(t){let r=await this._cache.get(t);if(!r){const i=this._pending[t];if(i){r=await i}else{const i=this.queryAndCache(t);this._pending[t]=i;try{r=await i}finally{delete this._pending[t]}}}r=r.map((t=>({...t})));return r}async _resolve(t){const[r,i]=await Promise.all([ignoreNoResultErrors(this._resolve4(t,b)),ignoreNoResultErrors(this._resolve6(t,b))]);let o=0;let a=0;let c=0;const l=Date.now();for(const t of r){t.family=4;t.expires=l+t.ttl*1e3;o=Math.max(o,t.ttl)}for(const t of i){t.family=6;t.expires=l+t.ttl*1e3;a=Math.max(a,t.ttl)}if(r.length>0){if(i.length>0){c=Math.min(o,a)}else{c=o}}else{c=a}return{entries:[...r,...i],cacheTtl:c}}async _lookup(t){try{const[r,i]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(t,_)),ignoreNoResultErrors(this._dnsLookup(t,w))]);return{entries:[...r,...i],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(t,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3;r[g]=Date.now()+i;try{await this._cache.set(t,r,i)}catch(t){this.lookupAsync=async()=>{const r=new Error("Cache Error. Please recreate the CacheableLookup instance.");r.cause=t;throw r}}if(isIterable(this._cache)){this._tick(i)}}}async queryAndCache(t){if(this._hostnamesToFallback.has(t)){return this._dnsLookup(t,v)}let r=await this._resolve(t);if(r.entries.length===0&&this._dnsLookup){r=await this._lookup(t);if(r.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(t)}}const i=r.entries.length===0?this.errorTtl:r.cacheTtl;await this._set(t,r.entries,i);return r.entries}_tick(t){const r=this._nextRemovalTime;if(!r||t<r){clearTimeout(this._removalTimeout);this._nextRemovalTime=t;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let t=Infinity;const r=Date.now();for(const[i,o]of this._cache){const a=o[g];if(r>=a){this._cache.delete(i)}else if(a<t){t=a}}if(t!==Infinity){this._tick(t-r)}}),t);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(t){verifyAgent(t);if(p in t){throw new Error("CacheableLookup has been already installed")}t[p]=t.createConnection;t[m]=this;t.createConnection=(r,i)=>{if(!("lookup"in r)){r.lookup=this.lookup}return t[p](r,i)}}uninstall(t){verifyAgent(t);if(t[p]){if(t[m]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}t.createConnection=t[p];delete t[p];delete t[m]}}updateInterfaceInfo(){const{_iface:t}=this;this._iface=getIfaceInfo();if(t.has4&&!this._iface.has4||t.has6&&!this._iface.has6){this._cache.clear()}}clear(t){if(t){this._cache.delete(t);return}this._cache.clear()}}t.exports=CacheableLookup;t.exports["default"]=CacheableLookup},3846:(t,r,i)=>{"use strict";const o=i(2361);const a=i(7310);const c=i(5521);const l=i(9580);const u=i(3485);const h=i(1762);const d=i(7976);const p=i(2812);const m=i(5326);class CacheableRequest{constructor(t,r){if(typeof t!=="function"){throw new TypeError("Parameter `request` must be a function")}this.cache=new m({uri:typeof r==="string"&&r,store:typeof r!=="string"&&r,namespace:"cacheable-request"});return this.createCacheableRequest(t)}createCacheableRequest(t){return(r,i)=>{let m;if(typeof r==="string"){m=normalizeUrlObject(a.parse(r));r={}}else if(r instanceof a.URL){m=normalizeUrlObject(a.parse(r.toString()));r={}}else{const[t,...i]=(r.path||"").split("?");const o=i.length>0?`?${i.join("?")}`:"";m=normalizeUrlObject({...r,pathname:t,search:o})}r={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...r,...urlObjectToRequestOptions(m)};r.headers=d(r.headers);const g=new o;const y=c(a.format(m),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});const b=`${r.method}:${y}`;let v=false;let _=false;const makeRequest=r=>{_=true;let o=false;let a;const c=new Promise((t=>{a=()=>{if(!o){o=true;t()}}}));const handler=t=>{if(v&&!r.forceRefresh){t.status=t.statusCode;const i=u.fromObject(v.cachePolicy).revalidatedPolicy(r,t);if(!i.modified){const r=i.policy.responseHeaders();t=new h(v.statusCode,r,v.body,v.url);t.cachePolicy=i.policy;t.fromCache=true}}if(!t.fromCache){t.cachePolicy=new u(r,t,r);t.fromCache=false}let a;if(r.cache&&t.cachePolicy.storable()){a=p(t);(async()=>{try{const i=l.buffer(t);await Promise.race([c,new Promise((r=>t.once("end",r)))]);if(o){return}const a=await i;const u={cachePolicy:t.cachePolicy.toObject(),url:t.url,statusCode:t.fromCache?v.statusCode:t.statusCode,body:a};let h=r.strictTtl?t.cachePolicy.timeToLive():undefined;if(r.maxTtl){h=h?Math.min(h,r.maxTtl):r.maxTtl}await this.cache.set(b,u,h)}catch(t){g.emit("error",new CacheableRequest.CacheError(t))}})()}else if(r.cache&&v){(async()=>{try{await this.cache.delete(b)}catch(t){g.emit("error",new CacheableRequest.CacheError(t))}})()}g.emit("response",a||t);if(typeof i==="function"){i(a||t)}};try{const i=t(r,handler);i.once("error",a);i.once("abort",a);g.emit("request",i)}catch(t){g.emit("error",new CacheableRequest.RequestError(t))}};(async()=>{const get=async t=>{await Promise.resolve();const r=t.cache?await this.cache.get(b):undefined;if(typeof r==="undefined"){return makeRequest(t)}const o=u.fromObject(r.cachePolicy);if(o.satisfiesWithoutRevalidation(t)&&!t.forceRefresh){const t=o.responseHeaders();const a=new h(r.statusCode,t,r.body,r.url);a.cachePolicy=o;a.fromCache=true;g.emit("response",a);if(typeof i==="function"){i(a)}}else{v=r;t.headers=o.revalidationHeaders(t);makeRequest(t)}};const errorHandler=t=>g.emit("error",new CacheableRequest.CacheError(t));this.cache.once("error",errorHandler);g.on("response",(()=>this.cache.removeListener("error",errorHandler)));try{await get(r)}catch(t){if(r.automaticFailover&&!_){makeRequest(r)}g.emit("error",new CacheableRequest.CacheError(t))}})();return g}}}function urlObjectToRequestOptions(t){const r={...t};r.path=`${t.pathname||"/"}${t.search||""}`;delete r.pathname;delete r.search;return r}function normalizeUrlObject(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}CacheableRequest.RequestError=class extends Error{constructor(t){super(t.message);this.name="RequestError";Object.assign(this,t)}};CacheableRequest.CacheError=class extends Error{constructor(t){super(t.message);this.name="CacheError";Object.assign(this,t)}};t.exports=CacheableRequest},1085:(t,r,i)=>{"use strict";const o=i(7147);const a=i(1017);const c=o.lchown?"lchown":"chown";const l=o.lchownSync?"lchownSync":"chownSync";const u=o.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(t,r,i)=>{try{return o[l](t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const chownSync=(t,r,i)=>{try{return o.chownSync(t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const h=u?(t,r,i,a)=>c=>{if(!c||c.code!=="EISDIR")a(c);else o.chown(t,r,i,a)}:(t,r,i,o)=>o;const d=u?(t,r,i)=>{try{return lchownSync(t,r,i)}catch(o){if(o.code!=="EISDIR")throw o;chownSync(t,r,i)}}:(t,r,i)=>lchownSync(t,r,i);const p=process.version;let readdir=(t,r,i)=>o.readdir(t,r,i);let readdirSync=(t,r)=>o.readdirSync(t,r);if(/^v4\./.test(p))readdir=(t,r,i)=>o.readdir(t,i);const chown=(t,r,i,a)=>{o[c](t,r,i,h(t,r,i,(t=>{a(t&&t.code!=="ENOENT"?t:null)})))};const chownrKid=(t,r,i,c,l)=>{if(typeof r==="string")return o.lstat(a.resolve(t,r),((o,a)=>{if(o)return l(o.code!=="ENOENT"?o:null);a.name=r;chownrKid(t,a,i,c,l)}));if(r.isDirectory()){chownr(a.resolve(t,r.name),i,c,(o=>{if(o)return l(o);const u=a.resolve(t,r.name);chown(u,i,c,l)}))}else{const o=a.resolve(t,r.name);chown(o,i,c,l)}};const chownr=(t,r,i,o)=>{readdir(t,{withFileTypes:true},((a,c)=>{if(a){if(a.code==="ENOENT")return o();else if(a.code!=="ENOTDIR"&&a.code!=="ENOTSUP")return o(a)}if(a||!c.length)return chown(t,r,i,o);let l=c.length;let u=null;const then=a=>{if(u)return;if(a)return o(u=a);if(--l===0)return chown(t,r,i,o)};c.forEach((o=>chownrKid(t,o,r,i,then)))}))};const chownrKidSync=(t,r,i,c)=>{if(typeof r==="string"){try{const i=o.lstatSync(a.resolve(t,r));i.name=r;r=i}catch(t){if(t.code==="ENOENT")return;else throw t}}if(r.isDirectory())chownrSync(a.resolve(t,r.name),i,c);d(a.resolve(t,r.name),i,c)};const chownrSync=(t,r,i)=>{let o;try{o=readdirSync(t,{withFileTypes:true})}catch(o){if(o.code==="ENOENT")return;else if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return d(t,r,i);else throw o}if(o&&o.length)o.forEach((o=>chownrKidSync(t,o,r,i)));return d(t,r,i)};t.exports=chownr;chownr.sync=chownrSync},2812:(t,r,i)=>{"use strict";const o=i(2781).PassThrough;const a=i(9958);const cloneResponse=t=>{if(!(t&&t.pipe)){throw new TypeError("Parameter `response` must be a response stream.")}const r=new o;a(t,r);return t.pipe(r)};t.exports=cloneResponse},1062:t=>{t.exports=function(t,i){var o=[];for(var a=0;a<t.length;a++){var c=i(t[a],a);if(r(c))o.push.apply(o,c);else o.push(c)}return o};var r=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}},7863:(t,r,i)=>{"use strict";const o=i(5842);class CpFileError extends o{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpFileError"}}t.exports=CpFileError},4404:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(6284);const c=i(8465);const l=i(2248);const u=i(7863);const h=o(a.stat);const d=o(a.lstat);const p=o(a.utimes);const m=o(a.chmod);r.closeSync=a.closeSync.bind(a);r.createWriteStream=a.createWriteStream.bind(a);r.createReadStream=async(t,r)=>{const i=a.createReadStream(t,r);try{await l(i,["readable","end"])}catch(r){throw new u(`Cannot read from \`${t}\`: ${r.message}`,r)}return i};r.stat=t=>h(t).catch((r=>{throw new u(`Cannot stat path \`${t}\`: ${r.message}`,r)}));r.lstat=t=>d(t).catch((r=>{throw new u(`lstat \`${t}\` failed: ${r.message}`,r)}));r.utimes=(t,r,i)=>p(t,r,i).catch((r=>{throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}));r.chmod=(t,r)=>m(t,r).catch((r=>{throw new u(`chmod \`${t}\` failed: ${r.message}`,r)}));r.statSync=t=>{try{return a.statSync(t)}catch(r){throw new u(`stat \`${t}\` failed: ${r.message}`,r)}};r.utimesSync=(t,r,i)=>{try{return a.utimesSync(t,r,i)}catch(r){throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}};r.makeDir=(t,r)=>c(t,{...r,fs:a}).catch((r=>{throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}));r.makeDirSync=(t,r)=>{try{c.sync(t,{...r,fs:a})}catch(r){throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}};r.copyFileSync=(t,r,i)=>{try{a.copyFileSync(t,r,i)}catch(i){throw new u(`Cannot copy from \`${t}\` to \`${r}\`: ${i.message}`,i)}}},654:(t,r,i)=>{"use strict";const o=i(1017);const{constants:a}=i(7147);const c=i(2248);const l=i(7863);const u=i(4404);const h=i(9537);const cpFileAsync=async(t,r,i,a)=>{let h;const d=await u.stat(t);a.size=d.size;const p=await u.createReadStream(t);await u.makeDir(o.dirname(r),{mode:i.directoryMode});const m=u.createWriteStream(r,{flags:i.overwrite?"w":"wx"});p.on("data",(()=>{a.writtenBytes=m.bytesWritten}));p.once("error",(r=>{h=new l(`Cannot read from \`${t}\`: ${r.message}`,r);m.end()}));let g=false;try{const t=c(m,"close");p.pipe(m);await t;a.writtenBytes=a.size;g=true}catch(t){throw new l(`Cannot write to \`${r}\`: ${t.message}`,t)}if(h){throw h}if(g){const i=await u.lstat(t);return Promise.all([u.utimes(r,i.atime,i.mtime),u.chmod(r,i.mode)])}};const cpFile=(t,r,i)=>{if(!t||!r){return Promise.reject(new l("`source` and `destination` required"))}i={overwrite:true,...i};const a=new h(o.resolve(t),o.resolve(r));const c=cpFileAsync(t,r,i,a);c.on=(...t)=>{a.on(...t);return c};return c};t.exports=cpFile;const checkSourceIsFile=(t,r)=>{if(t.isDirectory()){throw Object.assign(new l(`EISDIR: illegal operation on a directory '${r}'`),{errno:-21,code:"EISDIR",source:r})}};t.exports.sync=(t,r,i)=>{if(!t||!r){throw new l("`source` and `destination` required")}i={overwrite:true,...i};const c=u.statSync(t);checkSourceIsFile(c,t);u.makeDirSync(o.dirname(r),{mode:i.directoryMode});const h=i.overwrite?null:a.COPYFILE_EXCL;try{u.copyFileSync(t,r,h)}catch(t){if(!i.overwrite&&t.code==="EEXIST"){return}throw t}u.utimesSync(r,c.atime,c.mtime)}},9537:(t,r,i)=>{"use strict";const o=i(2361);const a=new WeakMap;class ProgressEmitter extends o{constructor(t,r){super();this._sourcePath=t;this._destinationPath=r}get writtenBytes(){return a.get(this)}set writtenBytes(t){a.set(this,t);this.emitProgress()}emitProgress(){const{size:t,writtenBytes:r}=this;this.emit("progress",{sourcePath:this._sourcePath,destinationPath:this._destinationPath,size:t,writtenBytes:r,percent:r===t?1:r/t})}}t.exports=ProgressEmitter},7328:(t,r,i)=>{"use strict";const o=i(2081);const a=i(3529);const c=i(9170);function spawn(t,r,i){const l=a(t,r,i);const u=o.spawn(l.command,l.args,l.options);c.hookChildProcess(u,l);return u}function spawnSync(t,r,i){const l=a(t,r,i);const u=o.spawnSync(l.command,l.args,l.options);u.error=u.error||c.verifyENOENTSync(u.status,l);return u}t.exports=spawn;t.exports.spawn=spawn;t.exports.sync=spawnSync;t.exports._parse=a;t.exports._enoent=c},9170:t=>{"use strict";const r=process.platform==="win32";function notFoundError(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function hookChildProcess(t,i){if(!r){return}const o=t.emit;t.emit=function(r,a){if(r==="exit"){const r=verifyENOENT(a,i,"spawn");if(r){return o.call(t,"error",r)}}return o.apply(t,arguments)}}function verifyENOENT(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawn")}return null}function verifyENOENTSync(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawnSync")}return null}t.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},3529:(t,r,i)=>{"use strict";const o=i(1017);const a=i(5499);const c=i(1024);const l=i(7091);const u=process.platform==="win32";const h=/\.(?:com|exe)$/i;const d=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(t){t.file=a(t);const r=t.file&&l(t.file);if(r){t.args.unshift(t.file);t.command=r;return a(t)}return t.file}function parseNonShell(t){if(!u){return t}const r=detectShebang(t);const i=!h.test(r);if(t.options.forceShell||i){const i=d.test(r);t.command=o.normalize(t.command);t.command=c.command(t.command);t.args=t.args.map((t=>c.argument(t,i)));const a=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${a}"`];t.command=process.env.comspec||"cmd.exe";t.options.windowsVerbatimArguments=true}return t}function parse(t,r,i){if(r&&!Array.isArray(r)){i=r;r=null}r=r?r.slice(0):[];i=Object.assign({},i);const o={command:t,args:r,options:i,file:undefined,original:{command:t,args:r}};return i.shell?o:parseNonShell(o)}t.exports=parse},1024:t=>{"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(t){t=t.replace(r,"^$1");return t}function escapeArgument(t,i){t=`${t}`;t=t.replace(/(\\*)"/g,'$1$1\\"');t=t.replace(/(\\*)$/,"$1$1");t=`"${t}"`;t=t.replace(r,"^$1");if(i){t=t.replace(r,"^$1")}return t}t.exports.command=escapeCommand;t.exports.argument=escapeArgument},7091:(t,r,i)=>{"use strict";const o=i(7147);const a=i(7256);function readShebang(t){const r=150;const i=Buffer.alloc(r);let c;try{c=o.openSync(t,"r");o.readSync(c,i,0,r,0);o.closeSync(c)}catch(t){}return a(i.toString())}t.exports=readShebang},5499:(t,r,i)=>{"use strict";const o=i(1017);const a=i(8085);const c=i(7460);function resolveCommandAttempt(t,r){const i=t.options.env||process.env;const l=process.cwd();const u=t.options.cwd!=null;const h=u&&process.chdir!==undefined&&!process.chdir.disabled;if(h){try{process.chdir(t.options.cwd)}catch(t){}}let d;try{d=a.sync(t.command,{path:i[c({env:i})],pathExt:r?o.delimiter:undefined})}catch(t){}finally{if(h){process.chdir(l)}}if(d){d=o.resolve(u?t.options.cwd:"",d)}return d}function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,true)}t.exports=resolveCommand},1599:(t,r,i)=>{"use strict";const{Transform:o,PassThrough:a}=i(2781);const c=i(9796);const l=i(2693);t.exports=t=>{const r=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(r)){return t}const i=r==="br";if(i&&typeof c.createBrotliDecompress!=="function"){t.destroy(new Error("Brotli is not supported on Node.js < 12"));return t}let u=true;const h=new o({transform(t,r,i){u=false;i(null,t)},flush(t){t()}});const d=new a({autoDestroy:false,destroy(r,i){t.destroy();i(r)}});const p=i?c.createBrotliDecompress():c.createUnzip();p.once("error",(r=>{if(u&&!t.readable){d.end();return}d.destroy(r)}));l(t,d);t.pipe(h).pipe(p).pipe(d);return d}},3110:t=>{"use strict";
|
|
2
|
+
(()=>{var t={4235:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},9201:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const l=10;const c=10;const u=o>l;const h=o===l&&a>=c;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},4157:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(154);const a=i(695);const l=i(363);r.Settings=l.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},154:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(8418);const a=i(9661);const l=i(9201);const c=i(8028);const u=i(5427);function read(t,r,i){if(!r.stats&&l.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,l)=>{if(o!==null){callFailureCallback(i,o);return}const c=l.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,c);return}const h=c.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=c.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((l,h)=>{if(l!==null){callFailureCallback(i,l);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,l)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:c.fs.createDirentFromStats(i,l)};if(r.stats){u.stats=l}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},5427:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},695:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(8418);const a=i(9201);const l=i(8028);const c=i(5427);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:c.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=l.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=c.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:l.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},363:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(8418);const l=i(4235);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=l.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},1438:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},8028:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(1438);r.fs=o},5441:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},8418:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(4131);const a=i(2796);const l=i(1669);r.Settings=l.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},4131:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2796:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},1669:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(5441);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},7921:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(7573);const a=i(1415);const l=i(5731);const c=i(9205);r.Settings=c.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new l.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},7573:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(4333);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},1415:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(4333);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},5731:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8488);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},4333:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(4157);const l=i(9403);const c=i(4329);const u=i(9746);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=l(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!c.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=c.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(c.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&c.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},4329:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},9746:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(4329);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},8488:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(4157);const a=i(4329);const l=i(9746);class SyncReader extends l.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},9205:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(4157);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},9845:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(t){return i.includes(t)}const o=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...i];function isObjectTypeName(t){return o.includes(t)}const a=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(t){return a.includes(t)}function isOfType(t){return r=>typeof r===t}const{toString:l}=Object.prototype;const getObjectType=t=>{const r=l.call(t).slice(8,-1);if(/HTML\w+Element/.test(r)&&is.domElement(t)){return"HTMLElement"}if(isObjectTypeName(r)){return r}return undefined};const isObjectOfType=t=>r=>getObjectType(r)===t;function is(t){if(t===null){return"null"}switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(t)){return"Observable"}if(is.array(t)){return"Array"}if(is.buffer(t)){return"Buffer"}const r=getObjectType(t);if(r){return r}if(t instanceof String||t instanceof Boolean||t instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const c=isOfType("number");is.number=t=>c(t)&&!is.nan(t);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=t=>t===null;is.class_=t=>is.function_(t)&&t.toString().startsWith("class ");is.boolean=t=>t===true||t===false;is.symbol=isOfType("symbol");is.numericString=t=>is.string(t)&&!is.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));is.array=(t,r)=>{if(!Array.isArray(t)){return false}if(!is.function_(r)){return true}return t.every(r)};is.buffer=t=>{var r,i,o,a;return(a=(o=(i=(r=t)===null||r===void 0?void 0:r.constructor)===null||i===void 0?void 0:i.isBuffer)===null||o===void 0?void 0:o.call(i,t))!==null&&a!==void 0?a:false};is.blob=t=>isObjectOfType("Blob")(t);is.nullOrUndefined=t=>is.null_(t)||is.undefined(t);is.object=t=>!is.null_(t)&&(typeof t==="object"||is.function_(t));is.iterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.iterator])};is.asyncIterable=t=>{var r;return is.function_((r=t)===null||r===void 0?void 0:r[Symbol.asyncIterator])};is.generator=t=>{var r,i;return is.iterable(t)&&is.function_((r=t)===null||r===void 0?void 0:r.next)&&is.function_((i=t)===null||i===void 0?void 0:i.throw)};is.asyncGenerator=t=>is.asyncIterable(t)&&is.function_(t.next)&&is.function_(t.throw);is.nativePromise=t=>isObjectOfType("Promise")(t);const hasPromiseAPI=t=>{var r,i;return is.function_((r=t)===null||r===void 0?void 0:r.then)&&is.function_((i=t)===null||i===void 0?void 0:i.catch)};is.promise=t=>is.nativePromise(t)||hasPromiseAPI(t);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=t=>getObjectType(t)==="AsyncGeneratorFunction";is.asyncFunction=t=>getObjectType(t)==="AsyncFunction";is.boundFunction=t=>is.function_(t)&&!t.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=t=>isObjectOfType("Map")(t);is.set=t=>isObjectOfType("Set")(t);is.weakMap=t=>isObjectOfType("WeakMap")(t);is.weakSet=t=>isObjectOfType("WeakSet")(t);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(t,r)=>Object.values(r).includes(t);is.directInstanceOf=(t,r)=>Object.getPrototypeOf(t)===r.prototype;is.urlInstance=t=>isObjectOfType("URL")(t);is.urlString=t=>{if(!is.string(t)){return false}try{new URL(t);return true}catch(t){return false}};is.truthy=t=>Boolean(t);is.falsy=t=>!t;is.nan=t=>Number.isNaN(t);is.primitive=t=>is.null_(t)||isPrimitiveTypeName(typeof t);is.integer=t=>Number.isInteger(t);is.safeInteger=t=>Number.isSafeInteger(t);is.plainObject=t=>{if(l.call(t)!=="[object Object]"){return false}const r=Object.getPrototypeOf(t);return r===null||r===Object.getPrototypeOf({})};is.typedArray=t=>isTypedArrayName(getObjectType(t));const isValidLength=t=>is.safeInteger(t)&&t>=0;is.arrayLike=t=>!is.nullOrUndefined(t)&&!is.function_(t)&&isValidLength(t.length);is.inRange=(t,r)=>{if(is.number(r)){return t>=Math.min(0,r)&&t<=Math.max(r,0)}if(is.array(r)&&r.length===2){return t>=Math.min(...r)&&t<=Math.max(...r)}throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};const u=1;const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=t=>is.object(t)&&t.nodeType===u&&is.string(t.nodeName)&&!is.plainObject(t)&&h.every((r=>r in t));is.observable=t=>{var r,i,o,a;if(!t){return false}if(t===((i=(r=t)[Symbol.observable])===null||i===void 0?void 0:i.call(r))){return true}if(t===((a=(o=t)["@@observable"])===null||a===void 0?void 0:a.call(o))){return true}return false};is.nodeStream=t=>is.object(t)&&is.function_(t.pipe)&&!is.observable(t);is.infinite=t=>t===Infinity||t===-Infinity;const isAbsoluteMod2=t=>r=>is.integer(r)&&Math.abs(r%2)===t;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=t=>is.array(t)&&t.length===0;is.nonEmptyArray=t=>is.array(t)&&t.length>0;is.emptyString=t=>is.string(t)&&t.length===0;const isWhiteSpaceString=t=>is.string(t)&&!/\S/.test(t);is.emptyStringOrWhitespace=t=>is.emptyString(t)||isWhiteSpaceString(t);is.nonEmptyString=t=>is.string(t)&&t.length>0;is.nonEmptyStringAndNotWhitespace=t=>is.string(t)&&!is.emptyStringOrWhitespace(t);is.emptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length===0;is.nonEmptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length>0;is.emptySet=t=>is.set(t)&&t.size===0;is.nonEmptySet=t=>is.set(t)&&t.size>0;is.emptyMap=t=>is.map(t)&&t.size===0;is.nonEmptyMap=t=>is.map(t)&&t.size>0;is.propertyKey=t=>is.any([is.string,is.number,is.symbol],t);is.formData=t=>isObjectOfType("FormData")(t);is.urlSearchParams=t=>isObjectOfType("URLSearchParams")(t);const predicateOnArray=(t,r,i)=>{if(!is.function_(r)){throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`)}if(i.length===0){throw new TypeError("Invalid number of values")}return t.call(i,r)};is.any=(t,...r)=>{const i=is.array(t)?t:[t];return i.some((t=>predicateOnArray(Array.prototype.some,t,r)))};is.all=(t,...r)=>predicateOnArray(Array.prototype.every,t,r);const assertType=(t,r,i,o={})=>{if(!t){const{multipleValues:t}=o;const a=t?`received values of types ${[...new Set(i.map((t=>`\`${is(t)}\``)))].join(", ")}`:`received value of type \`${is(i)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${a}.`)}};r.assert={undefined:t=>assertType(is.undefined(t),"undefined",t),string:t=>assertType(is.string(t),"string",t),number:t=>assertType(is.number(t),"number",t),bigint:t=>assertType(is.bigint(t),"bigint",t),function_:t=>assertType(is.function_(t),"Function",t),null_:t=>assertType(is.null_(t),"null",t),class_:t=>assertType(is.class_(t),"Class",t),boolean:t=>assertType(is.boolean(t),"boolean",t),symbol:t=>assertType(is.symbol(t),"symbol",t),numericString:t=>assertType(is.numericString(t),"string with a number",t),array:(t,r)=>{const i=assertType;i(is.array(t),"Array",t);if(r){t.forEach(r)}},buffer:t=>assertType(is.buffer(t),"Buffer",t),blob:t=>assertType(is.blob(t),"Blob",t),nullOrUndefined:t=>assertType(is.nullOrUndefined(t),"null or undefined",t),object:t=>assertType(is.object(t),"Object",t),iterable:t=>assertType(is.iterable(t),"Iterable",t),asyncIterable:t=>assertType(is.asyncIterable(t),"AsyncIterable",t),generator:t=>assertType(is.generator(t),"Generator",t),asyncGenerator:t=>assertType(is.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>assertType(is.nativePromise(t),"native Promise",t),promise:t=>assertType(is.promise(t),"Promise",t),generatorFunction:t=>assertType(is.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>assertType(is.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>assertType(is.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>assertType(is.boundFunction(t),"Function",t),regExp:t=>assertType(is.regExp(t),"RegExp",t),date:t=>assertType(is.date(t),"Date",t),error:t=>assertType(is.error(t),"Error",t),map:t=>assertType(is.map(t),"Map",t),set:t=>assertType(is.set(t),"Set",t),weakMap:t=>assertType(is.weakMap(t),"WeakMap",t),weakSet:t=>assertType(is.weakSet(t),"WeakSet",t),int8Array:t=>assertType(is.int8Array(t),"Int8Array",t),uint8Array:t=>assertType(is.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>assertType(is.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>assertType(is.int16Array(t),"Int16Array",t),uint16Array:t=>assertType(is.uint16Array(t),"Uint16Array",t),int32Array:t=>assertType(is.int32Array(t),"Int32Array",t),uint32Array:t=>assertType(is.uint32Array(t),"Uint32Array",t),float32Array:t=>assertType(is.float32Array(t),"Float32Array",t),float64Array:t=>assertType(is.float64Array(t),"Float64Array",t),bigInt64Array:t=>assertType(is.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>assertType(is.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>assertType(is.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>assertType(is.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>assertType(is.dataView(t),"DataView",t),enumCase:(t,r)=>assertType(is.enumCase(t,r),"EnumCase",t),urlInstance:t=>assertType(is.urlInstance(t),"URL",t),urlString:t=>assertType(is.urlString(t),"string with a URL",t),truthy:t=>assertType(is.truthy(t),"truthy",t),falsy:t=>assertType(is.falsy(t),"falsy",t),nan:t=>assertType(is.nan(t),"NaN",t),primitive:t=>assertType(is.primitive(t),"primitive",t),integer:t=>assertType(is.integer(t),"integer",t),safeInteger:t=>assertType(is.safeInteger(t),"integer",t),plainObject:t=>assertType(is.plainObject(t),"plain object",t),typedArray:t=>assertType(is.typedArray(t),"TypedArray",t),arrayLike:t=>assertType(is.arrayLike(t),"array-like",t),domElement:t=>assertType(is.domElement(t),"HTMLElement",t),observable:t=>assertType(is.observable(t),"Observable",t),nodeStream:t=>assertType(is.nodeStream(t),"Node.js Stream",t),infinite:t=>assertType(is.infinite(t),"infinite number",t),emptyArray:t=>assertType(is.emptyArray(t),"empty array",t),nonEmptyArray:t=>assertType(is.nonEmptyArray(t),"non-empty array",t),emptyString:t=>assertType(is.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>assertType(is.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>assertType(is.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>assertType(is.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>assertType(is.emptyObject(t),"empty object",t),nonEmptyObject:t=>assertType(is.nonEmptyObject(t),"non-empty object",t),emptySet:t=>assertType(is.emptySet(t),"empty set",t),nonEmptySet:t=>assertType(is.nonEmptySet(t),"non-empty set",t),emptyMap:t=>assertType(is.emptyMap(t),"empty map",t),nonEmptyMap:t=>assertType(is.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>assertType(is.propertyKey(t),"PropertyKey",t),formData:t=>assertType(is.formData(t),"FormData",t),urlSearchParams:t=>assertType(is.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>assertType(is.evenInteger(t),"even integer",t),oddInteger:t=>assertType(is.oddInteger(t),"odd integer",t),directInstanceOf:(t,r)=>assertType(is.directInstanceOf(t,r),"T",t),inRange:(t,r)=>assertType(is.inRange(t,r),"in range",t),any:(t,...r)=>assertType(is.any(t,...r),"predicate returns truthy for any value",r,{multipleValues:true}),all:(t,...r)=>assertType(is.all(t,...r),"predicate returns truthy for all values",r,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(r.assert,{class:{value:r.assert.class_},function:{value:r.assert.function_},null:{value:r.assert.null_}});r["default"]=is;t.exports=is;t.exports["default"]=is;t.exports.assert=r.assert},4177:(t,r,i)=>{var o=i(1653);var a=i(1017);var l=i(3715);var c=i(1015);var u=i(6669);var h=i(6130);var d=i(5895);var p=t.exports={};var m=/[\/\\]/g;var processPatterns=function(t,r){var i=[];l(t).forEach((function(t){var o=t.indexOf("!")===0;if(o){t=t.slice(1)}var a=r(t);if(o){i=c(i,a)}else{i=u(i,a)}}));return i};p.exists=function(){var t=a.join.apply(a,arguments);return o.existsSync(t)};p.expand=function(...t){var r=h(t[0])?t.shift():{};var i=Array.isArray(t[0])?t[0]:t;if(i.length===0){return[]}var l=processPatterns(i,(function(t){return d.sync(t,r)}));if(r.filter){l=l.filter((function(t){t=a.join(r.cwd||"",t);try{if(typeof r.filter==="function"){return r.filter(t)}else{return o.statSync(t)[r.filter]()}}catch(t){return false}}))}return l};p.expandMapping=function(t,r,i){i=Object.assign({rename:function(t,r){return a.join(t||"",r)}},i);var o=[];var l={};p.expand(i,t).forEach((function(t){var c=t;if(i.flatten){c=a.basename(c)}if(i.ext){c=c.replace(/(\.[^\/]*)?$/,i.ext)}var u=i.rename(r,c,i);if(i.cwd){t=a.join(i.cwd,t)}u=u.replace(m,"/");t=t.replace(m,"/");if(l[u]){l[u].src.push(t)}else{o.push({src:[t],dest:u});l[u]=o[o.length-1]}}));return o};p.normalizeFilesArray=function(t){var r=[];t.forEach((function(t){var i;if("src"in t||"dest"in t){r.push(t)}}));if(r.length===0){return[]}r=_(r).chain().forEach((function(t){if(!("src"in t)||!t.src){return}if(Array.isArray(t.src)){t.src=l(t.src)}else{t.src=[t.src]}})).map((function(t){var r=Object.assign({},t);delete r.src;delete r.dest;if(t.expand){return p.expandMapping(t.src,t.dest,r).map((function(r){var i=Object.assign({},t);i.orig=Object.assign({},t);i.src=r.src;i.dest=r.dest;["expand","cwd","flatten","rename","ext"].forEach((function(t){delete i[t]}));return i}))}var i=Object.assign({},t);i.orig=Object.assign({},t);if("src"in i){Object.defineProperty(i,"src",{enumerable:true,get:function fn(){var i;if(!("result"in fn)){i=t.src;i=Array.isArray(i)?l(i):[i];fn.result=p.expand(r,i)}return fn.result}})}if("dest"in i){i.dest=t.dest}return i})).flatten().value();return r}},1267:(t,r,i)=>{var o=i(1653);var a=i(1017);var l=i(3837);var c=i(9338);var u=i(4838);var h=i(3442);var d=i(2781).Stream;var p=i(7426).PassThrough;var m=t.exports={};m.file=i(4177);function assertPath(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+nutils.inspect(t))}}m.collectStream=function(t,r){var i=[];var o=0;t.on("error",r);t.on("data",(function(t){i.push(t);o+=t.length}));t.on("end",(function(){var t=new Buffer(o);var a=0;i.forEach((function(r){r.copy(t,a);a+=r.length}));r(null,t)}))};m.dateify=function(t){t=t||new Date;if(t instanceof Date){t=t}else if(typeof t==="string"){t=new Date(t)}else{t=new Date}return t};m.defaults=function(t,r,i){var o=arguments;o[0]=o[0]||{};return h(...o)};m.isStream=function(t){return t instanceof d};m.lazyReadStream=function(t){return new c.Readable((function(){return o.createReadStream(t)}))};m.normalizeInputSource=function(t){if(t===null){return new Buffer(0)}else if(typeof t==="string"){return new Buffer(t)}else if(m.isStream(t)&&!t._readableState){var r=new p;t.pipe(r);return r}return t};m.sanitizePath=function(t){return u(t,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};m.trailingSlashIt=function(t){return t.slice(-1)!=="/"?t+"/":t};m.unixifyPath=function(t){return u(t,false).replace(/^\w+:/,"")};m.walkdir=function(t,r,i){var l=[];if(typeof r==="function"){i=r;r=t}o.readdir(t,(function(c,u){var h=0;var d;var p;if(c){return i(c)}(function next(){d=u[h++];if(!d){return i(null,l)}p=a.join(t,d);o.stat(p,(function(t,i){l.push({path:p,relative:a.relative(r,p).replace(/\\/g,"/"),stats:i});if(i&&i.isDirectory()){m.walkdir(p,r,(function(t,r){r.forEach((function(t){l.push(t)}));next()}))}else{next()}}))})()}))}},8906:(t,r,i)=>{
|
|
3
|
+
/**
|
|
4
|
+
* Archiver Vending
|
|
5
|
+
*
|
|
6
|
+
* @ignore
|
|
7
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
8
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
9
|
+
*/
|
|
10
|
+
var o=i(8491);var a={};var vending=function(t,r){return vending.create(t,r)};vending.create=function(t,r){if(a[t]){var i=new o(t,r);i.setFormat(t);i.setModule(new a[t](r));return i}else{throw new Error("create("+t+"): format not registered")}};vending.registerFormat=function(t,r){if(a[t]){throw new Error("register("+t+"): format already registered")}if(typeof r!=="function"){throw new Error("register("+t+"): format module invalid")}if(typeof r.prototype.append!=="function"||typeof r.prototype.finalize!=="function"){throw new Error("register("+t+"): format module missing methods")}a[t]=r};vending.isRegisteredFormat=function(t){if(a[t]){return true}return false};vending.registerFormat("zip",i(8385));vending.registerFormat("tar",i(9560));vending.registerFormat("json",i(5729));t.exports=vending},8491:(t,r,i)=>{
|
|
11
|
+
/**
|
|
12
|
+
* Archiver Core
|
|
13
|
+
*
|
|
14
|
+
* @ignore
|
|
15
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
16
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
17
|
+
*/
|
|
18
|
+
var o=i(7147);var a=i(9619);var l=i(3408);var c=i(1017);var u=i(1267);var h=i(3837).inherits;var d=i(685);var p=i(4381).Transform;var m=process.platform==="win32";var Archiver=function(t,r){if(!(this instanceof Archiver)){return new Archiver(t,r)}if(typeof t!=="string"){r=t;t="zip"}r=this.options=u.defaults(r,{highWaterMark:1024*1024,statConcurrency:4});p.call(this,r);this._format=false;this._module=false;this._pending=0;this._pointer=0;this._entriesCount=0;this._entriesProcessedCount=0;this._fsEntriesTotalBytes=0;this._fsEntriesProcessedBytes=0;this._queue=l.queue(this._onQueueTask.bind(this),1);this._queue.drain(this._onQueueDrain.bind(this));this._statQueue=l.queue(this._onStatQueueTask.bind(this),r.statConcurrency);this._statQueue.drain(this._onQueueDrain.bind(this));this._state={aborted:false,finalize:false,finalizing:false,finalized:false,modulePiped:false};this._streams=[]};h(Archiver,p);Archiver.prototype._abort=function(){this._state.aborted=true;this._queue.kill();this._statQueue.kill();if(this._queue.idle()){this._shutdown()}};Archiver.prototype._append=function(t,r){r=r||{};var i={source:null,filepath:t};if(!r.name){r.name=t}r.sourcePath=t;i.data=r;this._entriesCount++;if(r.stats&&r.stats instanceof o.Stats){i=this._updateQueueTaskWithStats(i,r.stats);if(i){if(r.stats.size){this._fsEntriesTotalBytes+=r.stats.size}this._queue.push(i)}}else{this._statQueue.push(i)}};Archiver.prototype._finalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}this._state.finalizing=true;this._moduleFinalize();this._state.finalizing=false;this._state.finalized=true};Archiver.prototype._maybeFinalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return false}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize();return true}return false};Archiver.prototype._moduleAppend=function(t,r,i){if(this._state.aborted){i();return}this._module.append(t,r,function(t){this._task=null;if(this._state.aborted){this._shutdown();return}if(t){this.emit("error",t);setImmediate(i);return}this.emit("entry",r);this._entriesProcessedCount++;if(r.stats&&r.stats.size){this._fsEntriesProcessedBytes+=r.stats.size}this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}});setImmediate(i)}.bind(this))};Archiver.prototype._moduleFinalize=function(){if(typeof this._module.finalize==="function"){this._module.finalize()}else if(typeof this._module.end==="function"){this._module.end()}else{this.emit("error",new d("NOENDMETHOD"))}};Archiver.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this));this._module.pipe(this);this._state.modulePiped=true};Archiver.prototype._moduleSupports=function(t){if(!this._module.supports||!this._module.supports[t]){return false}return this._module.supports[t]};Archiver.prototype._moduleUnpipe=function(){this._module.unpipe(this);this._state.modulePiped=false};Archiver.prototype._normalizeEntryData=function(t,r){t=u.defaults(t,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:false});if(r&&t.stats===false){t.stats=r}var i=t.type==="directory";if(t.name){if(typeof t.prefix==="string"&&""!==t.prefix){t.name=t.prefix+"/"+t.name;t.prefix=null}t.name=u.sanitizePath(t.name);if(t.type!=="symlink"&&t.name.slice(-1)==="/"){i=true;t.type="directory"}else if(i){t.name+="/"}}if(typeof t.mode==="number"){if(m){t.mode&=511}else{t.mode&=4095}}else if(t.stats&&t.mode===null){if(m){t.mode=t.stats.mode&511}else{t.mode=t.stats.mode&4095}if(m&&i){t.mode=493}}else if(t.mode===null){t.mode=i?493:420}if(t.stats&&t.date===null){t.date=t.stats.mtime}else{t.date=u.dateify(t.date)}return t};Archiver.prototype._onModuleError=function(t){this.emit("error",t)};Archiver.prototype._onQueueDrain=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}};Archiver.prototype._onQueueTask=function(t,r){var fullCallback=()=>{if(t.data.callback){t.data.callback()}r()};if(this._state.finalizing||this._state.finalized||this._state.aborted){fullCallback();return}this._task=t;this._moduleAppend(t.source,t.data,fullCallback)};Archiver.prototype._onStatQueueTask=function(t,r){if(this._state.finalizing||this._state.finalized||this._state.aborted){r();return}o.lstat(t.filepath,function(i,o){if(this._state.aborted){setImmediate(r);return}if(i){this._entriesCount--;this.emit("warning",i);setImmediate(r);return}t=this._updateQueueTaskWithStats(t,o);if(t){if(o.size){this._fsEntriesTotalBytes+=o.size}this._queue.push(t)}setImmediate(r)}.bind(this))};Archiver.prototype._shutdown=function(){this._moduleUnpipe();this.end()};Archiver.prototype._transform=function(t,r,i){if(t){this._pointer+=t.length}i(null,t)};Archiver.prototype._updateQueueTaskWithStats=function(t,r){if(r.isFile()){t.data.type="file";t.data.sourceType="stream";t.source=u.lazyReadStream(t.filepath)}else if(r.isDirectory()&&this._moduleSupports("directory")){t.data.name=u.trailingSlashIt(t.data.name);t.data.type="directory";t.data.sourcePath=u.trailingSlashIt(t.filepath);t.data.sourceType="buffer";t.source=Buffer.concat([])}else if(r.isSymbolicLink()&&this._moduleSupports("symlink")){var i=o.readlinkSync(t.filepath);var a=c.dirname(t.filepath);t.data.type="symlink";t.data.linkname=c.relative(a,c.resolve(a,i));t.data.sourceType="buffer";t.source=Buffer.concat([])}else{if(r.isDirectory()){this.emit("warning",new d("DIRECTORYNOTSUPPORTED",t.data))}else if(r.isSymbolicLink()){this.emit("warning",new d("SYMLINKNOTSUPPORTED",t.data))}else{this.emit("warning",new d("ENTRYNOTSUPPORTED",t.data))}return null}t.data=this._normalizeEntryData(t.data,r);return t};Archiver.prototype.abort=function(){if(this._state.aborted||this._state.finalized){return this}this._abort();return this};Archiver.prototype.append=function(t,r){if(this._state.finalize||this._state.aborted){this.emit("error",new d("QUEUECLOSED"));return this}r=this._normalizeEntryData(r);if(typeof r.name!=="string"||r.name.length===0){this.emit("error",new d("ENTRYNAMEREQUIRED"));return this}if(r.type==="directory"&&!this._moduleSupports("directory")){this.emit("error",new d("DIRECTORYNOTSUPPORTED",{name:r.name}));return this}t=u.normalizeInputSource(t);if(Buffer.isBuffer(t)){r.sourceType="buffer"}else if(u.isStream(t)){r.sourceType="stream"}else{this.emit("error",new d("INPUTSTEAMBUFFERREQUIRED",{name:r.name}));return this}this._entriesCount++;this._queue.push({data:r,source:t});return this};Archiver.prototype.directory=function(t,r,i){if(this._state.finalize||this._state.aborted){this.emit("error",new d("QUEUECLOSED"));return this}if(typeof t!=="string"||t.length===0){this.emit("error",new d("DIRECTORYDIRPATHREQUIRED"));return this}this._pending++;if(r===false){r=""}else if(typeof r!=="string"){r=t}var o=false;if(typeof i==="function"){o=i;i={}}else if(typeof i!=="object"){i={}}var l={stat:true,dot:true};function onGlobEnd(){this._pending--;this._maybeFinalize()}function onGlobError(t){this.emit("error",t)}function onGlobMatch(a){c.pause();var l=false;var u=Object.assign({},i);u.name=a.relative;u.prefix=r;u.stats=a.stat;u.callback=c.resume.bind(c);try{if(o){u=o(u);if(u===false){l=true}else if(typeof u!=="object"){throw new d("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:t})}}}catch(t){this.emit("error",t);return}if(l){c.resume();return}this._append(a.absolute,u)}var c=a(t,l);c.on("error",onGlobError.bind(this));c.on("match",onGlobMatch.bind(this));c.on("end",onGlobEnd.bind(this));return this};Archiver.prototype.file=function(t,r){if(this._state.finalize||this._state.aborted){this.emit("error",new d("QUEUECLOSED"));return this}if(typeof t!=="string"||t.length===0){this.emit("error",new d("FILEFILEPATHREQUIRED"));return this}this._append(t,r);return this};Archiver.prototype.glob=function(t,r,i){this._pending++;r=u.defaults(r,{stat:true,pattern:t});function onGlobEnd(){this._pending--;this._maybeFinalize()}function onGlobError(t){this.emit("error",t)}function onGlobMatch(t){o.pause();var r=Object.assign({},i);r.callback=o.resume.bind(o);r.stats=t.stat;r.name=t.relative;this._append(t.absolute,r)}var o=a(r.cwd||".",r);o.on("error",onGlobError.bind(this));o.on("match",onGlobMatch.bind(this));o.on("end",onGlobEnd.bind(this));return this};Archiver.prototype.finalize=function(){if(this._state.aborted){var t=new d("ABORTED");this.emit("error",t);return Promise.reject(t)}if(this._state.finalize){var r=new d("FINALIZING");this.emit("error",r);return Promise.reject(r)}this._state.finalize=true;if(this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}var i=this;return new Promise((function(t,r){var o;i._module.on("end",(function(){if(!o){t()}}));i._module.on("error",(function(t){o=true;r(t)}))}))};Archiver.prototype.setFormat=function(t){if(this._format){this.emit("error",new d("FORMATSET"));return this}this._format=t;return this};Archiver.prototype.setModule=function(t){if(this._state.aborted){this.emit("error",new d("ABORTED"));return this}if(this._state.module){this.emit("error",new d("MODULESET"));return this}this._module=t;this._modulePipe();return this};Archiver.prototype.symlink=function(t,r,i){if(this._state.finalize||this._state.aborted){this.emit("error",new d("QUEUECLOSED"));return this}if(typeof t!=="string"||t.length===0){this.emit("error",new d("SYMLINKFILEPATHREQUIRED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new d("SYMLINKTARGETREQUIRED",{filepath:t}));return this}if(!this._moduleSupports("symlink")){this.emit("error",new d("SYMLINKNOTSUPPORTED",{filepath:t}));return this}var o={};o.type="symlink";o.name=t.replace(/\\/g,"/");o.linkname=r.replace(/\\/g,"/");o.sourceType="buffer";if(typeof i==="number"){o.mode=i}this._entriesCount++;this._queue.push({data:o,source:Buffer.concat([])});return this};Archiver.prototype.pointer=function(){return this._pointer};Archiver.prototype.use=function(t){this._streams.push(t);return this};t.exports=Archiver},685:(t,r,i)=>{
|
|
19
|
+
/**
|
|
20
|
+
* Archiver Core
|
|
21
|
+
*
|
|
22
|
+
* @ignore
|
|
23
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
24
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
25
|
+
*/
|
|
26
|
+
var o=i(3837);const a={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function ArchiverError(t,r){Error.captureStackTrace(this,this.constructor);this.message=a[t]||t;this.code=t;this.data=r}o.inherits(ArchiverError,Error);r=t.exports=ArchiverError},5729:(t,r,i)=>{
|
|
27
|
+
/**
|
|
28
|
+
* JSON Format Plugin
|
|
29
|
+
*
|
|
30
|
+
* @module plugins/json
|
|
31
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
32
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
33
|
+
*/
|
|
34
|
+
var o=i(3837).inherits;var a=i(4381).Transform;var l=i(8106);var c=i(1267);var Json=function(t){if(!(this instanceof Json)){return new Json(t)}t=this.options=c.defaults(t,{});a.call(this,t);this.supports={directory:true,symlink:true};this.files=[]};o(Json,a);Json.prototype._transform=function(t,r,i){i(null,t)};Json.prototype._writeStringified=function(){var t=JSON.stringify(this.files);this.write(t)};Json.prototype.append=function(t,r,i){var o=this;r.crc32=0;function onend(t,a){if(t){i(t);return}r.size=a.length||0;r.crc32=l.unsigned(a);o.files.push(r);i(null,r)}if(r.sourceType==="buffer"){onend(null,t)}else if(r.sourceType==="stream"){c.collectStream(t,onend)}};Json.prototype.finalize=function(){this._writeStringified();this.end()};t.exports=Json},9560:(t,r,i)=>{
|
|
35
|
+
/**
|
|
36
|
+
* TAR Format Plugin
|
|
37
|
+
*
|
|
38
|
+
* @module plugins/tar
|
|
39
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
40
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
41
|
+
*/
|
|
42
|
+
var o=i(9796);var a=i(5464);var l=i(1267);var Tar=function(t){if(!(this instanceof Tar)){return new Tar(t)}t=this.options=l.defaults(t,{gzip:false});if(typeof t.gzipOptions!=="object"){t.gzipOptions={}}this.supports={directory:true,symlink:true};this.engine=a.pack(t);this.compressor=false;if(t.gzip){this.compressor=o.createGzip(t.gzipOptions);this.compressor.on("error",this._onCompressorError.bind(this))}};Tar.prototype._onCompressorError=function(t){this.engine.emit("error",t)};Tar.prototype.append=function(t,r,i){var o=this;r.mtime=r.date;function append(t,a){if(t){i(t);return}o.engine.entry(r,a,(function(t){i(t,r)}))}if(r.sourceType==="buffer"){append(null,t)}else if(r.sourceType==="stream"&&r.stats){r.size=r.stats.size;var a=o.engine.entry(r,(function(t){i(t,r)}));t.pipe(a)}else if(r.sourceType==="stream"){l.collectStream(t,append)}};Tar.prototype.finalize=function(){this.engine.finalize()};Tar.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Tar.prototype.pipe=function(t,r){if(this.compressor){return this.engine.pipe.apply(this.engine,[this.compressor]).pipe(t,r)}else{return this.engine.pipe.apply(this.engine,arguments)}};Tar.prototype.unpipe=function(){if(this.compressor){return this.compressor.unpipe.apply(this.compressor,arguments)}else{return this.engine.unpipe.apply(this.engine,arguments)}};t.exports=Tar},8385:(t,r,i)=>{
|
|
43
|
+
/**
|
|
44
|
+
* ZIP Format Plugin
|
|
45
|
+
*
|
|
46
|
+
* @module plugins/zip
|
|
47
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
48
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
49
|
+
*/
|
|
50
|
+
var o=i(4127);var a=i(1267);var Zip=function(t){if(!(this instanceof Zip)){return new Zip(t)}t=this.options=a.defaults(t,{comment:"",forceUTC:false,namePrependSlash:false,store:false});this.supports={directory:true,symlink:true};this.engine=new o(t)};Zip.prototype.append=function(t,r,i){this.engine.entry(t,r,i)};Zip.prototype.finalize=function(){this.engine.finalize()};Zip.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Zip.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};Zip.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};t.exports=Zip},9449:(t,r,i)=>{var o=i(2998);function retry(t,r){function run(i,a){var l=r||{};var c;if(!("randomize"in l)){l.randomize=true}c=o.operation(l);function bail(t){a(t||new Error("Aborted"))}function onError(t,r){if(t.bail){bail(t);return}if(!c.retry(t)){a(c.mainError())}else if(l.onRetry){l.onRetry(t,r)}}function runAttempt(r){var o;try{o=t(bail,r)}catch(t){onError(t,r);return}Promise.resolve(o).then(i).catch((function catchIt(t){onError(t,r)}))}c.attempt(runAttempt)}return new Promise(run)}t.exports=retry},3408:function(t,r){(function(t,i){true?i(r):0})(this,(function(t){"use strict";function apply(t,...r){return(...i)=>t(...r,...i)}function initialParams(t){return function(...r){var i=r.pop();return t.call(this,r,i)}}var r=typeof queueMicrotask==="function"&&queueMicrotask;var i=typeof setImmediate==="function"&&setImmediate;var o=typeof process==="object"&&typeof process.nextTick==="function";function fallback(t){setTimeout(t,0)}function wrap(t){return(r,...i)=>t((()=>r(...i)))}var a;if(r){a=queueMicrotask}else if(i){a=setImmediate}else if(o){a=process.nextTick}else{a=fallback}var l=wrap(a);function asyncify(t){if(isAsync(t)){return function(...r){const i=r.pop();const o=t.apply(this,r);return handlePromise(o,i)}}return initialParams((function(r,i){var o;try{o=t.apply(this,r)}catch(t){return i(t)}if(o&&typeof o.then==="function"){return handlePromise(o,i)}else{i(null,o)}}))}function handlePromise(t,r){return t.then((t=>{invokeCallback(r,null,t)}),(t=>{invokeCallback(r,t&&t.message?t:new Error(t))}))}function invokeCallback(t,r,i){try{t(r,i)}catch(t){l((t=>{throw t}),t)}}function isAsync(t){return t[Symbol.toStringTag]==="AsyncFunction"}function isAsyncGenerator(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function isAsyncIterable(t){return typeof t[Symbol.asyncIterator]==="function"}function wrapAsync(t){if(typeof t!=="function")throw new Error("expected a function");return isAsync(t)?asyncify(t):t}function awaitify(t,r=t.length){if(!r)throw new Error("arity is undefined");function awaitable(...i){if(typeof i[r-1]==="function"){return t.apply(this,i)}return new Promise(((o,a)=>{i[r-1]=(t,...r)=>{if(t)return a(t);o(r.length>1?r:r[0])};t.apply(this,i)}))}return awaitable}function applyEach(t){return function applyEach(r,...i){const o=awaitify((function(o){var a=this;return t(r,((t,r)=>{wrapAsync(t).apply(a,i.concat(r))}),o)}));return o}}function _asyncMap(t,r,i,o){r=r||[];var a=[];var l=0;var c=wrapAsync(i);return t(r,((t,r,i)=>{var o=l++;c(t,((t,r)=>{a[o]=r;i(t)}))}),(t=>{o(t,a)}))}function isArrayLike(t){return t&&typeof t.length==="number"&&t.length>=0&&t.length%1===0}const c={};function once(t){function wrapper(...r){if(t===null)return;var i=t;t=null;i.apply(this,r)}Object.assign(wrapper,t);return wrapper}function getIterator(t){return t[Symbol.iterator]&&t[Symbol.iterator]()}function createArrayIterator(t){var r=-1;var i=t.length;return function next(){return++r<i?{value:t[r],key:r}:null}}function createES2015Iterator(t){var r=-1;return function next(){var i=t.next();if(i.done)return null;r++;return{value:i.value,key:r}}}function createObjectIterator(t){var r=t?Object.keys(t):[];var i=-1;var o=r.length;return function next(){var a=r[++i];if(a==="__proto__"){return next()}return i<o?{value:t[a],key:a}:null}}function createIterator(t){if(isArrayLike(t)){return createArrayIterator(t)}var r=getIterator(t);return r?createES2015Iterator(r):createObjectIterator(t)}function onlyOnce(t){return function(...r){if(t===null)throw new Error("Callback was already called.");var i=t;t=null;i.apply(this,r)}}function asyncEachOfLimit(t,r,i,o){let a=false;let l=false;let u=false;let h=0;let d=0;function replenish(){if(h>=r||u||a)return;u=true;t.next().then((({value:t,done:r})=>{if(l||a)return;u=false;if(r){a=true;if(h<=0){o(null)}return}h++;i(t,d,iterateeCallback);d++;replenish()})).catch(handleError)}function iterateeCallback(t,r){h-=1;if(l)return;if(t)return handleError(t);if(t===false){a=true;l=true;return}if(r===c||a&&h<=0){a=true;return o(null)}replenish()}function handleError(t){if(l)return;u=false;a=true;o(t)}replenish()}var eachOfLimit=t=>(r,i,o)=>{o=once(o);if(t<=0){throw new RangeError("concurrency limit cannot be less than 1")}if(!r){return o(null)}if(isAsyncGenerator(r)){return asyncEachOfLimit(r,t,i,o)}if(isAsyncIterable(r)){return asyncEachOfLimit(r[Symbol.asyncIterator](),t,i,o)}var a=createIterator(r);var l=false;var u=false;var h=0;var d=false;function iterateeCallback(t,r){if(u)return;h-=1;if(t){l=true;o(t)}else if(t===false){l=true;u=true}else if(r===c||l&&h<=0){l=true;return o(null)}else if(!d){replenish()}}function replenish(){d=true;while(h<t&&!l){var r=a();if(r===null){l=true;if(h<=0){o(null)}return}h+=1;i(r.value,r.key,onlyOnce(iterateeCallback))}d=false}replenish()};function eachOfLimit$1(t,r,i,o){return eachOfLimit(r)(t,wrapAsync(i),o)}var u=awaitify(eachOfLimit$1,4);function eachOfArrayLike(t,r,i){i=once(i);var o=0,a=0,{length:l}=t,u=false;if(l===0){i(null)}function iteratorCallback(t,r){if(t===false){u=true}if(u===true)return;if(t){i(t)}else if(++a===l||r===c){i(null)}}for(;o<l;o++){r(t[o],o,onlyOnce(iteratorCallback))}}function eachOfGeneric(t,r,i){return u(t,Infinity,r,i)}function eachOf(t,r,i){var o=isArrayLike(t)?eachOfArrayLike:eachOfGeneric;return o(t,wrapAsync(r),i)}var h=awaitify(eachOf,3);function map(t,r,i){return _asyncMap(h,t,r,i)}var d=awaitify(map,3);var p=applyEach(d);function eachOfSeries(t,r,i){return u(t,1,r,i)}var m=awaitify(eachOfSeries,3);function mapSeries(t,r,i){return _asyncMap(m,t,r,i)}var y=awaitify(mapSeries,3);var g=applyEach(y);const b=Symbol("promiseCallback");function promiseCallback(){let t,r;function callback(i,...o){if(i)return r(i);t(o.length>1?o:o[0])}callback[b]=new Promise(((i,o)=>{t=i,r=o}));return callback}function auto(t,r,i){if(typeof r!=="number"){i=r;r=null}i=once(i||promiseCallback());var o=Object.keys(t).length;if(!o){return i(null)}if(!r){r=o}var a={};var l=0;var c=false;var u=false;var h=Object.create(null);var d=[];var p=[];var m={};Object.keys(t).forEach((r=>{var i=t[r];if(!Array.isArray(i)){enqueueTask(r,[i]);p.push(r);return}var o=i.slice(0,i.length-1);var a=o.length;if(a===0){enqueueTask(r,i);p.push(r);return}m[r]=a;o.forEach((l=>{if(!t[l]){throw new Error("async.auto task `"+r+"` has a non-existent dependency `"+l+"` in "+o.join(", "))}addListener(l,(()=>{a--;if(a===0){enqueueTask(r,i)}}))}))}));checkForDeadlocks();processQueue();function enqueueTask(t,r){d.push((()=>runTask(t,r)))}function processQueue(){if(c)return;if(d.length===0&&l===0){return i(null,a)}while(d.length&&l<r){var t=d.shift();t()}}function addListener(t,r){var i=h[t];if(!i){i=h[t]=[]}i.push(r)}function taskComplete(t){var r=h[t]||[];r.forEach((t=>t()));processQueue()}function runTask(t,r){if(u)return;var o=onlyOnce(((r,...o)=>{l--;if(r===false){c=true;return}if(o.length<2){[o]=o}if(r){var d={};Object.keys(a).forEach((t=>{d[t]=a[t]}));d[t]=o;u=true;h=Object.create(null);if(c)return;i(r,d)}else{a[t]=o;taskComplete(t)}}));l++;var d=wrapAsync(r[r.length-1]);if(r.length>1){d(a,o)}else{d(o)}}function checkForDeadlocks(){var t;var r=0;while(p.length){t=p.pop();r++;getDependents(t).forEach((t=>{if(--m[t]===0){p.push(t)}}))}if(r!==o){throw new Error("async.auto cannot execute tasks due to a recursive dependency")}}function getDependents(r){var i=[];Object.keys(t).forEach((o=>{const a=t[o];if(Array.isArray(a)&&a.indexOf(r)>=0){i.push(o)}}));return i}return i[b]}var v=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/;var _=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;var w=/,/;var E=/(=.+)?(\s*)$/;function stripComments(t){let r="";let i=0;let o=t.indexOf("*/");while(i<t.length){if(t[i]==="/"&&t[i+1]==="/"){let r=t.indexOf("\n",i);i=r===-1?t.length:r}else if(o!==-1&&t[i]==="/"&&t[i+1]==="*"){let a=t.indexOf("*/",i);if(a!==-1){i=a+2;o=t.indexOf("*/",i)}else{r+=t[i];i++}}else{r+=t[i];i++}}return r}function parseParams(t){const r=stripComments(t.toString());let i=r.match(v);if(!i){i=r.match(_)}if(!i)throw new Error("could not parse args in autoInject\nSource:\n"+r);let[,o]=i;return o.replace(/\s/g,"").split(w).map((t=>t.replace(E,"").trim()))}function autoInject(t,r){var i={};Object.keys(t).forEach((r=>{var o=t[r];var a;var l=isAsync(o);var c=!l&&o.length===1||l&&o.length===0;if(Array.isArray(o)){a=[...o];o=a.pop();i[r]=a.concat(a.length>0?newTask:o)}else if(c){i[r]=o}else{a=parseParams(o);if(o.length===0&&!l&&a.length===0){throw new Error("autoInject task functions require explicit parameters.")}if(!l)a.pop();i[r]=a.concat(newTask)}function newTask(t,r){var i=a.map((r=>t[r]));i.push(r);wrapAsync(o)(...i)}}));return auto(i,r)}class DLL{constructor(){this.head=this.tail=null;this.length=0}removeLink(t){if(t.prev)t.prev.next=t.next;else this.head=t.next;if(t.next)t.next.prev=t.prev;else this.tail=t.prev;t.prev=t.next=null;this.length-=1;return t}empty(){while(this.head)this.shift();return this}insertAfter(t,r){r.prev=t;r.next=t.next;if(t.next)t.next.prev=r;else this.tail=r;t.next=r;this.length+=1}insertBefore(t,r){r.prev=t.prev;r.next=t;if(t.prev)t.prev.next=r;else this.head=r;t.prev=r;this.length+=1}unshift(t){if(this.head)this.insertBefore(this.head,t);else setInitial(this,t)}push(t){if(this.tail)this.insertAfter(this.tail,t);else setInitial(this,t)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var t=this.head;while(t){yield t.data;t=t.next}}remove(t){var r=this.head;while(r){var{next:i}=r;if(t(r)){this.removeLink(r)}r=i}return this}}function setInitial(t,r){t.length=1;t.head=t.tail=r}function queue(t,r,i){if(r==null){r=1}else if(r===0){throw new RangeError("Concurrency must not be zero")}var o=wrapAsync(t);var a=0;var c=[];const u={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function on(t,r){u[t].push(r)}function once(t,r){const handleAndRemove=(...i)=>{off(t,handleAndRemove);r(...i)};u[t].push(handleAndRemove)}function off(t,r){if(!t)return Object.keys(u).forEach((t=>u[t]=[]));if(!r)return u[t]=[];u[t]=u[t].filter((t=>t!==r))}function trigger(t,...r){u[t].forEach((t=>t(...r)))}var h=false;function _insert(t,r,i,o){if(o!=null&&typeof o!=="function"){throw new Error("task callback must be a function")}p.started=true;var a,c;function promiseCallback(t,...r){if(t)return i?c(t):a();if(r.length<=1)return a(r[0]);a(r)}var u={data:t,callback:i?promiseCallback:o||promiseCallback};if(r){p._tasks.unshift(u)}else{p._tasks.push(u)}if(!h){h=true;l((()=>{h=false;p.process()}))}if(i||!o){return new Promise(((t,r)=>{a=t;c=r}))}}function _createCB(t){return function(r,...i){a-=1;for(var o=0,l=t.length;o<l;o++){var u=t[o];var h=c.indexOf(u);if(h===0){c.shift()}else if(h>0){c.splice(h,1)}u.callback(r,...i);if(r!=null){trigger("error",r,u.data)}}if(a<=p.concurrency-p.buffer){trigger("unsaturated")}if(p.idle()){trigger("drain")}p.process()}}function _maybeDrain(t){if(t.length===0&&p.idle()){l((()=>trigger("drain")));return true}return false}const eventMethod=t=>r=>{if(!r){return new Promise(((r,i)=>{once(t,((t,o)=>{if(t)return i(t);r(o)}))}))}off(t);on(t,r)};var d=false;var p={_tasks:new DLL,*[Symbol.iterator](){yield*p._tasks[Symbol.iterator]()},concurrency:r,payload:i,buffer:r/4,started:false,paused:false,push(t,r){if(Array.isArray(t)){if(_maybeDrain(t))return;return t.map((t=>_insert(t,false,false,r)))}return _insert(t,false,false,r)},pushAsync(t,r){if(Array.isArray(t)){if(_maybeDrain(t))return;return t.map((t=>_insert(t,false,true,r)))}return _insert(t,false,true,r)},kill(){off();p._tasks.empty()},unshift(t,r){if(Array.isArray(t)){if(_maybeDrain(t))return;return t.map((t=>_insert(t,true,false,r)))}return _insert(t,true,false,r)},unshiftAsync(t,r){if(Array.isArray(t)){if(_maybeDrain(t))return;return t.map((t=>_insert(t,true,true,r)))}return _insert(t,true,true,r)},remove(t){p._tasks.remove(t)},process(){if(d){return}d=true;while(!p.paused&&a<p.concurrency&&p._tasks.length){var t=[],r=[];var i=p._tasks.length;if(p.payload)i=Math.min(i,p.payload);for(var l=0;l<i;l++){var u=p._tasks.shift();t.push(u);c.push(u);r.push(u.data)}a+=1;if(p._tasks.length===0){trigger("empty")}if(a===p.concurrency){trigger("saturated")}var h=onlyOnce(_createCB(t));o(r,h)}d=false},length(){return p._tasks.length},running(){return a},workersList(){return c},idle(){return p._tasks.length+a===0},pause(){p.paused=true},resume(){if(p.paused===false){return}p.paused=false;l(p.process)}};Object.defineProperties(p,{saturated:{writable:false,value:eventMethod("saturated")},unsaturated:{writable:false,value:eventMethod("unsaturated")},empty:{writable:false,value:eventMethod("empty")},drain:{writable:false,value:eventMethod("drain")},error:{writable:false,value:eventMethod("error")}});return p}function cargo(t,r){return queue(t,1,r)}function cargo$1(t,r,i){return queue(t,r,i)}function reduce(t,r,i,o){o=once(o);var a=wrapAsync(i);return m(t,((t,i,o)=>{a(r,t,((t,i)=>{r=i;o(t)}))}),(t=>o(t,r)))}var S=awaitify(reduce,4);function seq(...t){var r=t.map(wrapAsync);return function(...t){var i=this;var o=t[t.length-1];if(typeof o=="function"){t.pop()}else{o=promiseCallback()}S(r,t,((t,r,o)=>{r.apply(i,t.concat(((t,...r)=>{o(t,r)})))}),((t,r)=>o(t,...r)));return o[b]}}function compose(...t){return seq(...t.reverse())}function mapLimit(t,r,i,o){return _asyncMap(eachOfLimit(r),t,i,o)}var R=awaitify(mapLimit,4);function concatLimit(t,r,i,o){var a=wrapAsync(i);return R(t,r,((t,r)=>{a(t,((t,...i)=>{if(t)return r(t);return r(t,i)}))}),((t,r)=>{var i=[];for(var a=0;a<r.length;a++){if(r[a]){i=i.concat(...r[a])}}return o(t,i)}))}var O=awaitify(concatLimit,4);function concat(t,r,i){return O(t,Infinity,r,i)}var x=awaitify(concat,3);function concatSeries(t,r,i){return O(t,1,r,i)}var T=awaitify(concatSeries,3);function constant(...t){return function(...r){var i=r.pop();return i(null,...t)}}function _createTester(t,r){return(i,o,a,l)=>{var u=false;var h;const d=wrapAsync(a);i(o,((i,o,a)=>{d(i,((o,l)=>{if(o||o===false)return a(o);if(t(l)&&!h){u=true;h=r(true,i);return a(null,c)}a()}))}),(t=>{if(t)return l(t);l(null,u?h:r(false))}))}}function detect(t,r,i){return _createTester((t=>t),((t,r)=>r))(h,t,r,i)}var k=awaitify(detect,3);function detectLimit(t,r,i,o){return _createTester((t=>t),((t,r)=>r))(eachOfLimit(r),t,i,o)}var A=awaitify(detectLimit,4);function detectSeries(t,r,i){return _createTester((t=>t),((t,r)=>r))(eachOfLimit(1),t,r,i)}var C=awaitify(detectSeries,3);function consoleFunc(t){return(r,...i)=>wrapAsync(r)(...i,((r,...i)=>{if(typeof console==="object"){if(r){if(console.error){console.error(r)}}else if(console[t]){i.forEach((r=>console[t](r)))}}}))}var P=consoleFunc("dir");function doWhilst(t,r,i){i=onlyOnce(i);var o=wrapAsync(t);var a=wrapAsync(r);var l;function next(t,...r){if(t)return i(t);if(t===false)return;l=r;a(...r,check)}function check(t,r){if(t)return i(t);if(t===false)return;if(!r)return i(null,...l);o(next)}return check(null,true)}var I=awaitify(doWhilst,3);function doUntil(t,r,i){const o=wrapAsync(r);return I(t,((...t)=>{const r=t.pop();o(...t,((t,i)=>r(t,!i)))}),i)}function _withoutIndex(t){return(r,i,o)=>t(r,o)}function eachLimit(t,r,i){return h(t,_withoutIndex(wrapAsync(r)),i)}var L=awaitify(eachLimit,3);function eachLimit$1(t,r,i,o){return eachOfLimit(r)(t,_withoutIndex(wrapAsync(i)),o)}var D=awaitify(eachLimit$1,4);function eachSeries(t,r,i){return D(t,1,r,i)}var M=awaitify(eachSeries,3);function ensureAsync(t){if(isAsync(t))return t;return function(...r){var i=r.pop();var o=true;r.push(((...t)=>{if(o){l((()=>i(...t)))}else{i(...t)}}));t.apply(this,r);o=false}}function every(t,r,i){return _createTester((t=>!t),(t=>!t))(h,t,r,i)}var N=awaitify(every,3);function everyLimit(t,r,i,o){return _createTester((t=>!t),(t=>!t))(eachOfLimit(r),t,i,o)}var j=awaitify(everyLimit,4);function everySeries(t,r,i){return _createTester((t=>!t),(t=>!t))(m,t,r,i)}var B=awaitify(everySeries,3);function filterArray(t,r,i,o){var a=new Array(r.length);t(r,((t,r,o)=>{i(t,((t,i)=>{a[r]=!!i;o(t)}))}),(t=>{if(t)return o(t);var i=[];for(var l=0;l<r.length;l++){if(a[l])i.push(r[l])}o(null,i)}))}function filterGeneric(t,r,i,o){var a=[];t(r,((t,r,o)=>{i(t,((i,l)=>{if(i)return o(i);if(l){a.push({index:r,value:t})}o(i)}))}),(t=>{if(t)return o(t);o(null,a.sort(((t,r)=>t.index-r.index)).map((t=>t.value)))}))}function _filter(t,r,i,o){var a=isArrayLike(r)?filterArray:filterGeneric;return a(t,r,wrapAsync(i),o)}function filter(t,r,i){return _filter(h,t,r,i)}var $=awaitify(filter,3);function filterLimit(t,r,i,o){return _filter(eachOfLimit(r),t,i,o)}var H=awaitify(filterLimit,4);function filterSeries(t,r,i){return _filter(m,t,r,i)}var U=awaitify(filterSeries,3);function forever(t,r){var i=onlyOnce(r);var o=wrapAsync(ensureAsync(t));function next(t){if(t)return i(t);if(t===false)return;o(next)}return next()}var q=awaitify(forever,2);function groupByLimit(t,r,i,o){var a=wrapAsync(i);return R(t,r,((t,r)=>{a(t,((i,o)=>{if(i)return r(i);return r(i,{key:o,val:t})}))}),((t,r)=>{var i={};var{hasOwnProperty:a}=Object.prototype;for(var l=0;l<r.length;l++){if(r[l]){var{key:c}=r[l];var{val:u}=r[l];if(a.call(i,c)){i[c].push(u)}else{i[c]=[u]}}}return o(t,i)}))}var z=awaitify(groupByLimit,4);function groupBy(t,r,i){return z(t,Infinity,r,i)}function groupBySeries(t,r,i){return z(t,1,r,i)}var G=consoleFunc("log");function mapValuesLimit(t,r,i,o){o=once(o);var a={};var l=wrapAsync(i);return eachOfLimit(r)(t,((t,r,i)=>{l(t,r,((t,o)=>{if(t)return i(t);a[r]=o;i(t)}))}),(t=>o(t,a)))}var W=awaitify(mapValuesLimit,4);function mapValues(t,r,i){return W(t,Infinity,r,i)}function mapValuesSeries(t,r,i){return W(t,1,r,i)}function memoize(t,r=(t=>t)){var i=Object.create(null);var o=Object.create(null);var a=wrapAsync(t);var c=initialParams(((t,c)=>{var u=r(...t);if(u in i){l((()=>c(null,...i[u])))}else if(u in o){o[u].push(c)}else{o[u]=[c];a(...t,((t,...r)=>{if(!t){i[u]=r}var a=o[u];delete o[u];for(var l=0,c=a.length;l<c;l++){a[l](t,...r)}}))}}));c.memo=i;c.unmemoized=t;return c}var V;if(o){V=process.nextTick}else if(i){V=setImmediate}else{V=fallback}var Y=wrap(V);var Z=awaitify(((t,r,i)=>{var o=isArrayLike(r)?[]:{};t(r,((t,r,i)=>{wrapAsync(t)(((t,...a)=>{if(a.length<2){[a]=a}o[r]=a;i(t)}))}),(t=>i(t,o)))}),3);function parallel(t,r){return Z(h,t,r)}function parallelLimit(t,r,i){return Z(eachOfLimit(r),t,i)}function queue$1(t,r){var i=wrapAsync(t);return queue(((t,r)=>{i(t[0],r)}),r,1)}class Heap{constructor(){this.heap=[];this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){this.heap=[];return this}percUp(t){let r;while(t>0&&smaller(this.heap[t],this.heap[r=parent(t)])){let i=this.heap[t];this.heap[t]=this.heap[r];this.heap[r]=i;t=r}}percDown(t){let r;while((r=leftChi(t))<this.heap.length){if(r+1<this.heap.length&&smaller(this.heap[r+1],this.heap[r])){r=r+1}if(smaller(this.heap[t],this.heap[r])){break}let i=this.heap[t];this.heap[t]=this.heap[r];this.heap[r]=i;t=r}}push(t){t.pushCount=++this.pushCount;this.heap.push(t);this.percUp(this.heap.length-1)}unshift(t){return this.heap.push(t)}shift(){let[t]=this.heap;this.heap[0]=this.heap[this.heap.length-1];this.heap.pop();this.percDown(0);return t}toArray(){return[...this]}*[Symbol.iterator](){for(let t=0;t<this.heap.length;t++){yield this.heap[t].data}}remove(t){let r=0;for(let i=0;i<this.heap.length;i++){if(!t(this.heap[i])){this.heap[r]=this.heap[i];r++}}this.heap.splice(r);for(let t=parent(this.heap.length-1);t>=0;t--){this.percDown(t)}return this}}function leftChi(t){return(t<<1)+1}function parent(t){return(t+1>>1)-1}function smaller(t,r){if(t.priority!==r.priority){return t.priority<r.priority}else{return t.pushCount<r.pushCount}}function priorityQueue(t,r){var i=queue$1(t,r);var o=false;i._tasks=new Heap;i.push=function(t,r=0,a=(()=>{})){if(typeof a!=="function"){throw new Error("task callback must be a function")}i.started=true;if(!Array.isArray(t)){t=[t]}if(t.length===0&&i.idle()){return l((()=>i.drain()))}for(var c=0,u=t.length;c<u;c++){var h={data:t[c],priority:r,callback:a};i._tasks.push(h)}if(!o){o=true;l((()=>{o=false;i.process()}))}};delete i.unshift;return i}function race(t,r){r=once(r);if(!Array.isArray(t))return r(new TypeError("First argument to race must be an array of functions"));if(!t.length)return r();for(var i=0,o=t.length;i<o;i++){wrapAsync(t[i])(r)}}var K=awaitify(race,2);function reduceRight(t,r,i,o){var a=[...t].reverse();return S(a,r,i,o)}function reflect(t){var r=wrapAsync(t);return initialParams((function reflectOn(t,i){t.push(((t,...r)=>{let o={};if(t){o.error=t}if(r.length>0){var a=r;if(r.length<=1){[a]=r}o.value=a}i(null,o)}));return r.apply(this,t)}))}function reflectAll(t){var r;if(Array.isArray(t)){r=t.map(reflect)}else{r={};Object.keys(t).forEach((i=>{r[i]=reflect.call(this,t[i])}))}return r}function reject(t,r,i,o){const a=wrapAsync(i);return _filter(t,r,((t,r)=>{a(t,((t,i)=>{r(t,!i)}))}),o)}function reject$1(t,r,i){return reject(h,t,r,i)}var Q=awaitify(reject$1,3);function rejectLimit(t,r,i,o){return reject(eachOfLimit(r),t,i,o)}var X=awaitify(rejectLimit,4);function rejectSeries(t,r,i){return reject(m,t,r,i)}var J=awaitify(rejectSeries,3);function constant$1(t){return function(){return t}}const ee=5;const te=0;function retry(t,r,i){var o={times:ee,intervalFunc:constant$1(te)};if(arguments.length<3&&typeof t==="function"){i=r||promiseCallback();r=t}else{parseTimes(o,t);i=i||promiseCallback()}if(typeof r!=="function"){throw new Error("Invalid arguments for async.retry")}var a=wrapAsync(r);var l=1;function retryAttempt(){a(((t,...r)=>{if(t===false)return;if(t&&l++<o.times&&(typeof o.errorFilter!="function"||o.errorFilter(t))){setTimeout(retryAttempt,o.intervalFunc(l-1))}else{i(t,...r)}}))}retryAttempt();return i[b]}function parseTimes(t,r){if(typeof r==="object"){t.times=+r.times||ee;t.intervalFunc=typeof r.interval==="function"?r.interval:constant$1(+r.interval||te);t.errorFilter=r.errorFilter}else if(typeof r==="number"||typeof r==="string"){t.times=+r||ee}else{throw new Error("Invalid arguments for async.retry")}}function retryable(t,r){if(!r){r=t;t=null}let i=t&&t.arity||r.length;if(isAsync(r)){i+=1}var o=wrapAsync(r);return initialParams(((r,a)=>{if(r.length<i-1||a==null){r.push(a);a=promiseCallback()}function taskFn(t){o(...r,t)}if(t)retry(t,taskFn,a);else retry(taskFn,a);return a[b]}))}function series(t,r){return Z(m,t,r)}function some(t,r,i){return _createTester(Boolean,(t=>t))(h,t,r,i)}var re=awaitify(some,3);function someLimit(t,r,i,o){return _createTester(Boolean,(t=>t))(eachOfLimit(r),t,i,o)}var ie=awaitify(someLimit,4);function someSeries(t,r,i){return _createTester(Boolean,(t=>t))(m,t,r,i)}var se=awaitify(someSeries,3);function sortBy(t,r,i){var o=wrapAsync(r);return d(t,((t,r)=>{o(t,((i,o)=>{if(i)return r(i);r(i,{value:t,criteria:o})}))}),((t,r)=>{if(t)return i(t);i(null,r.sort(comparator).map((t=>t.value)))}));function comparator(t,r){var i=t.criteria,o=r.criteria;return i<o?-1:i>o?1:0}}var ne=awaitify(sortBy,3);function timeout(t,r,i){var o=wrapAsync(t);return initialParams(((a,l)=>{var c=false;var u;function timeoutCallback(){var r=t.name||"anonymous";var o=new Error('Callback function "'+r+'" timed out.');o.code="ETIMEDOUT";if(i){o.info=i}c=true;l(o)}a.push(((...t)=>{if(!c){l(...t);clearTimeout(u)}}));u=setTimeout(timeoutCallback,r);o(...a)}))}function range(t){var r=Array(t);while(t--){r[t]=t}return r}function timesLimit(t,r,i,o){var a=wrapAsync(i);return R(range(t),r,a,o)}function times(t,r,i){return timesLimit(t,Infinity,r,i)}function timesSeries(t,r,i){return timesLimit(t,1,r,i)}function transform(t,r,i,o){if(arguments.length<=3&&typeof r==="function"){o=i;i=r;r=Array.isArray(t)?[]:{}}o=once(o||promiseCallback());var a=wrapAsync(i);h(t,((t,i,o)=>{a(r,t,i,o)}),(t=>o(t,r)));return o[b]}function tryEach(t,r){var i=null;var o;return M(t,((t,r)=>{wrapAsync(t)(((t,...a)=>{if(t===false)return r(t);if(a.length<2){[o]=a}else{o=a}i=t;r(t?null:{})}))}),(()=>r(i,o)))}var oe=awaitify(tryEach);function unmemoize(t){return(...r)=>(t.unmemoized||t)(...r)}function whilst(t,r,i){i=onlyOnce(i);var o=wrapAsync(r);var a=wrapAsync(t);var l=[];function next(t,...r){if(t)return i(t);l=r;if(t===false)return;a(check)}function check(t,r){if(t)return i(t);if(t===false)return;if(!r)return i(null,...l);o(next)}return a(check)}var ae=awaitify(whilst,3);function until(t,r,i){const o=wrapAsync(t);return ae((t=>o(((r,i)=>t(r,!i)))),r,i)}function waterfall(t,r){r=once(r);if(!Array.isArray(t))return r(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return r();var i=0;function nextTask(r){var o=wrapAsync(t[i++]);o(...r,onlyOnce(next))}function next(o,...a){if(o===false)return;if(o||i===t.length){return r(o,...a)}nextTask(a)}nextTask([])}var le=awaitify(waterfall);var ce={apply:apply,applyEach:p,applyEachSeries:g,asyncify:asyncify,auto:auto,autoInject:autoInject,cargo:cargo,cargoQueue:cargo$1,compose:compose,concat:x,concatLimit:O,concatSeries:T,constant:constant,detect:k,detectLimit:A,detectSeries:C,dir:P,doUntil:doUntil,doWhilst:I,each:L,eachLimit:D,eachOf:h,eachOfLimit:u,eachOfSeries:m,eachSeries:M,ensureAsync:ensureAsync,every:N,everyLimit:j,everySeries:B,filter:$,filterLimit:H,filterSeries:U,forever:q,groupBy:groupBy,groupByLimit:z,groupBySeries:groupBySeries,log:G,map:d,mapLimit:R,mapSeries:y,mapValues:mapValues,mapValuesLimit:W,mapValuesSeries:mapValuesSeries,memoize:memoize,nextTick:Y,parallel:parallel,parallelLimit:parallelLimit,priorityQueue:priorityQueue,queue:queue$1,race:K,reduce:S,reduceRight:reduceRight,reflect:reflect,reflectAll:reflectAll,reject:Q,rejectLimit:X,rejectSeries:J,retry:retry,retryable:retryable,seq:seq,series:series,setImmediate:l,some:re,someLimit:ie,someSeries:se,sortBy:ne,timeout:timeout,times:times,timesLimit:timesLimit,timesSeries:timesSeries,transform:transform,tryEach:oe,unmemoize:unmemoize,until:until,waterfall:le,whilst:ae,all:N,allLimit:j,allSeries:B,any:re,anyLimit:ie,anySeries:se,find:k,findLimit:A,findSeries:C,flatMap:x,flatMapLimit:O,flatMapSeries:T,forEach:L,forEachSeries:M,forEachLimit:D,forEachOf:h,forEachOfSeries:m,forEachOfLimit:u,inject:S,foldl:S,foldr:reduceRight,select:$,selectLimit:H,selectSeries:U,wrapSync:asyncify,during:ae,doDuring:I};t.default=ce;t.apply=apply;t.applyEach=p;t.applyEachSeries=g;t.asyncify=asyncify;t.auto=auto;t.autoInject=autoInject;t.cargo=cargo;t.cargoQueue=cargo$1;t.compose=compose;t.concat=x;t.concatLimit=O;t.concatSeries=T;t.constant=constant;t.detect=k;t.detectLimit=A;t.detectSeries=C;t.dir=P;t.doUntil=doUntil;t.doWhilst=I;t.each=L;t.eachLimit=D;t.eachOf=h;t.eachOfLimit=u;t.eachOfSeries=m;t.eachSeries=M;t.ensureAsync=ensureAsync;t.every=N;t.everyLimit=j;t.everySeries=B;t.filter=$;t.filterLimit=H;t.filterSeries=U;t.forever=q;t.groupBy=groupBy;t.groupByLimit=z;t.groupBySeries=groupBySeries;t.log=G;t.map=d;t.mapLimit=R;t.mapSeries=y;t.mapValues=mapValues;t.mapValuesLimit=W;t.mapValuesSeries=mapValuesSeries;t.memoize=memoize;t.nextTick=Y;t.parallel=parallel;t.parallelLimit=parallelLimit;t.priorityQueue=priorityQueue;t.queue=queue$1;t.race=K;t.reduce=S;t.reduceRight=reduceRight;t.reflect=reflect;t.reflectAll=reflectAll;t.reject=Q;t.rejectLimit=X;t.rejectSeries=J;t.retry=retry;t.retryable=retryable;t.seq=seq;t.series=series;t.setImmediate=l;t.some=re;t.someLimit=ie;t.someSeries=se;t.sortBy=ne;t.timeout=timeout;t.times=times;t.timesLimit=timesLimit;t.timesSeries=timesSeries;t.transform=transform;t.tryEach=oe;t.unmemoize=unmemoize;t.until=until;t.waterfall=le;t.whilst=ae;t.all=N;t.allLimit=j;t.allSeries=B;t.any=re;t.anyLimit=ie;t.anySeries=se;t.find=k;t.findLimit=A;t.findSeries=C;t.flatMap=x;t.flatMapLimit=O;t.flatMapSeries=T;t.forEach=L;t.forEachSeries=M;t.forEachLimit=D;t.forEachOf=h;t.forEachOfSeries=m;t.forEachOfLimit=u;t.inject=S;t.foldl=S;t.foldr=reduceRight;t.select=$;t.selectLimit=H;t.selectSeries=U;t.wrapSync=asyncify;t.during=ae;t.doDuring=I;Object.defineProperty(t,"__esModule",{value:true})}))},7452:t=>{"use strict";t.exports=balanced;function balanced(t,r,i){if(t instanceof RegExp)t=maybeMatch(t,i);if(r instanceof RegExp)r=maybeMatch(r,i);var o=range(t,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+t.length,o[1]),post:i.slice(o[1]+r.length)}}function maybeMatch(t,r){var i=r.match(t);return i?i[0]:null}balanced.range=range;function range(t,r,i){var o,a,l,c,u;var h=i.indexOf(t);var d=i.indexOf(r,h+1);var p=h;if(h>=0&&d>0){if(t===r){return[h,d]}o=[];l=i.length;while(p>=0&&!u){if(p==h){o.push(p);h=i.indexOf(t,p+1)}else if(o.length==1){u=[o.pop(),d]}else{a=o.pop();if(a<l){l=a;c=d}d=i.indexOf(r,p+1)}p=h<d&&h>=0?h:d}if(o.length){u=[l,c]}}return u}},4577:(t,r,i)=>{"use strict";const{Buffer:o}=i(4300);const a=Symbol.for("BufferList");function BufferList(t){if(!(this instanceof BufferList)){return new BufferList(t)}BufferList._init.call(this,t)}BufferList._init=function _init(t){Object.defineProperty(this,a,{value:true});this._bufs=[];this.length=0;if(t){this.append(t)}};BufferList.prototype._new=function _new(t){return new BufferList(t)};BufferList.prototype._offset=function _offset(t){if(t===0){return[0,0]}let r=0;for(let i=0;i<this._bufs.length;i++){const o=r+this._bufs[i].length;if(t<o||i===this._bufs.length-1){return[i,t-r]}r=o}};BufferList.prototype._reverseOffset=function(t){const r=t[0];let i=t[1];for(let t=0;t<r;t++){i+=this._bufs[t].length}return i};BufferList.prototype.get=function get(t){if(t>this.length||t<0){return undefined}const r=this._offset(t);return this._bufs[r[0]][r[1]]};BufferList.prototype.slice=function slice(t,r){if(typeof t==="number"&&t<0){t+=this.length}if(typeof r==="number"&&r<0){r+=this.length}return this.copy(null,0,t,r)};BufferList.prototype.copy=function copy(t,r,i,a){if(typeof i!=="number"||i<0){i=0}if(typeof a!=="number"||a>this.length){a=this.length}if(i>=this.length){return t||o.alloc(0)}if(a<=0){return t||o.alloc(0)}const copy=!!t;const l=this._offset(i);const c=a-i;let u=c;let h=copy&&r||0;let d=l[1];if(i===0&&a===this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:o.concat(this._bufs,this.length)}for(let r=0;r<this._bufs.length;r++){this._bufs[r].copy(t,h);h+=this._bufs[r].length}return t}if(u<=this._bufs[l[0]].length-d){return copy?this._bufs[l[0]].copy(t,r,d,d+u):this._bufs[l[0]].slice(d,d+u)}if(!copy){t=o.allocUnsafe(c)}for(let r=l[0];r<this._bufs.length;r++){const i=this._bufs[r].length-d;if(u>i){this._bufs[r].copy(t,h,d);h+=i}else{this._bufs[r].copy(t,h,d,d+u);h+=i;break}u-=i;if(d){d=0}}if(t.length>h)return t.slice(0,h);return t};BufferList.prototype.shallowSlice=function shallowSlice(t,r){t=t||0;r=typeof r!=="number"?this.length:r;if(t<0){t+=this.length}if(r<0){r+=this.length}if(t===r){return this._new()}const i=this._offset(t);const o=this._offset(r);const a=this._bufs.slice(i[0],o[0]+1);if(o[1]===0){a.pop()}else{a[a.length-1]=a[a.length-1].slice(0,o[1])}if(i[1]!==0){a[0]=a[0].slice(i[1])}return this._new(a)};BufferList.prototype.toString=function toString(t,r,i){return this.slice(r,i).toString(t)};BufferList.prototype.consume=function consume(t){t=Math.trunc(t);if(Number.isNaN(t)||t<=0)return this;while(this._bufs.length){if(t>=this._bufs[0].length){t-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(t);this.length-=t;break}}return this};BufferList.prototype.duplicate=function duplicate(){const t=this._new();for(let r=0;r<this._bufs.length;r++){t.append(this._bufs[r])}return t};BufferList.prototype.append=function append(t){if(t==null){return this}if(t.buffer){this._appendBuffer(o.from(t.buffer,t.byteOffset,t.byteLength))}else if(Array.isArray(t)){for(let r=0;r<t.length;r++){this.append(t[r])}}else if(this._isBufferList(t)){for(let r=0;r<t._bufs.length;r++){this.append(t._bufs[r])}}else{if(typeof t==="number"){t=t.toString()}this._appendBuffer(o.from(t))}return this};BufferList.prototype._appendBuffer=function appendBuffer(t){this._bufs.push(t);this.length+=t.length};BufferList.prototype.indexOf=function(t,r,i){if(i===undefined&&typeof r==="string"){i=r;r=undefined}if(typeof t==="function"||Array.isArray(t)){throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.')}else if(typeof t==="number"){t=o.from([t])}else if(typeof t==="string"){t=o.from(t,i)}else if(this._isBufferList(t)){t=t.slice()}else if(Array.isArray(t.buffer)){t=o.from(t.buffer,t.byteOffset,t.byteLength)}else if(!o.isBuffer(t)){t=o.from(t)}r=Number(r||0);if(isNaN(r)){r=0}if(r<0){r=this.length+r}if(r<0){r=0}if(t.length===0){return r>this.length?this.length:r}const a=this._offset(r);let l=a[0];let c=a[1];for(;l<this._bufs.length;l++){const r=this._bufs[l];while(c<r.length){const i=r.length-c;if(i>=t.length){const i=r.indexOf(t,c);if(i!==-1){return this._reverseOffset([l,i])}c=r.length-t.length+1}else{const r=this._reverseOffset([l,c]);if(this._match(r,t)){return r}c++}}c=0}return-1};BufferList.prototype._match=function(t,r){if(this.length-t<r.length){return false}for(let i=0;i<r.length;i++){if(this.get(t+i)!==r[i]){return false}}return true};(function(){const t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const r in t){(function(r){if(t[r]===null){BufferList.prototype[r]=function(t,i){return this.slice(t,t+i)[r](0,i)}}else{BufferList.prototype[r]=function(i=0){return this.slice(i,i+t[r])[r](0)}}})(r)}})();BufferList.prototype._isBufferList=function _isBufferList(t){return t instanceof BufferList||BufferList.isBufferList(t)};BufferList.isBufferList=function isBufferList(t){return t!=null&&t[a]};t.exports=BufferList},6539:(t,r,i)=>{"use strict";const o=i(4381).Duplex;const a=i(3193);const l=i(4577);function BufferListStream(t){if(!(this instanceof BufferListStream)){return new BufferListStream(t)}if(typeof t==="function"){this._callback=t;const r=function piper(t){if(this._callback){this._callback(t);this._callback=null}}.bind(this);this.on("pipe",(function onPipe(t){t.on("error",r)}));this.on("unpipe",(function onUnpipe(t){t.removeListener("error",r)}));t=null}l._init.call(this,t);o.call(this)}a(BufferListStream,o);Object.assign(BufferListStream.prototype,l.prototype);BufferListStream.prototype._new=function _new(t){return new BufferListStream(t)};BufferListStream.prototype._write=function _write(t,r,i){this._appendBuffer(t);if(typeof i==="function"){i()}};BufferListStream.prototype._read=function _read(t){if(!this.length){return this.push(null)}t=Math.min(t,this.length);this.push(this.slice(0,t));this.consume(t)};BufferListStream.prototype.end=function end(t){o.prototype.end.call(this,t);if(this._callback){this._callback(null,this.slice());this._callback=null}};BufferListStream.prototype._destroy=function _destroy(t,r){this._bufs.length=0;this.length=0;r(t)};BufferListStream.prototype._isBufferList=function _isBufferList(t){return t instanceof BufferListStream||t instanceof l||BufferListStream.isBufferList(t)};BufferListStream.isBufferList=l.isBufferList;t.exports=BufferListStream;t.exports.BufferListStream=BufferListStream;t.exports.BufferList=l},70:(t,r,i)=>{var o=i(1454);var a=i(7452);t.exports=expandTop;var l="\0SLASH"+Math.random()+"\0";var c="\0OPEN"+Math.random()+"\0";var u="\0CLOSE"+Math.random()+"\0";var h="\0COMMA"+Math.random()+"\0";var d="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(l).split("\\{").join(c).split("\\}").join(u).split("\\,").join(h).split("\\.").join(d)}function unescapeBraces(t){return t.split(l).join("\\").split(c).join("{").split(u).join("}").split(h).join(",").split(d).join(".")}function parseCommaParts(t){if(!t)return[""];var r=[];var i=a("{","}",t);if(!i)return t.split(",");var o=i.pre;var l=i.body;var c=i.post;var u=o.split(",");u[u.length-1]+="{"+l+"}";var h=parseCommaParts(c);if(c.length){u[u.length-1]+=h.shift();u.push.apply(u,h)}r.push.apply(r,u);return r}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function identity(t){return t}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,r){return t<=r}function gte(t,r){return t>=r}function expand(t,r){var i=[];var l=a("{","}",t);if(!l||/\$$/.test(l.pre))return[t];var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body);var h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body);var d=c||h;var p=l.body.indexOf(",")>=0;if(!d&&!p){if(l.post.match(/,.*\}/)){t=l.pre+"{"+l.body+u+l.post;return expand(t)}return[t]}var m;if(d){m=l.body.split(/\.\./)}else{m=parseCommaParts(l.body);if(m.length===1){m=expand(m[0],false).map(embrace);if(m.length===1){var y=l.post.length?expand(l.post,false):[""];return y.map((function(t){return l.pre+m[0]+t}))}}}var g=l.pre;var y=l.post.length?expand(l.post,false):[""];var b;if(d){var v=numeric(m[0]);var _=numeric(m[1]);var w=Math.max(m[0].length,m[1].length);var E=m.length==3?Math.abs(numeric(m[2])):1;var S=lte;var R=_<v;if(R){E*=-1;S=gte}var O=m.some(isPadded);b=[];for(var x=v;S(x,_);x+=E){var T;if(h){T=String.fromCharCode(x);if(T==="\\")T=""}else{T=String(x);if(O){var k=w-T.length;if(k>0){var A=new Array(k+1).join("0");if(x<0)T="-"+A+T.slice(1);else T=A+T}}}b.push(T)}}else{b=o(m,(function(t){return expand(t,false)}))}for(var C=0;C<b.length;C++){for(var P=0;P<y.length;P++){var I=g+b[C]+y[P];if(!r||d||I)i.push(I)}}return i}},4526:(t,r,i)=>{"use strict";const o=i(3119);const a=i(769);const l=i(722);const c=i(407);const braces=(t,r={})=>{let i=[];if(Array.isArray(t)){for(let o of t){let t=braces.create(o,r);if(Array.isArray(t)){i.push(...t)}else{i.push(t)}}}else{i=[].concat(braces.create(t,r))}if(r&&r.expand===true&&r.nodupes===true){i=[...new Set(i)]}return i};braces.parse=(t,r={})=>c(t,r);braces.stringify=(t,r={})=>{if(typeof t==="string"){return o(braces.parse(t,r),r)}return o(t,r)};braces.compile=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}return a(t,r)};braces.expand=(t,r={})=>{if(typeof t==="string"){t=braces.parse(t,r)}let i=l(t,r);if(r.noempty===true){i=i.filter(Boolean)}if(r.nodupes===true){i=[...new Set(i)]}return i};braces.create=(t,r={})=>{if(t===""||t.length<3){return[t]}return r.expand!==true?braces.compile(t,r):braces.expand(t,r)};t.exports=braces},769:(t,r,i)=>{"use strict";const o=i(6789);const a=i(9015);const compile=(t,r={})=>{let walk=(t,i={})=>{let l=a.isInvalidBrace(i);let c=t.invalid===true&&r.escapeInvalid===true;let u=l===true||c===true;let h=r.escapeInvalid===true?"\\":"";let d="";if(t.isOpen===true){return h+t.value}if(t.isClose===true){return h+t.value}if(t.type==="open"){return u?h+t.value:"("}if(t.type==="close"){return u?h+t.value:")"}if(t.type==="comma"){return t.prev.type==="comma"?"":u?t.value:"|"}if(t.value){return t.value}if(t.nodes&&t.ranges>0){let i=a.reduce(t.nodes);let l=o(...i,{...r,wrap:false,toRegex:true});if(l.length!==0){return i.length>1&&l.length>1?`(${l})`:l}}if(t.nodes){for(let r of t.nodes){d+=walk(r,t)}}return d};return walk(t)};t.exports=compile},262:t=>{"use strict";t.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},722:(t,r,i)=>{"use strict";const o=i(6789);const a=i(3119);const l=i(9015);const append=(t="",r="",i=false)=>{let o=[];t=[].concat(t);r=[].concat(r);if(!r.length)return t;if(!t.length){return i?l.flatten(r).map((t=>`{${t}}`)):r}for(let a of t){if(Array.isArray(a)){for(let t of a){o.push(append(t,r,i))}}else{for(let t of r){if(i===true&&typeof t==="string")t=`{${t}}`;o.push(Array.isArray(t)?append(a,t,i):a+t)}}}return l.flatten(o)};const expand=(t,r={})=>{let i=r.rangeLimit===void 0?1e3:r.rangeLimit;let walk=(t,c={})=>{t.queue=[];let u=c;let h=c.queue;while(u.type!=="brace"&&u.type!=="root"&&u.parent){u=u.parent;h=u.queue}if(t.invalid||t.dollar){h.push(append(h.pop(),a(t,r)));return}if(t.type==="brace"&&t.invalid!==true&&t.nodes.length===2){h.push(append(h.pop(),["{}"]));return}if(t.nodes&&t.ranges>0){let c=l.reduce(t.nodes);if(l.exceedsLimit(...c,r.step,i)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let u=o(...c,r);if(u.length===0){u=a(t,r)}h.push(append(h.pop(),u));t.nodes=[];return}let d=l.encloseBrace(t);let p=t.queue;let m=t;while(m.type!=="brace"&&m.type!=="root"&&m.parent){m=m.parent;p=m.queue}for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r];if(i.type==="comma"&&t.type==="brace"){if(r===1)p.push("");p.push("");continue}if(i.type==="close"){h.push(append(h.pop(),p,d));continue}if(i.value&&i.type!=="open"){p.push(append(p.pop(),i.value));continue}if(i.nodes){walk(i,t)}}return p};return l.flatten(walk(t))};t.exports=expand},407:(t,r,i)=>{"use strict";const o=i(3119);const{MAX_LENGTH:a,CHAR_BACKSLASH:l,CHAR_BACKTICK:c,CHAR_COMMA:u,CHAR_DOT:h,CHAR_LEFT_PARENTHESES:d,CHAR_RIGHT_PARENTHESES:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_RIGHT_CURLY_BRACE:y,CHAR_LEFT_SQUARE_BRACKET:g,CHAR_RIGHT_SQUARE_BRACKET:b,CHAR_DOUBLE_QUOTE:v,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:w,CHAR_ZERO_WIDTH_NOBREAK_SPACE:E}=i(262);const parse=(t,r={})=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}let i=r||{};let S=typeof i.maxLength==="number"?Math.min(a,i.maxLength):a;if(t.length>S){throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${S})`)}let R={type:"root",input:t,nodes:[]};let O=[R];let x=R;let T=R;let k=0;let A=t.length;let C=0;let P=0;let I;let L={};const advance=()=>t[C++];const push=t=>{if(t.type==="text"&&T.type==="dot"){T.type="text"}if(T&&T.type==="text"&&t.type==="text"){T.value+=t.value;return}x.nodes.push(t);t.parent=x;t.prev=T;T=t;return t};push({type:"bos"});while(C<A){x=O[O.length-1];I=advance();if(I===E||I===w){continue}if(I===l){push({type:"text",value:(r.keepEscaping?I:"")+advance()});continue}if(I===b){push({type:"text",value:"\\"+I});continue}if(I===g){k++;let t=true;let r;while(C<A&&(r=advance())){I+=r;if(r===g){k++;continue}if(r===l){I+=advance();continue}if(r===b){k--;if(k===0){break}}}push({type:"text",value:I});continue}if(I===d){x=push({type:"paren",nodes:[]});O.push(x);push({type:"text",value:I});continue}if(I===p){if(x.type!=="paren"){push({type:"text",value:I});continue}x=O.pop();push({type:"text",value:I});x=O[O.length-1];continue}if(I===v||I===_||I===c){let t=I;let i;if(r.keepQuotes!==true){I=""}while(C<A&&(i=advance())){if(i===l){I+=i+advance();continue}if(i===t){if(r.keepQuotes===true)I+=i;break}I+=i}push({type:"text",value:I});continue}if(I===m){P++;let t=T.value&&T.value.slice(-1)==="$"||x.dollar===true;let r={type:"brace",open:true,close:false,dollar:t,depth:P,commas:0,ranges:0,nodes:[]};x=push(r);O.push(x);push({type:"open",value:I});continue}if(I===y){if(x.type!=="brace"){push({type:"text",value:I});continue}let t="close";x=O.pop();x.close=true;push({type:t,value:I});P--;x=O[O.length-1];continue}if(I===u&&P>0){if(x.ranges>0){x.ranges=0;let t=x.nodes.shift();x.nodes=[t,{type:"text",value:o(x)}]}push({type:"comma",value:I});x.commas++;continue}if(I===h&&P>0&&x.commas===0){let t=x.nodes;if(P===0||t.length===0){push({type:"text",value:I});continue}if(T.type==="dot"){x.range=[];T.value+=I;T.type="range";if(x.nodes.length!==3&&x.nodes.length!==5){x.invalid=true;x.ranges=0;T.type="text";continue}x.ranges++;x.args=[];continue}if(T.type==="range"){t.pop();let r=t[t.length-1];r.value+=T.value+I;T=r;x.ranges--;continue}push({type:"dot",value:I});continue}push({type:"text",value:I})}do{x=O.pop();if(x.type!=="root"){x.nodes.forEach((t=>{if(!t.nodes){if(t.type==="open")t.isOpen=true;if(t.type==="close")t.isClose=true;if(!t.nodes)t.type="text";t.invalid=true}}));let t=O[O.length-1];let r=t.nodes.indexOf(x);t.nodes.splice(r,1,...x.nodes)}}while(O.length>0);push({type:"eos"});return R};t.exports=parse},3119:(t,r,i)=>{"use strict";const o=i(9015);t.exports=(t,r={})=>{let stringify=(t,i={})=>{let a=r.escapeInvalid&&o.isInvalidBrace(i);let l=t.invalid===true&&r.escapeInvalid===true;let c="";if(t.value){if((a||l)&&o.isOpenOrClose(t)){return"\\"+t.value}return t.value}if(t.value){return t.value}if(t.nodes){for(let r of t.nodes){c+=stringify(r)}}return c};return stringify(t)}},9015:(t,r)=>{"use strict";r.isInteger=t=>{if(typeof t==="number"){return Number.isInteger(t)}if(typeof t==="string"&&t.trim()!==""){return Number.isInteger(Number(t))}return false};r.find=(t,r)=>t.nodes.find((t=>t.type===r));r.exceedsLimit=(t,i,o=1,a)=>{if(a===false)return false;if(!r.isInteger(t)||!r.isInteger(i))return false;return(Number(i)-Number(t))/Number(o)>=a};r.escapeNode=(t,r=0,i)=>{let o=t.nodes[r];if(!o)return;if(i&&o.type===i||o.type==="open"||o.type==="close"){if(o.escaped!==true){o.value="\\"+o.value;o.escaped=true}}};r.encloseBrace=t=>{if(t.type!=="brace")return false;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}return false};r.isInvalidBrace=t=>{if(t.type!=="brace")return false;if(t.invalid===true||t.dollar)return true;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}if(t.open!==true||t.close!==true){t.invalid=true;return true}return false};r.isOpenOrClose=t=>{if(t.type==="open"||t.type==="close"){return true}return t.open===true||t.close===true};r.reduce=t=>t.reduce(((t,r)=>{if(r.type==="text")t.push(r.value);if(r.type==="range")r.type="text";return t}),[]);r.flatten=(...t)=>{const r=[];const flat=t=>{for(let i=0;i<t.length;i++){let o=t[i];Array.isArray(o)?flat(o,r):o!==void 0&&r.push(o)}return r};flat(t);return r}},8106:(t,r,i)=>{var o=i(4300).Buffer;var a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined"){a=new Int32Array(a)}function ensureBuffer(t){if(o.isBuffer(t)){return t}var r=typeof o.alloc==="function"&&typeof o.from==="function";if(typeof t==="number"){return r?o.alloc(t):new o(t)}else if(typeof t==="string"){return r?o.from(t):new o(t)}else{throw new Error("input must be buffer, number, or string, received "+typeof t)}}function bufferizeInt(t){var r=ensureBuffer(4);r.writeInt32BE(t,0);return r}function _crc32(t,r){t=ensureBuffer(t);if(o.isBuffer(r)){r=r.readUInt32BE(0)}var i=~~r^-1;for(var l=0;l<t.length;l++){i=a[(i^t[l])&255]^i>>>8}return i^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};t.exports=crc32},8897:(t,r,i)=>{"use strict";const{V4MAPPED:o,ADDRCONFIG:a,ALL:l,promises:{Resolver:c},lookup:u}=i(9523);const{promisify:h}=i(3837);const d=i(2037);const p=Symbol("cacheableLookupCreateConnection");const m=Symbol("cacheableLookupInstance");const y=Symbol("expires");const g=typeof l==="number";const verifyAgent=t=>{if(!(t&&typeof t.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=t=>{for(const r of t){if(r.family===6){continue}r.address=`::ffff:${r.address}`;r.family=6}};const getIfaceInfo=()=>{let t=false;let r=false;for(const i of Object.values(d.networkInterfaces())){for(const o of i){if(o.internal){continue}if(o.family==="IPv6"){r=true}else{t=true}if(t&&r){return{has4:t,has6:r}}}}return{has4:t,has6:r}};const isIterable=t=>Symbol.iterator in t;const ignoreNoResultErrors=t=>t.catch((t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT"){return[]}throw t}));const b={ttl:true};const v={all:true};const _={all:true,family:4};const w={all:true,family:6};class CacheableLookup{constructor({cache:t=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:o=.15,resolver:a=new c,lookup:l=u}={}){this.maxTtl=r;this.errorTtl=o;this._cache=t;this._resolver=a;this._dnsLookup=l&&h(l);if(this._resolver instanceof c){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=h(this._resolver.resolve4.bind(this._resolver));this._resolve6=h(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=i;if(i>0){const t=setInterval((()=>{this._hostnamesToFallback.clear()}),i*1e3);if(t.unref){t.unref()}this._fallbackInterval=t}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(t){this.clear();this._resolver.setServers(t)}get servers(){return this._resolver.getServers()}lookup(t,r,i){if(typeof r==="function"){i=r;r={}}else if(typeof r==="number"){r={family:r}}if(!i){throw new Error("Callback must be a function.")}this.lookupAsync(t,r).then((t=>{if(r.all){i(null,t)}else{i(null,t.address,t.family,t.expires,t.ttl)}}),i)}async lookupAsync(t,r={}){if(typeof r==="number"){r={family:r}}let i=await this.query(t);if(r.family===6){const t=i.filter((t=>t.family===6));if(r.hints&o){if(g&&r.hints&l||t.length===0){map4to6(i)}else{i=t}}else{i=t}}else if(r.family===4){i=i.filter((t=>t.family===4))}if(r.hints&a){const{_iface:t}=this;i=i.filter((r=>r.family===6?t.has6:t.has4))}if(i.length===0){const r=new Error(`cacheableLookup ENOTFOUND ${t}`);r.code="ENOTFOUND";r.hostname=t;throw r}if(r.all){return i}return i[0]}async query(t){let r=await this._cache.get(t);if(!r){const i=this._pending[t];if(i){r=await i}else{const i=this.queryAndCache(t);this._pending[t]=i;try{r=await i}finally{delete this._pending[t]}}}r=r.map((t=>({...t})));return r}async _resolve(t){const[r,i]=await Promise.all([ignoreNoResultErrors(this._resolve4(t,b)),ignoreNoResultErrors(this._resolve6(t,b))]);let o=0;let a=0;let l=0;const c=Date.now();for(const t of r){t.family=4;t.expires=c+t.ttl*1e3;o=Math.max(o,t.ttl)}for(const t of i){t.family=6;t.expires=c+t.ttl*1e3;a=Math.max(a,t.ttl)}if(r.length>0){if(i.length>0){l=Math.min(o,a)}else{l=o}}else{l=a}return{entries:[...r,...i],cacheTtl:l}}async _lookup(t){try{const[r,i]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(t,_)),ignoreNoResultErrors(this._dnsLookup(t,w))]);return{entries:[...r,...i],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(t,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3;r[y]=Date.now()+i;try{await this._cache.set(t,r,i)}catch(t){this.lookupAsync=async()=>{const r=new Error("Cache Error. Please recreate the CacheableLookup instance.");r.cause=t;throw r}}if(isIterable(this._cache)){this._tick(i)}}}async queryAndCache(t){if(this._hostnamesToFallback.has(t)){return this._dnsLookup(t,v)}let r=await this._resolve(t);if(r.entries.length===0&&this._dnsLookup){r=await this._lookup(t);if(r.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(t)}}const i=r.entries.length===0?this.errorTtl:r.cacheTtl;await this._set(t,r.entries,i);return r.entries}_tick(t){const r=this._nextRemovalTime;if(!r||t<r){clearTimeout(this._removalTimeout);this._nextRemovalTime=t;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let t=Infinity;const r=Date.now();for(const[i,o]of this._cache){const a=o[y];if(r>=a){this._cache.delete(i)}else if(a<t){t=a}}if(t!==Infinity){this._tick(t-r)}}),t);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(t){verifyAgent(t);if(p in t){throw new Error("CacheableLookup has been already installed")}t[p]=t.createConnection;t[m]=this;t.createConnection=(r,i)=>{if(!("lookup"in r)){r.lookup=this.lookup}return t[p](r,i)}}uninstall(t){verifyAgent(t);if(t[p]){if(t[m]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}t.createConnection=t[p];delete t[p];delete t[m]}}updateInterfaceInfo(){const{_iface:t}=this;this._iface=getIfaceInfo();if(t.has4&&!this._iface.has4||t.has6&&!this._iface.has6){this._cache.clear()}}clear(t){if(t){this._cache.delete(t);return}this._cache.clear()}}t.exports=CacheableLookup;t.exports["default"]=CacheableLookup},8622:(t,r,i)=>{"use strict";const o=i(2361);const a=i(7310);const l=i(1191);const c=i(7035);const u=i(8490);const h=i(3165);const d=i(6822);const p=i(1606);const m=i(9276);class CacheableRequest{constructor(t,r){if(typeof t!=="function"){throw new TypeError("Parameter `request` must be a function")}this.cache=new m({uri:typeof r==="string"&&r,store:typeof r!=="string"&&r,namespace:"cacheable-request"});return this.createCacheableRequest(t)}createCacheableRequest(t){return(r,i)=>{let m;if(typeof r==="string"){m=normalizeUrlObject(a.parse(r));r={}}else if(r instanceof a.URL){m=normalizeUrlObject(a.parse(r.toString()));r={}}else{const[t,...i]=(r.path||"").split("?");const o=i.length>0?`?${i.join("?")}`:"";m=normalizeUrlObject({...r,pathname:t,search:o})}r={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...r,...urlObjectToRequestOptions(m)};r.headers=d(r.headers);const y=new o;const g=l(a.format(m),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});const b=`${r.method}:${g}`;let v=false;let _=false;const makeRequest=r=>{_=true;let o=false;let a;const l=new Promise((t=>{a=()=>{if(!o){o=true;t()}}}));const handler=t=>{if(v&&!r.forceRefresh){t.status=t.statusCode;const i=u.fromObject(v.cachePolicy).revalidatedPolicy(r,t);if(!i.modified){const r=i.policy.responseHeaders();t=new h(v.statusCode,r,v.body,v.url);t.cachePolicy=i.policy;t.fromCache=true}}if(!t.fromCache){t.cachePolicy=new u(r,t,r);t.fromCache=false}let a;if(r.cache&&t.cachePolicy.storable()){a=p(t);(async()=>{try{const i=c.buffer(t);await Promise.race([l,new Promise((r=>t.once("end",r)))]);if(o){return}const a=await i;const u={cachePolicy:t.cachePolicy.toObject(),url:t.url,statusCode:t.fromCache?v.statusCode:t.statusCode,body:a};let h=r.strictTtl?t.cachePolicy.timeToLive():undefined;if(r.maxTtl){h=h?Math.min(h,r.maxTtl):r.maxTtl}await this.cache.set(b,u,h)}catch(t){y.emit("error",new CacheableRequest.CacheError(t))}})()}else if(r.cache&&v){(async()=>{try{await this.cache.delete(b)}catch(t){y.emit("error",new CacheableRequest.CacheError(t))}})()}y.emit("response",a||t);if(typeof i==="function"){i(a||t)}};try{const i=t(r,handler);i.once("error",a);i.once("abort",a);y.emit("request",i)}catch(t){y.emit("error",new CacheableRequest.RequestError(t))}};(async()=>{const get=async t=>{await Promise.resolve();const r=t.cache?await this.cache.get(b):undefined;if(typeof r==="undefined"){return makeRequest(t)}const o=u.fromObject(r.cachePolicy);if(o.satisfiesWithoutRevalidation(t)&&!t.forceRefresh){const t=o.responseHeaders();const a=new h(r.statusCode,t,r.body,r.url);a.cachePolicy=o;a.fromCache=true;y.emit("response",a);if(typeof i==="function"){i(a)}}else{v=r;t.headers=o.revalidationHeaders(t);makeRequest(t)}};const errorHandler=t=>y.emit("error",new CacheableRequest.CacheError(t));this.cache.once("error",errorHandler);y.on("response",(()=>this.cache.removeListener("error",errorHandler)));try{await get(r)}catch(t){if(r.automaticFailover&&!_){makeRequest(r)}y.emit("error",new CacheableRequest.CacheError(t))}})();return y}}}function urlObjectToRequestOptions(t){const r={...t};r.path=`${t.pathname||"/"}${t.search||""}`;delete r.pathname;delete r.search;return r}function normalizeUrlObject(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}CacheableRequest.RequestError=class extends Error{constructor(t){super(t.message);this.name="RequestError";Object.assign(this,t)}};CacheableRequest.CacheError=class extends Error{constructor(t){super(t.message);this.name="CacheError";Object.assign(this,t)}};t.exports=CacheableRequest},9409:(t,r,i)=>{"use strict";const o=i(7147);const a=i(1017);const l=o.lchown?"lchown":"chown";const c=o.lchownSync?"lchownSync":"chownSync";const u=o.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(t,r,i)=>{try{return o[c](t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const chownSync=(t,r,i)=>{try{return o.chownSync(t,r,i)}catch(t){if(t.code!=="ENOENT")throw t}};const h=u?(t,r,i,a)=>l=>{if(!l||l.code!=="EISDIR")a(l);else o.chown(t,r,i,a)}:(t,r,i,o)=>o;const d=u?(t,r,i)=>{try{return lchownSync(t,r,i)}catch(o){if(o.code!=="EISDIR")throw o;chownSync(t,r,i)}}:(t,r,i)=>lchownSync(t,r,i);const p=process.version;let readdir=(t,r,i)=>o.readdir(t,r,i);let readdirSync=(t,r)=>o.readdirSync(t,r);if(/^v4\./.test(p))readdir=(t,r,i)=>o.readdir(t,i);const chown=(t,r,i,a)=>{o[l](t,r,i,h(t,r,i,(t=>{a(t&&t.code!=="ENOENT"?t:null)})))};const chownrKid=(t,r,i,l,c)=>{if(typeof r==="string")return o.lstat(a.resolve(t,r),((o,a)=>{if(o)return c(o.code!=="ENOENT"?o:null);a.name=r;chownrKid(t,a,i,l,c)}));if(r.isDirectory()){chownr(a.resolve(t,r.name),i,l,(o=>{if(o)return c(o);const u=a.resolve(t,r.name);chown(u,i,l,c)}))}else{const o=a.resolve(t,r.name);chown(o,i,l,c)}};const chownr=(t,r,i,o)=>{readdir(t,{withFileTypes:true},((a,l)=>{if(a){if(a.code==="ENOENT")return o();else if(a.code!=="ENOTDIR"&&a.code!=="ENOTSUP")return o(a)}if(a||!l.length)return chown(t,r,i,o);let c=l.length;let u=null;const then=a=>{if(u)return;if(a)return o(u=a);if(--c===0)return chown(t,r,i,o)};l.forEach((o=>chownrKid(t,o,r,i,then)))}))};const chownrKidSync=(t,r,i,l)=>{if(typeof r==="string"){try{const i=o.lstatSync(a.resolve(t,r));i.name=r;r=i}catch(t){if(t.code==="ENOENT")return;else throw t}}if(r.isDirectory())chownrSync(a.resolve(t,r.name),i,l);d(a.resolve(t,r.name),i,l)};const chownrSync=(t,r,i)=>{let o;try{o=readdirSync(t,{withFileTypes:true})}catch(o){if(o.code==="ENOENT")return;else if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return d(t,r,i);else throw o}if(o&&o.length)o.forEach((o=>chownrKidSync(t,o,r,i)));return d(t,r,i)};t.exports=chownr;chownr.sync=chownrSync},1606:(t,r,i)=>{"use strict";const o=i(2781).PassThrough;const a=i(7145);const cloneResponse=t=>{if(!(t&&t.pipe)){throw new TypeError("Parameter `response` must be a response stream.")}const r=new o;a(t,r);return t.pipe(r)};t.exports=cloneResponse},6432:t=>{var r=t.exports=function(){};r.prototype.getName=function(){};r.prototype.getSize=function(){};r.prototype.getLastModifiedDate=function(){};r.prototype.isDirectory=function(){}},7922:(t,r,i)=>{var o=i(3837).inherits;var a=i(4381).Transform;var l=i(6432);var c=i(5110);var u=t.exports=function(t){if(!(this instanceof u)){return new u(t)}a.call(this,t);this.offset=0;this._archive={finish:false,finished:false,processing:false}};o(u,a);u.prototype._appendBuffer=function(t,r,i){};u.prototype._appendStream=function(t,r,i){};u.prototype._emitErrorCallback=function(t){if(t){this.emit("error",t)}};u.prototype._finish=function(t){};u.prototype._normalizeEntry=function(t){};u.prototype._transform=function(t,r,i){i(null,t)};u.prototype.entry=function(t,r,i){r=r||null;if(typeof i!=="function"){i=this._emitErrorCallback.bind(this)}if(!(t instanceof l)){i(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){i(new Error("unacceptable entry after finish"));return}if(this._archive.processing){i(new Error("already processing an entry"));return}this._archive.processing=true;this._normalizeEntry(t);this._entry=t;r=c.normalizeInputSource(r);if(Buffer.isBuffer(r)){this._appendBuffer(t,r,i)}else if(c.isStream(r)){this._appendStream(t,r,i)}else{this._archive.processing=false;i(new Error("input source must be valid Stream or Buffer instance"));return}return this};u.prototype.finish=function(){if(this._archive.processing){this._archive.finish=true;return}this._finish()};u.prototype.getBytesWritten=function(){return this.offset};u.prototype.write=function(t,r){if(t){this.offset+=t.length}return a.prototype.write.call(this,t,r)}},7088:t=>{t.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}},5325:(t,r,i)=>{var o=i(9233);var a=1<<3;var l=1<<0;var c=1<<2;var u=1<<1;var h=1<<6;var d=1<<11;var p=t.exports=function(){if(!(this instanceof p)){return new p}this.descriptor=false;this.encryption=false;this.utf8=false;this.numberOfShannonFanoTrees=0;this.strongEncryption=false;this.slidingDictionarySize=0;return this};p.prototype.encode=function(){return o.getShortBytes((this.descriptor?a:0)|(this.utf8?d:0)|(this.encryption?l:0)|(this.strongEncryption?h:0))};p.prototype.parse=function(t,r){var i=o.getShortBytesValue(t,r);var m=new p;m.useDataDescriptor((i&a)!==0);m.useUTF8ForNames((i&d)!==0);m.useStrongEncryption((i&h)!==0);m.useEncryption((i&l)!==0);m.setSlidingDictionarySize((i&u)!==0?8192:4096);m.setNumberOfShannonFanoTrees((i&c)!==0?3:2);return m};p.prototype.setNumberOfShannonFanoTrees=function(t){this.numberOfShannonFanoTrees=t};p.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};p.prototype.setSlidingDictionarySize=function(t){this.slidingDictionarySize=t};p.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};p.prototype.useDataDescriptor=function(t){this.descriptor=t};p.prototype.usesDataDescriptor=function(){return this.descriptor};p.prototype.useEncryption=function(t){this.encryption=t};p.prototype.usesEncryption=function(){return this.encryption};p.prototype.useStrongEncryption=function(t){this.strongEncryption=t};p.prototype.usesStrongEncryption=function(){return this.strongEncryption};p.prototype.useUTF8ForNames=function(t){this.utf8=t};p.prototype.usesUTF8ForNames=function(){return this.utf8}},6894:t=>{t.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}},9233:t=>{var r=t.exports={};r.dateToDos=function(t,r){r=r||false;var i=r?t.getFullYear():t.getUTCFullYear();if(i<1980){return 2162688}else if(i>=2044){return 2141175677}var o={year:i,month:r?t.getMonth():t.getUTCMonth(),date:r?t.getDate():t.getUTCDate(),hours:r?t.getHours():t.getUTCHours(),minutes:r?t.getMinutes():t.getUTCMinutes(),seconds:r?t.getSeconds():t.getUTCSeconds()};return o.year-1980<<25|o.month+1<<21|o.date<<16|o.hours<<11|o.minutes<<5|o.seconds/2};r.dosToDate=function(t){return new Date((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(t&31)<<1)};r.fromDosTime=function(t){return r.dosToDate(t.readUInt32LE(0))};r.getEightBytes=function(t){var r=Buffer.alloc(8);r.writeUInt32LE(t%4294967296,0);r.writeUInt32LE(t/4294967296|0,4);return r};r.getShortBytes=function(t){var r=Buffer.alloc(2);r.writeUInt16LE((t&65535)>>>0,0);return r};r.getShortBytesValue=function(t,r){return t.readUInt16LE(r)};r.getLongBytes=function(t){var r=Buffer.alloc(4);r.writeUInt32LE((t&4294967295)>>>0,0);return r};r.getLongBytesValue=function(t,r){return t.readUInt32LE(r)};r.toDosTime=function(t){return r.getLongBytes(r.dateToDos(t))}},9163:(t,r,i)=>{var o=i(3837).inherits;var a=i(4838);var l=i(6432);var c=i(5325);var u=i(6894);var h=i(7088);var d=i(9233);var p=t.exports=function(t){if(!(this instanceof p)){return new p(t)}l.call(this);this.platform=h.PLATFORM_FAT;this.method=-1;this.name=null;this.size=0;this.csize=0;this.gpb=new c;this.crc=0;this.time=-1;this.minver=h.MIN_VERSION_INITIAL;this.mode=-1;this.extra=null;this.exattr=0;this.inattr=0;this.comment=null;if(t){this.setName(t)}};o(p,l);p.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};p.prototype.getComment=function(){return this.comment!==null?this.comment:""};p.prototype.getCompressedSize=function(){return this.csize};p.prototype.getCrc=function(){return this.crc};p.prototype.getExternalAttributes=function(){return this.exattr};p.prototype.getExtra=function(){return this.extra!==null?this.extra:h.EMPTY};p.prototype.getGeneralPurposeBit=function(){return this.gpb};p.prototype.getInternalAttributes=function(){return this.inattr};p.prototype.getLastModifiedDate=function(){return this.getTime()};p.prototype.getLocalFileDataExtra=function(){return this.getExtra()};p.prototype.getMethod=function(){return this.method};p.prototype.getName=function(){return this.name};p.prototype.getPlatform=function(){return this.platform};p.prototype.getSize=function(){return this.size};p.prototype.getTime=function(){return this.time!==-1?d.dosToDate(this.time):-1};p.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};p.prototype.getUnixMode=function(){return this.platform!==h.PLATFORM_UNIX?0:this.getExternalAttributes()>>h.SHORT_SHIFT&h.SHORT_MASK};p.prototype.getVersionNeededToExtract=function(){return this.minver};p.prototype.setComment=function(t){if(Buffer.byteLength(t)!==t.length){this.getGeneralPurposeBit().useUTF8ForNames(true)}this.comment=t};p.prototype.setCompressedSize=function(t){if(t<0){throw new Error("invalid entry compressed size")}this.csize=t};p.prototype.setCrc=function(t){if(t<0){throw new Error("invalid entry crc32")}this.crc=t};p.prototype.setExternalAttributes=function(t){this.exattr=t>>>0};p.prototype.setExtra=function(t){this.extra=t};p.prototype.setGeneralPurposeBit=function(t){if(!(t instanceof c)){throw new Error("invalid entry GeneralPurposeBit")}this.gpb=t};p.prototype.setInternalAttributes=function(t){this.inattr=t};p.prototype.setMethod=function(t){if(t<0){throw new Error("invalid entry compression method")}this.method=t};p.prototype.setName=function(t,r=false){t=a(t,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"");if(r){t=`/${t}`}if(Buffer.byteLength(t)!==t.length){this.getGeneralPurposeBit().useUTF8ForNames(true)}this.name=t};p.prototype.setPlatform=function(t){this.platform=t};p.prototype.setSize=function(t){if(t<0){throw new Error("invalid entry size")}this.size=t};p.prototype.setTime=function(t,r){if(!(t instanceof Date)){throw new Error("invalid entry time")}this.time=d.dateToDos(t,r)};p.prototype.setUnixMode=function(t){t|=this.isDirectory()?h.S_IFDIR:h.S_IFREG;var r=0;r|=t<<h.SHORT_SHIFT|(this.isDirectory()?h.S_DOS_D:h.S_DOS_A);this.setExternalAttributes(r);this.mode=t&h.MODE_MASK;this.platform=h.PLATFORM_UNIX};p.prototype.setVersionNeededToExtract=function(t){this.minver=t};p.prototype.isDirectory=function(){return this.getName().slice(-1)==="/"};p.prototype.isUnixSymlink=function(){return(this.getUnixMode()&u.FILE_TYPE_FLAG)===u.LINK_FLAG};p.prototype.isZip64=function(){return this.csize>h.ZIP64_MAGIC||this.size>h.ZIP64_MAGIC}},504:(t,r,i)=>{var o=i(3837).inherits;var a=i(8106);var{CRC32Stream:l}=i(1348);var{DeflateCRC32Stream:c}=i(1348);var u=i(7922);var h=i(9163);var d=i(5325);var p=i(7088);var m=i(5110);var y=i(9233);var g=t.exports=function(t){if(!(this instanceof g)){return new g(t)}t=this.options=this._defaults(t);u.call(this,t);this._entry=null;this._entries=[];this._archive={centralLength:0,centralOffset:0,comment:"",finish:false,finished:false,processing:false,forceZip64:t.forceZip64,forceLocalTime:t.forceLocalTime}};o(g,u);g.prototype._afterAppend=function(t){this._entries.push(t);if(t.getGeneralPurposeBit().usesDataDescriptor()){this._writeDataDescriptor(t)}this._archive.processing=false;this._entry=null;if(this._archive.finish&&!this._archive.finished){this._finish()}};g.prototype._appendBuffer=function(t,r,i){if(r.length===0){t.setMethod(p.METHOD_STORED)}var o=t.getMethod();if(o===p.METHOD_STORED){t.setSize(r.length);t.setCompressedSize(r.length);t.setCrc(a.unsigned(r))}this._writeLocalFileHeader(t);if(o===p.METHOD_STORED){this.write(r);this._afterAppend(t);i(null,t);return}else if(o===p.METHOD_DEFLATED){this._smartStream(t,i).end(r);return}else{i(new Error("compression method "+o+" not implemented"));return}};g.prototype._appendStream=function(t,r,i){t.getGeneralPurposeBit().useDataDescriptor(true);t.setVersionNeededToExtract(p.MIN_VERSION_DATA_DESCRIPTOR);this._writeLocalFileHeader(t);var o=this._smartStream(t,i);r.once("error",(function(t){o.emit("error",t);o.end()}));r.pipe(o)};g.prototype._defaults=function(t){if(typeof t!=="object"){t={}}if(typeof t.zlib!=="object"){t.zlib={}}if(typeof t.zlib.level!=="number"){t.zlib.level=p.ZLIB_BEST_SPEED}t.forceZip64=!!t.forceZip64;t.forceLocalTime=!!t.forceLocalTime;return t};g.prototype._finish=function(){this._archive.centralOffset=this.offset;this._entries.forEach(function(t){this._writeCentralFileHeader(t)}.bind(this));this._archive.centralLength=this.offset-this._archive.centralOffset;if(this.isZip64()){this._writeCentralDirectoryZip64()}this._writeCentralDirectoryEnd();this._archive.processing=false;this._archive.finish=true;this._archive.finished=true;this.end()};g.prototype._normalizeEntry=function(t){if(t.getMethod()===-1){t.setMethod(p.METHOD_DEFLATED)}if(t.getMethod()===p.METHOD_DEFLATED){t.getGeneralPurposeBit().useDataDescriptor(true);t.setVersionNeededToExtract(p.MIN_VERSION_DATA_DESCRIPTOR)}if(t.getTime()===-1){t.setTime(new Date,this._archive.forceLocalTime)}t._offsets={file:0,data:0,contents:0}};g.prototype._smartStream=function(t,r){var i=t.getMethod()===p.METHOD_DEFLATED;var o=i?new c(this.options.zlib):new l;var a=null;function handleStuff(){var i=o.digest().readUInt32BE(0);t.setCrc(i);t.setSize(o.size());t.setCompressedSize(o.size(true));this._afterAppend(t);r(a,t)}o.once("end",handleStuff.bind(this));o.once("error",(function(t){a=t}));o.pipe(this,{end:false});return o};g.prototype._writeCentralDirectoryEnd=function(){var t=this._entries.length;var r=this._archive.centralLength;var i=this._archive.centralOffset;if(this.isZip64()){t=p.ZIP64_MAGIC_SHORT;r=p.ZIP64_MAGIC;i=p.ZIP64_MAGIC}this.write(y.getLongBytes(p.SIG_EOCD));this.write(p.SHORT_ZERO);this.write(p.SHORT_ZERO);this.write(y.getShortBytes(t));this.write(y.getShortBytes(t));this.write(y.getLongBytes(r));this.write(y.getLongBytes(i));var o=this.getComment();var a=Buffer.byteLength(o);this.write(y.getShortBytes(a));this.write(o)};g.prototype._writeCentralDirectoryZip64=function(){this.write(y.getLongBytes(p.SIG_ZIP64_EOCD));this.write(y.getEightBytes(44));this.write(y.getShortBytes(p.MIN_VERSION_ZIP64));this.write(y.getShortBytes(p.MIN_VERSION_ZIP64));this.write(p.LONG_ZERO);this.write(p.LONG_ZERO);this.write(y.getEightBytes(this._entries.length));this.write(y.getEightBytes(this._entries.length));this.write(y.getEightBytes(this._archive.centralLength));this.write(y.getEightBytes(this._archive.centralOffset));this.write(y.getLongBytes(p.SIG_ZIP64_EOCD_LOC));this.write(p.LONG_ZERO);this.write(y.getEightBytes(this._archive.centralOffset+this._archive.centralLength));this.write(y.getLongBytes(1))};g.prototype._writeCentralFileHeader=function(t){var r=t.getGeneralPurposeBit();var i=t.getMethod();var o=t._offsets;var a=t.getSize();var l=t.getCompressedSize();if(t.isZip64()||o.file>p.ZIP64_MAGIC){a=p.ZIP64_MAGIC;l=p.ZIP64_MAGIC;t.setVersionNeededToExtract(p.MIN_VERSION_ZIP64);var c=Buffer.concat([y.getShortBytes(p.ZIP64_EXTRA_ID),y.getShortBytes(24),y.getEightBytes(t.getSize()),y.getEightBytes(t.getCompressedSize()),y.getEightBytes(o.file)],28);t.setExtra(c)}this.write(y.getLongBytes(p.SIG_CFH));this.write(y.getShortBytes(t.getPlatform()<<8|p.VERSION_MADEBY));this.write(y.getShortBytes(t.getVersionNeededToExtract()));this.write(r.encode());this.write(y.getShortBytes(i));this.write(y.getLongBytes(t.getTimeDos()));this.write(y.getLongBytes(t.getCrc()));this.write(y.getLongBytes(l));this.write(y.getLongBytes(a));var u=t.getName();var h=t.getComment();var d=t.getCentralDirectoryExtra();if(r.usesUTF8ForNames()){u=Buffer.from(u);h=Buffer.from(h)}this.write(y.getShortBytes(u.length));this.write(y.getShortBytes(d.length));this.write(y.getShortBytes(h.length));this.write(p.SHORT_ZERO);this.write(y.getShortBytes(t.getInternalAttributes()));this.write(y.getLongBytes(t.getExternalAttributes()));if(o.file>p.ZIP64_MAGIC){this.write(y.getLongBytes(p.ZIP64_MAGIC))}else{this.write(y.getLongBytes(o.file))}this.write(u);this.write(d);this.write(h)};g.prototype._writeDataDescriptor=function(t){this.write(y.getLongBytes(p.SIG_DD));this.write(y.getLongBytes(t.getCrc()));if(t.isZip64()){this.write(y.getEightBytes(t.getCompressedSize()));this.write(y.getEightBytes(t.getSize()))}else{this.write(y.getLongBytes(t.getCompressedSize()));this.write(y.getLongBytes(t.getSize()))}};g.prototype._writeLocalFileHeader=function(t){var r=t.getGeneralPurposeBit();var i=t.getMethod();var o=t.getName();var a=t.getLocalFileDataExtra();if(t.isZip64()){r.useDataDescriptor(true);t.setVersionNeededToExtract(p.MIN_VERSION_ZIP64)}if(r.usesUTF8ForNames()){o=Buffer.from(o)}t._offsets.file=this.offset;this.write(y.getLongBytes(p.SIG_LFH));this.write(y.getShortBytes(t.getVersionNeededToExtract()));this.write(r.encode());this.write(y.getShortBytes(i));this.write(y.getLongBytes(t.getTimeDos()));t._offsets.data=this.offset;if(r.usesDataDescriptor()){this.write(p.LONG_ZERO);this.write(p.LONG_ZERO);this.write(p.LONG_ZERO)}else{this.write(y.getLongBytes(t.getCrc()));this.write(y.getLongBytes(t.getCompressedSize()));this.write(y.getLongBytes(t.getSize()))}this.write(y.getShortBytes(o.length));this.write(y.getShortBytes(a.length));this.write(o);this.write(a);t._offsets.contents=this.offset};g.prototype.getComment=function(t){return this._archive.comment!==null?this._archive.comment:""};g.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>p.ZIP64_MAGIC_SHORT||this._archive.centralLength>p.ZIP64_MAGIC||this._archive.centralOffset>p.ZIP64_MAGIC};g.prototype.setComment=function(t){this._archive.comment=t}},7449:(t,r,i)=>{t.exports={ArchiveEntry:i(6432),ZipArchiveEntry:i(9163),ArchiveOutputStream:i(7922),ZipArchiveOutputStream:i(504)}},5110:(t,r,i)=>{var o=i(2781).Stream;var a=i(4381).PassThrough;var l=t.exports={};l.isStream=function(t){return t instanceof o};l.normalizeInputSource=function(t){if(t===null){return Buffer.alloc(0)}else if(typeof t==="string"){return Buffer.from(t)}else if(l.isStream(t)&&!t._readableState){var r=new a;t.pipe(r);return r}return t}},1454:t=>{t.exports=function(t,i){var o=[];for(var a=0;a<t.length;a++){var l=i(t[a],a);if(r(l))o.push.apply(o,l);else o.push(l)}return o};var r=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}},9571:(t,r,i)=>{function isArray(t){if(Array.isArray){return Array.isArray(t)}return objectToString(t)==="[object Array]"}r.isArray=isArray;function isBoolean(t){return typeof t==="boolean"}r.isBoolean=isBoolean;function isNull(t){return t===null}r.isNull=isNull;function isNullOrUndefined(t){return t==null}r.isNullOrUndefined=isNullOrUndefined;function isNumber(t){return typeof t==="number"}r.isNumber=isNumber;function isString(t){return typeof t==="string"}r.isString=isString;function isSymbol(t){return typeof t==="symbol"}r.isSymbol=isSymbol;function isUndefined(t){return t===void 0}r.isUndefined=isUndefined;function isRegExp(t){return objectToString(t)==="[object RegExp]"}r.isRegExp=isRegExp;function isObject(t){return typeof t==="object"&&t!==null}r.isObject=isObject;function isDate(t){return objectToString(t)==="[object Date]"}r.isDate=isDate;function isError(t){return objectToString(t)==="[object Error]"||t instanceof Error}r.isError=isError;function isFunction(t){return typeof t==="function"}r.isFunction=isFunction;function isPrimitive(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}r.isPrimitive=isPrimitive;r.isBuffer=i(4300).Buffer.isBuffer;function objectToString(t){return Object.prototype.toString.call(t)}},2195:(t,r,i)=>{"use strict";const o=i(5800);class CpFileError extends o{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpFileError"}}t.exports=CpFileError},3365:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(1653);const l=i(3550);const c=i(9286);const u=i(2195);const h=o(a.stat);const d=o(a.lstat);const p=o(a.utimes);const m=o(a.chmod);r.closeSync=a.closeSync.bind(a);r.createWriteStream=a.createWriteStream.bind(a);r.createReadStream=async(t,r)=>{const i=a.createReadStream(t,r);try{await c(i,["readable","end"])}catch(r){throw new u(`Cannot read from \`${t}\`: ${r.message}`,r)}return i};r.stat=t=>h(t).catch((r=>{throw new u(`Cannot stat path \`${t}\`: ${r.message}`,r)}));r.lstat=t=>d(t).catch((r=>{throw new u(`lstat \`${t}\` failed: ${r.message}`,r)}));r.utimes=(t,r,i)=>p(t,r,i).catch((r=>{throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}));r.chmod=(t,r)=>m(t,r).catch((r=>{throw new u(`chmod \`${t}\` failed: ${r.message}`,r)}));r.statSync=t=>{try{return a.statSync(t)}catch(r){throw new u(`stat \`${t}\` failed: ${r.message}`,r)}};r.utimesSync=(t,r,i)=>{try{return a.utimesSync(t,r,i)}catch(r){throw new u(`utimes \`${t}\` failed: ${r.message}`,r)}};r.makeDir=(t,r)=>l(t,{...r,fs:a}).catch((r=>{throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}));r.makeDirSync=(t,r)=>{try{l.sync(t,{...r,fs:a})}catch(r){throw new u(`Cannot create directory \`${t}\`: ${r.message}`,r)}};r.copyFileSync=(t,r,i)=>{try{a.copyFileSync(t,r,i)}catch(i){throw new u(`Cannot copy from \`${t}\` to \`${r}\`: ${i.message}`,i)}}},2797:(t,r,i)=>{"use strict";const o=i(1017);const{constants:a}=i(7147);const l=i(9286);const c=i(2195);const u=i(3365);const h=i(601);const cpFileAsync=async(t,r,i,a)=>{let h;const d=await u.stat(t);a.size=d.size;const p=await u.createReadStream(t);await u.makeDir(o.dirname(r),{mode:i.directoryMode});const m=u.createWriteStream(r,{flags:i.overwrite?"w":"wx"});p.on("data",(()=>{a.writtenBytes=m.bytesWritten}));p.once("error",(r=>{h=new c(`Cannot read from \`${t}\`: ${r.message}`,r);m.end()}));let y=false;try{const t=l(m,"close");p.pipe(m);await t;a.writtenBytes=a.size;y=true}catch(t){throw new c(`Cannot write to \`${r}\`: ${t.message}`,t)}if(h){throw h}if(y){const i=await u.lstat(t);return Promise.all([u.utimes(r,i.atime,i.mtime),u.chmod(r,i.mode)])}};const cpFile=(t,r,i)=>{if(!t||!r){return Promise.reject(new c("`source` and `destination` required"))}i={overwrite:true,...i};const a=new h(o.resolve(t),o.resolve(r));const l=cpFileAsync(t,r,i,a);l.on=(...t)=>{a.on(...t);return l};return l};t.exports=cpFile;const checkSourceIsFile=(t,r)=>{if(t.isDirectory()){throw Object.assign(new c(`EISDIR: illegal operation on a directory '${r}'`),{errno:-21,code:"EISDIR",source:r})}};t.exports.sync=(t,r,i)=>{if(!t||!r){throw new c("`source` and `destination` required")}i={overwrite:true,...i};const l=u.statSync(t);checkSourceIsFile(l,t);u.makeDirSync(o.dirname(r),{mode:i.directoryMode});const h=i.overwrite?null:a.COPYFILE_EXCL;try{u.copyFileSync(t,r,h)}catch(t){if(!i.overwrite&&t.code==="EEXIST"){return}throw t}u.utimesSync(r,l.atime,l.mtime)}},601:(t,r,i)=>{"use strict";const o=i(2361);const a=new WeakMap;class ProgressEmitter extends o{constructor(t,r){super();this._sourcePath=t;this._destinationPath=r}get writtenBytes(){return a.get(this)}set writtenBytes(t){a.set(this,t);this.emitProgress()}emitProgress(){const{size:t,writtenBytes:r}=this;this.emit("progress",{sourcePath:this._sourcePath,destinationPath:this._destinationPath,size:t,writtenBytes:r,percent:r===t?1:r/t})}}t.exports=ProgressEmitter},1208:(t,r)=>{
|
|
51
|
+
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
|
52
|
+
var i;(function(t){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if(true){t(r)}else{}}else{t(i={})}})((function(t){t.version="1.2.2";function signed_crc_table(){var t=0,r=new Array(256);for(var i=0;i!=256;++i){t=i;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;t=t&1?-306674912^t>>>1:t>>>1;r[i]=t}return typeof Int32Array!=="undefined"?new Int32Array(r):r}var r=signed_crc_table();function slice_by_16_tables(t){var r=0,i=0,o=0,a=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(o=0;o!=256;++o)a[o]=t[o];for(o=0;o!=256;++o){i=t[o];for(r=256+o;r<4096;r+=256)i=a[r]=i>>>8^t[i&255]}var l=[];for(o=1;o!=16;++o)l[o-1]=typeof Int32Array!=="undefined"?a.subarray(o*256,o*256+256):a.slice(o*256,o*256+256);return l}var i=slice_by_16_tables(r);var o=i[0],a=i[1],l=i[2],c=i[3],u=i[4];var h=i[5],d=i[6],p=i[7],m=i[8],y=i[9];var g=i[10],b=i[11],v=i[12],_=i[13],w=i[14];function crc32_bstr(t,i){var o=i^-1;for(var a=0,l=t.length;a<l;)o=o>>>8^r[(o^t.charCodeAt(a++))&255];return~o}function crc32_buf(t,i){var E=i^-1,S=t.length-15,R=0;for(;R<S;)E=w[t[R++]^E&255]^_[t[R++]^E>>8&255]^v[t[R++]^E>>16&255]^b[t[R++]^E>>>24]^g[t[R++]]^y[t[R++]]^m[t[R++]]^p[t[R++]]^d[t[R++]]^h[t[R++]]^u[t[R++]]^c[t[R++]]^l[t[R++]]^a[t[R++]]^o[t[R++]]^r[t[R++]];S+=15;while(R<S)E=E>>>8^r[(E^t[R++])&255];return~E}function crc32_str(t,i){var o=i^-1;for(var a=0,l=t.length,c=0,u=0;a<l;){c=t.charCodeAt(a++);if(c<128){o=o>>>8^r[(o^c)&255]}else if(c<2048){o=o>>>8^r[(o^(192|c>>6&31))&255];o=o>>>8^r[(o^(128|c&63))&255]}else if(c>=55296&&c<57344){c=(c&1023)+64;u=t.charCodeAt(a++)&1023;o=o>>>8^r[(o^(240|c>>8&7))&255];o=o>>>8^r[(o^(128|c>>2&63))&255];o=o>>>8^r[(o^(128|u>>6&15|(c&3)<<4))&255];o=o>>>8^r[(o^(128|u&63))&255]}else{o=o>>>8^r[(o^(224|c>>12&15))&255];o=o>>>8^r[(o^(128|c>>6&63))&255];o=o>>>8^r[(o^(128|c&63))&255]}}return~o}t.table=r;t.bstr=crc32_bstr;t.buf=crc32_buf;t.str=crc32_str}))},2359:(t,r,i)=>{"use strict";const{Transform:o}=i(4381);const a=i(1208);class CRC32Stream extends o{constructor(t){super(t);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0}_transform(t,r,i){if(t){this.checksum=a.buf(t,this.checksum)>>>0;this.rawSize+=t.length}i(null,t)}digest(t){const r=Buffer.allocUnsafe(4);r.writeUInt32BE(this.checksum>>>0,0);return t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}}t.exports=CRC32Stream},5191:(t,r,i)=>{"use strict";const{DeflateRaw:o}=i(9796);const a=i(1208);class DeflateCRC32Stream extends o{constructor(t){super(t);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0;this.compressedSize=0}push(t,r){if(t){this.compressedSize+=t.length}return super.push(t,r)}_transform(t,r,i){if(t){this.checksum=a.buf(t,this.checksum)>>>0;this.rawSize+=t.length}super._transform(t,r,i)}digest(t){const r=Buffer.allocUnsafe(4);r.writeUInt32BE(this.checksum>>>0,0);return t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(t=false){if(t){return this.compressedSize}else{return this.rawSize}}}t.exports=DeflateCRC32Stream},1348:(t,r,i)=>{"use strict";t.exports={CRC32Stream:i(2359),DeflateCRC32Stream:i(5191)}},9579:(t,r,i)=>{"use strict";const o=i(2081);const a=i(7722);const l=i(9284);function spawn(t,r,i){const c=a(t,r,i);const u=o.spawn(c.command,c.args,c.options);l.hookChildProcess(u,c);return u}function spawnSync(t,r,i){const c=a(t,r,i);const u=o.spawnSync(c.command,c.args,c.options);u.error=u.error||l.verifyENOENTSync(u.status,c);return u}t.exports=spawn;t.exports.spawn=spawn;t.exports.sync=spawnSync;t.exports._parse=a;t.exports._enoent=l},9284:t=>{"use strict";const r=process.platform==="win32";function notFoundError(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function hookChildProcess(t,i){if(!r){return}const o=t.emit;t.emit=function(r,a){if(r==="exit"){const r=verifyENOENT(a,i,"spawn");if(r){return o.call(t,"error",r)}}return o.apply(t,arguments)}}function verifyENOENT(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawn")}return null}function verifyENOENTSync(t,i){if(r&&t===1&&!i.file){return notFoundError(i.original,"spawnSync")}return null}t.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},7722:(t,r,i)=>{"use strict";const o=i(1017);const a=i(4462);const l=i(9629);const c=i(2353);const u=process.platform==="win32";const h=/\.(?:com|exe)$/i;const d=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(t){t.file=a(t);const r=t.file&&c(t.file);if(r){t.args.unshift(t.file);t.command=r;return a(t)}return t.file}function parseNonShell(t){if(!u){return t}const r=detectShebang(t);const i=!h.test(r);if(t.options.forceShell||i){const i=d.test(r);t.command=o.normalize(t.command);t.command=l.command(t.command);t.args=t.args.map((t=>l.argument(t,i)));const a=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${a}"`];t.command=process.env.comspec||"cmd.exe";t.options.windowsVerbatimArguments=true}return t}function parse(t,r,i){if(r&&!Array.isArray(r)){i=r;r=null}r=r?r.slice(0):[];i=Object.assign({},i);const o={command:t,args:r,options:i,file:undefined,original:{command:t,args:r}};return i.shell?o:parseNonShell(o)}t.exports=parse},9629:t=>{"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(t){t=t.replace(r,"^$1");return t}function escapeArgument(t,i){t=`${t}`;t=t.replace(/(\\*)"/g,'$1$1\\"');t=t.replace(/(\\*)$/,"$1$1");t=`"${t}"`;t=t.replace(r,"^$1");if(i){t=t.replace(r,"^$1")}return t}t.exports.command=escapeCommand;t.exports.argument=escapeArgument},2353:(t,r,i)=>{"use strict";const o=i(7147);const a=i(6464);function readShebang(t){const r=150;const i=Buffer.alloc(r);let l;try{l=o.openSync(t,"r");o.readSync(l,i,0,r,0);o.closeSync(l)}catch(t){}return a(i.toString())}t.exports=readShebang},4462:(t,r,i)=>{"use strict";const o=i(1017);const a=i(7183);const l=i(8430);function resolveCommandAttempt(t,r){const i=t.options.env||process.env;const c=process.cwd();const u=t.options.cwd!=null;const h=u&&process.chdir!==undefined&&!process.chdir.disabled;if(h){try{process.chdir(t.options.cwd)}catch(t){}}let d;try{d=a.sync(t.command,{path:i[l({env:i})],pathExt:r?o.delimiter:undefined})}catch(t){}finally{if(h){process.chdir(c)}}if(d){d=o.resolve(u?t.options.cwd:"",d)}return d}function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,true)}t.exports=resolveCommand},1614:(t,r,i)=>{"use strict";const{Transform:o,PassThrough:a}=i(2781);const l=i(9796);const c=i(1138);t.exports=t=>{const r=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(r)){return t}const i=r==="br";if(i&&typeof l.createBrotliDecompress!=="function"){t.destroy(new Error("Brotli is not supported on Node.js < 12"));return t}let u=true;const h=new o({transform(t,r,i){u=false;i(null,t)},flush(t){t()}});const d=new a({autoDestroy:false,destroy(r,i){t.destroy();i(r)}});const p=i?l.createBrotliDecompress():l.createUnzip();p.once("error",(r=>{if(u&&!t.readable){d.end();return}d.destroy(r)}));c(t,d);t.pipe(h).pipe(p).pipe(d);return d}},5666:t=>{"use strict";
|
|
3
53
|
/*!
|
|
4
54
|
* @description Recursive object extending
|
|
5
55
|
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
|
@@ -25,42 +75,57 @@
|
|
|
25
75
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
26
76
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
77
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
*/function isSpecificValue(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp?true:false}function cloneSpecificValue(t){if(t instanceof Buffer){var r=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);t.copy(r);return r}else if(t instanceof Date){return new Date(t.getTime())}else if(t instanceof RegExp){return new RegExp(t)}else{throw new Error("Unexpected situation")}}function deepCloneArray(t){var i=[];t.forEach((function(t,o){if(typeof t==="object"&&t!==null){if(Array.isArray(t)){i[o]=deepCloneArray(t)}else if(isSpecificValue(t)){i[o]=cloneSpecificValue(t)}else{i[o]=r({},t)}}else{i[o]=t}}));return i}function safeGetProperty(t,r){return r==="__proto__"?undefined:t[r]}var r=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object"){return false}if(arguments.length<2){return arguments[0]}var t=arguments[0];var i=Array.prototype.slice.call(arguments,1);var o,a,c;i.forEach((function(i){if(typeof i!=="object"||i===null||Array.isArray(i)){return}Object.keys(i).forEach((function(c){a=safeGetProperty(t,c);o=safeGetProperty(i,c);if(o===t){return}else if(typeof o!=="object"||o===null){t[c]=o;return}else if(Array.isArray(o)){t[c]=deepCloneArray(o);return}else if(isSpecificValue(o)){t[c]=cloneSpecificValue(o);return}else if(typeof a!=="object"||a===null||Array.isArray(a)){t[c]=r({},o);return}else{t[c]=r(a,o);return}}))}));return t}},2966:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function isTLSSocket(t){return t.encrypted}const deferToConnect=(t,r)=>{let i;if(typeof r==="function"){const t=r;i={connect:t}}else{i=r}const o=typeof i.connect==="function";const a=typeof i.secureConnect==="function";const c=typeof i.close==="function";const onConnect=()=>{if(o){i.connect()}if(isTLSSocket(t)&&a){if(t.authorized){i.secureConnect()}else if(!t.authorizationError){t.once("secureConnect",i.secureConnect)}}if(c){t.once("close",i.close)}};if(t.writable&&!t.connecting){onConnect()}else if(t.connecting){t.once("connect",onConnect)}else if(t.destroyed&&c){i.close(t._hadError)}};r["default"]=deferToConnect;t.exports=deferToConnect;t.exports["default"]=deferToConnect},5352:(t,r,i)=>{"use strict";const o=i(1017);const a=i(9223);const getExtensions=t=>t.length>1?`{${t.join(",")}}`:t[0];const getPath=(t,r)=>{const i=t[0]==="!"?t.slice(1):t;return o.isAbsolute(i)?i:o.join(r,i)};const addExtensions=(t,r)=>{if(o.extname(t)){return`**/${t}`}return`**/${t}.${getExtensions(r)}`};const getGlob=(t,r)=>{if(r.files&&!Array.isArray(r.files)){throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof r.files}\``)}if(r.extensions&&!Array.isArray(r.extensions)){throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof r.extensions}\``)}if(r.files&&r.extensions){return r.files.map((i=>o.posix.join(t,addExtensions(i,r.extensions))))}if(r.files){return r.files.map((r=>o.posix.join(t,`**/${r}`)))}if(r.extensions){return[o.posix.join(t,`**/*.${getExtensions(r.extensions)}`)]}return[o.posix.join(t,"**")]};t.exports=async(t,r)=>{r={cwd:process.cwd(),...r};if(typeof r.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof r.cwd}\``)}const i=await Promise.all([].concat(t).map((async t=>{const i=await a.isDirectory(getPath(t,r.cwd));return i?getGlob(t,r):t})));return[].concat.apply([],i)};t.exports.sync=(t,r)=>{r={cwd:process.cwd(),...r};if(typeof r.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof r.cwd}\``)}const i=[].concat(t).map((t=>a.isDirectorySync(getPath(t,r.cwd))?getGlob(t,r):t));return[].concat.apply([],i)}},1328:(t,r,i)=>{var o=i(4556);var noop=function(){};var isRequest=function(t){return t.setHeader&&typeof t.abort==="function"};var isChildProcess=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3};var eos=function(t,r,i){if(typeof r==="function")return eos(t,null,r);if(!r)r={};i=o(i||noop);var a=t._writableState;var c=t._readableState;var l=r.readable||r.readable!==false&&t.readable;var u=r.writable||r.writable!==false&&t.writable;var h=false;var onlegacyfinish=function(){if(!t.writable)onfinish()};var onfinish=function(){u=false;if(!l)i.call(t)};var onend=function(){l=false;if(!u)i.call(t)};var onexit=function(r){i.call(t,r?new Error("exited with error code: "+r):null)};var onerror=function(r){i.call(t,r)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(h)return;if(l&&!(c&&(c.ended&&!c.destroyed)))return i.call(t,new Error("premature close"));if(u&&!(a&&(a.ended&&!a.destroyed)))return i.call(t,new Error("premature close"))};var onrequest=function(){t.req.on("finish",onfinish)};if(isRequest(t)){t.on("complete",onfinish);t.on("abort",onclose);if(t.req)onrequest();else t.on("request",onrequest)}else if(u&&!a){t.on("end",onlegacyfinish);t.on("close",onlegacyfinish)}if(isChildProcess(t))t.on("exit",onexit);t.on("end",onend);t.on("finish",onfinish);if(r.error!==false)t.on("error",onerror);t.on("close",onclose);return function(){h=true;t.removeListener("complete",onfinish);t.removeListener("abort",onclose);t.removeListener("request",onrequest);if(t.req)t.req.removeListener("finish",onfinish);t.removeListener("end",onlegacyfinish);t.removeListener("close",onlegacyfinish);t.removeListener("finish",onfinish);t.removeListener("exit",onexit);t.removeListener("end",onend);t.removeListener("error",onerror);t.removeListener("close",onclose)}};t.exports=eos},3924:(t,r,i)=>{"use strict";const o=i(2291);const a=i(8620);const c=i(7900);const l=i(5407);const u=i(1066);const h=i(7190);const d=i(3828);async function FastGlob(t,r){assertPatternsInput(t);const i=getWorks(t,c.default,r);const o=await Promise.all(i);return d.array.flatten(o)}(function(t){function sync(t,r){assertPatternsInput(t);const i=getWorks(t,u.default,r);return d.array.flatten(i)}t.sync=sync;function stream(t,r){assertPatternsInput(t);const i=getWorks(t,l.default,r);return d.stream.merge(i)}t.stream=stream;function generateTasks(t,r){assertPatternsInput(t);const i=a.transform([].concat(t));const c=new h.default(r);return o.generate(i,c)}t.generateTasks=generateTasks;function isDynamicPattern(t,r){assertPatternsInput(t);const i=new h.default(r);return d.pattern.isDynamicPattern(t,i)}t.isDynamicPattern=isDynamicPattern;function escapePath(t){assertPatternsInput(t);return d.path.escape(t)}t.escapePath=escapePath})(FastGlob||(FastGlob={}));function getWorks(t,r,i){const c=a.transform([].concat(t));const l=new h.default(i);const u=o.generate(c,l);const d=new r(l);return u.map(d.read,d)}function assertPatternsInput(t){const r=[].concat(t);const i=r.every((t=>d.string.isString(t)&&!d.string.isEmpty(t)));if(!i){throw new TypeError("Patterns must be a string (non empty) or an array of strings")}}t.exports=FastGlob},8620:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.removeDuplicateSlashes=r.transform=void 0;const i=/(?!^)\/{2,}/g;function transform(t){return t.map((t=>removeDuplicateSlashes(t)))}r.transform=transform;function removeDuplicateSlashes(t){return t.replace(i,"/")}r.removeDuplicateSlashes=removeDuplicateSlashes},2291:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.convertPatternGroupToTask=r.convertPatternGroupsToTasks=r.groupPatternsByBaseDirectory=r.getNegativePatternsAsPositive=r.getPositivePatterns=r.convertPatternsToTasks=r.generate=void 0;const o=i(3828);function generate(t,r){const i=getPositivePatterns(t);const a=getNegativePatternsAsPositive(t,r.ignore);const c=i.filter((t=>o.pattern.isStaticPattern(t,r)));const l=i.filter((t=>o.pattern.isDynamicPattern(t,r)));const u=convertPatternsToTasks(c,a,false);const h=convertPatternsToTasks(l,a,true);return u.concat(h)}r.generate=generate;function convertPatternsToTasks(t,r,i){const a=[];const c=o.pattern.getPatternsOutsideCurrentDirectory(t);const l=o.pattern.getPatternsInsideCurrentDirectory(t);const u=groupPatternsByBaseDirectory(c);const h=groupPatternsByBaseDirectory(l);a.push(...convertPatternGroupsToTasks(u,r,i));if("."in h){a.push(convertPatternGroupToTask(".",l,r,i))}else{a.push(...convertPatternGroupsToTasks(h,r,i))}return a}r.convertPatternsToTasks=convertPatternsToTasks;function getPositivePatterns(t){return o.pattern.getPositivePatterns(t)}r.getPositivePatterns=getPositivePatterns;function getNegativePatternsAsPositive(t,r){const i=o.pattern.getNegativePatterns(t).concat(r);const a=i.map(o.pattern.convertToPositivePattern);return a}r.getNegativePatternsAsPositive=getNegativePatternsAsPositive;function groupPatternsByBaseDirectory(t){const r={};return t.reduce(((t,r)=>{const i=o.pattern.getBaseDirectory(r);if(i in t){t[i].push(r)}else{t[i]=[r]}return t}),r)}r.groupPatternsByBaseDirectory=groupPatternsByBaseDirectory;function convertPatternGroupsToTasks(t,r,i){return Object.keys(t).map((o=>convertPatternGroupToTask(o,t[o],r,i)))}r.convertPatternGroupsToTasks=convertPatternGroupsToTasks;function convertPatternGroupToTask(t,r,i,a){return{dynamic:a,positive:r,negative:i,base:t,patterns:[].concat(r,i.map(o.pattern.convertToNegativePattern))}}r.convertPatternGroupToTask=convertPatternGroupToTask},7900:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8075);const a=i(8845);class ProviderAsync extends a.default{constructor(){super(...arguments);this._reader=new o.default(this._settings)}read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const o=[];return new Promise(((a,c)=>{const l=this.api(r,t,i);l.once("error",c);l.on("data",(t=>o.push(i.transform(t))));l.once("end",(()=>a(o)))}))}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderAsync},4292:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3828);const a=i(5995);class DeepFilter{constructor(t,r){this._settings=t;this._micromatchOptions=r}getFilter(t,r,i){const o=this._getMatcher(r);const a=this._getNegativePatternsRe(i);return r=>this._filter(t,r,o,a)}_getMatcher(t){return new a.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){const r=t.filter(o.pattern.isAffectDepthOfReadingPattern);return o.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,i,a){if(this._isSkippedByDeep(t,r.path)){return false}if(this._isSkippedSymbolicLink(r)){return false}const c=o.path.removeLeadingDotSegment(r.path);if(this._isSkippedByPositivePatterns(c,i)){return false}return this._isSkippedByNegativePatterns(c,a)}_isSkippedByDeep(t,r){if(this._settings.deep===Infinity){return false}return this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){const i=r.split("/").length;if(t===""){return i}const o=t.split("/").length;return i-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!o.pattern.matchAny(t,r)}}r["default"]=DeepFilter},659:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3828);class EntryFilter{constructor(t,r){this._settings=t;this._micromatchOptions=r;this.index=new Map}getFilter(t,r){const i=o.pattern.convertPatternsToRe(t,this._micromatchOptions);const a=o.pattern.convertPatternsToRe(r,this._micromatchOptions);return t=>this._filter(t,i,a)}_filter(t,r,i){if(this._settings.unique&&this._isDuplicateEntry(t)){return false}if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t)){return false}if(this._isSkippedByAbsoluteNegativePatterns(t.path,i)){return false}const o=this._settings.baseNameMatch?t.name:t.path;const a=this._isMatchToPatterns(o,r)&&!this._isMatchToPatterns(t.path,i);if(this._settings.unique&&a){this._createIndexRecord(t)}return a}_isDuplicateEntry(t){return this.index.has(t.path)}_createIndexRecord(t){this.index.set(t.path,undefined)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(t,r){if(!this._settings.absolute){return false}const i=o.path.makeAbsolute(this._settings.cwd,t);return o.pattern.matchAny(i,r)}_isMatchToPatterns(t,r){const i=o.path.removeLeadingDotSegment(t);return o.pattern.matchAny(i,r)||o.pattern.matchAny(i+"/",r)}}r["default"]=EntryFilter},9558:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3828);class ErrorFilter{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return o.errno.isEnoentCodeError(t)||this._settings.suppressErrors}}r["default"]=ErrorFilter},8302:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3828);class Matcher{constructor(t,r,i){this._patterns=t;this._settings=r;this._micromatchOptions=i;this._storage=[];this._fillStorage()}_fillStorage(){const t=o.pattern.expandPatternsWithBraceExpansion(this._patterns);for(const r of t){const t=this._getPatternSegments(r);const i=this._splitSegmentsIntoSections(t);this._storage.push({complete:i.length<=1,pattern:r,segments:t,sections:i})}}_getPatternSegments(t){const r=o.pattern.getPatternParts(t,this._micromatchOptions);return r.map((t=>{const r=o.pattern.isDynamicPattern(t,this._settings);if(!r){return{dynamic:false,pattern:t}}return{dynamic:true,pattern:t,patternRe:o.pattern.makeRe(t,this._micromatchOptions)}}))}_splitSegmentsIntoSections(t){return o.array.splitWhen(t,(t=>t.dynamic&&o.pattern.hasGlobStar(t.pattern)))}}r["default"]=Matcher},5995:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8302);class PartialMatcher extends o.default{match(t){const r=t.split("/");const i=r.length;const o=this._storage.filter((t=>!t.complete||t.segments.length>i));for(const t of o){const o=t.sections[0];if(!t.complete&&i>o.length){return true}const a=r.every(((r,i)=>{const o=t.segments[i];if(o.dynamic&&o.patternRe.test(r)){return true}if(!o.dynamic&&o.pattern===r){return true}return false}));if(a){return true}}return false}}r["default"]=PartialMatcher},8845:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(4292);const c=i(659);const l=i(9558);const u=i(8460);class Provider{constructor(t){this._settings=t;this.errorFilter=new l.default(this._settings);this.entryFilter=new c.default(this._settings,this._getMicromatchOptions());this.deepFilter=new a.default(this._settings,this._getMicromatchOptions());this.entryTransformer=new u.default(this._settings)}_getRootDirectory(t){return o.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){const r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:true,strictSlashes:false}}}r["default"]=Provider},5407:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(8075);const c=i(8845);class ProviderStream extends c.default{constructor(){super(...arguments);this._reader=new a.default(this._settings)}read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const a=this.api(r,t,i);const c=new o.Readable({objectMode:true,read:()=>{}});a.once("error",(t=>c.emit("error",t))).on("data",(t=>c.emit("data",i.transform(t)))).once("end",(()=>c.emit("end")));c.once("close",(()=>a.destroy()));return c}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderStream},1066:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8110);const a=i(8845);class ProviderSync extends a.default{constructor(){super(...arguments);this._reader=new o.default(this._settings)}read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const o=this.api(r,t,i);return o.map(i.transform)}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderSync},8460:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3828);class EntryTransformer{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;if(this._settings.absolute){r=o.path.makeAbsolute(this._settings.cwd,r);r=o.path.unixify(r)}if(this._settings.markDirectories&&t.dirent.isDirectory()){r+="/"}if(!this._settings.objectMode){return r}return Object.assign(Object.assign({},t),{path:r})}}r["default"]=EntryTransformer},5906:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(3645);const c=i(3828);class Reader{constructor(t){this._settings=t;this._fsStatSettings=new a.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return o.resolve(this._settings.cwd,t)}_makeEntry(t,r){const i={name:r,path:r,dirent:c.fs.createDirentFromStats(r,t)};if(this._settings.stats){i.stats=t}return i}_isFatalError(t){return!c.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}}r["default"]=Reader},8075:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(3645);const c=i(4328);const l=i(5906);class ReaderStream extends l.default{constructor(){super(...arguments);this._walkStream=c.walkStream;this._stat=a.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){const i=t.map(this._getFullEntryPath,this);const a=new o.PassThrough({objectMode:true});a._write=(o,c,l)=>this._getEntry(i[o],t[o],r).then((t=>{if(t!==null&&r.entryFilter(t)){a.push(t)}if(o===i.length-1){a.end()}l()})).catch(l);for(let t=0;t<i.length;t++){a.write(t)}return a}_getEntry(t,r,i){return this._getStat(t).then((t=>this._makeEntry(t,r))).catch((t=>{if(i.errorFilter(t)){return null}throw t}))}_getStat(t){return new Promise(((r,i)=>{this._stat(t,this._fsStatSettings,((t,o)=>t===null?r(o):i(t)))}))}}r["default"]=ReaderStream},8110:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3645);const a=i(4328);const c=i(5906);class ReaderSync extends c.default{constructor(){super(...arguments);this._walkSync=a.walkSync;this._statSync=o.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){const i=[];for(const o of t){const t=this._getFullEntryPath(o);const a=this._getEntry(t,o,r);if(a===null||!r.entryFilter(a)){continue}i.push(a)}return i}_getEntry(t,r,i){try{const i=this._getStat(t);return this._makeEntry(i,r)}catch(t){if(i.errorFilter(t)){return null}throw t}}_getStat(t){return this._statSync(t,this._fsStatSettings)}}r["default"]=ReaderSync},7190:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);const a=i(2037);const c=Math.max(a.cpus().length,1);r.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:o.lstat,lstatSync:o.lstatSync,stat:o.stat,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};class Settings{constructor(t={}){this._options=t;this.absolute=this._getValue(this._options.absolute,false);this.baseNameMatch=this._getValue(this._options.baseNameMatch,false);this.braceExpansion=this._getValue(this._options.braceExpansion,true);this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,true);this.concurrency=this._getValue(this._options.concurrency,c);this.cwd=this._getValue(this._options.cwd,process.cwd());this.deep=this._getValue(this._options.deep,Infinity);this.dot=this._getValue(this._options.dot,false);this.extglob=this._getValue(this._options.extglob,true);this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,true);this.fs=this._getFileSystemMethods(this._options.fs);this.globstar=this._getValue(this._options.globstar,true);this.ignore=this._getValue(this._options.ignore,[]);this.markDirectories=this._getValue(this._options.markDirectories,false);this.objectMode=this._getValue(this._options.objectMode,false);this.onlyDirectories=this._getValue(this._options.onlyDirectories,false);this.onlyFiles=this._getValue(this._options.onlyFiles,true);this.stats=this._getValue(this._options.stats,false);this.suppressErrors=this._getValue(this._options.suppressErrors,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,false);this.unique=this._getValue(this._options.unique,true);if(this.onlyDirectories){this.onlyFiles=false}if(this.stats){this.objectMode=true}}_getValue(t,r){return t===undefined?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},r.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}r["default"]=Settings},5789:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.splitWhen=r.flatten=void 0;function flatten(t){return t.reduce(((t,r)=>[].concat(t,r)),[])}r.flatten=flatten;function splitWhen(t,r){const i=[[]];let o=0;for(const a of t){if(r(a)){o++;i[o]=[]}else{i[o].push(a)}}return i}r.splitWhen=splitWhen},886:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code==="ENOENT"}r.isEnoentCodeError=isEnoentCodeError},9102:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},3828:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.string=r.stream=r.pattern=r.path=r.fs=r.errno=r.array=void 0;const o=i(5789);r.array=o;const a=i(886);r.errno=a;const c=i(9102);r.fs=c;const l=i(6462);r.path=l;const u=i(2256);r.pattern=u;const h=i(9941);r.stream=h;const d=i(5121);r.string=d},6462:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.removeLeadingDotSegment=r.escape=r.makeAbsolute=r.unixify=void 0;const o=i(1017);const a=2;const c=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;function unixify(t){return t.replace(/\\/g,"/")}r.unixify=unixify;function makeAbsolute(t,r){return o.resolve(t,r)}r.makeAbsolute=makeAbsolute;function escape(t){return t.replace(c,"\\$2")}r.escape=escape;function removeLeadingDotSegment(t){if(t.charAt(0)==="."){const r=t.charAt(1);if(r==="/"||r==="\\"){return t.slice(a)}}return t}r.removeLeadingDotSegment=removeLeadingDotSegment},2256:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.matchAny=r.convertPatternsToRe=r.makeRe=r.getPatternParts=r.expandBraceExpansion=r.expandPatternsWithBraceExpansion=r.isAffectDepthOfReadingPattern=r.endsWithSlashGlobStar=r.hasGlobStar=r.getBaseDirectory=r.isPatternRelatedToParentDirectory=r.getPatternsOutsideCurrentDirectory=r.getPatternsInsideCurrentDirectory=r.getPositivePatterns=r.getNegativePatterns=r.isPositivePattern=r.isNegativePattern=r.convertToNegativePattern=r.convertToPositivePattern=r.isDynamicPattern=r.isStaticPattern=void 0;const o=i(1017);const a=i(5976);const c=i(1224);const l="**";const u="\\";const h=/[*?]|^!/;const d=/\[[^[]*]/;const p=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;const m=/[!*+?@]\([^(]*\)/;const g=/,|\.\./;function isStaticPattern(t,r={}){return!isDynamicPattern(t,r)}r.isStaticPattern=isStaticPattern;function isDynamicPattern(t,r={}){if(t===""){return false}if(r.caseSensitiveMatch===false||t.includes(u)){return true}if(h.test(t)||d.test(t)||p.test(t)){return true}if(r.extglob!==false&&m.test(t)){return true}if(r.braceExpansion!==false&&hasBraceExpansion(t)){return true}return false}r.isDynamicPattern=isDynamicPattern;function hasBraceExpansion(t){const r=t.indexOf("{");if(r===-1){return false}const i=t.indexOf("}",r+1);if(i===-1){return false}const o=t.slice(r,i);return g.test(o)}function convertToPositivePattern(t){return isNegativePattern(t)?t.slice(1):t}r.convertToPositivePattern=convertToPositivePattern;function convertToNegativePattern(t){return"!"+t}r.convertToNegativePattern=convertToNegativePattern;function isNegativePattern(t){return t.startsWith("!")&&t[1]!=="("}r.isNegativePattern=isNegativePattern;function isPositivePattern(t){return!isNegativePattern(t)}r.isPositivePattern=isPositivePattern;function getNegativePatterns(t){return t.filter(isNegativePattern)}r.getNegativePatterns=getNegativePatterns;function getPositivePatterns(t){return t.filter(isPositivePattern)}r.getPositivePatterns=getPositivePatterns;function getPatternsInsideCurrentDirectory(t){return t.filter((t=>!isPatternRelatedToParentDirectory(t)))}r.getPatternsInsideCurrentDirectory=getPatternsInsideCurrentDirectory;function getPatternsOutsideCurrentDirectory(t){return t.filter(isPatternRelatedToParentDirectory)}r.getPatternsOutsideCurrentDirectory=getPatternsOutsideCurrentDirectory;function isPatternRelatedToParentDirectory(t){return t.startsWith("..")||t.startsWith("./..")}r.isPatternRelatedToParentDirectory=isPatternRelatedToParentDirectory;function getBaseDirectory(t){return a(t,{flipBackslashes:false})}r.getBaseDirectory=getBaseDirectory;function hasGlobStar(t){return t.includes(l)}r.hasGlobStar=hasGlobStar;function endsWithSlashGlobStar(t){return t.endsWith("/"+l)}r.endsWithSlashGlobStar=endsWithSlashGlobStar;function isAffectDepthOfReadingPattern(t){const r=o.basename(t);return endsWithSlashGlobStar(t)||isStaticPattern(r)}r.isAffectDepthOfReadingPattern=isAffectDepthOfReadingPattern;function expandPatternsWithBraceExpansion(t){return t.reduce(((t,r)=>t.concat(expandBraceExpansion(r))),[])}r.expandPatternsWithBraceExpansion=expandPatternsWithBraceExpansion;function expandBraceExpansion(t){return c.braces(t,{expand:true,nodupes:true})}r.expandBraceExpansion=expandBraceExpansion;function getPatternParts(t,r){let{parts:i}=c.scan(t,Object.assign(Object.assign({},r),{parts:true}));if(i.length===0){i=[t]}if(i[0].startsWith("/")){i[0]=i[0].slice(1);i.unshift("")}return i}r.getPatternParts=getPatternParts;function makeRe(t,r){return c.makeRe(t,r)}r.makeRe=makeRe;function convertPatternsToRe(t,r){return t.map((t=>makeRe(t,r)))}r.convertPatternsToRe=convertPatternsToRe;function matchAny(t,r){return r.some((r=>r.test(t)))}r.matchAny=matchAny},9941:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.merge=void 0;const o=i(1382);function merge(t){const r=o(t);t.forEach((t=>{t.once("error",(t=>r.emit("error",t)))}));r.once("close",(()=>propagateCloseEventToSources(t)));r.once("end",(()=>propagateCloseEventToSources(t)));return r}r.merge=merge;function propagateCloseEventToSources(t){t.forEach((t=>t.emit("close")))}},5121:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.isEmpty=r.isString=void 0;function isString(t){return typeof t==="string"}r.isString=isString;function isEmpty(t){return t===""}r.isEmpty=isEmpty},4241:(t,r,i)=>{"use strict";var o=i(1816);function fastqueue(t,r,i){if(typeof t==="function"){i=r;r=t;t=null}if(i<1){throw new Error("fastqueue concurrency must be greater than 1")}var a=o(Task);var c=null;var l=null;var u=0;var h=null;var d={push:push,drain:noop,saturated:noop,pause:pause,paused:false,concurrency:i,running:running,resume:resume,idle:idle,length:length,getQueue:getQueue,unshift:unshift,empty:noop,kill:kill,killAndDrain:killAndDrain,error:error};return d;function running(){return u}function pause(){d.paused=true}function length(){var t=c;var r=0;while(t){t=t.next;r++}return r}function getQueue(){var t=c;var r=[];while(t){r.push(t.value);t=t.next}return r}function resume(){if(!d.paused)return;d.paused=false;for(var t=0;t<d.concurrency;t++){u++;release()}}function idle(){return u===0&&d.length()===0}function push(i,o){var p=a.get();p.context=t;p.release=release;p.value=i;p.callback=o||noop;p.errorHandler=h;if(u===d.concurrency||d.paused){if(l){l.next=p;l=p}else{c=p;l=p;d.saturated()}}else{u++;r.call(t,p.value,p.worked)}}function unshift(i,o){var h=a.get();h.context=t;h.release=release;h.value=i;h.callback=o||noop;if(u===d.concurrency||d.paused){if(c){h.next=c;c=h}else{c=h;l=h;d.saturated()}}else{u++;r.call(t,h.value,h.worked)}}function release(i){if(i){a.release(i)}var o=c;if(o){if(!d.paused){if(l===c){l=null}c=o.next;o.next=null;r.call(t,o.value,o.worked);if(l===null){d.empty()}}else{u--}}else if(--u===0){d.drain()}}function kill(){c=null;l=null;d.drain=noop}function killAndDrain(){c=null;l=null;d.drain();d.drain=noop}function error(t){h=t}}function noop(){}function Task(){this.value=null;this.callback=noop;this.next=null;this.release=noop;this.context=null;this.errorHandler=null;var t=this;this.worked=function worked(r,i){var o=t.callback;var a=t.errorHandler;var c=t.value;t.value=null;t.callback=noop;if(t.errorHandler){a(r,c)}o.call(t.context,r,i);t.release(t)}}function queueAsPromised(t,r,i){if(typeof t==="function"){i=r;r=t;t=null}function asyncWrapper(t,i){r.call(this,t).then((function(t){i(null,t)}),i)}var o=fastqueue(t,asyncWrapper,i);var a=o.push;var c=o.unshift;o.push=push;o.unshift=unshift;o.drained=drained;return o;function push(t){var r=new Promise((function(r,i){a(t,(function(t,o){if(t){i(t);return}r(o)}))}));r.catch(noop);return r}function unshift(t){var r=new Promise((function(r,i){c(t,(function(t,o){if(t){i(t);return}r(o)}))}));r.catch(noop);return r}function drained(){var t=o.drain;var r=new Promise((function(r){o.drain=function(){t();r()}}));return r}}t.exports=fastqueue;t.exports.promise=queueAsPromised},442:(t,r,i)=>{"use strict";
|
|
78
|
+
*/function isSpecificValue(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp?true:false}function cloneSpecificValue(t){if(t instanceof Buffer){var r=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);t.copy(r);return r}else if(t instanceof Date){return new Date(t.getTime())}else if(t instanceof RegExp){return new RegExp(t)}else{throw new Error("Unexpected situation")}}function deepCloneArray(t){var i=[];t.forEach((function(t,o){if(typeof t==="object"&&t!==null){if(Array.isArray(t)){i[o]=deepCloneArray(t)}else if(isSpecificValue(t)){i[o]=cloneSpecificValue(t)}else{i[o]=r({},t)}}else{i[o]=t}}));return i}function safeGetProperty(t,r){return r==="__proto__"?undefined:t[r]}var r=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object"){return false}if(arguments.length<2){return arguments[0]}var t=arguments[0];var i=Array.prototype.slice.call(arguments,1);var o,a,l;i.forEach((function(i){if(typeof i!=="object"||i===null||Array.isArray(i)){return}Object.keys(i).forEach((function(l){a=safeGetProperty(t,l);o=safeGetProperty(i,l);if(o===t){return}else if(typeof o!=="object"||o===null){t[l]=o;return}else if(Array.isArray(o)){t[l]=deepCloneArray(o);return}else if(isSpecificValue(o)){t[l]=cloneSpecificValue(o);return}else if(typeof a!=="object"||a===null||Array.isArray(a)){t[l]=r({},o);return}else{t[l]=r(a,o);return}}))}));return t}},7233:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function isTLSSocket(t){return t.encrypted}const deferToConnect=(t,r)=>{let i;if(typeof r==="function"){const t=r;i={connect:t}}else{i=r}const o=typeof i.connect==="function";const a=typeof i.secureConnect==="function";const l=typeof i.close==="function";const onConnect=()=>{if(o){i.connect()}if(isTLSSocket(t)&&a){if(t.authorized){i.secureConnect()}else if(!t.authorizationError){t.once("secureConnect",i.secureConnect)}}if(l){t.once("close",i.close)}};if(t.writable&&!t.connecting){onConnect()}else if(t.connecting){t.once("connect",onConnect)}else if(t.destroyed&&l){i.close(t._hadError)}};r["default"]=deferToConnect;t.exports=deferToConnect;t.exports["default"]=deferToConnect},5753:(t,r,i)=>{"use strict";const o=i(1017);const a=i(1733);const getExtensions=t=>t.length>1?`{${t.join(",")}}`:t[0];const getPath=(t,r)=>{const i=t[0]==="!"?t.slice(1):t;return o.isAbsolute(i)?i:o.join(r,i)};const addExtensions=(t,r)=>{if(o.extname(t)){return`**/${t}`}return`**/${t}.${getExtensions(r)}`};const getGlob=(t,r)=>{if(r.files&&!Array.isArray(r.files)){throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof r.files}\``)}if(r.extensions&&!Array.isArray(r.extensions)){throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof r.extensions}\``)}if(r.files&&r.extensions){return r.files.map((i=>o.posix.join(t,addExtensions(i,r.extensions))))}if(r.files){return r.files.map((r=>o.posix.join(t,`**/${r}`)))}if(r.extensions){return[o.posix.join(t,`**/*.${getExtensions(r.extensions)}`)]}return[o.posix.join(t,"**")]};t.exports=async(t,r)=>{r={cwd:process.cwd(),...r};if(typeof r.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof r.cwd}\``)}const i=await Promise.all([].concat(t).map((async t=>{const i=await a.isDirectory(getPath(t,r.cwd));return i?getGlob(t,r):t})));return[].concat.apply([],i)};t.exports.sync=(t,r)=>{r={cwd:process.cwd(),...r};if(typeof r.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof r.cwd}\``)}const i=[].concat(t).map((t=>a.isDirectorySync(getPath(t,r.cwd))?getGlob(t,r):t));return[].concat.apply([],i)}},1545:(t,r,i)=>{var o=i(3306);var noop=function(){};var isRequest=function(t){return t.setHeader&&typeof t.abort==="function"};var isChildProcess=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3};var eos=function(t,r,i){if(typeof r==="function")return eos(t,null,r);if(!r)r={};i=o(i||noop);var a=t._writableState;var l=t._readableState;var c=r.readable||r.readable!==false&&t.readable;var u=r.writable||r.writable!==false&&t.writable;var h=false;var onlegacyfinish=function(){if(!t.writable)onfinish()};var onfinish=function(){u=false;if(!c)i.call(t)};var onend=function(){c=false;if(!u)i.call(t)};var onexit=function(r){i.call(t,r?new Error("exited with error code: "+r):null)};var onerror=function(r){i.call(t,r)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(h)return;if(c&&!(l&&(l.ended&&!l.destroyed)))return i.call(t,new Error("premature close"));if(u&&!(a&&(a.ended&&!a.destroyed)))return i.call(t,new Error("premature close"))};var onrequest=function(){t.req.on("finish",onfinish)};if(isRequest(t)){t.on("complete",onfinish);t.on("abort",onclose);if(t.req)onrequest();else t.on("request",onrequest)}else if(u&&!a){t.on("end",onlegacyfinish);t.on("close",onlegacyfinish)}if(isChildProcess(t))t.on("exit",onexit);t.on("end",onend);t.on("finish",onfinish);if(r.error!==false)t.on("error",onerror);t.on("close",onclose);return function(){h=true;t.removeListener("complete",onfinish);t.removeListener("abort",onclose);t.removeListener("request",onrequest);if(t.req)t.req.removeListener("finish",onfinish);t.removeListener("end",onlegacyfinish);t.removeListener("close",onlegacyfinish);t.removeListener("finish",onfinish);t.removeListener("exit",onexit);t.removeListener("end",onend);t.removeListener("error",onerror);t.removeListener("close",onclose)}};t.exports=eos},2682:(t,r,i)=>{"use strict";const o=i(7519);const a=i(5812);const l=i(3850);const c=i(3494);const u=i(1094);const h=i(5335);const d=i(1441);async function FastGlob(t,r){assertPatternsInput(t);const i=getWorks(t,l.default,r);const o=await Promise.all(i);return d.array.flatten(o)}(function(t){function sync(t,r){assertPatternsInput(t);const i=getWorks(t,u.default,r);return d.array.flatten(i)}t.sync=sync;function stream(t,r){assertPatternsInput(t);const i=getWorks(t,c.default,r);return d.stream.merge(i)}t.stream=stream;function generateTasks(t,r){assertPatternsInput(t);const i=a.transform([].concat(t));const l=new h.default(r);return o.generate(i,l)}t.generateTasks=generateTasks;function isDynamicPattern(t,r){assertPatternsInput(t);const i=new h.default(r);return d.pattern.isDynamicPattern(t,i)}t.isDynamicPattern=isDynamicPattern;function escapePath(t){assertPatternsInput(t);return d.path.escape(t)}t.escapePath=escapePath})(FastGlob||(FastGlob={}));function getWorks(t,r,i){const l=a.transform([].concat(t));const c=new h.default(i);const u=o.generate(l,c);const d=new r(c);return u.map(d.read,d)}function assertPatternsInput(t){const r=[].concat(t);const i=r.every((t=>d.string.isString(t)&&!d.string.isEmpty(t)));if(!i){throw new TypeError("Patterns must be a string (non empty) or an array of strings")}}t.exports=FastGlob},5812:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.removeDuplicateSlashes=r.transform=void 0;const i=/(?!^)\/{2,}/g;function transform(t){return t.map((t=>removeDuplicateSlashes(t)))}r.transform=transform;function removeDuplicateSlashes(t){return t.replace(i,"/")}r.removeDuplicateSlashes=removeDuplicateSlashes},7519:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.convertPatternGroupToTask=r.convertPatternGroupsToTasks=r.groupPatternsByBaseDirectory=r.getNegativePatternsAsPositive=r.getPositivePatterns=r.convertPatternsToTasks=r.generate=void 0;const o=i(1441);function generate(t,r){const i=getPositivePatterns(t);const a=getNegativePatternsAsPositive(t,r.ignore);const l=i.filter((t=>o.pattern.isStaticPattern(t,r)));const c=i.filter((t=>o.pattern.isDynamicPattern(t,r)));const u=convertPatternsToTasks(l,a,false);const h=convertPatternsToTasks(c,a,true);return u.concat(h)}r.generate=generate;function convertPatternsToTasks(t,r,i){const a=[];const l=o.pattern.getPatternsOutsideCurrentDirectory(t);const c=o.pattern.getPatternsInsideCurrentDirectory(t);const u=groupPatternsByBaseDirectory(l);const h=groupPatternsByBaseDirectory(c);a.push(...convertPatternGroupsToTasks(u,r,i));if("."in h){a.push(convertPatternGroupToTask(".",c,r,i))}else{a.push(...convertPatternGroupsToTasks(h,r,i))}return a}r.convertPatternsToTasks=convertPatternsToTasks;function getPositivePatterns(t){return o.pattern.getPositivePatterns(t)}r.getPositivePatterns=getPositivePatterns;function getNegativePatternsAsPositive(t,r){const i=o.pattern.getNegativePatterns(t).concat(r);const a=i.map(o.pattern.convertToPositivePattern);return a}r.getNegativePatternsAsPositive=getNegativePatternsAsPositive;function groupPatternsByBaseDirectory(t){const r={};return t.reduce(((t,r)=>{const i=o.pattern.getBaseDirectory(r);if(i in t){t[i].push(r)}else{t[i]=[r]}return t}),r)}r.groupPatternsByBaseDirectory=groupPatternsByBaseDirectory;function convertPatternGroupsToTasks(t,r,i){return Object.keys(t).map((o=>convertPatternGroupToTask(o,t[o],r,i)))}r.convertPatternGroupsToTasks=convertPatternGroupsToTasks;function convertPatternGroupToTask(t,r,i,a){return{dynamic:a,positive:r,negative:i,base:t,patterns:[].concat(r,i.map(o.pattern.convertToNegativePattern))}}r.convertPatternGroupToTask=convertPatternGroupToTask},3850:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8612);const a=i(2420);class ProviderAsync extends a.default{constructor(){super(...arguments);this._reader=new o.default(this._settings)}read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const o=[];return new Promise(((a,l)=>{const c=this.api(r,t,i);c.once("error",l);c.on("data",(t=>o.push(i.transform(t))));c.once("end",(()=>a(o)))}))}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderAsync},9142:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1441);const a=i(9043);class DeepFilter{constructor(t,r){this._settings=t;this._micromatchOptions=r}getFilter(t,r,i){const o=this._getMatcher(r);const a=this._getNegativePatternsRe(i);return r=>this._filter(t,r,o,a)}_getMatcher(t){return new a.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){const r=t.filter(o.pattern.isAffectDepthOfReadingPattern);return o.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,i,a){if(this._isSkippedByDeep(t,r.path)){return false}if(this._isSkippedSymbolicLink(r)){return false}const l=o.path.removeLeadingDotSegment(r.path);if(this._isSkippedByPositivePatterns(l,i)){return false}return this._isSkippedByNegativePatterns(l,a)}_isSkippedByDeep(t,r){if(this._settings.deep===Infinity){return false}return this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){const i=r.split("/").length;if(t===""){return i}const o=t.split("/").length;return i-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!o.pattern.matchAny(t,r)}}r["default"]=DeepFilter},5240:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1441);class EntryFilter{constructor(t,r){this._settings=t;this._micromatchOptions=r;this.index=new Map}getFilter(t,r){const i=o.pattern.convertPatternsToRe(t,this._micromatchOptions);const a=o.pattern.convertPatternsToRe(r,this._micromatchOptions);return t=>this._filter(t,i,a)}_filter(t,r,i){if(this._settings.unique&&this._isDuplicateEntry(t)){return false}if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t)){return false}if(this._isSkippedByAbsoluteNegativePatterns(t.path,i)){return false}const o=this._settings.baseNameMatch?t.name:t.path;const a=this._isMatchToPatterns(o,r)&&!this._isMatchToPatterns(t.path,i);if(this._settings.unique&&a){this._createIndexRecord(t)}return a}_isDuplicateEntry(t){return this.index.has(t.path)}_createIndexRecord(t){this.index.set(t.path,undefined)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(t,r){if(!this._settings.absolute){return false}const i=o.path.makeAbsolute(this._settings.cwd,t);return o.pattern.matchAny(i,r)}_isMatchToPatterns(t,r){const i=o.path.removeLeadingDotSegment(t);return o.pattern.matchAny(i,r)||o.pattern.matchAny(i+"/",r)}}r["default"]=EntryFilter},4691:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1441);class ErrorFilter{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return o.errno.isEnoentCodeError(t)||this._settings.suppressErrors}}r["default"]=ErrorFilter},6514:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1441);class Matcher{constructor(t,r,i){this._patterns=t;this._settings=r;this._micromatchOptions=i;this._storage=[];this._fillStorage()}_fillStorage(){const t=o.pattern.expandPatternsWithBraceExpansion(this._patterns);for(const r of t){const t=this._getPatternSegments(r);const i=this._splitSegmentsIntoSections(t);this._storage.push({complete:i.length<=1,pattern:r,segments:t,sections:i})}}_getPatternSegments(t){const r=o.pattern.getPatternParts(t,this._micromatchOptions);return r.map((t=>{const r=o.pattern.isDynamicPattern(t,this._settings);if(!r){return{dynamic:false,pattern:t}}return{dynamic:true,pattern:t,patternRe:o.pattern.makeRe(t,this._micromatchOptions)}}))}_splitSegmentsIntoSections(t){return o.array.splitWhen(t,(t=>t.dynamic&&o.pattern.hasGlobStar(t.pattern)))}}r["default"]=Matcher},9043:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(6514);class PartialMatcher extends o.default{match(t){const r=t.split("/");const i=r.length;const o=this._storage.filter((t=>!t.complete||t.segments.length>i));for(const t of o){const o=t.sections[0];if(!t.complete&&i>o.length){return true}const a=r.every(((r,i)=>{const o=t.segments[i];if(o.dynamic&&o.patternRe.test(r)){return true}if(!o.dynamic&&o.pattern===r){return true}return false}));if(a){return true}}return false}}r["default"]=PartialMatcher},2420:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(9142);const l=i(5240);const c=i(4691);const u=i(7379);class Provider{constructor(t){this._settings=t;this.errorFilter=new c.default(this._settings);this.entryFilter=new l.default(this._settings,this._getMicromatchOptions());this.deepFilter=new a.default(this._settings,this._getMicromatchOptions());this.entryTransformer=new u.default(this._settings)}_getRootDirectory(t){return o.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){const r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:true,strictSlashes:false}}}r["default"]=Provider},3494:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(8612);const l=i(2420);class ProviderStream extends l.default{constructor(){super(...arguments);this._reader=new a.default(this._settings)}read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const a=this.api(r,t,i);const l=new o.Readable({objectMode:true,read:()=>{}});a.once("error",(t=>l.emit("error",t))).on("data",(t=>l.emit("data",i.transform(t)))).once("end",(()=>l.emit("end")));l.once("close",(()=>a.destroy()));return l}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderStream},1094:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(82);const a=i(2420);class ProviderSync extends a.default{constructor(){super(...arguments);this._reader=new o.default(this._settings)}read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const o=this.api(r,t,i);return o.map(i.transform)}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderSync},7379:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1441);class EntryTransformer{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;if(this._settings.absolute){r=o.path.makeAbsolute(this._settings.cwd,r);r=o.path.unixify(r)}if(this._settings.markDirectories&&t.dirent.isDirectory()){r+="/"}if(!this._settings.objectMode){return r}return Object.assign(Object.assign({},t),{path:r})}}r["default"]=EntryTransformer},747:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(8418);const l=i(1441);class Reader{constructor(t){this._settings=t;this._fsStatSettings=new a.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return o.resolve(this._settings.cwd,t)}_makeEntry(t,r){const i={name:r,path:r,dirent:l.fs.createDirentFromStats(r,t)};if(this._settings.stats){i.stats=t}return i}_isFatalError(t){return!l.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}}r["default"]=Reader},8612:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(8418);const l=i(7921);const c=i(747);class ReaderStream extends c.default{constructor(){super(...arguments);this._walkStream=l.walkStream;this._stat=a.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){const i=t.map(this._getFullEntryPath,this);const a=new o.PassThrough({objectMode:true});a._write=(o,l,c)=>this._getEntry(i[o],t[o],r).then((t=>{if(t!==null&&r.entryFilter(t)){a.push(t)}if(o===i.length-1){a.end()}c()})).catch(c);for(let t=0;t<i.length;t++){a.write(t)}return a}_getEntry(t,r,i){return this._getStat(t).then((t=>this._makeEntry(t,r))).catch((t=>{if(i.errorFilter(t)){return null}throw t}))}_getStat(t){return new Promise(((r,i)=>{this._stat(t,this._fsStatSettings,((t,o)=>t===null?r(o):i(t)))}))}}r["default"]=ReaderStream},82:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8418);const a=i(7921);const l=i(747);class ReaderSync extends l.default{constructor(){super(...arguments);this._walkSync=a.walkSync;this._statSync=o.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){const i=[];for(const o of t){const t=this._getFullEntryPath(o);const a=this._getEntry(t,o,r);if(a===null||!r.entryFilter(a)){continue}i.push(a)}return i}_getEntry(t,r,i){try{const i=this._getStat(t);return this._makeEntry(i,r)}catch(t){if(i.errorFilter(t)){return null}throw t}}_getStat(t){return this._statSync(t,this._fsStatSettings)}}r["default"]=ReaderSync},5335:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);const a=i(2037);const l=Math.max(a.cpus().length,1);r.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:o.lstat,lstatSync:o.lstatSync,stat:o.stat,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};class Settings{constructor(t={}){this._options=t;this.absolute=this._getValue(this._options.absolute,false);this.baseNameMatch=this._getValue(this._options.baseNameMatch,false);this.braceExpansion=this._getValue(this._options.braceExpansion,true);this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,true);this.concurrency=this._getValue(this._options.concurrency,l);this.cwd=this._getValue(this._options.cwd,process.cwd());this.deep=this._getValue(this._options.deep,Infinity);this.dot=this._getValue(this._options.dot,false);this.extglob=this._getValue(this._options.extglob,true);this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,true);this.fs=this._getFileSystemMethods(this._options.fs);this.globstar=this._getValue(this._options.globstar,true);this.ignore=this._getValue(this._options.ignore,[]);this.markDirectories=this._getValue(this._options.markDirectories,false);this.objectMode=this._getValue(this._options.objectMode,false);this.onlyDirectories=this._getValue(this._options.onlyDirectories,false);this.onlyFiles=this._getValue(this._options.onlyFiles,true);this.stats=this._getValue(this._options.stats,false);this.suppressErrors=this._getValue(this._options.suppressErrors,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,false);this.unique=this._getValue(this._options.unique,true);if(this.onlyDirectories){this.onlyFiles=false}if(this.stats){this.objectMode=true}}_getValue(t,r){return t===undefined?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},r.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}r["default"]=Settings},4792:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.splitWhen=r.flatten=void 0;function flatten(t){return t.reduce(((t,r)=>[].concat(t,r)),[])}r.flatten=flatten;function splitWhen(t,r){const i=[[]];let o=0;for(const a of t){if(r(a)){o++;i[o]=[]}else{i[o].push(a)}}return i}r.splitWhen=splitWhen},90:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code==="ENOENT"}r.isEnoentCodeError=isEnoentCodeError},743:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},1441:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.string=r.stream=r.pattern=r.path=r.fs=r.errno=r.array=void 0;const o=i(4792);r.array=o;const a=i(90);r.errno=a;const l=i(743);r.fs=l;const c=i(5599);r.path=c;const u=i(8184);r.pattern=u;const h=i(3666);r.stream=h;const d=i(2055);r.string=d},5599:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.removeLeadingDotSegment=r.escape=r.makeAbsolute=r.unixify=void 0;const o=i(1017);const a=2;const l=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;function unixify(t){return t.replace(/\\/g,"/")}r.unixify=unixify;function makeAbsolute(t,r){return o.resolve(t,r)}r.makeAbsolute=makeAbsolute;function escape(t){return t.replace(l,"\\$2")}r.escape=escape;function removeLeadingDotSegment(t){if(t.charAt(0)==="."){const r=t.charAt(1);if(r==="/"||r==="\\"){return t.slice(a)}}return t}r.removeLeadingDotSegment=removeLeadingDotSegment},8184:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.matchAny=r.convertPatternsToRe=r.makeRe=r.getPatternParts=r.expandBraceExpansion=r.expandPatternsWithBraceExpansion=r.isAffectDepthOfReadingPattern=r.endsWithSlashGlobStar=r.hasGlobStar=r.getBaseDirectory=r.isPatternRelatedToParentDirectory=r.getPatternsOutsideCurrentDirectory=r.getPatternsInsideCurrentDirectory=r.getPositivePatterns=r.getNegativePatterns=r.isPositivePattern=r.isNegativePattern=r.convertToNegativePattern=r.convertToPositivePattern=r.isDynamicPattern=r.isStaticPattern=void 0;const o=i(1017);const a=i(8876);const l=i(1888);const c="**";const u="\\";const h=/[*?]|^!/;const d=/\[[^[]*]/;const p=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;const m=/[!*+?@]\([^(]*\)/;const y=/,|\.\./;function isStaticPattern(t,r={}){return!isDynamicPattern(t,r)}r.isStaticPattern=isStaticPattern;function isDynamicPattern(t,r={}){if(t===""){return false}if(r.caseSensitiveMatch===false||t.includes(u)){return true}if(h.test(t)||d.test(t)||p.test(t)){return true}if(r.extglob!==false&&m.test(t)){return true}if(r.braceExpansion!==false&&hasBraceExpansion(t)){return true}return false}r.isDynamicPattern=isDynamicPattern;function hasBraceExpansion(t){const r=t.indexOf("{");if(r===-1){return false}const i=t.indexOf("}",r+1);if(i===-1){return false}const o=t.slice(r,i);return y.test(o)}function convertToPositivePattern(t){return isNegativePattern(t)?t.slice(1):t}r.convertToPositivePattern=convertToPositivePattern;function convertToNegativePattern(t){return"!"+t}r.convertToNegativePattern=convertToNegativePattern;function isNegativePattern(t){return t.startsWith("!")&&t[1]!=="("}r.isNegativePattern=isNegativePattern;function isPositivePattern(t){return!isNegativePattern(t)}r.isPositivePattern=isPositivePattern;function getNegativePatterns(t){return t.filter(isNegativePattern)}r.getNegativePatterns=getNegativePatterns;function getPositivePatterns(t){return t.filter(isPositivePattern)}r.getPositivePatterns=getPositivePatterns;function getPatternsInsideCurrentDirectory(t){return t.filter((t=>!isPatternRelatedToParentDirectory(t)))}r.getPatternsInsideCurrentDirectory=getPatternsInsideCurrentDirectory;function getPatternsOutsideCurrentDirectory(t){return t.filter(isPatternRelatedToParentDirectory)}r.getPatternsOutsideCurrentDirectory=getPatternsOutsideCurrentDirectory;function isPatternRelatedToParentDirectory(t){return t.startsWith("..")||t.startsWith("./..")}r.isPatternRelatedToParentDirectory=isPatternRelatedToParentDirectory;function getBaseDirectory(t){return a(t,{flipBackslashes:false})}r.getBaseDirectory=getBaseDirectory;function hasGlobStar(t){return t.includes(c)}r.hasGlobStar=hasGlobStar;function endsWithSlashGlobStar(t){return t.endsWith("/"+c)}r.endsWithSlashGlobStar=endsWithSlashGlobStar;function isAffectDepthOfReadingPattern(t){const r=o.basename(t);return endsWithSlashGlobStar(t)||isStaticPattern(r)}r.isAffectDepthOfReadingPattern=isAffectDepthOfReadingPattern;function expandPatternsWithBraceExpansion(t){return t.reduce(((t,r)=>t.concat(expandBraceExpansion(r))),[])}r.expandPatternsWithBraceExpansion=expandPatternsWithBraceExpansion;function expandBraceExpansion(t){return l.braces(t,{expand:true,nodupes:true})}r.expandBraceExpansion=expandBraceExpansion;function getPatternParts(t,r){let{parts:i}=l.scan(t,Object.assign(Object.assign({},r),{parts:true}));if(i.length===0){i=[t]}if(i[0].startsWith("/")){i[0]=i[0].slice(1);i.unshift("")}return i}r.getPatternParts=getPatternParts;function makeRe(t,r){return l.makeRe(t,r)}r.makeRe=makeRe;function convertPatternsToRe(t,r){return t.map((t=>makeRe(t,r)))}r.convertPatternsToRe=convertPatternsToRe;function matchAny(t,r){return r.some((r=>r.test(t)))}r.matchAny=matchAny},3666:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.merge=void 0;const o=i(5628);function merge(t){const r=o(t);t.forEach((t=>{t.once("error",(t=>r.emit("error",t)))}));r.once("close",(()=>propagateCloseEventToSources(t)));r.once("end",(()=>propagateCloseEventToSources(t)));return r}r.merge=merge;function propagateCloseEventToSources(t){t.forEach((t=>t.emit("close")))}},2055:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.isEmpty=r.isString=void 0;function isString(t){return typeof t==="string"}r.isString=isString;function isEmpty(t){return t===""}r.isEmpty=isEmpty},9403:(t,r,i)=>{"use strict";var o=i(8509);function fastqueue(t,r,i){if(typeof t==="function"){i=r;r=t;t=null}if(i<1){throw new Error("fastqueue concurrency must be greater than 1")}var a=o(Task);var l=null;var c=null;var u=0;var h=null;var d={push:push,drain:noop,saturated:noop,pause:pause,paused:false,concurrency:i,running:running,resume:resume,idle:idle,length:length,getQueue:getQueue,unshift:unshift,empty:noop,kill:kill,killAndDrain:killAndDrain,error:error};return d;function running(){return u}function pause(){d.paused=true}function length(){var t=l;var r=0;while(t){t=t.next;r++}return r}function getQueue(){var t=l;var r=[];while(t){r.push(t.value);t=t.next}return r}function resume(){if(!d.paused)return;d.paused=false;for(var t=0;t<d.concurrency;t++){u++;release()}}function idle(){return u===0&&d.length()===0}function push(i,o){var p=a.get();p.context=t;p.release=release;p.value=i;p.callback=o||noop;p.errorHandler=h;if(u===d.concurrency||d.paused){if(c){c.next=p;c=p}else{l=p;c=p;d.saturated()}}else{u++;r.call(t,p.value,p.worked)}}function unshift(i,o){var h=a.get();h.context=t;h.release=release;h.value=i;h.callback=o||noop;if(u===d.concurrency||d.paused){if(l){h.next=l;l=h}else{l=h;c=h;d.saturated()}}else{u++;r.call(t,h.value,h.worked)}}function release(i){if(i){a.release(i)}var o=l;if(o){if(!d.paused){if(c===l){c=null}l=o.next;o.next=null;r.call(t,o.value,o.worked);if(c===null){d.empty()}}else{u--}}else if(--u===0){d.drain()}}function kill(){l=null;c=null;d.drain=noop}function killAndDrain(){l=null;c=null;d.drain();d.drain=noop}function error(t){h=t}}function noop(){}function Task(){this.value=null;this.callback=noop;this.next=null;this.release=noop;this.context=null;this.errorHandler=null;var t=this;this.worked=function worked(r,i){var o=t.callback;var a=t.errorHandler;var l=t.value;t.value=null;t.callback=noop;if(t.errorHandler){a(r,l)}o.call(t.context,r,i);t.release(t)}}function queueAsPromised(t,r,i){if(typeof t==="function"){i=r;r=t;t=null}function asyncWrapper(t,i){r.call(this,t).then((function(t){i(null,t)}),i)}var o=fastqueue(t,asyncWrapper,i);var a=o.push;var l=o.unshift;o.push=push;o.unshift=unshift;o.drained=drained;return o;function push(t){var r=new Promise((function(r,i){a(t,(function(t,o){if(t){i(t);return}r(o)}))}));r.catch(noop);return r}function unshift(t){var r=new Promise((function(r,i){l(t,(function(t,o){if(t){i(t);return}r(o)}))}));r.catch(noop);return r}function drained(){var t=o.drain;var r=new Promise((function(r){o.drain=function(){t();r()}}));return r}}t.exports=fastqueue;t.exports.promise=queueAsPromised},6789:(t,r,i)=>{"use strict";
|
|
29
79
|
/*!
|
|
30
80
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
31
81
|
*
|
|
32
82
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
33
83
|
* Licensed under the MIT License.
|
|
34
|
-
*/const o=i(3837);const a=i(211);const isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);const transform=t=>r=>t===true?Number(r):String(r);const isValidValue=t=>typeof t==="number"||typeof t==="string"&&t!=="";const isNumber=t=>Number.isInteger(+t);const zeros=t=>{let r=`${t}`;let i=-1;if(r[0]==="-")r=r.slice(1);if(r==="0")return false;while(r[++i]==="0");return i>0};const stringify=(t,r,i)=>{if(typeof t==="string"||typeof r==="string"){return true}return i.stringify===true};const pad=(t,r,i)=>{if(r>0){let i=t[0]==="-"?"-":"";if(i)t=t.slice(1);t=i+t.padStart(i?r-1:r,"0")}if(i===false){return String(t)}return t};const toMaxLen=(t,r)=>{let i=t[0]==="-"?"-":"";if(i){t=t.slice(1);r--}while(t.length<r)t="0"+t;return i?"-"+t:t};const toSequence=(t,r)=>{t.negatives.sort(((t,r)=>t<r?-1:t>r?1:0));t.positives.sort(((t,r)=>t<r?-1:t>r?1:0));let i=r.capture?"":"?:";let o="";let a="";let c;if(t.positives.length){o=t.positives.join("|")}if(t.negatives.length){a=`-(${i}${t.negatives.join("|")})`}if(o&&a){c=`${o}|${a}`}else{c=o||a}if(r.wrap){return`(${i}${c})`}return c};const toRange=(t,r,i,o)=>{if(i){return a(t,r,{wrap:false,...o})}let c=String.fromCharCode(t);if(t===r)return c;let l=String.fromCharCode(r);return`[${c}-${l}]`};const toRegex=(t,r,i)=>{if(Array.isArray(t)){let r=i.wrap===true;let o=i.capture?"":"?:";return r?`(${o}${t.join("|")})`:t.join("|")}return a(t,r,i)};const rangeError=(...t)=>new RangeError("Invalid range arguments: "+o.inspect(...t));const invalidRange=(t,r,i)=>{if(i.strictRanges===true)throw rangeError([t,r]);return[]};const invalidStep=(t,r)=>{if(r.strictRanges===true){throw new TypeError(`Expected step "${t}" to be a number`)}return[]};const fillNumbers=(t,r,i=1,o={})=>{let a=Number(t);let c=Number(r);if(!Number.isInteger(a)||!Number.isInteger(c)){if(o.strictRanges===true)throw rangeError([t,r]);return[]}if(a===0)a=0;if(c===0)c=0;let l=a>c;let u=String(t);let h=String(r);let d=String(i);i=Math.max(Math.abs(i),1);let p=zeros(u)||zeros(h)||zeros(d);let m=p?Math.max(u.length,h.length,d.length):0;let g=p===false&&stringify(t,r,o)===false;let y=o.transform||transform(g);if(o.toRegex&&i===1){return toRange(toMaxLen(t,m),toMaxLen(r,m),true,o)}let b={negatives:[],positives:[]};let push=t=>b[t<0?"negatives":"positives"].push(Math.abs(t));let v=[];let _=0;while(l?a>=c:a<=c){if(o.toRegex===true&&i>1){push(a)}else{v.push(pad(y(a,_),m,g))}a=l?a-i:a+i;_++}if(o.toRegex===true){return i>1?toSequence(b,o):toRegex(v,null,{wrap:false,...o})}return v};const fillLetters=(t,r,i=1,o={})=>{if(!isNumber(t)&&t.length>1||!isNumber(r)&&r.length>1){return invalidRange(t,r,o)}let a=o.transform||(t=>String.fromCharCode(t));let c=`${t}`.charCodeAt(0);let l=`${r}`.charCodeAt(0);let u=c>l;let h=Math.min(c,l);let d=Math.max(c,l);if(o.toRegex&&i===1){return toRange(h,d,false,o)}let p=[];let m=0;while(u?c>=l:c<=l){p.push(a(c,m));c=u?c-i:c+i;m++}if(o.toRegex===true){return toRegex(p,null,{wrap:false,options:o})}return p};const fill=(t,r,i,o={})=>{if(r==null&&isValidValue(t)){return[t]}if(!isValidValue(t)||!isValidValue(r)){return invalidRange(t,r,o)}if(typeof i==="function"){return fill(t,r,1,{transform:i})}if(isObject(i)){return fill(t,r,0,i)}let a={...o};if(a.capture===true)a.wrap=true;i=i||a.step||1;if(!isNumber(i)){if(i!=null&&!isObject(i))return invalidStep(i,a);return fill(t,r,1,i)}if(isNumber(t)&&isNumber(r)){return fillNumbers(t,r,i,a)}return fillLetters(t,r,Math.max(Math.abs(i),1),a)};t.exports=fill},8829:(t,r,i)=>{"use strict";const o=i(6150);const a=i(2361).EventEmitter;const c=i(7147);let l=c.writev;if(!l){const t=process.binding("fs");const r=t.FSReqWrap||t.FSReqCallback;l=(i,o,a,c)=>{const done=(t,r)=>c(t,r,o);const l=new r;l.oncomplete=done;t.writeBuffers(i,o,a,l)}}const u=Symbol("_autoClose");const h=Symbol("_close");const d=Symbol("_ended");const p=Symbol("_fd");const m=Symbol("_finished");const g=Symbol("_flags");const y=Symbol("_flush");const b=Symbol("_handleChunk");const v=Symbol("_makeBuf");const _=Symbol("_mode");const w=Symbol("_needDrain");const E=Symbol("_onerror");const S=Symbol("_onopen");const O=Symbol("_onread");const R=Symbol("_onwrite");const x=Symbol("_open");const A=Symbol("_path");const T=Symbol("_pos");const k=Symbol("_queue");const C=Symbol("_read");const P=Symbol("_readSize");const I=Symbol("_reading");const L=Symbol("_remain");const N=Symbol("_size");const M=Symbol("_write");const D=Symbol("_writing");const j=Symbol("_defaultFlag");const $=Symbol("_errored");class ReadStream extends o{constructor(t,r){r=r||{};super(r);this.readable=true;this.writable=false;if(typeof t!=="string")throw new TypeError("path must be a string");this[$]=false;this[p]=typeof r.fd==="number"?r.fd:null;this[A]=t;this[P]=r.readSize||16*1024*1024;this[I]=false;this[N]=typeof r.size==="number"?r.size:Infinity;this[L]=this[N];this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;if(typeof this[p]==="number")this[C]();else this[x]()}get fd(){return this[p]}get path(){return this[A]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[x](){c.open(this[A],"r",((t,r)=>this[S](t,r)))}[S](t,r){if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[C]()}}[v](){return Buffer.allocUnsafe(Math.min(this[P],this[L]))}[C](){if(!this[I]){this[I]=true;const t=this[v]();if(t.length===0)return process.nextTick((()=>this[O](null,0,t)));c.read(this[p],t,0,t.length,null,((t,r,i)=>this[O](t,r,i)))}}[O](t,r,i){this[I]=false;if(t)this[E](t);else if(this[b](r,i))this[C]()}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;c.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[E](t){this[I]=true;this[h]();this.emit("error",t)}[b](t,r){let i=false;this[L]-=t;if(t>0)i=super.write(t<r.length?r.slice(0,t):r);if(t===0||this[L]<=0){i=false;this[h]();super.end()}return i}emit(t,r){switch(t){case"prefinish":case"finish":break;case"drain":if(typeof this[p]==="number")this[C]();break;case"error":if(this[$])return;this[$]=true;return super.emit(t,r);default:return super.emit(t,r)}}}class ReadStreamSync extends ReadStream{[x](){let t=true;try{this[S](null,c.openSync(this[A],"r"));t=false}finally{if(t)this[h]()}}[C](){let t=true;try{if(!this[I]){this[I]=true;do{const t=this[v]();const r=t.length===0?0:c.readSync(this[p],t,0,t.length,null);if(!this[b](r,t))break}while(true);this[I]=false}t=false}finally{if(t)this[h]()}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;c.closeSync(t);this.emit("close")}}}class WriteStream extends a{constructor(t,r){r=r||{};super(r);this.readable=false;this.writable=true;this[$]=false;this[D]=false;this[d]=false;this[w]=false;this[k]=[];this[A]=t;this[p]=typeof r.fd==="number"?r.fd:null;this[_]=r.mode===undefined?438:r.mode;this[T]=typeof r.start==="number"?r.start:null;this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;const i=this[T]!==null?"r+":"w";this[j]=r.flags===undefined;this[g]=this[j]?i:r.flags;if(this[p]===null)this[x]()}emit(t,r){if(t==="error"){if(this[$])return;this[$]=true}return super.emit(t,r)}get fd(){return this[p]}get path(){return this[A]}[E](t){this[h]();this[D]=true;this.emit("error",t)}[x](){c.open(this[A],this[g],this[_],((t,r)=>this[S](t,r)))}[S](t,r){if(this[j]&&this[g]==="r+"&&t&&t.code==="ENOENT"){this[g]="w";this[x]()}else if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[y]()}}end(t,r){if(t)this.write(t,r);this[d]=true;if(!this[D]&&!this[k].length&&typeof this[p]==="number")this[R](null,0);return this}write(t,r){if(typeof t==="string")t=Buffer.from(t,r);if(this[d]){this.emit("error",new Error("write() after end()"));return false}if(this[p]===null||this[D]||this[k].length){this[k].push(t);this[w]=true;return false}this[D]=true;this[M](t);return true}[M](t){c.write(this[p],t,0,t.length,this[T],((t,r)=>this[R](t,r)))}[R](t,r){if(t)this[E](t);else{if(this[T]!==null)this[T]+=r;if(this[k].length)this[y]();else{this[D]=false;if(this[d]&&!this[m]){this[m]=true;this[h]();this.emit("finish")}else if(this[w]){this[w]=false;this.emit("drain")}}}}[y](){if(this[k].length===0){if(this[d])this[R](null,0)}else if(this[k].length===1)this[M](this[k].pop());else{const t=this[k];this[k]=[];l(this[p],t,this[T],((t,r)=>this[R](t,r)))}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;c.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[x](){let t;if(this[j]&&this[g]==="r+"){try{t=c.openSync(this[A],this[g],this[_])}catch(t){if(t.code==="ENOENT"){this[g]="w";return this[x]()}else throw t}}else t=c.openSync(this[A],this[g],this[_]);this[S](null,t)}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;c.closeSync(t);this.emit("close")}}[M](t){let r=true;try{this[R](null,c.writeSync(this[p],t,0,t.length,this[T]));r=false}finally{if(r)try{this[h]()}catch(t){}}}}r.ReadStream=ReadStream;r.ReadStreamSync=ReadStreamSync;r.WriteStream=WriteStream;r.WriteStreamSync=WriteStreamSync},4737:(t,r,i)=>{t.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var o=i(7147);var a=o.realpath;var c=o.realpathSync;var l=process.version;var u=/^v[0-5]\./.test(l);var h=i(7613);function newError(t){return t&&t.syscall==="realpath"&&(t.code==="ELOOP"||t.code==="ENOMEM"||t.code==="ENAMETOOLONG")}function realpath(t,r,i){if(u){return a(t,r,i)}if(typeof r==="function"){i=r;r=null}a(t,r,(function(o,a){if(newError(o)){h.realpath(t,r,i)}else{i(o,a)}}))}function realpathSync(t,r){if(u){return c(t,r)}try{return c(t,r)}catch(i){if(newError(i)){return h.realpathSync(t,r)}else{throw i}}}function monkeypatch(){o.realpath=realpath;o.realpathSync=realpathSync}function unmonkeypatch(){o.realpath=a;o.realpathSync=c}},7613:(t,r,i)=>{var o=i(1017);var a=process.platform==="win32";var c=i(7147);var l=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var t;if(l){var r=new Error;t=debugCallback}else t=missingCallback;return t;function debugCallback(t){if(t){r.message=t.message;t=r;missingCallback(t)}}function missingCallback(t){if(t){if(process.throwDeprecation)throw t;else if(!process.noDeprecation){var r="fs: missing callback "+(t.stack||t.message);if(process.traceDeprecation)console.trace(r);else console.error(r)}}}}function maybeCallback(t){return typeof t==="function"?t:rethrow()}var u=o.normalize;if(a){var h=/(.*?)(?:[\/\\]+|$)/g}else{var h=/(.*?)(?:[\/]+|$)/g}if(a){var d=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var d=/^[\/]*/}r.realpathSync=function realpathSync(t,r){t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var i=t,l={},u={};var p;var m;var g;var y;start();function start(){var r=d.exec(t);p=r[0].length;m=r[0];g=r[0];y="";if(a&&!u[g]){c.lstatSync(g);u[g]=true}}while(p<t.length){h.lastIndex=p;var b=h.exec(t);y=m;m+=b[0];g=y+b[1];p=h.lastIndex;if(u[g]||r&&r[g]===g){continue}var v;if(r&&Object.prototype.hasOwnProperty.call(r,g)){v=r[g]}else{var _=c.lstatSync(g);if(!_.isSymbolicLink()){u[g]=true;if(r)r[g]=g;continue}var w=null;if(!a){var E=_.dev.toString(32)+":"+_.ino.toString(32);if(l.hasOwnProperty(E)){w=l[E]}}if(w===null){c.statSync(g);w=c.readlinkSync(g)}v=o.resolve(y,w);if(r)r[g]=v;if(!a)l[E]=w}t=o.resolve(v,t.slice(p));start()}if(r)r[i]=t;return t};r.realpath=function realpath(t,r,i){if(typeof i!=="function"){i=maybeCallback(r);r=null}t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(i.bind(null,null,r[t]))}var l=t,u={},p={};var m;var g;var y;var b;start();function start(){var r=d.exec(t);m=r[0].length;g=r[0];y=r[0];b="";if(a&&!p[y]){c.lstat(y,(function(t){if(t)return i(t);p[y]=true;LOOP()}))}else{process.nextTick(LOOP)}}function LOOP(){if(m>=t.length){if(r)r[l]=t;return i(null,t)}h.lastIndex=m;var o=h.exec(t);b=g;g+=o[0];y=b+o[1];m=h.lastIndex;if(p[y]||r&&r[y]===y){return process.nextTick(LOOP)}if(r&&Object.prototype.hasOwnProperty.call(r,y)){return gotResolvedLink(r[y])}return c.lstat(y,gotStat)}function gotStat(t,o){if(t)return i(t);if(!o.isSymbolicLink()){p[y]=true;if(r)r[y]=y;return process.nextTick(LOOP)}if(!a){var l=o.dev.toString(32)+":"+o.ino.toString(32);if(u.hasOwnProperty(l)){return gotTarget(null,u[l],y)}}c.stat(y,(function(t){if(t)return i(t);c.readlink(y,(function(t,r){if(!a)u[l]=r;gotTarget(t,r)}))}))}function gotTarget(t,a,c){if(t)return i(t);var l=o.resolve(b,a);if(r)r[c]=l;gotResolvedLink(l)}function gotResolvedLink(r){t=o.resolve(r,t.slice(m));start()}}},88:(t,r,i)=>{"use strict";const{PassThrough:o}=i(2781);t.exports=t=>{t={...t};const{array:r}=t;let{encoding:i}=t;const a=i==="buffer";let c=false;if(r){c=!(i||a)}else{i=i||"utf8"}if(a){i=null}const l=new o({objectMode:c});if(i){l.setEncoding(i)}let u=0;const h=[];l.on("data",(t=>{h.push(t);if(c){u=h.length}else{u+=t.length}}));l.getBufferedValue=()=>{if(r){return h}return a?Buffer.concat(h,u):h.join("")};l.getBufferedLength=()=>u;return l}},9580:(t,r,i)=>{"use strict";const{constants:o}=i(4300);const a=i(6405);const c=i(88);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,r){if(!t){return Promise.reject(new Error("Expected a stream"))}r={maxBuffer:Infinity,...r};const{maxBuffer:i}=r;let l;await new Promise(((u,h)=>{const rejectPromise=t=>{if(t&&l.getBufferedLength()<=o.MAX_LENGTH){t.bufferedData=l.getBufferedValue()}h(t)};l=a(t,c(r),(t=>{if(t){rejectPromise(t);return}u()}));l.on("data",(()=>{if(l.getBufferedLength()>i){rejectPromise(new MaxBufferError)}}))}));return l.getBufferedValue()}t.exports=getStream;t.exports["default"]=getStream;t.exports.buffer=(t,r)=>getStream(t,{...r,encoding:"buffer"});t.exports.array=(t,r)=>getStream(t,{...r,array:true});t.exports.MaxBufferError=MaxBufferError},7782:(t,r,i)=>{"use strict";const{PassThrough:o}=i(2781);t.exports=t=>{t={...t};const{array:r}=t;let{encoding:i}=t;const a=i==="buffer";let c=false;if(r){c=!(i||a)}else{i=i||"utf8"}if(a){i=null}const l=new o({objectMode:c});if(i){l.setEncoding(i)}let u=0;const h=[];l.on("data",(t=>{h.push(t);if(c){u=h.length}else{u+=t.length}}));l.getBufferedValue=()=>{if(r){return h}return a?Buffer.concat(h,u):h.join("")};l.getBufferedLength=()=>u;return l}},7981:(t,r,i)=>{"use strict";const{constants:o}=i(4300);const a=i(2781);const{promisify:c}=i(3837);const l=i(7782);const u=c(a.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,r){if(!t){throw new Error("Expected a stream")}r={maxBuffer:Infinity,...r};const{maxBuffer:i}=r;const a=l(r);await new Promise(((r,c)=>{const rejectPromise=t=>{if(t&&a.getBufferedLength()<=o.MAX_LENGTH){t.bufferedData=a.getBufferedValue()}c(t)};(async()=>{try{await u(t,a);r()}catch(t){rejectPromise(t)}})();a.on("data",(()=>{if(a.getBufferedLength()>i){rejectPromise(new MaxBufferError)}}))}));return a.getBufferedValue()}t.exports=getStream;t.exports.buffer=(t,r)=>getStream(t,{...r,encoding:"buffer"});t.exports.array=(t,r)=>getStream(t,{...r,array:true});t.exports.MaxBufferError=MaxBufferError},5976:(t,r,i)=>{"use strict";var o=i(6654);var a=i(1017).posix.dirname;var c=i(2037).platform()==="win32";var l="/";var u=/\\/g;var h=/[\{\[].*[\}\]]$/;var d=/(^|[^\\])([\{\[]|\([^\)]+$)/;var p=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function globParent(t,r){var i=Object.assign({flipBackslashes:true},r);if(i.flipBackslashes&&c&&t.indexOf(l)<0){t=t.replace(u,l)}if(h.test(t)){t+=l}t+="a";do{t=a(t)}while(o(t)||d.test(t));return t.replace(p,"$1")}},8875:(t,r,i)=>{r.setopts=setopts;r.ownProp=ownProp;r.makeAbs=makeAbs;r.finish=finish;r.mark=mark;r.isIgnored=isIgnored;r.childrenIgnored=childrenIgnored;function ownProp(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var o=i(7147);var a=i(1017);var c=i(4235);var l=i(4249);var u=c.Minimatch;function alphasort(t,r){return t.localeCompare(r,"en")}function setupIgnores(t,r){t.ignore=r.ignore||[];if(!Array.isArray(t.ignore))t.ignore=[t.ignore];if(t.ignore.length){t.ignore=t.ignore.map(ignoreMap)}}function ignoreMap(t){var r=null;if(t.slice(-3)==="/**"){var i=t.replace(/(\/\*\*)+$/,"");r=new u(i,{dot:true})}return{matcher:new u(t,{dot:true}),gmatcher:r}}function setopts(t,r,i){if(!i)i={};if(i.matchBase&&-1===r.indexOf("/")){if(i.noglobstar){throw new Error("base matching requires globstar")}r="**/"+r}t.silent=!!i.silent;t.pattern=r;t.strict=i.strict!==false;t.realpath=!!i.realpath;t.realpathCache=i.realpathCache||Object.create(null);t.follow=!!i.follow;t.dot=!!i.dot;t.mark=!!i.mark;t.nodir=!!i.nodir;if(t.nodir)t.mark=true;t.sync=!!i.sync;t.nounique=!!i.nounique;t.nonull=!!i.nonull;t.nosort=!!i.nosort;t.nocase=!!i.nocase;t.stat=!!i.stat;t.noprocess=!!i.noprocess;t.absolute=!!i.absolute;t.fs=i.fs||o;t.maxLength=i.maxLength||Infinity;t.cache=i.cache||Object.create(null);t.statCache=i.statCache||Object.create(null);t.symlinks=i.symlinks||Object.create(null);setupIgnores(t,i);t.changedCwd=false;var c=process.cwd();if(!ownProp(i,"cwd"))t.cwd=c;else{t.cwd=a.resolve(i.cwd);t.changedCwd=t.cwd!==c}t.root=i.root||a.resolve(t.cwd,"/");t.root=a.resolve(t.root);if(process.platform==="win32")t.root=t.root.replace(/\\/g,"/");t.cwdAbs=l(t.cwd)?t.cwd:makeAbs(t,t.cwd);if(process.platform==="win32")t.cwdAbs=t.cwdAbs.replace(/\\/g,"/");t.nomount=!!i.nomount;i.nonegate=true;i.nocomment=true;t.minimatch=new u(r,i);t.options=t.minimatch.options}function finish(t){var r=t.nounique;var i=r?[]:Object.create(null);for(var o=0,a=t.matches.length;o<a;o++){var c=t.matches[o];if(!c||Object.keys(c).length===0){if(t.nonull){var l=t.minimatch.globSet[o];if(r)i.push(l);else i[l]=true}}else{var u=Object.keys(c);if(r)i.push.apply(i,u);else u.forEach((function(t){i[t]=true}))}}if(!r)i=Object.keys(i);if(!t.nosort)i=i.sort(alphasort);if(t.mark){for(var o=0;o<i.length;o++){i[o]=t._mark(i[o])}if(t.nodir){i=i.filter((function(r){var i=!/\/$/.test(r);var o=t.cache[r]||t.cache[makeAbs(t,r)];if(i&&o)i=o!=="DIR"&&!Array.isArray(o);return i}))}}if(t.ignore.length)i=i.filter((function(r){return!isIgnored(t,r)}));t.found=i}function mark(t,r){var i=makeAbs(t,r);var o=t.cache[i];var a=r;if(o){var c=o==="DIR"||Array.isArray(o);var l=r.slice(-1)==="/";if(c&&!l)a+="/";else if(!c&&l)a=a.slice(0,-1);if(a!==r){var u=makeAbs(t,a);t.statCache[u]=t.statCache[i];t.cache[u]=t.cache[i]}}return a}function makeAbs(t,r){var i=r;if(r.charAt(0)==="/"){i=a.join(t.root,r)}else if(l(r)||r===""){i=r}else if(t.changedCwd){i=a.resolve(t.cwd,r)}else{i=a.resolve(r)}if(process.platform==="win32")i=i.replace(/\\/g,"/");return i}function isIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return t.matcher.match(r)||!!(t.gmatcher&&t.gmatcher.match(r))}))}function childrenIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return!!(t.gmatcher&&t.gmatcher.match(r))}))}},1978:(t,r,i)=>{t.exports=glob;var o=i(4737);var a=i(4235);var c=a.Minimatch;var l=i(6315);var u=i(2361).EventEmitter;var h=i(1017);var d=i(9491);var p=i(4249);var m=i(8019);var g=i(8875);var y=g.setopts;var b=g.ownProp;var v=i(6900);var _=i(3837);var w=g.childrenIgnored;var E=g.isIgnored;var S=i(4556);function glob(t,r,i){if(typeof r==="function")i=r,r={};if(!r)r={};if(r.sync){if(i)throw new TypeError("callback provided to sync glob");return m(t,r)}return new Glob(t,r,i)}glob.sync=m;var O=glob.GlobSync=m.GlobSync;glob.glob=glob;function extend(t,r){if(r===null||typeof r!=="object"){return t}var i=Object.keys(r);var o=i.length;while(o--){t[i[o]]=r[i[o]]}return t}glob.hasMagic=function(t,r){var i=extend({},r);i.noprocess=true;var o=new Glob(t,i);var a=o.minimatch.set;if(!t)return false;if(a.length>1)return true;for(var c=0;c<a[0].length;c++){if(typeof a[0][c]!=="string")return true}return false};glob.Glob=Glob;l(Glob,u);function Glob(t,r,i){if(typeof r==="function"){i=r;r=null}if(r&&r.sync){if(i)throw new TypeError("callback provided to sync glob");return new O(t,r)}if(!(this instanceof Glob))return new Glob(t,r,i);y(this,t,r);this._didRealPath=false;var o=this.minimatch.set.length;this.matches=new Array(o);if(typeof i==="function"){i=S(i);this.on("error",i);this.on("end",(function(t){i(null,t)}))}var a=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(o===0)return done();var c=true;for(var l=0;l<o;l++){this._process(this.minimatch.set[l],l,false,done)}c=false;function done(){--a._processing;if(a._processing<=0){if(c){process.nextTick((function(){a._finish()}))}else{a._finish()}}}}Glob.prototype._finish=function(){d(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();g.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var t=this.matches.length;if(t===0)return this._finish();var r=this;for(var i=0;i<this.matches.length;i++)this._realpathSet(i,next);function next(){if(--t===0)r._finish()}};Glob.prototype._realpathSet=function(t,r){var i=this.matches[t];if(!i)return r();var a=Object.keys(i);var c=this;var l=a.length;if(l===0)return r();var u=this.matches[t]=Object.create(null);a.forEach((function(i,a){i=c._makeAbs(i);o.realpath(i,c.realpathCache,(function(o,a){if(!o)u[a]=true;else if(o.syscall==="stat")u[i]=true;else c.emit("error",o);if(--l===0){c.matches[t]=u;r()}}))}))};Glob.prototype._mark=function(t){return g.mark(this,t)};Glob.prototype._makeAbs=function(t){return g.makeAbs(this,t)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var r=0;r<t.length;r++){var i=t[r];this._emitMatch(i[0],i[1])}}if(this._processQueue.length){var o=this._processQueue.slice(0);this._processQueue.length=0;for(var r=0;r<o.length;r++){var a=o[r];this._processing--;this._process(a[0],a[1],a[2],a[3])}}}};Glob.prototype._process=function(t,r,i,o){d(this instanceof Glob);d(typeof o==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([t,r,i,o]);return}var c=0;while(typeof t[c]==="string"){c++}var l;switch(c){case t.length:this._processSimple(t.join("/"),r,o);return;case 0:l=null;break;default:l=t.slice(0,c).join("/");break}var u=t.slice(c);var h;if(l===null)h=".";else if(p(l)||p(t.join("/"))){if(!l||!p(l))l="/"+l;h=l}else h=l;var m=this._makeAbs(h);if(w(this,h))return o();var g=u[0]===a.GLOBSTAR;if(g)this._processGlobStar(l,h,m,u,r,i,o);else this._processReaddir(l,h,m,u,r,i,o)};Glob.prototype._processReaddir=function(t,r,i,o,a,c,l){var u=this;this._readdir(i,c,(function(h,d){return u._processReaddir2(t,r,i,o,a,c,d,l)}))};Glob.prototype._processReaddir2=function(t,r,i,o,a,c,l,u){if(!l)return u();var d=o[0];var p=!!this.minimatch.negate;var m=d._glob;var g=this.dot||m.charAt(0)===".";var y=[];for(var b=0;b<l.length;b++){var v=l[b];if(v.charAt(0)!=="."||g){var _;if(p&&!t){_=!v.match(d)}else{_=v.match(d)}if(_)y.push(v)}}var w=y.length;if(w===0)return u();if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var b=0;b<w;b++){var v=y[b];if(t){if(t!=="/")v=t+"/"+v;else v=t+v}if(v.charAt(0)==="/"&&!this.nomount){v=h.join(this.root,v)}this._emitMatch(a,v)}return u()}o.shift();for(var b=0;b<w;b++){var v=y[b];var E;if(t){if(t!=="/")v=t+"/"+v;else v=t+v}this._process([v].concat(o),a,c,u)}u()};Glob.prototype._emitMatch=function(t,r){if(this.aborted)return;if(E(this,r))return;if(this.paused){this._emitQueue.push([t,r]);return}var i=p(r)?r:this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute)r=i;if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;var a=this.statCache[i];if(a)this.emit("stat",r,a);this.emit("match",r)};Glob.prototype._readdirInGlobStar=function(t,r){if(this.aborted)return;if(this.follow)return this._readdir(t,false,r);var i="lstat\0"+t;var o=this;var a=v(i,lstatcb_);if(a)o.fs.lstat(t,a);function lstatcb_(i,a){if(i&&i.code==="ENOENT")return r();var c=a&&a.isSymbolicLink();o.symlinks[t]=c;if(!c&&a&&!a.isDirectory()){o.cache[t]="FILE";r()}else o._readdir(t,false,r)}};Glob.prototype._readdir=function(t,r,i){if(this.aborted)return;i=v("readdir\0"+t+"\0"+r,i);if(!i)return;if(r&&!b(this.symlinks,t))return this._readdirInGlobStar(t,i);if(b(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return i();if(Array.isArray(o))return i(null,o)}var a=this;a.fs.readdir(t,readdirCb(this,t,i))};function readdirCb(t,r,i){return function(o,a){if(o)t._readdirError(r,o,i);else t._readdirEntries(r,a,i)}}Glob.prototype._readdirEntries=function(t,r,i){if(this.aborted)return;if(!this.mark&&!this.stat){for(var o=0;o<r.length;o++){var a=r[o];if(t==="/")a=t+a;else a=t+"/"+a;this.cache[a]=true}}this.cache[t]=r;return i(null,r)};Glob.prototype._readdirError=function(t,r,i){if(this.aborted)return;switch(r.code){case"ENOTSUP":case"ENOTDIR":var o=this._makeAbs(t);this.cache[o]="FILE";if(o===this.cwdAbs){var a=new Error(r.code+" invalid cwd "+this.cwd);a.path=this.cwd;a.code=r.code;this.emit("error",a);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict){this.emit("error",r);this.abort()}if(!this.silent)console.error("glob error",r);break}return i()};Glob.prototype._processGlobStar=function(t,r,i,o,a,c,l){var u=this;this._readdir(i,c,(function(h,d){u._processGlobStar2(t,r,i,o,a,c,d,l)}))};Glob.prototype._processGlobStar2=function(t,r,i,o,a,c,l,u){if(!l)return u();var h=o.slice(1);var d=t?[t]:[];var p=d.concat(h);this._process(p,a,false,u);var m=this.symlinks[i];var g=l.length;if(m&&c)return u();for(var y=0;y<g;y++){var b=l[y];if(b.charAt(0)==="."&&!this.dot)continue;var v=d.concat(l[y],h);this._process(v,a,true,u);var _=d.concat(l[y],o);this._process(_,a,true,u)}u()};Glob.prototype._processSimple=function(t,r,i){var o=this;this._stat(t,(function(a,c){o._processSimple2(t,r,a,c,i)}))};Glob.prototype._processSimple2=function(t,r,i,o,a){if(!this.matches[r])this.matches[r]=Object.create(null);if(!o)return a();if(t&&p(t)&&!this.nomount){var c=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(c)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t);a()};Glob.prototype._stat=function(t,r){var i=this._makeAbs(t);var o=t.slice(-1)==="/";if(t.length>this.maxLength)return r();if(!this.stat&&b(this.cache,i)){var a=this.cache[i];if(Array.isArray(a))a="DIR";if(!o||a==="DIR")return r(null,a);if(o&&a==="FILE")return r()}var c;var l=this.statCache[i];if(l!==undefined){if(l===false)return r(null,l);else{var u=l.isDirectory()?"DIR":"FILE";if(o&&u==="FILE")return r();else return r(null,u,l)}}var h=this;var d=v("stat\0"+i,lstatcb_);if(d)h.fs.lstat(i,d);function lstatcb_(o,a){if(a&&a.isSymbolicLink()){return h.fs.stat(i,(function(o,c){if(o)h._stat2(t,i,null,a,r);else h._stat2(t,i,o,c,r)}))}else{h._stat2(t,i,o,a,r)}}};Glob.prototype._stat2=function(t,r,i,o,a){if(i&&(i.code==="ENOENT"||i.code==="ENOTDIR")){this.statCache[r]=false;return a()}var c=t.slice(-1)==="/";this.statCache[r]=o;if(r.slice(-1)==="/"&&o&&!o.isDirectory())return a(null,false,o);var l=true;if(o)l=o.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||l;if(c&&l==="FILE")return a();return a(null,l,o)}},8019:(t,r,i)=>{t.exports=globSync;globSync.GlobSync=GlobSync;var o=i(4737);var a=i(4235);var c=a.Minimatch;var l=i(1978).Glob;var u=i(3837);var h=i(1017);var d=i(9491);var p=i(4249);var m=i(8875);var g=m.setopts;var y=m.ownProp;var b=m.childrenIgnored;var v=m.isIgnored;function globSync(t,r){if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(t,r).found}function GlobSync(t,r){if(!t)throw new Error("must provide pattern");if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(t,r);g(this,t,r);if(this.noprocess)return this;var i=this.minimatch.set.length;this.matches=new Array(i);for(var o=0;o<i;o++){this._process(this.minimatch.set[o],o,false)}this._finish()}GlobSync.prototype._finish=function(){d(this instanceof GlobSync);if(this.realpath){var t=this;this.matches.forEach((function(r,i){var a=t.matches[i]=Object.create(null);for(var c in r){try{c=t._makeAbs(c);var l=o.realpathSync(c,t.realpathCache);a[l]=true}catch(r){if(r.syscall==="stat")a[t._makeAbs(c)]=true;else throw r}}}))}m.finish(this)};GlobSync.prototype._process=function(t,r,i){d(this instanceof GlobSync);var o=0;while(typeof t[o]==="string"){o++}var c;switch(o){case t.length:this._processSimple(t.join("/"),r);return;case 0:c=null;break;default:c=t.slice(0,o).join("/");break}var l=t.slice(o);var u;if(c===null)u=".";else if(p(c)||p(t.join("/"))){if(!c||!p(c))c="/"+c;u=c}else u=c;var h=this._makeAbs(u);if(b(this,u))return;var m=l[0]===a.GLOBSTAR;if(m)this._processGlobStar(c,u,h,l,r,i);else this._processReaddir(c,u,h,l,r,i)};GlobSync.prototype._processReaddir=function(t,r,i,o,a,c){var l=this._readdir(i,c);if(!l)return;var u=o[0];var d=!!this.minimatch.negate;var p=u._glob;var m=this.dot||p.charAt(0)===".";var g=[];for(var y=0;y<l.length;y++){var b=l[y];if(b.charAt(0)!=="."||m){var v;if(d&&!t){v=!b.match(u)}else{v=b.match(u)}if(v)g.push(b)}}var _=g.length;if(_===0)return;if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var y=0;y<_;y++){var b=g[y];if(t){if(t.slice(-1)!=="/")b=t+"/"+b;else b=t+b}if(b.charAt(0)==="/"&&!this.nomount){b=h.join(this.root,b)}this._emitMatch(a,b)}return}o.shift();for(var y=0;y<_;y++){var b=g[y];var w;if(t)w=[t,b];else w=[b];this._process(w.concat(o),a,c)}};GlobSync.prototype._emitMatch=function(t,r){if(v(this,r))return;var i=this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute){r=i}if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;if(this.stat)this._stat(r)};GlobSync.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,false);var r;var i;var o;try{i=this.fs.lstatSync(t)}catch(t){if(t.code==="ENOENT"){return null}}var a=i&&i.isSymbolicLink();this.symlinks[t]=a;if(!a&&i&&!i.isDirectory())this.cache[t]="FILE";else r=this._readdir(t,false);return r};GlobSync.prototype._readdir=function(t,r){var i;if(r&&!y(this.symlinks,t))return this._readdirInGlobStar(t);if(y(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return null;if(Array.isArray(o))return o}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(r){this._readdirError(t,r);return null}};GlobSync.prototype._readdirEntries=function(t,r){if(!this.mark&&!this.stat){for(var i=0;i<r.length;i++){var o=r[i];if(t==="/")o=t+o;else o=t+"/"+o;this.cache[o]=true}}this.cache[t]=r;return r};GlobSync.prototype._readdirError=function(t,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);this.cache[i]="FILE";if(i===this.cwdAbs){var o=new Error(r.code+" invalid cwd "+this.cwd);o.path=this.cwd;o.code=r.code;throw o}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict)throw r;if(!this.silent)console.error("glob error",r);break}};GlobSync.prototype._processGlobStar=function(t,r,i,o,a,c){var l=this._readdir(i,c);if(!l)return;var u=o.slice(1);var h=t?[t]:[];var d=h.concat(u);this._process(d,a,false);var p=l.length;var m=this.symlinks[i];if(m&&c)return;for(var g=0;g<p;g++){var y=l[g];if(y.charAt(0)==="."&&!this.dot)continue;var b=h.concat(l[g],u);this._process(b,a,true);var v=h.concat(l[g],o);this._process(v,a,true)}};GlobSync.prototype._processSimple=function(t,r){var i=this._stat(t);if(!this.matches[r])this.matches[r]=Object.create(null);if(!i)return;if(t&&p(t)&&!this.nomount){var o=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(o)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t)};GlobSync.prototype._stat=function(t){var r=this._makeAbs(t);var i=t.slice(-1)==="/";if(t.length>this.maxLength)return false;if(!this.stat&&y(this.cache,r)){var o=this.cache[r];if(Array.isArray(o))o="DIR";if(!i||o==="DIR")return o;if(i&&o==="FILE")return false}var a;var c=this.statCache[r];if(!c){var l;try{l=this.fs.lstatSync(r)}catch(t){if(t&&(t.code==="ENOENT"||t.code==="ENOTDIR")){this.statCache[r]=false;return false}}if(l&&l.isSymbolicLink()){try{c=this.fs.statSync(r)}catch(t){c=l}}else{c=l}}this.statCache[r]=c;var o=true;if(c)o=c.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||o;if(i&&o==="FILE")return false;return o};GlobSync.prototype._mark=function(t){return m.mark(this,t)};GlobSync.prototype._makeAbs=function(t){return m.makeAbs(this,t)}},6395:t=>{"use strict";t.exports=clone;var r=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:r(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))}));return i}},6284:(t,r,i)=>{var o=i(7147);var a=i(4371);var c=i(2457);var l=i(6395);var u=i(3837);var h;var d;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){h=Symbol.for("graceful-fs.queue");d=Symbol.for("graceful-fs.previous")}else{h="___graceful-fs.queue";d="___graceful-fs.previous"}function noop(){}function publishQueue(t,r){Object.defineProperty(t,h,{get:function(){return r}})}var p=noop;if(u.debuglog)p=u.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var t=u.format.apply(u,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!o[h]){var m=global[h]||[];publishQueue(o,m);o.close=function(t){function close(r,i){return t.call(o,r,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,d,{value:t});return close}(o.close);o.closeSync=function(t){function closeSync(r){t.apply(o,arguments);resetQueue()}Object.defineProperty(closeSync,d,{value:t});return closeSync}(o.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(o[h]);i(9491).equal(o[h].length,0)}))}}if(!global[h]){publishQueue(global,o[h])}t.exports=patch(l(o));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched){t.exports=patch(o);o.__patched=true}function patch(t){a(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var r=t.readFile;t.readFile=readFile;function readFile(t,i,o){if(typeof i==="function")o=i,i=null;return go$readFile(t,i,o);function go$readFile(t,i,o,a){return r(t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$readFile,[t,i,o],r,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,r,o,a){if(typeof o==="function")a=o,o=null;return go$writeFile(t,r,o,a);function go$writeFile(t,r,o,a,c){return i(t,r,o,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,r,o,a],i,c||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var o=t.appendFile;if(o)t.appendFile=appendFile;function appendFile(t,r,i,a){if(typeof i==="function")a=i,i=null;return go$appendFile(t,r,i,a);function go$appendFile(t,r,i,a,c){return o(t,r,i,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$appendFile,[t,r,i,a],o,c||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var l=t.copyFile;if(l)t.copyFile=copyFile;function copyFile(t,r,i,o){if(typeof i==="function"){o=i;i=0}return go$copyFile(t,r,i,o);function go$copyFile(t,r,i,o,a){return l(t,r,i,(function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$copyFile,[t,r,i,o],c,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=t.readdir;t.readdir=readdir;function readdir(t,r,i){if(typeof r==="function")i=r,r=null;return go$readdir(t,r,i);function go$readdir(t,r,i,o){return u(t,r,(function(a,c){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$readdir,[t,r,i],a,o||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof i==="function")i.call(this,a,c)}}))}}if(process.version.substr(0,4)==="v0.8"){var h=c(t);ReadStream=h.ReadStream;WriteStream=h.WriteStream}var d=t.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var p=t.WriteStream;if(p){WriteStream.prototype=Object.create(p.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var m=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(t){m=t},enumerable:true,configurable:true});var g=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(t){g=t},enumerable:true,configurable:true});function ReadStream(t,r){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){if(t.autoClose)t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,r){if(this instanceof WriteStream)return p.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(r,i){return new t.ReadStream(r,i)}function createWriteStream(r,i){return new t.WriteStream(r,i)}var y=t.open;t.open=open;function open(t,r,i,o){if(typeof i==="function")o=i,i=null;return go$open(t,r,i,o);function go$open(t,r,i,o,a){return y(t,r,i,(function(c,l){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$open,[t,r,i,o],c,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}return t}function enqueue(t){p("ENQUEUE",t[0].name,t[1]);o[h].push(t);retry()}var g;function resetQueue(){var t=Date.now();for(var r=0;r<o[h].length;++r){if(o[h][r].length>2){o[h][r][3]=t;o[h][r][4]=t}}retry()}function retry(){clearTimeout(g);g=undefined;if(o[h].length===0)return;var t=o[h].shift();var r=t[0];var i=t[1];var a=t[2];var c=t[3];var l=t[4];if(c===undefined){p("RETRY",r.name,i);r.apply(null,i)}else if(Date.now()-c>=6e4){p("TIMEOUT",r.name,i);var u=i.pop();if(typeof u==="function")u.call(null,a)}else{var d=Date.now()-l;var m=Math.max(l-c,1);var y=Math.min(m*1.2,100);if(d>=y){p("RETRY",r.name,i);r.apply(null,i.concat([c]))}else{o[h].push(t)}}if(g===undefined){g=setTimeout(retry,0)}}},2457:(t,r,i)=>{var o=i(2781).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(r,i){if(!(this instanceof ReadStream))return new ReadStream(r,i);o.call(this);var a=this;this.path=r;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var c=Object.keys(i);for(var l=0,u=c.length;l<u;l++){var h=c[l];this[h]=i[h]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){a._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,r){if(t){a.emit("error",t);a.readable=false;return}a.fd=r;a.emit("open",r);a._read()}))}function WriteStream(r,i){if(!(this instanceof WriteStream))return new WriteStream(r,i);o.call(this);this.path=r;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var a=Object.keys(i);for(var c=0,l=a.length;c<l;c++){var u=a[c];this[u]=i[u]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},4371:(t,r,i)=>{var o=i(2057);var a=process.cwd;var c=null;var l=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!c)c=a.call(process);return c};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var u=process.chdir;process.chdir=function(t){c=null;u.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,u)}t.exports=patch;function patch(t){if(o.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(!t.lchmod){t.lchmod=function(t,r,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(!t.lchown){t.lchown=function(t,r,i,o){if(o)process.nextTick(o)};t.lchownSync=function(){}}if(l==="win32"){t.rename=function(r){return function(i,o,a){var c=Date.now();var l=0;r(i,o,(function CB(u){if(u&&(u.code==="EACCES"||u.code==="EPERM")&&Date.now()-c<6e4){setTimeout((function(){t.stat(o,(function(t,c){if(t&&t.code==="ENOENT")r(i,o,CB);else a(u)}))}),l);if(l<100)l+=10;return}if(a)a(u)}))}}(t.rename)}t.read=function(r){function read(i,o,a,c,l,u){var h;if(u&&typeof u==="function"){var d=0;h=function(p,m,g){if(p&&p.code==="EAGAIN"&&d<10){d++;return r.call(t,i,o,a,c,l,h)}u.apply(this,arguments)}}return r.call(t,i,o,a,c,l,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,r);return read}(t.read);t.readSync=function(r){return function(i,o,a,c,l){var u=0;while(true){try{return r.call(t,i,o,a,c,l)}catch(t){if(t.code==="EAGAIN"&&u<10){u++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(r,i,a){t.open(r,o.O_WRONLY|o.O_SYMLINK,i,(function(r,o){if(r){if(a)a(r);return}t.fchmod(o,i,(function(r){t.close(o,(function(t){if(a)a(r||t)}))}))}))};t.lchmodSync=function(r,i){var a=t.openSync(r,o.O_WRONLY|o.O_SYMLINK,i);var c=true;var l;try{l=t.fchmodSync(a,i);c=false}finally{if(c){try{t.closeSync(a)}catch(t){}}else{t.closeSync(a)}}return l}}function patchLutimes(t){if(o.hasOwnProperty("O_SYMLINK")){t.lutimes=function(r,i,a,c){t.open(r,o.O_SYMLINK,(function(r,o){if(r){if(c)c(r);return}t.futimes(o,i,a,(function(r){t.close(o,(function(t){if(c)c(r||t)}))}))}))};t.lutimesSync=function(r,i,a){var c=t.openSync(r,o.O_SYMLINK);var l;var u=true;try{l=t.futimesSync(c,i,a);u=false}finally{if(u){try{t.closeSync(c)}catch(t){}}else{t.closeSync(c)}}return l}}else{t.lutimes=function(t,r,i,o){if(o)process.nextTick(o)};t.lutimesSync=function(){}}}function chmodFix(r){if(!r)return r;return function(i,o,a){return r.call(t,i,o,(function(t){if(chownErOk(t))t=null;if(a)a.apply(this,arguments)}))}}function chmodFixSync(r){if(!r)return r;return function(i,o){try{return r.call(t,i,o)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(r){if(!r)return r;return function(i,o,a,c){return r.call(t,i,o,a,(function(t){if(chownErOk(t))t=null;if(c)c.apply(this,arguments)}))}}function chownFixSync(r){if(!r)return r;return function(i,o,a){try{return r.call(t,i,o,a)}catch(t){if(!chownErOk(t))throw t}}}function statFix(r){if(!r)return r;return function(i,o,a){if(typeof o==="function"){a=o;o=null}function callback(t,r){if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}if(a)a.apply(this,arguments)}return o?r.call(t,i,o,callback):r.call(t,i,callback)}}function statFixSync(r){if(!r)return r;return function(i,o){var a=o?r.call(t,i,o):r.call(t,i);if(a){if(a.uid<0)a.uid+=4294967296;if(a.gid<0)a.gid+=4294967296}return a}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var r=!process.getuid||process.getuid()!==0;if(r){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},3485:t=>{"use strict";const r=new Set([200,203,204,206,300,301,404,405,410,414,501]);const i=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]);const o=new Set([500,502,503,504]);const a={date:true,connection:true,"keep-alive":true,"proxy-authenticate":true,"proxy-authorization":true,te:true,trailer:true,"transfer-encoding":true,upgrade:true};const c={"content-length":true,"content-encoding":true,"transfer-encoding":true,"content-range":true};function toNumberOrZero(t){const r=parseInt(t,10);return isFinite(r)?r:0}function isErrorResponse(t){if(!t){return true}return o.has(t.status)}function parseCacheControl(t){const r={};if(!t)return r;const i=t.trim().split(/\s*,\s*/);for(const t of i){const[i,o]=t.split(/\s*=\s*/,2);r[i]=o===undefined?true:o.replace(/^"|"$/g,"")}return r}function formatCacheControl(t){let r=[];for(const i in t){const o=t[i];r.push(o===true?i:i+"="+o)}if(!r.length){return undefined}return r.join(", ")}t.exports=class CachePolicy{constructor(t,r,{shared:i,cacheHeuristic:o,immutableMinTimeToLive:a,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers){throw Error("Response headers missing")}this._assertRequestHasHeaders(t);this._responseTime=this.now();this._isShared=i!==false;this._cacheHeuristic=undefined!==o?o:.1;this._immutableMinTtl=undefined!==a?a:24*3600*1e3;this._status="status"in r?r.status:200;this._resHeaders=r.headers;this._rescc=parseCacheControl(r.headers["cache-control"]);this._method="method"in t?t.method:"GET";this._url=t.url;this._host=t.headers.host;this._noAuthorization=!t.headers.authorization;this._reqHeaders=r.headers.vary?t.headers:null;this._reqcc=parseCacheControl(t.headers["cache-control"]);if(c&&"pre-check"in this._rescc&&"post-check"in this._rescc){delete this._rescc["pre-check"];delete this._rescc["post-check"];delete this._rescc["no-cache"];delete this._rescc["no-store"];delete this._rescc["must-revalidate"];this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":formatCacheControl(this._rescc)});delete this._resHeaders.expires;delete this._resHeaders.pragma}if(r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)){this._rescc["no-cache"]=true}}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())&&i.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(t){if(!t||!t.headers){throw Error("Request headers missing")}}satisfiesWithoutRevalidation(t){this._assertRequestHasHeaders(t);const r=parseCacheControl(t.headers["cache-control"]);if(r["no-cache"]||/no-cache/.test(t.headers.pragma)){return false}if(r["max-age"]&&this.age()>r["max-age"]){return false}if(r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]){return false}if(this.stale()){const t=r["max-stale"]&&!this._rescc["must-revalidate"]&&(true===r["max-stale"]||r["max-stale"]>this.age()-this.maxAge());if(!t){return false}}return this._requestMatches(t,false)}_requestMatches(t,r){return(!this._url||this._url===t.url)&&this._host===t.headers.host&&(!t.method||this._method===t.method||r&&"HEAD"===t.method)&&this._varyMatches(t)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(t){if(!this._resHeaders.vary){return true}if(this._resHeaders.vary==="*"){return false}const r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const i of r){if(t.headers[i]!==this._reqHeaders[i])return false}return true}_copyWithoutHopByHopHeaders(t){const r={};for(const i in t){if(a[i])continue;r[i]=t[i]}if(t.connection){const i=t.connection.trim().split(/\s*,\s*/);for(const t of i){delete r[t]}}if(r.warning){const t=r.warning.split(/,/).filter((t=>!/^\s*1[0-9][0-9]/.test(t)));if(!t.length){delete r.warning}else{r.warning=t.join(",").trim()}}return r}responseHeaders(){const t=this._copyWithoutHopByHopHeaders(this._resHeaders);const r=this.age();if(r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24){t.warning=(t.warning?`${t.warning}, `:"")+'113 - "rfc7234 5.5.4"'}t.age=`${Math.round(r)}`;t.date=new Date(this.now()).toUTCString();return t}date(){const t=Date.parse(this._resHeaders.date);if(isFinite(t)){return t}return this._responseTime}age(){let t=this._ageValue();const r=(this.now()-this._responseTime)/1e3;return t+r}_ageValue(){return toNumberOrZero(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]){return 0}if(this._isShared&&(this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)){return 0}if(this._resHeaders.vary==="*"){return 0}if(this._isShared){if(this._rescc["proxy-revalidate"]){return 0}if(this._rescc["s-maxage"]){return toNumberOrZero(this._rescc["s-maxage"])}}if(this._rescc["max-age"]){return toNumberOrZero(this._rescc["max-age"])}const t=this._rescc.immutable?this._immutableMinTtl:0;const r=this.date();if(this._resHeaders.expires){const i=Date.parse(this._resHeaders.expires);if(Number.isNaN(i)||i<r){return 0}return Math.max(t,(i-r)/1e3)}if(this._resHeaders["last-modified"]){const i=Date.parse(this._resHeaders["last-modified"]);if(isFinite(i)&&r>i){return Math.max(t,(r-i)/1e3*this._cacheHeuristic)}}return t}timeToLive(){const t=this.maxAge()-this.age();const r=t+toNumberOrZero(this._rescc["stale-if-error"]);const i=t+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,t,r,i)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(t){return new this(undefined,undefined,{_fromObject:t})}_fromObject(t){if(this._responseTime)throw Error("Reinitialized");if(!t||t.v!==1)throw Error("Invalid serialization");this._responseTime=t.t;this._isShared=t.sh;this._cacheHeuristic=t.ch;this._immutableMinTtl=t.imm!==undefined?t.imm:24*3600*1e3;this._status=t.st;this._resHeaders=t.resh;this._rescc=t.rescc;this._method=t.m;this._url=t.u;this._host=t.h;this._noAuthorization=t.a;this._reqHeaders=t.reqh;this._reqcc=t.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(t){this._assertRequestHasHeaders(t);const r=this._copyWithoutHopByHopHeaders(t.headers);delete r["if-range"];if(!this._requestMatches(t,true)||!this.storable()){delete r["if-none-match"];delete r["if-modified-since"];return r}if(this._resHeaders.etag){r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag}const i=r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET";if(i){delete r["if-modified-since"];if(r["if-none-match"]){const t=r["if-none-match"].split(/,/).filter((t=>!/^\s*W\//.test(t)));if(!t.length){delete r["if-none-match"]}else{r["if-none-match"]=t.join(",").trim()}}}else if(this._resHeaders["last-modified"]&&!r["if-modified-since"]){r["if-modified-since"]=this._resHeaders["last-modified"]}return r}revalidatedPolicy(t,r){this._assertRequestHasHeaders(t);if(this._useStaleIfError()&&isErrorResponse(r)){return{modified:false,matches:false,policy:this}}if(!r||!r.headers){throw Error("Response headers missing")}let i=false;if(r.status!==undefined&&r.status!=304){i=false}else if(r.headers.etag&&!/^\s*W\//.test(r.headers.etag)){i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag}else if(this._resHeaders.etag&&r.headers.etag){i=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,"")}else if(this._resHeaders["last-modified"]){i=this._resHeaders["last-modified"]===r.headers["last-modified"]}else{if(!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]){i=true}}if(!i){return{policy:new this.constructor(t,r),modified:r.status!=304,matches:false}}const o={};for(const t in this._resHeaders){o[t]=t in r.headers&&!c[t]?r.headers[t]:this._resHeaders[t]}const a=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(t,a,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:false,matches:true}}}},8360:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(2361);const c=i(6821);const l=i(5158);const u=i(2575);const h=i(5046);const d=Symbol("currentStreamCount");const p=Symbol("request");const m=Symbol("cachedOriginSet");const g=Symbol("gracefullyClosing");const y=Symbol("length");const b=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"];const getSortedIndex=(t,r,i)=>{let o=0;let a=t.length;while(o<a){const c=o+a>>>1;if(i(t[c],r)){o=c+1}else{a=c}}return o};const compareSessions=(t,r)=>t.remoteSettings.maxConcurrentStreams>r.remoteSettings.maxConcurrentStreams;const closeCoveredSessions=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(o[m].length>0&&o[m].length<r[m].length&&o[m].every((t=>r[m].includes(t)))&&o[d]+r[d]<=r.remoteSettings.maxConcurrentStreams){gracefullyClose(o)}}};const closeSessionIfCovered=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(r[m].length>0&&r[m].length<o[m].length&&r[m].every((t=>o[m].includes(t)))&&r[d]+o[d]<=o.remoteSettings.maxConcurrentStreams){gracefullyClose(r);return true}}return false};const gracefullyClose=t=>{t[g]=true;if(t[d]===0){t.close()}};class Agent extends a{constructor({timeout:t=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:i=10,maxCachedTlsSessions:o=100}={}){super();this.sessions={};this.queue={};this.timeout=t;this.maxSessions=r;this.maxEmptySessions=i;this._emptySessionCount=0;this._sessionCount=0;this.settings={enablePush:false,initialWindowSize:1024*1024*32};this.tlsSessionCache=new u({maxSize:o})}get protocol(){return"https:"}normalizeOptions(t){let r="";for(let i=0;i<b.length;i++){const o=b[i];r+=":";if(t&&t[o]!==undefined){r+=t[o]}}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(const t in this.queue){for(const r in this.queue[t]){const i=this.queue[t][r];if(!i.completed){i.completed=true;i()}}}}_isBetterSession(t,r){return t>r}_accept(t,r,i,o){let a=0;while(a<r.length&&t[d]<t.remoteSettings.maxConcurrentStreams){r[a].resolve(t);a++}r.splice(0,a);if(r.length>0){this.getSession(i,o,r);r.length=0}}getSession(t,r,i){return new Promise(((a,c)=>{if(Array.isArray(i)&&i.length>0){i=[...i];a()}else{i=[{resolve:a,reject:c}]}try{if(typeof t==="string"){t=new o(t)}else if(!(t instanceof o)){throw new TypeError("The `origin` argument needs to be a string or an URL object")}if(r){const{servername:i}=r;const{hostname:o}=t;if(i&&o!==i){throw new Error(`Origin ${o} differs from servername ${i}`)}}}catch(t){for(let r=0;r<i.length;r++){i[r].reject(t)}return}const u=this.normalizeOptions(r);const h=t.origin;if(u in this.sessions){const t=this.sessions[u];let o=-1;let a=-1;let c;for(let r=0;r<t.length;r++){const i=t[r];const l=i.remoteSettings.maxConcurrentStreams;if(l<o){break}if(!i[m].includes(h)){continue}const u=i[d];if(u>=l||i[g]||i.destroyed){continue}if(!c){o=l}if(this._isBetterSession(u,a)){c=i;a=u}}if(c){this._accept(c,i,h,r);return}}if(u in this.queue){if(h in this.queue[u]){this.queue[u][h].listeners.push(...i);return}}else{this.queue[u]={[y]:0}}const removeFromQueue=()=>{if(u in this.queue&&this.queue[u][h]===entry){delete this.queue[u][h];if(--this.queue[u][y]===0){delete this.queue[u]}}};const entry=async()=>{this._sessionCount++;const o=`${h}:${u}`;let a=false;let c;try{const b={...r};if(b.settings===undefined){b.settings=this.settings}if(b.session===undefined){b.session=this.tlsSessionCache.get(o)}const v=b.createConnection||this.createConnection;c=await v.call(this,t,b);b.createConnection=()=>c;const _=l.connect(t,b);_[d]=0;_[g]=false;const getOriginSet=()=>{const{socket:t}=_;let r;if(t.servername===false){t.servername=t.remoteAddress;r=_.originSet;t.servername=false}else{r=_.originSet}return r};const isFree=()=>_[d]<_.remoteSettings.maxConcurrentStreams;_.socket.once("session",(t=>{this.tlsSessionCache.set(o,t)}));_.once("error",(t=>{for(let r=0;r<i.length;r++){i[r].reject(t)}this.tlsSessionCache.delete(o)}));_.setTimeout(this.timeout,(()=>{_.destroy()}));_.once("close",(()=>{this._sessionCount--;if(a){this._emptySessionCount--;const t=this.sessions[u];if(t.length===1){delete this.sessions[u]}else{t.splice(t.indexOf(_),1)}}else{removeFromQueue();const t=new Error("Session closed without receiving a SETTINGS frame");t.code="HTTP2WRAPPER_NOSETTINGS";for(let r=0;r<i.length;r++){i[r].reject(t)}}this._processQueue()}));const processListeners=()=>{const t=this.queue[u];if(!t){return}const r=_[m];for(let i=0;i<r.length;i++){const o=r[i];if(o in t){const{listeners:r,completed:i}=t[o];let a=0;while(a<r.length&&isFree()){r[a].resolve(_);a++}t[o].listeners.splice(0,a);if(t[o].listeners.length===0&&!i){delete t[o];if(--t[y]===0){delete this.queue[u];break}}if(!isFree()){break}}}};_.on("origin",(()=>{_[m]=getOriginSet()||[];_[g]=false;closeSessionIfCovered(this.sessions[u],_);if(_[g]||!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}));_.once("remoteSettings",(()=>{if(entry.destroyed){const t=new Error("Agent has been destroyed");for(let r=0;r<i.length;r++){i[r].reject(t)}_.destroy();return}if(_.setLocalWindowSize){_.setLocalWindowSize(1024*1024*4)}_[m]=getOriginSet()||[];if(_.socket.encrypted){const t=_[m][0];if(t!==h){const r=new Error(`Requested origin ${h} does not match server ${t}`);for(let t=0;t<i.length;t++){i[t].reject(r)}_.destroy();return}}removeFromQueue();{const t=this.sessions;if(u in t){const r=t[u];r.splice(getSortedIndex(r,_,compareSessions),0,_)}else{t[u]=[_]}}a=true;this._emptySessionCount++;this.emit("session",_);this._accept(_,i,h,r);if(_[d]===0&&this._emptySessionCount>this.maxEmptySessions){this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions)}_.on("remoteSettings",(()=>{if(!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}))}));_[p]=_.request;_.request=(t,r)=>{if(_[g]){throw new Error("The session is gracefully closing. No new streams are allowed.")}const i=_[p](t,r);_.ref();if(_[d]++===0){this._emptySessionCount--}i.once("close",(()=>{if(--_[d]===0){this._emptySessionCount++;_.unref();if(this._emptySessionCount>this.maxEmptySessions||_[g]){_.close();return}}if(_.destroyed||_.closed){return}if(isFree()&&!closeSessionIfCovered(this.sessions[u],_)){closeCoveredSessions(this.sessions[u],_);processListeners();if(_[d]===0){this._processQueue()}}}));return i}}catch(t){removeFromQueue();this._sessionCount--;for(let r=0;r<i.length;r++){i[r].reject(t)}}};entry.listeners=i;entry.completed=false;entry.destroyed=false;this.queue[u][h]=entry;this.queue[u][y]++;this._processQueue()}))}request(t,r,i,o){return new Promise(((a,c)=>{this.getSession(t,r,[{reject:c,resolve:t=>{try{const r=t.request(i,o);h(r);a(r)}catch(t){c(t)}}}])}))}async createConnection(t,r){return Agent.connect(t,r)}static connect(t,r){r.ALPNProtocols=["h2"];const i=t.port||443;const o=t.hostname;if(typeof r.servername==="undefined"){r.servername=o}const a=c.connect(i,o,r);if(r.socket){a._peername={family:undefined,address:undefined,port:i}}return a}closeEmptySessions(t=Number.POSITIVE_INFINITY){let r=0;const{sessions:i}=this;for(const o in i){const a=i[o];for(let i=0;i<a.length;i++){const o=a[i];if(o[d]===0){r++;o.close();if(r>=t){return r}}}}return r}destroy(t){const{sessions:r,queue:i}=this;for(const i in r){const o=r[i];for(let r=0;r<o.length;r++){o[r].destroy(t)}}for(const t in i){const r=i[t];for(const t in r){r[t].destroyed=true}}this.queue={};this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}}Agent.kCurrentStreamCount=d;Agent.kGracefullyClosing=g;t.exports={Agent:Agent,globalAgent:new Agent}},8939:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const c=i(3685);const l=i(5687);const u=i(4459);const h=i(2575);const{Agent:d,globalAgent:p}=i(8360);const m=i(4720);const g=i(2157);const y=i(5046);const b=new h({maxSize:100});const v=new Map;const installSocket=(t,r,i)=>{r._httpMessage={shouldKeepAlive:true};const onFree=()=>{t.emit("free",r,i)};r.on("free",onFree);const onClose=()=>{t.removeSocket(r,i)};r.on("close",onClose);const onTimeout=()=>{const{freeSockets:i}=t;for(const t of Object.values(i)){if(t.includes(r)){r.destroy();return}}};r.on("timeout",onTimeout);const onRemove=()=>{t.removeSocket(r,i);r.off("close",onClose);r.off("free",onFree);r.off("timeout",onTimeout);r.off("agentRemove",onRemove)};r.on("agentRemove",onRemove);t.emit("free",r,i)};const createResolveProtocol=(t,r=new Map,i=undefined)=>async o=>{const a=`${o.host}:${o.port}:${o.ALPNProtocols.sort()}`;if(!t.has(a)){if(r.has(a)){const t=await r.get(a);return{alpnProtocol:t.alpnProtocol}}const{path:c}=o;o.path=o.socketPath;const l=u(o,i);r.set(a,l);try{const i=await l;t.set(a,i.alpnProtocol);r.delete(a);o.path=c;return i}catch(t){r.delete(a);o.path=c;throw t}}return{alpnProtocol:t.get(a)}};const _=createResolveProtocol(b,v);t.exports=async(t,r,i)=>{if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}r.ALPNProtocols=r.ALPNProtocols||["h2","http/1.1"];if(!Array.isArray(r.ALPNProtocols)||r.ALPNProtocols.length===0){throw new Error("The `ALPNProtocols` option must be an Array with at least one entry")}r.protocol=r.protocol||"https:";const u=r.protocol==="https:";r.host=r.hostname||r.host||"localhost";r.session=r.tlsSession;r.servername=r.servername||g(r.headers&&r.headers.host||r.host);r.port=r.port||(u?443:80);r._defaultAgent=u?l.globalAgent:c.globalAgent;const h=r.resolveProtocol||_;let{agent:b}=r;if(b!==undefined&&b!==false&&b.constructor.name!=="Object"){throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties")}if(u){r.resolveSocket=true;let{socket:t,alpnProtocol:o,timeout:a}=await h(r);if(a){if(t){t.destroy()}const i=new Error(`Timed out resolving ALPN: ${r.timeout} ms`);i.code="ETIMEDOUT";i.ms=r.timeout;throw i}if(t&&r.createConnection){t.destroy();t=undefined}delete r.resolveSocket;const c=o==="h2";if(b){b=c?b.http2:b.https;r.agent=b}if(b===undefined){b=c?p:l.globalAgent}if(t){if(b===false){t.destroy()}else{const i=(c?d:l.Agent).prototype.createConnection;if(b.createConnection===i){if(c){r._reuseSocket=t}else{installSocket(b,t,r)}}else{t.destroy()}}}if(c){return y(new m(r,i))}}else if(b){r.agent=b.http}return y(c.request(r,i))};t.exports.protocolCache=b;t.exports.resolveProtocol=_;t.exports.createResolveProtocol=createResolveProtocol},4720:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const c=i(5158);const{Writable:l}=i(2781);const{Agent:u,globalAgent:h}=i(8360);const d=i(5274);const p=i(2004);const{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_PROTOCOL:g,ERR_HTTP_HEADERS_SENT:y}=i(2031);const b=i(8026);const v=i(4562);const _=i(4075);const{HTTP2_HEADER_STATUS:w,HTTP2_HEADER_METHOD:E,HTTP2_HEADER_PATH:S,HTTP2_HEADER_AUTHORITY:O,HTTP2_METHOD_CONNECT:R}=c.constants;const x=Symbol("headers");const A=Symbol("origin");const T=Symbol("session");const k=Symbol("options");const C=Symbol("flushedHeaders");const P=Symbol("jobs");const I=Symbol("pendingAgentPromise");class ClientRequest extends l{constructor(t,r,i){super({autoDestroy:false,emitClose:false});if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}if(r.h2session){this[T]=r.h2session;if(this[T].destroyed){throw new Error("The session has been closed already")}this.protocol=this[T].socket.encrypted?"https:":"http:"}else if(r.agent===false){this.agent=new u({maxEmptySessions:0})}else if(typeof r.agent==="undefined"||r.agent===null){this.agent=h}else if(typeof r.agent.request==="function"){this.agent=r.agent}else{throw new m("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent)}if(this.agent){this.protocol=this.agent.protocol}if(r.protocol&&r.protocol!==this.protocol){throw new g(r.protocol,this.protocol)}if(!r.port){r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443}r.host=r.hostname||r.host||"localhost";delete r.hostname;const{timeout:c}=r;r.timeout=undefined;this[x]=Object.create(null);this[P]=[];this[I]=undefined;this.socket=null;this.connection=null;this.method=r.method||"GET";if(!(this.method==="CONNECT"&&(r.path==="/"||r.path===undefined))){this.path=r.path}this.res=null;this.aborted=false;this.reusedSocket=false;const{headers:l}=r;if(l){for(const t in l){this.setHeader(t,l[t])}}if(r.auth&&!("authorization"in this[x])){this[x].authorization="Basic "+Buffer.from(r.auth).toString("base64")}r.session=r.tlsSession;r.path=r.socketPath;this[k]=r;this[A]=new o(`${this.protocol}//${r.servername||r.host}:${r.port}`);const d=r._reuseSocket;if(d){r.createConnection=(...t)=>{if(d.destroyed){return this.agent.createConnection(...t)}return d};this.agent.getSession(this[A],this[k]).catch((()=>{}))}if(c){this.setTimeout(c)}if(i){this.once("response",i)}this[C]=false}get method(){return this[x][E]}set method(t){if(t){this[x][E]=t.toUpperCase()}}get path(){const t=this.method==="CONNECT"?O:S;return this[x][t]}set path(t){if(t){const r=this.method==="CONNECT"?O:S;this[x][r]=t}}get host(){return this[A].hostname}set host(t){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(t,r,i){if(this._mustNotHaveABody){i(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();const callWrite=()=>this._request.write(t,r,i);if(this._request){callWrite()}else{this[P].push(callWrite)}}_final(t){this.flushHeaders();const callEnd=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){t();return}this._request.end(t)};if(this._request){callEnd()}else{this[P].push(callEnd)}}abort(){if(this.res&&this.res.complete){return}if(!this.aborted){process.nextTick((()=>this.emit("abort")))}this.aborted=true;this.destroy()}async _destroy(t,r){if(this.res){this.res._dump()}if(this._request){this._request.destroy()}else{process.nextTick((()=>{this.emit("close")}))}try{await this[I]}catch(r){if(this.aborted){t=r}}r(t)}async flushHeaders(){if(this[C]||this.destroyed){return}this[C]=true;const t=this.method===R;const onStream=r=>{this._request=r;if(this.destroyed){r.destroy();return}if(!t){p(r,this,["timeout","continue"])}r.once("error",(t=>{this.destroy(t)}));r.once("aborted",(()=>{const{res:t}=this;if(t){t.aborted=true;t.emit("aborted");t.destroy()}else{this.destroy(new Error("The server aborted the HTTP/2 stream"))}}));const onResponse=(i,o,a)=>{const c=new d(this.socket,r.readableHighWaterMark);this.res=c;c.url=`${this[A].origin}${this.path}`;c.req=this;c.statusCode=i[w];c.headers=i;c.rawHeaders=a;c.once("end",(()=>{c.complete=true;c.socket=null;c.connection=null}));if(t){c.upgrade=true;if(this.emit("connect",c,r,Buffer.alloc(0))){this.emit("close")}else{r.destroy()}}else{r.on("data",(t=>{if(!c._dumped&&!c.push(t)){r.pause()}}));r.once("end",(()=>{if(!this.aborted){c.push(null)}}));if(!this.emit("response",c)){c._dump()}}};r.once("response",onResponse);r.once("headers",(t=>this.emit("information",{statusCode:t[w]})));r.once("trailers",((t,r,i)=>{const{res:o}=this;if(o===null){onResponse(t,r,i);return}o.trailers=t;o.rawTrailers=i}));r.once("close",(()=>{const{aborted:t,res:r}=this;if(r){if(t){r.aborted=true;r.emit("aborted");r.destroy()}const finish=()=>{r.emit("close");this.destroy();this.emit("close")};if(r.readable){r.once("end",finish)}else{finish()}return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated"));this.emit("close");return}this.destroy();this.emit("close")}));this.socket=new Proxy(r,_);for(const t of this[P]){t()}this.emit("socket",this.socket)};if(!(O in this[x])&&!t){this[x][O]=this[A].host}if(this[T]){try{onStream(this[T].request(this[x]))}catch(t){this.destroy(t)}}else{this.reusedSocket=true;try{const t=this.agent.request(this[A],this[k],this[x]);this[I]=t;onStream(await t);this[I]=false}catch(t){this[I]=false;this.destroy(t)}}}get connection(){return this.socket}set connection(t){this.socket=t}getHeaderNames(){return Object.keys(this[x])}hasHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return Boolean(this[x][t.toLowerCase()])}getHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return this[x][t.toLowerCase()]}get headersSent(){return this[C]}removeHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}if(this.headersSent){throw new y("remove")}delete this[x][t.toLowerCase()]}setHeader(t,r){if(this.headersSent){throw new y("set")}b(t);v(t,r);const i=t.toLowerCase();if(i==="connection"){if(r.toLowerCase()==="keep-alive"){return}throw new Error(`Invalid 'connection' header: ${r}`)}if(i==="host"&&this.method==="CONNECT"){this[x][O]=r}else{this[x][i]=r}}setNoDelay(){}setSocketKeepAlive(){}setTimeout(t,r){const applyTimeout=()=>this._request.setTimeout(t,r);if(this._request){applyTimeout()}else{this[P].push(applyTimeout)}return this}get maxHeadersCount(){if(!this.destroyed&&this._request){return this._request.session.localSettings.maxHeaderListSize}return undefined}set maxHeadersCount(t){}}t.exports=ClientRequest},5274:(t,r,i)=>{"use strict";const{Readable:o}=i(2781);class IncomingMessage extends o{constructor(t,r){super({emitClose:false,autoDestroy:true,highWaterMark:r});this.statusCode=null;this.statusMessage="";this.httpVersion="2.0";this.httpVersionMajor=2;this.httpVersionMinor=0;this.headers={};this.trailers={};this.req=null;this.aborted=false;this.complete=false;this.upgrade=null;this.rawHeaders=[];this.rawTrailers=[];this.socket=t;this._dumped=false}get connection(){return this.socket}set connection(t){this.socket=t}_destroy(t,r){if(!this.readableEnded){this.aborted=true}r();this.req._request.destroy(t)}setTimeout(t,r){this.req.setTimeout(t,r);return this}_dump(){if(!this._dumped){this._dumped=true;this.removeAllListeners("data");this.resume()}}_read(){if(this.req){this.req._request.resume()}}}t.exports=IncomingMessage},7331:(t,r,i)=>{"use strict";const o=i(5158);const{Agent:a,globalAgent:c}=i(8360);const l=i(4720);const u=i(5274);const h=i(8939);const{HttpOverHttp2:d,HttpsOverHttp2:p}=i(1188);const m=i(2849);const{Http2OverHttp:g,Http2OverHttps:y}=i(7095);const b=i(8026);const v=i(4562);const request=(t,r,i)=>new l(t,r,i);const get=(t,r,i)=>{const o=new l(t,r,i);o.end();return o};t.exports={...o,ClientRequest:l,IncomingMessage:u,Agent:a,globalAgent:c,request:request,get:get,auto:h,proxies:{HttpOverHttp2:d,HttpsOverHttp2:p,Http2OverHttp2:m,Http2OverHttp:g,Http2OverHttps:y},validateHeaderName:b,validateHeaderValue:v}},1002:t=>{"use strict";t.exports=t=>{const{username:r,password:i}=t.proxyOptions.url;if(r||i){const t=`${r}:${i}`;const o=`Basic ${Buffer.from(t).toString("base64")}`;return{"proxy-authorization":o,authorization:o}}return{}}},1188:(t,r,i)=>{"use strict";const o=i(6821);const a=i(3685);const c=i(5687);const l=i(1983);const{globalAgent:u}=i(8360);const h=i(1265);const d=i(365);const p=i(1002);const createConnection=(t,r,i)=>{(async()=>{try{const{proxyOptions:a}=t;const{url:d,headers:m,raw:g}=a;const y=await u.request(d,a,{...p(t),...m,":method":"CONNECT",":authority":`${r.host}:${r.port}`});y.once("error",i);y.once("response",(a=>{const u=a[":status"];if(u!==200){i(new h(u));return}const d=t instanceof c.Agent;if(g&&d){r.socket=y;const t=o.connect(r);t.once("close",(()=>{y.destroy()}));i(null,t);return}const p=new l(y);p.encrypted=false;p._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};i(null,p)}))}catch(t){i(t)}})()};class HttpOverHttp2 extends a.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}class HttpsOverHttp2 extends c.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}t.exports={HttpOverHttp2:HttpOverHttp2,HttpsOverHttp2:HttpsOverHttp2}},7095:(t,r,i)=>{"use strict";const o=i(3685);const a=i(5687);const c=i(5482);const l=i(1002);const getStream=t=>new Promise(((r,i)=>{const onConnect=(o,a,c)=>{a.unshift(c);t.off("error",i);r([a,o.statusCode])};t.once("error",i);t.once("connect",onConnect)}));class Http2OverHttp extends c{async _getProxyStream(t){const{proxyOptions:r}=this;const{url:i,headers:c}=this.proxyOptions;const u=i.protocol==="https:"?a:o;const h=u.request({...r,hostname:i.hostname,port:i.port,path:t,headers:{...l(this),...c,host:t},method:"CONNECT"}).end();return getStream(h)}}t.exports={Http2OverHttp:Http2OverHttp,Http2OverHttps:Http2OverHttp}},2849:(t,r,i)=>{"use strict";const{globalAgent:o}=i(8360);const a=i(5482);const c=i(1002);const getStatusCode=t=>new Promise(((r,i)=>{t.once("error",i);t.once("response",(o=>{t.off("error",i);r(o[":status"])}))}));class Http2OverHttp2 extends a{async _getProxyStream(t){const{proxyOptions:r}=this;const i={...c(this),...r.headers,":method":"CONNECT",":authority":t};const a=await o.request(r.url,r,i);const l=await getStatusCode(a);return[a,l]}}t.exports=Http2OverHttp2},5482:(t,r,i)=>{"use strict";const{Agent:o}=i(8360);const a=i(1983);const c=i(1265);const l=i(365);class Http2OverHttpX extends o{constructor(t){super(t);l(this,t.proxyOptions)}async createConnection(t,r){const i=`${t.hostname}:${t.port||443}`;const[o,l]=await this._getProxyStream(i);if(l!==200){throw new c(l)}if(this.proxyOptions.raw){r.socket=o}else{const t=new a(o);t.encrypted=false;t._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};return t}return super.createConnection(t,r)}}t.exports=Http2OverHttpX},365:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(6007);t.exports=(t,r)=>{a("proxyOptions",r,["object"]);a("proxyOptions.headers",r.headers,["object","undefined"]);a("proxyOptions.raw",r.raw,["boolean","undefined"]);a("proxyOptions.url",r.url,[o,"string"]);const i=new o(r.url);t.proxyOptions={raw:true,...r,headers:{...r.headers},url:i}}},1265:t=>{"use strict";class UnexpectedStatusCodeError extends Error{constructor(t){super(`The proxy server rejected the request with status code ${t}`);this.statusCode=t}}t.exports=UnexpectedStatusCodeError},2157:(t,r,i)=>{"use strict";const{isIP:o}=i(1808);const a=i(9491);const getHost=t=>{if(t[0]==="["){const r=t.indexOf("]");a(r!==-1);return t.slice(1,r)}const r=t.indexOf(":");if(r===-1){return t}return t.slice(0,r)};t.exports=t=>{const r=getHost(t);if(o(r)){return""}return r}},6007:t=>{"use strict";const checkType=(t,r,i)=>{const o=i.some((t=>{const i=typeof t;if(i==="string"){return typeof r===t}return r instanceof t}));if(!o){const o=i.map((t=>typeof t==="string"?t:t.name));throw new TypeError(`Expected '${t}' to be a type of ${o.join(" or ")}, got ${typeof r}`)}};t.exports=checkType},5046:t=>{"use strict";t.exports=t=>{if(t.listenerCount("error")!==0){return}t.__destroy=t._destroy;t._destroy=(...r)=>{const i=r.pop();t.__destroy(...r,(async t=>{await Promise.resolve();i(t)}))};const onError=r=>{Promise.resolve().then((()=>{t.emit("error",r)}))};t.once("error",onError);Promise.resolve().then((()=>{t.off("error",onError)}));return t}},2031:t=>{"use strict";const makeError=(r,i,o)=>{t.exports[i]=class NodeError extends r{constructor(...t){super(typeof o==="string"?o:o(t));this.name=`${super.name} [${i}]`;this.code=i}}};makeError(TypeError,"ERR_INVALID_ARG_TYPE",(t=>{const r=t[0].includes(".")?"property":"argument";let i=t[1];const o=Array.isArray(i);if(o){i=`${i.slice(0,-1).join(", ")} or ${i.slice(-1)}`}return`The "${t[0]}" ${r} must be ${o?"one of":"of"} type ${i}. Received ${typeof t[2]}`}));makeError(TypeError,"ERR_INVALID_PROTOCOL",(t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`));makeError(Error,"ERR_HTTP_HEADERS_SENT",(t=>`Cannot ${t[0]} headers after they are sent to the client`));makeError(TypeError,"ERR_INVALID_HTTP_TOKEN",(t=>`${t[0]} must be a valid HTTP token [${t[1]}]`));makeError(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",(t=>`Invalid value "${t[0]} for header "${t[1]}"`));makeError(TypeError,"ERR_INVALID_CHAR",(t=>`Invalid character in ${t[0]} [${t[1]}]`));makeError(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")},9809:t=>{"use strict";t.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return true;default:return false}}},1983:(t,r,i)=>{"use strict";const o=i(2781);const a=i(6821);const c=new a.TLSSocket(new o.PassThrough)._handle._parentWrap.constructor;t.exports=c},2004:t=>{"use strict";t.exports=(t,r,i)=>{for(const o of i){t.on(o,((...t)=>r.emit(o,...t)))}}},4075:(t,r,i)=>{"use strict";const{ERR_HTTP2_NO_SOCKET_MANIPULATION:o}=i(2031);const a={has(t,r){const i=t.session===undefined?t:t.session.socket;return r in t||r in i},get(t,r){switch(r){case"on":case"once":case"end":case"emit":case"destroy":return t[r].bind(t);case"writable":case"destroyed":return t[r];case"readable":if(t.destroyed){return false}return t.readable;case"setTimeout":{const{session:r}=t;if(r!==undefined){return r.setTimeout.bind(r)}return t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new o;default:{const i=t.session===undefined?t:t.session.socket;const o=i[r];return typeof o==="function"?o.bind(i):o}}},getPrototypeOf(t){if(t.session!==undefined){return Reflect.getPrototypeOf(t.session.socket)}return Reflect.getPrototypeOf(t)},set(t,r,i){switch(r){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":t[r]=i;return true;case"setTimeout":{const{session:r}=t;if(r===undefined){t.setTimeout=i}else{r.setTimeout=i}return true}case"write":case"read":case"pause":case"resume":throw new o;default:{const o=t.session===undefined?t:t.session.socket;o[r]=i;return true}}}};t.exports=a},8026:(t,r,i)=>{"use strict";const{ERR_INVALID_HTTP_TOKEN:o}=i(2031);const a=i(9809);const c=/^[\^`\-\w!#$%&*+.|~]+$/;t.exports=t=>{if(typeof t!=="string"||!c.test(t)&&!a(t)){throw new o("Header name",t)}}},4562:(t,r,i)=>{"use strict";const{ERR_HTTP_INVALID_HEADER_VALUE:o,ERR_INVALID_CHAR:a}=i(2031);const c=/[^\t\u0020-\u007E\u0080-\u00FF]/;t.exports=(t,r)=>{if(typeof r==="undefined"){throw new o(r,t)}if(c.test(r)){throw new a("header content",t)}}},6302:t=>{function makeArray(t){return Array.isArray(t)?t:[t]}const r="";const i=" ";const o="\\";const a=/^\s+$/;const c=/^\\!/;const l=/^\\#/;const u=/\r?\n/g;const h=/^\.*\/|^\.+$/;const d="/";const p=typeof Symbol!=="undefined"?Symbol.for("node-ignore"):"node-ignore";const define=(t,r,i)=>Object.defineProperty(t,r,{value:i});const m=/([0-z])-([0-z])/g;const RETURN_FALSE=()=>false;const sanitizeRange=t=>t.replace(m,((t,i,o)=>i.charCodeAt(0)<=o.charCodeAt(0)?t:r));const cleanRangeBackSlash=t=>{const{length:r}=t;return t.slice(0,r-r%2)};const g=[[/\\?\s+$/,t=>t.indexOf("\\")===0?i:r],[/\\\s/g,()=>i],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function startingReplacer(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,r,i)=>r+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,r)=>`${r}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>o],[/\\\\/g,()=>o],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,r,i,a,c)=>r===o?`\\[${i}${cleanRangeBackSlash(a)}${c}`:c==="]"?a.length%2===0?`[${sanitizeRange(i)}${a}]`:"[]":"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,r)=>{const i=r?`${r}[^/]+`:"[^/]*";return`${i}(?=$|\\/$)`}]];const y=Object.create(null);const makeRegex=(t,r)=>{let i=y[t];if(!i){i=g.reduce(((r,i)=>r.replace(i[0],i[1].bind(t))),t);y[t]=i}return r?new RegExp(i,"i"):new RegExp(i)};const isString=t=>typeof t==="string";const checkPattern=t=>t&&isString(t)&&!a.test(t)&&t.indexOf("#")!==0;const splitPattern=t=>t.split(u);class IgnoreRule{constructor(t,r,i,o){this.origin=t;this.pattern=r;this.negative=i;this.regex=o}}const createRule=(t,r)=>{const i=t;let o=false;if(t.indexOf("!")===0){o=true;t=t.substr(1)}t=t.replace(c,"!").replace(l,"#");const a=makeRegex(t,r);return new IgnoreRule(i,t,o,a)};const throwError=(t,r)=>{throw new r(t)};const checkPath=(t,r,i)=>{if(!isString(t)){return i(`path must be a string, but got \`${r}\``,TypeError)}if(!t){return i(`path must not be empty`,TypeError)}if(checkPath.isNotRelative(t)){const t="`path.relative()`d";return i(`path should be a ${t} string, but got "${r}"`,RangeError)}return true};const isNotRelative=t=>h.test(t);checkPath.isNotRelative=isNotRelative;checkPath.convert=t=>t;class Ignore{constructor({ignorecase:t=true,ignoreCase:r=t,allowRelativePaths:i=false}={}){define(this,p,true);this._rules=[];this._ignoreCase=r;this._allowRelativePaths=i;this._initCache()}_initCache(){this._ignoreCache=Object.create(null);this._testCache=Object.create(null)}_addPattern(t){if(t&&t[p]){this._rules=this._rules.concat(t._rules);this._added=true;return}if(checkPattern(t)){const r=createRule(t,this._ignoreCase);this._added=true;this._rules.push(r)}}add(t){this._added=false;makeArray(isString(t)?splitPattern(t):t).forEach(this._addPattern,this);if(this._added){this._initCache()}return this}addPattern(t){return this.add(t)}_testOne(t,r){let i=false;let o=false;this._rules.forEach((a=>{const{negative:c}=a;if(o===c&&i!==o||c&&!i&&!o&&!r){return}const l=a.regex.test(t);if(l){i=!c;o=c}}));return{ignored:i,unignored:o}}_test(t,r,i,o){const a=t&&checkPath.convert(t);checkPath(a,t,this._allowRelativePaths?RETURN_FALSE:throwError);return this._t(a,r,i,o)}_t(t,r,i,o){if(t in r){return r[t]}if(!o){o=t.split(d)}o.pop();if(!o.length){return r[t]=this._testOne(t,i)}const a=this._t(o.join(d)+d,r,i,o);return r[t]=a.ignored?a:this._testOne(t,i)}ignores(t){return this._test(t,this._ignoreCache,false).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return makeArray(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,true)}}const factory=t=>new Ignore(t);const isPathValid=t=>checkPath(t&&checkPath.convert(t),t,RETURN_FALSE);factory.isPathValid=isPathValid;factory.default=factory;t.exports=factory;if(typeof process!=="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const makePosix=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");checkPath.convert=makePosix;const t=/^[a-z]:\//i;checkPath.isNotRelative=r=>t.test(r)||isNotRelative(r)}},6900:(t,r,i)=>{var o=i(2928);var a=Object.create(null);var c=i(4556);t.exports=o(inflight);function inflight(t,r){if(a[t]){a[t].push(r);return null}else{a[t]=[r];return makeres(t)}}function makeres(t){return c((function RES(){var r=a[t];var i=r.length;var o=slice(arguments);try{for(var c=0;c<i;c++){r[c].apply(null,o)}}finally{if(r.length>i){r.splice(0,i);process.nextTick((function(){RES.apply(null,o)}))}else{delete a[t]}}}))}function slice(t){var r=t.length;var i=[];for(var o=0;o<r;o++)i[o]=t[o];return i}},6315:(t,r,i)=>{try{var o=i(3837);if(typeof o.inherits!=="function")throw"";t.exports=o.inherits}catch(r){t.exports=i(959)}},959:t=>{if(typeof Object.create==="function"){t.exports=function inherits(t,r){if(r){t.super_=r;t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}})}}}else{t.exports=function inherits(t,r){if(r){t.super_=r;var TempCtor=function(){};TempCtor.prototype=r.prototype;t.prototype=new TempCtor;t.prototype.constructor=t}}}},809:(t,r)=>{r.parse=r.decode=decode;r.stringify=r.encode=encode;r.safe=safe;r.unsafe=unsafe;var i=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(t,r){var o=[];var a="";if(typeof r==="string"){r={section:r,whitespace:false}}else{r=r||{};r.whitespace=r.whitespace===true}var c=r.whitespace?" = ":"=";Object.keys(t).forEach((function(r,l,u){var h=t[r];if(h&&Array.isArray(h)){h.forEach((function(t){a+=safe(r+"[]")+c+safe(t)+"\n"}))}else if(h&&typeof h==="object")o.push(r);else a+=safe(r)+c+safe(h)+i}));if(r.section&&a.length)a="["+safe(r.section)+"]"+i+a;o.forEach((function(o,c,l){var u=dotSplit(o).join("\\.");var h=(r.section?r.section+".":"")+u;var d=encode(t[o],{section:h,whitespace:r.whitespace});if(a.length&&d.length)a+=i;a+=d}));return a}function dotSplit(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(t){return t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(t){var r={};var i=r;var o=null;var a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var c=t.split(/[\r\n]+/g);c.forEach((function(t,c,l){if(!t||t.match(/^\s*[;#]/))return;var u=t.match(a);if(!u)return;if(u[1]!==undefined){o=unsafe(u[1]);if(o==="__proto__"){i={};return}i=r[o]=r[o]||{};return}var h=unsafe(u[2]);if(h==="__proto__")return;var d=u[3]?unsafe(u[4]):true;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(h.length>2&&h.slice(-2)==="[]"){h=h.substring(0,h.length-2);if(h==="__proto__")return;if(!i[h])i[h]=[];else if(!Array.isArray(i[h]))i[h]=[i[h]]}if(Array.isArray(i[h]))i[h].push(d);else i[h]=d}));Object.keys(r).filter((function(t,i,o){if(!r[t]||typeof r[t]!=="object"||Array.isArray(r[t]))return false;var a=dotSplit(t);var c=r;var l=a.pop();var u=l.replace(/\\\./g,".");a.forEach((function(t,r,i){if(t==="__proto__")return;if(!c[t]||typeof c[t]!=="object")c[t]={};c=c[t]}));if(c===r&&u===l)return false;c[u]=r[t];return true})).forEach((function(t,i,o){delete r[t]}));return r}function isQuoted(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function safe(t){return typeof t!=="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&isQuoted(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(t,r){t=(t||"").trim();if(isQuoted(t)){if(t.charAt(0)==="'")t=t.substr(1,t.length-2);try{t=JSON.parse(t)}catch(t){}}else{var i=false;var o="";for(var a=0,c=t.length;a<c;a++){var l=t.charAt(a);if(i){if("\\;#".indexOf(l)!==-1)o+=l;else o+="\\"+l;i=false}else if(";#".indexOf(l)!==-1)break;else if(l==="\\")i=true;else o+=l}if(i)o+="\\";return o.trim()}return t}},3071:t=>{
|
|
84
|
+
*/const o=i(3837);const a=i(8368);const isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);const transform=t=>r=>t===true?Number(r):String(r);const isValidValue=t=>typeof t==="number"||typeof t==="string"&&t!=="";const isNumber=t=>Number.isInteger(+t);const zeros=t=>{let r=`${t}`;let i=-1;if(r[0]==="-")r=r.slice(1);if(r==="0")return false;while(r[++i]==="0");return i>0};const stringify=(t,r,i)=>{if(typeof t==="string"||typeof r==="string"){return true}return i.stringify===true};const pad=(t,r,i)=>{if(r>0){let i=t[0]==="-"?"-":"";if(i)t=t.slice(1);t=i+t.padStart(i?r-1:r,"0")}if(i===false){return String(t)}return t};const toMaxLen=(t,r)=>{let i=t[0]==="-"?"-":"";if(i){t=t.slice(1);r--}while(t.length<r)t="0"+t;return i?"-"+t:t};const toSequence=(t,r)=>{t.negatives.sort(((t,r)=>t<r?-1:t>r?1:0));t.positives.sort(((t,r)=>t<r?-1:t>r?1:0));let i=r.capture?"":"?:";let o="";let a="";let l;if(t.positives.length){o=t.positives.join("|")}if(t.negatives.length){a=`-(${i}${t.negatives.join("|")})`}if(o&&a){l=`${o}|${a}`}else{l=o||a}if(r.wrap){return`(${i}${l})`}return l};const toRange=(t,r,i,o)=>{if(i){return a(t,r,{wrap:false,...o})}let l=String.fromCharCode(t);if(t===r)return l;let c=String.fromCharCode(r);return`[${l}-${c}]`};const toRegex=(t,r,i)=>{if(Array.isArray(t)){let r=i.wrap===true;let o=i.capture?"":"?:";return r?`(${o}${t.join("|")})`:t.join("|")}return a(t,r,i)};const rangeError=(...t)=>new RangeError("Invalid range arguments: "+o.inspect(...t));const invalidRange=(t,r,i)=>{if(i.strictRanges===true)throw rangeError([t,r]);return[]};const invalidStep=(t,r)=>{if(r.strictRanges===true){throw new TypeError(`Expected step "${t}" to be a number`)}return[]};const fillNumbers=(t,r,i=1,o={})=>{let a=Number(t);let l=Number(r);if(!Number.isInteger(a)||!Number.isInteger(l)){if(o.strictRanges===true)throw rangeError([t,r]);return[]}if(a===0)a=0;if(l===0)l=0;let c=a>l;let u=String(t);let h=String(r);let d=String(i);i=Math.max(Math.abs(i),1);let p=zeros(u)||zeros(h)||zeros(d);let m=p?Math.max(u.length,h.length,d.length):0;let y=p===false&&stringify(t,r,o)===false;let g=o.transform||transform(y);if(o.toRegex&&i===1){return toRange(toMaxLen(t,m),toMaxLen(r,m),true,o)}let b={negatives:[],positives:[]};let push=t=>b[t<0?"negatives":"positives"].push(Math.abs(t));let v=[];let _=0;while(c?a>=l:a<=l){if(o.toRegex===true&&i>1){push(a)}else{v.push(pad(g(a,_),m,y))}a=c?a-i:a+i;_++}if(o.toRegex===true){return i>1?toSequence(b,o):toRegex(v,null,{wrap:false,...o})}return v};const fillLetters=(t,r,i=1,o={})=>{if(!isNumber(t)&&t.length>1||!isNumber(r)&&r.length>1){return invalidRange(t,r,o)}let a=o.transform||(t=>String.fromCharCode(t));let l=`${t}`.charCodeAt(0);let c=`${r}`.charCodeAt(0);let u=l>c;let h=Math.min(l,c);let d=Math.max(l,c);if(o.toRegex&&i===1){return toRange(h,d,false,o)}let p=[];let m=0;while(u?l>=c:l<=c){p.push(a(l,m));l=u?l-i:l+i;m++}if(o.toRegex===true){return toRegex(p,null,{wrap:false,options:o})}return p};const fill=(t,r,i,o={})=>{if(r==null&&isValidValue(t)){return[t]}if(!isValidValue(t)||!isValidValue(r)){return invalidRange(t,r,o)}if(typeof i==="function"){return fill(t,r,1,{transform:i})}if(isObject(i)){return fill(t,r,0,i)}let a={...o};if(a.capture===true)a.wrap=true;i=i||a.step||1;if(!isNumber(i)){if(i!=null&&!isObject(i))return invalidStep(i,a);return fill(t,r,1,i)}if(isNumber(t)&&isNumber(r)){return fillNumbers(t,r,i,a)}return fillLetters(t,r,Math.max(Math.abs(i),1),a)};t.exports=fill},6086:(t,r,i)=>{t.exports=i(7147).constants||i(2057)},6855:(t,r,i)=>{"use strict";const o=i(2103);const a=i(2361).EventEmitter;const l=i(7147);let c=l.writev;if(!c){const t=process.binding("fs");const r=t.FSReqWrap||t.FSReqCallback;c=(i,o,a,l)=>{const done=(t,r)=>l(t,r,o);const c=new r;c.oncomplete=done;t.writeBuffers(i,o,a,c)}}const u=Symbol("_autoClose");const h=Symbol("_close");const d=Symbol("_ended");const p=Symbol("_fd");const m=Symbol("_finished");const y=Symbol("_flags");const g=Symbol("_flush");const b=Symbol("_handleChunk");const v=Symbol("_makeBuf");const _=Symbol("_mode");const w=Symbol("_needDrain");const E=Symbol("_onerror");const S=Symbol("_onopen");const R=Symbol("_onread");const O=Symbol("_onwrite");const x=Symbol("_open");const T=Symbol("_path");const k=Symbol("_pos");const A=Symbol("_queue");const C=Symbol("_read");const P=Symbol("_readSize");const I=Symbol("_reading");const L=Symbol("_remain");const D=Symbol("_size");const M=Symbol("_write");const N=Symbol("_writing");const j=Symbol("_defaultFlag");const B=Symbol("_errored");class ReadStream extends o{constructor(t,r){r=r||{};super(r);this.readable=true;this.writable=false;if(typeof t!=="string")throw new TypeError("path must be a string");this[B]=false;this[p]=typeof r.fd==="number"?r.fd:null;this[T]=t;this[P]=r.readSize||16*1024*1024;this[I]=false;this[D]=typeof r.size==="number"?r.size:Infinity;this[L]=this[D];this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;if(typeof this[p]==="number")this[C]();else this[x]()}get fd(){return this[p]}get path(){return this[T]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[x](){l.open(this[T],"r",((t,r)=>this[S](t,r)))}[S](t,r){if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[C]()}}[v](){return Buffer.allocUnsafe(Math.min(this[P],this[L]))}[C](){if(!this[I]){this[I]=true;const t=this[v]();if(t.length===0)return process.nextTick((()=>this[R](null,0,t)));l.read(this[p],t,0,t.length,null,((t,r,i)=>this[R](t,r,i)))}}[R](t,r,i){this[I]=false;if(t)this[E](t);else if(this[b](r,i))this[C]()}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[E](t){this[I]=true;this[h]();this.emit("error",t)}[b](t,r){let i=false;this[L]-=t;if(t>0)i=super.write(t<r.length?r.slice(0,t):r);if(t===0||this[L]<=0){i=false;this[h]();super.end()}return i}emit(t,r){switch(t){case"prefinish":case"finish":break;case"drain":if(typeof this[p]==="number")this[C]();break;case"error":if(this[B])return;this[B]=true;return super.emit(t,r);default:return super.emit(t,r)}}}class ReadStreamSync extends ReadStream{[x](){let t=true;try{this[S](null,l.openSync(this[T],"r"));t=false}finally{if(t)this[h]()}}[C](){let t=true;try{if(!this[I]){this[I]=true;do{const t=this[v]();const r=t.length===0?0:l.readSync(this[p],t,0,t.length,null);if(!this[b](r,t))break}while(true);this[I]=false}t=false}finally{if(t)this[h]()}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.closeSync(t);this.emit("close")}}}class WriteStream extends a{constructor(t,r){r=r||{};super(r);this.readable=false;this.writable=true;this[B]=false;this[N]=false;this[d]=false;this[w]=false;this[A]=[];this[T]=t;this[p]=typeof r.fd==="number"?r.fd:null;this[_]=r.mode===undefined?438:r.mode;this[k]=typeof r.start==="number"?r.start:null;this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;const i=this[k]!==null?"r+":"w";this[j]=r.flags===undefined;this[y]=this[j]?i:r.flags;if(this[p]===null)this[x]()}emit(t,r){if(t==="error"){if(this[B])return;this[B]=true}return super.emit(t,r)}get fd(){return this[p]}get path(){return this[T]}[E](t){this[h]();this[N]=true;this.emit("error",t)}[x](){l.open(this[T],this[y],this[_],((t,r)=>this[S](t,r)))}[S](t,r){if(this[j]&&this[y]==="r+"&&t&&t.code==="ENOENT"){this[y]="w";this[x]()}else if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[g]()}}end(t,r){if(t)this.write(t,r);this[d]=true;if(!this[N]&&!this[A].length&&typeof this[p]==="number")this[O](null,0);return this}write(t,r){if(typeof t==="string")t=Buffer.from(t,r);if(this[d]){this.emit("error",new Error("write() after end()"));return false}if(this[p]===null||this[N]||this[A].length){this[A].push(t);this[w]=true;return false}this[N]=true;this[M](t);return true}[M](t){l.write(this[p],t,0,t.length,this[k],((t,r)=>this[O](t,r)))}[O](t,r){if(t)this[E](t);else{if(this[k]!==null)this[k]+=r;if(this[A].length)this[g]();else{this[N]=false;if(this[d]&&!this[m]){this[m]=true;this[h]();this.emit("finish")}else if(this[w]){this[w]=false;this.emit("drain")}}}}[g](){if(this[A].length===0){if(this[d])this[O](null,0)}else if(this[A].length===1)this[M](this[A].pop());else{const t=this[A];this[A]=[];c(this[p],t,this[k],((t,r)=>this[O](t,r)))}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[x](){let t;if(this[j]&&this[y]==="r+"){try{t=l.openSync(this[T],this[y],this[_])}catch(t){if(t.code==="ENOENT"){this[y]="w";return this[x]()}else throw t}}else t=l.openSync(this[T],this[y],this[_]);this[S](null,t)}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.closeSync(t);this.emit("close")}}[M](t){let r=true;try{this[O](null,l.writeSync(this[p],t,0,t.length,this[k]));r=false}finally{if(r)try{this[h]()}catch(t){}}}}r.ReadStream=ReadStream;r.ReadStreamSync=ReadStreamSync;r.WriteStream=WriteStream;r.WriteStreamSync=WriteStreamSync},5221:(t,r,i)=>{t.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var o=i(7147);var a=o.realpath;var l=o.realpathSync;var c=process.version;var u=/^v[0-5]\./.test(c);var h=i(5810);function newError(t){return t&&t.syscall==="realpath"&&(t.code==="ELOOP"||t.code==="ENOMEM"||t.code==="ENAMETOOLONG")}function realpath(t,r,i){if(u){return a(t,r,i)}if(typeof r==="function"){i=r;r=null}a(t,r,(function(o,a){if(newError(o)){h.realpath(t,r,i)}else{i(o,a)}}))}function realpathSync(t,r){if(u){return l(t,r)}try{return l(t,r)}catch(i){if(newError(i)){return h.realpathSync(t,r)}else{throw i}}}function monkeypatch(){o.realpath=realpath;o.realpathSync=realpathSync}function unmonkeypatch(){o.realpath=a;o.realpathSync=l}},5810:(t,r,i)=>{var o=i(1017);var a=process.platform==="win32";var l=i(7147);var c=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var t;if(c){var r=new Error;t=debugCallback}else t=missingCallback;return t;function debugCallback(t){if(t){r.message=t.message;t=r;missingCallback(t)}}function missingCallback(t){if(t){if(process.throwDeprecation)throw t;else if(!process.noDeprecation){var r="fs: missing callback "+(t.stack||t.message);if(process.traceDeprecation)console.trace(r);else console.error(r)}}}}function maybeCallback(t){return typeof t==="function"?t:rethrow()}var u=o.normalize;if(a){var h=/(.*?)(?:[\/\\]+|$)/g}else{var h=/(.*?)(?:[\/]+|$)/g}if(a){var d=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var d=/^[\/]*/}r.realpathSync=function realpathSync(t,r){t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var i=t,c={},u={};var p;var m;var y;var g;start();function start(){var r=d.exec(t);p=r[0].length;m=r[0];y=r[0];g="";if(a&&!u[y]){l.lstatSync(y);u[y]=true}}while(p<t.length){h.lastIndex=p;var b=h.exec(t);g=m;m+=b[0];y=g+b[1];p=h.lastIndex;if(u[y]||r&&r[y]===y){continue}var v;if(r&&Object.prototype.hasOwnProperty.call(r,y)){v=r[y]}else{var _=l.lstatSync(y);if(!_.isSymbolicLink()){u[y]=true;if(r)r[y]=y;continue}var w=null;if(!a){var E=_.dev.toString(32)+":"+_.ino.toString(32);if(c.hasOwnProperty(E)){w=c[E]}}if(w===null){l.statSync(y);w=l.readlinkSync(y)}v=o.resolve(g,w);if(r)r[y]=v;if(!a)c[E]=w}t=o.resolve(v,t.slice(p));start()}if(r)r[i]=t;return t};r.realpath=function realpath(t,r,i){if(typeof i!=="function"){i=maybeCallback(r);r=null}t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(i.bind(null,null,r[t]))}var c=t,u={},p={};var m;var y;var g;var b;start();function start(){var r=d.exec(t);m=r[0].length;y=r[0];g=r[0];b="";if(a&&!p[g]){l.lstat(g,(function(t){if(t)return i(t);p[g]=true;LOOP()}))}else{process.nextTick(LOOP)}}function LOOP(){if(m>=t.length){if(r)r[c]=t;return i(null,t)}h.lastIndex=m;var o=h.exec(t);b=y;y+=o[0];g=b+o[1];m=h.lastIndex;if(p[g]||r&&r[g]===g){return process.nextTick(LOOP)}if(r&&Object.prototype.hasOwnProperty.call(r,g)){return gotResolvedLink(r[g])}return l.lstat(g,gotStat)}function gotStat(t,o){if(t)return i(t);if(!o.isSymbolicLink()){p[g]=true;if(r)r[g]=g;return process.nextTick(LOOP)}if(!a){var c=o.dev.toString(32)+":"+o.ino.toString(32);if(u.hasOwnProperty(c)){return gotTarget(null,u[c],g)}}l.stat(g,(function(t){if(t)return i(t);l.readlink(g,(function(t,r){if(!a)u[c]=r;gotTarget(t,r)}))}))}function gotTarget(t,a,l){if(t)return i(t);var c=o.resolve(b,a);if(r)r[l]=c;gotResolvedLink(c)}function gotResolvedLink(r){t=o.resolve(r,t.slice(m));start()}}},5891:(t,r,i)=>{"use strict";const{PassThrough:o}=i(2781);t.exports=t=>{t={...t};const{array:r}=t;let{encoding:i}=t;const a=i==="buffer";let l=false;if(r){l=!(i||a)}else{i=i||"utf8"}if(a){i=null}const c=new o({objectMode:l});if(i){c.setEncoding(i)}let u=0;const h=[];c.on("data",(t=>{h.push(t);if(l){u=h.length}else{u+=t.length}}));c.getBufferedValue=()=>{if(r){return h}return a?Buffer.concat(h,u):h.join("")};c.getBufferedLength=()=>u;return c}},7035:(t,r,i)=>{"use strict";const{constants:o}=i(4300);const a=i(7459);const l=i(5891);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,r){if(!t){return Promise.reject(new Error("Expected a stream"))}r={maxBuffer:Infinity,...r};const{maxBuffer:i}=r;let c;await new Promise(((u,h)=>{const rejectPromise=t=>{if(t&&c.getBufferedLength()<=o.MAX_LENGTH){t.bufferedData=c.getBufferedValue()}h(t)};c=a(t,l(r),(t=>{if(t){rejectPromise(t);return}u()}));c.on("data",(()=>{if(c.getBufferedLength()>i){rejectPromise(new MaxBufferError)}}))}));return c.getBufferedValue()}t.exports=getStream;t.exports["default"]=getStream;t.exports.buffer=(t,r)=>getStream(t,{...r,encoding:"buffer"});t.exports.array=(t,r)=>getStream(t,{...r,array:true});t.exports.MaxBufferError=MaxBufferError},633:(t,r,i)=>{"use strict";const{PassThrough:o}=i(2781);t.exports=t=>{t={...t};const{array:r}=t;let{encoding:i}=t;const a=i==="buffer";let l=false;if(r){l=!(i||a)}else{i=i||"utf8"}if(a){i=null}const c=new o({objectMode:l});if(i){c.setEncoding(i)}let u=0;const h=[];c.on("data",(t=>{h.push(t);if(l){u=h.length}else{u+=t.length}}));c.getBufferedValue=()=>{if(r){return h}return a?Buffer.concat(h,u):h.join("")};c.getBufferedLength=()=>u;return c}},7567:(t,r,i)=>{"use strict";const{constants:o}=i(4300);const a=i(2781);const{promisify:l}=i(3837);const c=i(633);const u=l(a.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,r){if(!t){throw new Error("Expected a stream")}r={maxBuffer:Infinity,...r};const{maxBuffer:i}=r;const a=c(r);await new Promise(((r,l)=>{const rejectPromise=t=>{if(t&&a.getBufferedLength()<=o.MAX_LENGTH){t.bufferedData=a.getBufferedValue()}l(t)};(async()=>{try{await u(t,a);r()}catch(t){rejectPromise(t)}})();a.on("data",(()=>{if(a.getBufferedLength()>i){rejectPromise(new MaxBufferError)}}))}));return a.getBufferedValue()}t.exports=getStream;t.exports.buffer=(t,r)=>getStream(t,{...r,encoding:"buffer"});t.exports.array=(t,r)=>getStream(t,{...r,array:true});t.exports.MaxBufferError=MaxBufferError},8876:(t,r,i)=>{"use strict";var o=i(162);var a=i(1017).posix.dirname;var l=i(2037).platform()==="win32";var c="/";var u=/\\/g;var h=/[\{\[].*[\}\]]$/;var d=/(^|[^\\])([\{\[]|\([^\)]+$)/;var p=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function globParent(t,r){var i=Object.assign({flipBackslashes:true},r);if(i.flipBackslashes&&l&&t.indexOf(c)<0){t=t.replace(u,c)}if(h.test(t)){t+=c}t+="a";do{t=a(t)}while(o(t)||d.test(t));return t.replace(p,"$1")}},8431:(t,r,i)=>{r.setopts=setopts;r.ownProp=ownProp;r.makeAbs=makeAbs;r.finish=finish;r.mark=mark;r.isIgnored=isIgnored;r.childrenIgnored=childrenIgnored;function ownProp(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var o=i(7147);var a=i(1017);var l=i(5909);var c=i(8830);var u=l.Minimatch;function alphasort(t,r){return t.localeCompare(r,"en")}function setupIgnores(t,r){t.ignore=r.ignore||[];if(!Array.isArray(t.ignore))t.ignore=[t.ignore];if(t.ignore.length){t.ignore=t.ignore.map(ignoreMap)}}function ignoreMap(t){var r=null;if(t.slice(-3)==="/**"){var i=t.replace(/(\/\*\*)+$/,"");r=new u(i,{dot:true})}return{matcher:new u(t,{dot:true}),gmatcher:r}}function setopts(t,r,i){if(!i)i={};if(i.matchBase&&-1===r.indexOf("/")){if(i.noglobstar){throw new Error("base matching requires globstar")}r="**/"+r}t.silent=!!i.silent;t.pattern=r;t.strict=i.strict!==false;t.realpath=!!i.realpath;t.realpathCache=i.realpathCache||Object.create(null);t.follow=!!i.follow;t.dot=!!i.dot;t.mark=!!i.mark;t.nodir=!!i.nodir;if(t.nodir)t.mark=true;t.sync=!!i.sync;t.nounique=!!i.nounique;t.nonull=!!i.nonull;t.nosort=!!i.nosort;t.nocase=!!i.nocase;t.stat=!!i.stat;t.noprocess=!!i.noprocess;t.absolute=!!i.absolute;t.fs=i.fs||o;t.maxLength=i.maxLength||Infinity;t.cache=i.cache||Object.create(null);t.statCache=i.statCache||Object.create(null);t.symlinks=i.symlinks||Object.create(null);setupIgnores(t,i);t.changedCwd=false;var l=process.cwd();if(!ownProp(i,"cwd"))t.cwd=l;else{t.cwd=a.resolve(i.cwd);t.changedCwd=t.cwd!==l}t.root=i.root||a.resolve(t.cwd,"/");t.root=a.resolve(t.root);if(process.platform==="win32")t.root=t.root.replace(/\\/g,"/");t.cwdAbs=c(t.cwd)?t.cwd:makeAbs(t,t.cwd);if(process.platform==="win32")t.cwdAbs=t.cwdAbs.replace(/\\/g,"/");t.nomount=!!i.nomount;i.nonegate=true;i.nocomment=true;t.minimatch=new u(r,i);t.options=t.minimatch.options}function finish(t){var r=t.nounique;var i=r?[]:Object.create(null);for(var o=0,a=t.matches.length;o<a;o++){var l=t.matches[o];if(!l||Object.keys(l).length===0){if(t.nonull){var c=t.minimatch.globSet[o];if(r)i.push(c);else i[c]=true}}else{var u=Object.keys(l);if(r)i.push.apply(i,u);else u.forEach((function(t){i[t]=true}))}}if(!r)i=Object.keys(i);if(!t.nosort)i=i.sort(alphasort);if(t.mark){for(var o=0;o<i.length;o++){i[o]=t._mark(i[o])}if(t.nodir){i=i.filter((function(r){var i=!/\/$/.test(r);var o=t.cache[r]||t.cache[makeAbs(t,r)];if(i&&o)i=o!=="DIR"&&!Array.isArray(o);return i}))}}if(t.ignore.length)i=i.filter((function(r){return!isIgnored(t,r)}));t.found=i}function mark(t,r){var i=makeAbs(t,r);var o=t.cache[i];var a=r;if(o){var l=o==="DIR"||Array.isArray(o);var c=r.slice(-1)==="/";if(l&&!c)a+="/";else if(!l&&c)a=a.slice(0,-1);if(a!==r){var u=makeAbs(t,a);t.statCache[u]=t.statCache[i];t.cache[u]=t.cache[i]}}return a}function makeAbs(t,r){var i=r;if(r.charAt(0)==="/"){i=a.join(t.root,r)}else if(c(r)||r===""){i=r}else if(t.changedCwd){i=a.resolve(t.cwd,r)}else{i=a.resolve(r)}if(process.platform==="win32")i=i.replace(/\\/g,"/");return i}function isIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return t.matcher.match(r)||!!(t.gmatcher&&t.gmatcher.match(r))}))}function childrenIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return!!(t.gmatcher&&t.gmatcher.match(r))}))}},5895:(t,r,i)=>{t.exports=glob;var o=i(5221);var a=i(5909);var l=a.Minimatch;var c=i(3193);var u=i(2361).EventEmitter;var h=i(1017);var d=i(9491);var p=i(8830);var m=i(5853);var y=i(8431);var g=y.setopts;var b=y.ownProp;var v=i(7022);var _=i(3837);var w=y.childrenIgnored;var E=y.isIgnored;var S=i(3306);function glob(t,r,i){if(typeof r==="function")i=r,r={};if(!r)r={};if(r.sync){if(i)throw new TypeError("callback provided to sync glob");return m(t,r)}return new Glob(t,r,i)}glob.sync=m;var R=glob.GlobSync=m.GlobSync;glob.glob=glob;function extend(t,r){if(r===null||typeof r!=="object"){return t}var i=Object.keys(r);var o=i.length;while(o--){t[i[o]]=r[i[o]]}return t}glob.hasMagic=function(t,r){var i=extend({},r);i.noprocess=true;var o=new Glob(t,i);var a=o.minimatch.set;if(!t)return false;if(a.length>1)return true;for(var l=0;l<a[0].length;l++){if(typeof a[0][l]!=="string")return true}return false};glob.Glob=Glob;c(Glob,u);function Glob(t,r,i){if(typeof r==="function"){i=r;r=null}if(r&&r.sync){if(i)throw new TypeError("callback provided to sync glob");return new R(t,r)}if(!(this instanceof Glob))return new Glob(t,r,i);g(this,t,r);this._didRealPath=false;var o=this.minimatch.set.length;this.matches=new Array(o);if(typeof i==="function"){i=S(i);this.on("error",i);this.on("end",(function(t){i(null,t)}))}var a=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(o===0)return done();var l=true;for(var c=0;c<o;c++){this._process(this.minimatch.set[c],c,false,done)}l=false;function done(){--a._processing;if(a._processing<=0){if(l){process.nextTick((function(){a._finish()}))}else{a._finish()}}}}Glob.prototype._finish=function(){d(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();y.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var t=this.matches.length;if(t===0)return this._finish();var r=this;for(var i=0;i<this.matches.length;i++)this._realpathSet(i,next);function next(){if(--t===0)r._finish()}};Glob.prototype._realpathSet=function(t,r){var i=this.matches[t];if(!i)return r();var a=Object.keys(i);var l=this;var c=a.length;if(c===0)return r();var u=this.matches[t]=Object.create(null);a.forEach((function(i,a){i=l._makeAbs(i);o.realpath(i,l.realpathCache,(function(o,a){if(!o)u[a]=true;else if(o.syscall==="stat")u[i]=true;else l.emit("error",o);if(--c===0){l.matches[t]=u;r()}}))}))};Glob.prototype._mark=function(t){return y.mark(this,t)};Glob.prototype._makeAbs=function(t){return y.makeAbs(this,t)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var r=0;r<t.length;r++){var i=t[r];this._emitMatch(i[0],i[1])}}if(this._processQueue.length){var o=this._processQueue.slice(0);this._processQueue.length=0;for(var r=0;r<o.length;r++){var a=o[r];this._processing--;this._process(a[0],a[1],a[2],a[3])}}}};Glob.prototype._process=function(t,r,i,o){d(this instanceof Glob);d(typeof o==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([t,r,i,o]);return}var l=0;while(typeof t[l]==="string"){l++}var c;switch(l){case t.length:this._processSimple(t.join("/"),r,o);return;case 0:c=null;break;default:c=t.slice(0,l).join("/");break}var u=t.slice(l);var h;if(c===null)h=".";else if(p(c)||p(t.join("/"))){if(!c||!p(c))c="/"+c;h=c}else h=c;var m=this._makeAbs(h);if(w(this,h))return o();var y=u[0]===a.GLOBSTAR;if(y)this._processGlobStar(c,h,m,u,r,i,o);else this._processReaddir(c,h,m,u,r,i,o)};Glob.prototype._processReaddir=function(t,r,i,o,a,l,c){var u=this;this._readdir(i,l,(function(h,d){return u._processReaddir2(t,r,i,o,a,l,d,c)}))};Glob.prototype._processReaddir2=function(t,r,i,o,a,l,c,u){if(!c)return u();var d=o[0];var p=!!this.minimatch.negate;var m=d._glob;var y=this.dot||m.charAt(0)===".";var g=[];for(var b=0;b<c.length;b++){var v=c[b];if(v.charAt(0)!=="."||y){var _;if(p&&!t){_=!v.match(d)}else{_=v.match(d)}if(_)g.push(v)}}var w=g.length;if(w===0)return u();if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var b=0;b<w;b++){var v=g[b];if(t){if(t!=="/")v=t+"/"+v;else v=t+v}if(v.charAt(0)==="/"&&!this.nomount){v=h.join(this.root,v)}this._emitMatch(a,v)}return u()}o.shift();for(var b=0;b<w;b++){var v=g[b];var E;if(t){if(t!=="/")v=t+"/"+v;else v=t+v}this._process([v].concat(o),a,l,u)}u()};Glob.prototype._emitMatch=function(t,r){if(this.aborted)return;if(E(this,r))return;if(this.paused){this._emitQueue.push([t,r]);return}var i=p(r)?r:this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute)r=i;if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;var a=this.statCache[i];if(a)this.emit("stat",r,a);this.emit("match",r)};Glob.prototype._readdirInGlobStar=function(t,r){if(this.aborted)return;if(this.follow)return this._readdir(t,false,r);var i="lstat\0"+t;var o=this;var a=v(i,lstatcb_);if(a)o.fs.lstat(t,a);function lstatcb_(i,a){if(i&&i.code==="ENOENT")return r();var l=a&&a.isSymbolicLink();o.symlinks[t]=l;if(!l&&a&&!a.isDirectory()){o.cache[t]="FILE";r()}else o._readdir(t,false,r)}};Glob.prototype._readdir=function(t,r,i){if(this.aborted)return;i=v("readdir\0"+t+"\0"+r,i);if(!i)return;if(r&&!b(this.symlinks,t))return this._readdirInGlobStar(t,i);if(b(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return i();if(Array.isArray(o))return i(null,o)}var a=this;a.fs.readdir(t,readdirCb(this,t,i))};function readdirCb(t,r,i){return function(o,a){if(o)t._readdirError(r,o,i);else t._readdirEntries(r,a,i)}}Glob.prototype._readdirEntries=function(t,r,i){if(this.aborted)return;if(!this.mark&&!this.stat){for(var o=0;o<r.length;o++){var a=r[o];if(t==="/")a=t+a;else a=t+"/"+a;this.cache[a]=true}}this.cache[t]=r;return i(null,r)};Glob.prototype._readdirError=function(t,r,i){if(this.aborted)return;switch(r.code){case"ENOTSUP":case"ENOTDIR":var o=this._makeAbs(t);this.cache[o]="FILE";if(o===this.cwdAbs){var a=new Error(r.code+" invalid cwd "+this.cwd);a.path=this.cwd;a.code=r.code;this.emit("error",a);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict){this.emit("error",r);this.abort()}if(!this.silent)console.error("glob error",r);break}return i()};Glob.prototype._processGlobStar=function(t,r,i,o,a,l,c){var u=this;this._readdir(i,l,(function(h,d){u._processGlobStar2(t,r,i,o,a,l,d,c)}))};Glob.prototype._processGlobStar2=function(t,r,i,o,a,l,c,u){if(!c)return u();var h=o.slice(1);var d=t?[t]:[];var p=d.concat(h);this._process(p,a,false,u);var m=this.symlinks[i];var y=c.length;if(m&&l)return u();for(var g=0;g<y;g++){var b=c[g];if(b.charAt(0)==="."&&!this.dot)continue;var v=d.concat(c[g],h);this._process(v,a,true,u);var _=d.concat(c[g],o);this._process(_,a,true,u)}u()};Glob.prototype._processSimple=function(t,r,i){var o=this;this._stat(t,(function(a,l){o._processSimple2(t,r,a,l,i)}))};Glob.prototype._processSimple2=function(t,r,i,o,a){if(!this.matches[r])this.matches[r]=Object.create(null);if(!o)return a();if(t&&p(t)&&!this.nomount){var l=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(l)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t);a()};Glob.prototype._stat=function(t,r){var i=this._makeAbs(t);var o=t.slice(-1)==="/";if(t.length>this.maxLength)return r();if(!this.stat&&b(this.cache,i)){var a=this.cache[i];if(Array.isArray(a))a="DIR";if(!o||a==="DIR")return r(null,a);if(o&&a==="FILE")return r()}var l;var c=this.statCache[i];if(c!==undefined){if(c===false)return r(null,c);else{var u=c.isDirectory()?"DIR":"FILE";if(o&&u==="FILE")return r();else return r(null,u,c)}}var h=this;var d=v("stat\0"+i,lstatcb_);if(d)h.fs.lstat(i,d);function lstatcb_(o,a){if(a&&a.isSymbolicLink()){return h.fs.stat(i,(function(o,l){if(o)h._stat2(t,i,null,a,r);else h._stat2(t,i,o,l,r)}))}else{h._stat2(t,i,o,a,r)}}};Glob.prototype._stat2=function(t,r,i,o,a){if(i&&(i.code==="ENOENT"||i.code==="ENOTDIR")){this.statCache[r]=false;return a()}var l=t.slice(-1)==="/";this.statCache[r]=o;if(r.slice(-1)==="/"&&o&&!o.isDirectory())return a(null,false,o);var c=true;if(o)c=o.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||c;if(l&&c==="FILE")return a();return a(null,c,o)}},5853:(t,r,i)=>{t.exports=globSync;globSync.GlobSync=GlobSync;var o=i(5221);var a=i(5909);var l=a.Minimatch;var c=i(5895).Glob;var u=i(3837);var h=i(1017);var d=i(9491);var p=i(8830);var m=i(8431);var y=m.setopts;var g=m.ownProp;var b=m.childrenIgnored;var v=m.isIgnored;function globSync(t,r){if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(t,r).found}function GlobSync(t,r){if(!t)throw new Error("must provide pattern");if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(t,r);y(this,t,r);if(this.noprocess)return this;var i=this.minimatch.set.length;this.matches=new Array(i);for(var o=0;o<i;o++){this._process(this.minimatch.set[o],o,false)}this._finish()}GlobSync.prototype._finish=function(){d(this instanceof GlobSync);if(this.realpath){var t=this;this.matches.forEach((function(r,i){var a=t.matches[i]=Object.create(null);for(var l in r){try{l=t._makeAbs(l);var c=o.realpathSync(l,t.realpathCache);a[c]=true}catch(r){if(r.syscall==="stat")a[t._makeAbs(l)]=true;else throw r}}}))}m.finish(this)};GlobSync.prototype._process=function(t,r,i){d(this instanceof GlobSync);var o=0;while(typeof t[o]==="string"){o++}var l;switch(o){case t.length:this._processSimple(t.join("/"),r);return;case 0:l=null;break;default:l=t.slice(0,o).join("/");break}var c=t.slice(o);var u;if(l===null)u=".";else if(p(l)||p(t.join("/"))){if(!l||!p(l))l="/"+l;u=l}else u=l;var h=this._makeAbs(u);if(b(this,u))return;var m=c[0]===a.GLOBSTAR;if(m)this._processGlobStar(l,u,h,c,r,i);else this._processReaddir(l,u,h,c,r,i)};GlobSync.prototype._processReaddir=function(t,r,i,o,a,l){var c=this._readdir(i,l);if(!c)return;var u=o[0];var d=!!this.minimatch.negate;var p=u._glob;var m=this.dot||p.charAt(0)===".";var y=[];for(var g=0;g<c.length;g++){var b=c[g];if(b.charAt(0)!=="."||m){var v;if(d&&!t){v=!b.match(u)}else{v=b.match(u)}if(v)y.push(b)}}var _=y.length;if(_===0)return;if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var g=0;g<_;g++){var b=y[g];if(t){if(t.slice(-1)!=="/")b=t+"/"+b;else b=t+b}if(b.charAt(0)==="/"&&!this.nomount){b=h.join(this.root,b)}this._emitMatch(a,b)}return}o.shift();for(var g=0;g<_;g++){var b=y[g];var w;if(t)w=[t,b];else w=[b];this._process(w.concat(o),a,l)}};GlobSync.prototype._emitMatch=function(t,r){if(v(this,r))return;var i=this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute){r=i}if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;if(this.stat)this._stat(r)};GlobSync.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,false);var r;var i;var o;try{i=this.fs.lstatSync(t)}catch(t){if(t.code==="ENOENT"){return null}}var a=i&&i.isSymbolicLink();this.symlinks[t]=a;if(!a&&i&&!i.isDirectory())this.cache[t]="FILE";else r=this._readdir(t,false);return r};GlobSync.prototype._readdir=function(t,r){var i;if(r&&!g(this.symlinks,t))return this._readdirInGlobStar(t);if(g(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return null;if(Array.isArray(o))return o}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(r){this._readdirError(t,r);return null}};GlobSync.prototype._readdirEntries=function(t,r){if(!this.mark&&!this.stat){for(var i=0;i<r.length;i++){var o=r[i];if(t==="/")o=t+o;else o=t+"/"+o;this.cache[o]=true}}this.cache[t]=r;return r};GlobSync.prototype._readdirError=function(t,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);this.cache[i]="FILE";if(i===this.cwdAbs){var o=new Error(r.code+" invalid cwd "+this.cwd);o.path=this.cwd;o.code=r.code;throw o}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict)throw r;if(!this.silent)console.error("glob error",r);break}};GlobSync.prototype._processGlobStar=function(t,r,i,o,a,l){var c=this._readdir(i,l);if(!c)return;var u=o.slice(1);var h=t?[t]:[];var d=h.concat(u);this._process(d,a,false);var p=c.length;var m=this.symlinks[i];if(m&&l)return;for(var y=0;y<p;y++){var g=c[y];if(g.charAt(0)==="."&&!this.dot)continue;var b=h.concat(c[y],u);this._process(b,a,true);var v=h.concat(c[y],o);this._process(v,a,true)}};GlobSync.prototype._processSimple=function(t,r){var i=this._stat(t);if(!this.matches[r])this.matches[r]=Object.create(null);if(!i)return;if(t&&p(t)&&!this.nomount){var o=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(o)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t)};GlobSync.prototype._stat=function(t){var r=this._makeAbs(t);var i=t.slice(-1)==="/";if(t.length>this.maxLength)return false;if(!this.stat&&g(this.cache,r)){var o=this.cache[r];if(Array.isArray(o))o="DIR";if(!i||o==="DIR")return o;if(i&&o==="FILE")return false}var a;var l=this.statCache[r];if(!l){var c;try{c=this.fs.lstatSync(r)}catch(t){if(t&&(t.code==="ENOENT"||t.code==="ENOTDIR")){this.statCache[r]=false;return false}}if(c&&c.isSymbolicLink()){try{l=this.fs.statSync(r)}catch(t){l=c}}else{l=c}}this.statCache[r]=l;var o=true;if(l)o=l.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||o;if(i&&o==="FILE")return false;return o};GlobSync.prototype._mark=function(t){return m.mark(this,t)};GlobSync.prototype._makeAbs=function(t){return m.makeAbs(this,t)}},6045:t=>{"use strict";t.exports=clone;var r=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:r(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))}));return i}},1653:(t,r,i)=>{var o=i(7147);var a=i(8);var l=i(7448);var c=i(6045);var u=i(3837);var h;var d;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){h=Symbol.for("graceful-fs.queue");d=Symbol.for("graceful-fs.previous")}else{h="___graceful-fs.queue";d="___graceful-fs.previous"}function noop(){}function publishQueue(t,r){Object.defineProperty(t,h,{get:function(){return r}})}var p=noop;if(u.debuglog)p=u.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var t=u.format.apply(u,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!o[h]){var m=global[h]||[];publishQueue(o,m);o.close=function(t){function close(r,i){return t.call(o,r,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,d,{value:t});return close}(o.close);o.closeSync=function(t){function closeSync(r){t.apply(o,arguments);resetQueue()}Object.defineProperty(closeSync,d,{value:t});return closeSync}(o.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(o[h]);i(9491).equal(o[h].length,0)}))}}if(!global[h]){publishQueue(global,o[h])}t.exports=patch(c(o));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched){t.exports=patch(o);o.__patched=true}function patch(t){a(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var r=t.readFile;t.readFile=readFile;function readFile(t,i,o){if(typeof i==="function")o=i,i=null;return go$readFile(t,i,o);function go$readFile(t,i,o,a){return r(t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$readFile,[t,i,o],r,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,r,o,a){if(typeof o==="function")a=o,o=null;return go$writeFile(t,r,o,a);function go$writeFile(t,r,o,a,l){return i(t,r,o,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,r,o,a],i,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var o=t.appendFile;if(o)t.appendFile=appendFile;function appendFile(t,r,i,a){if(typeof i==="function")a=i,i=null;return go$appendFile(t,r,i,a);function go$appendFile(t,r,i,a,l){return o(t,r,i,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$appendFile,[t,r,i,a],o,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var c=t.copyFile;if(c)t.copyFile=copyFile;function copyFile(t,r,i,o){if(typeof i==="function"){o=i;i=0}return go$copyFile(t,r,i,o);function go$copyFile(t,r,i,o,a){return c(t,r,i,(function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$copyFile,[t,r,i,o],l,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=t.readdir;t.readdir=readdir;function readdir(t,r,i){if(typeof r==="function")i=r,r=null;return go$readdir(t,r,i);function go$readdir(t,r,i,o){return u(t,r,(function(a,l){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$readdir,[t,r,i],a,o||Date.now(),Date.now()]);else{if(l&&l.sort)l.sort();if(typeof i==="function")i.call(this,a,l)}}))}}if(process.version.substr(0,4)==="v0.8"){var h=l(t);ReadStream=h.ReadStream;WriteStream=h.WriteStream}var d=t.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var p=t.WriteStream;if(p){WriteStream.prototype=Object.create(p.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var m=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(t){m=t},enumerable:true,configurable:true});var y=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(t){y=t},enumerable:true,configurable:true});function ReadStream(t,r){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){if(t.autoClose)t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,r){if(this instanceof WriteStream)return p.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(r,i){return new t.ReadStream(r,i)}function createWriteStream(r,i){return new t.WriteStream(r,i)}var g=t.open;t.open=open;function open(t,r,i,o){if(typeof i==="function")o=i,i=null;return go$open(t,r,i,o);function go$open(t,r,i,o,a){return g(t,r,i,(function(l,c){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$open,[t,r,i,o],l,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}return t}function enqueue(t){p("ENQUEUE",t[0].name,t[1]);o[h].push(t);retry()}var y;function resetQueue(){var t=Date.now();for(var r=0;r<o[h].length;++r){if(o[h][r].length>2){o[h][r][3]=t;o[h][r][4]=t}}retry()}function retry(){clearTimeout(y);y=undefined;if(o[h].length===0)return;var t=o[h].shift();var r=t[0];var i=t[1];var a=t[2];var l=t[3];var c=t[4];if(l===undefined){p("RETRY",r.name,i);r.apply(null,i)}else if(Date.now()-l>=6e4){p("TIMEOUT",r.name,i);var u=i.pop();if(typeof u==="function")u.call(null,a)}else{var d=Date.now()-c;var m=Math.max(c-l,1);var g=Math.min(m*1.2,100);if(d>=g){p("RETRY",r.name,i);r.apply(null,i.concat([l]))}else{o[h].push(t)}}if(y===undefined){y=setTimeout(retry,0)}}},7448:(t,r,i)=>{var o=i(2781).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(r,i){if(!(this instanceof ReadStream))return new ReadStream(r,i);o.call(this);var a=this;this.path=r;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var l=Object.keys(i);for(var c=0,u=l.length;c<u;c++){var h=l[c];this[h]=i[h]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){a._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,r){if(t){a.emit("error",t);a.readable=false;return}a.fd=r;a.emit("open",r);a._read()}))}function WriteStream(r,i){if(!(this instanceof WriteStream))return new WriteStream(r,i);o.call(this);this.path=r;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var a=Object.keys(i);for(var l=0,c=a.length;l<c;l++){var u=a[l];this[u]=i[u]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},8:(t,r,i)=>{var o=i(2057);var a=process.cwd;var l=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!l)l=a.call(process);return l};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var u=process.chdir;process.chdir=function(t){l=null;u.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,u)}t.exports=patch;function patch(t){if(o.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(!t.lchmod){t.lchmod=function(t,r,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(!t.lchown){t.lchown=function(t,r,i,o){if(o)process.nextTick(o)};t.lchownSync=function(){}}if(c==="win32"){t.rename=function(r){return function(i,o,a){var l=Date.now();var c=0;r(i,o,(function CB(u){if(u&&(u.code==="EACCES"||u.code==="EPERM")&&Date.now()-l<6e4){setTimeout((function(){t.stat(o,(function(t,l){if(t&&t.code==="ENOENT")r(i,o,CB);else a(u)}))}),c);if(c<100)c+=10;return}if(a)a(u)}))}}(t.rename)}t.read=function(r){function read(i,o,a,l,c,u){var h;if(u&&typeof u==="function"){var d=0;h=function(p,m,y){if(p&&p.code==="EAGAIN"&&d<10){d++;return r.call(t,i,o,a,l,c,h)}u.apply(this,arguments)}}return r.call(t,i,o,a,l,c,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,r);return read}(t.read);t.readSync=function(r){return function(i,o,a,l,c){var u=0;while(true){try{return r.call(t,i,o,a,l,c)}catch(t){if(t.code==="EAGAIN"&&u<10){u++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(r,i,a){t.open(r,o.O_WRONLY|o.O_SYMLINK,i,(function(r,o){if(r){if(a)a(r);return}t.fchmod(o,i,(function(r){t.close(o,(function(t){if(a)a(r||t)}))}))}))};t.lchmodSync=function(r,i){var a=t.openSync(r,o.O_WRONLY|o.O_SYMLINK,i);var l=true;var c;try{c=t.fchmodSync(a,i);l=false}finally{if(l){try{t.closeSync(a)}catch(t){}}else{t.closeSync(a)}}return c}}function patchLutimes(t){if(o.hasOwnProperty("O_SYMLINK")){t.lutimes=function(r,i,a,l){t.open(r,o.O_SYMLINK,(function(r,o){if(r){if(l)l(r);return}t.futimes(o,i,a,(function(r){t.close(o,(function(t){if(l)l(r||t)}))}))}))};t.lutimesSync=function(r,i,a){var l=t.openSync(r,o.O_SYMLINK);var c;var u=true;try{c=t.futimesSync(l,i,a);u=false}finally{if(u){try{t.closeSync(l)}catch(t){}}else{t.closeSync(l)}}return c}}else{t.lutimes=function(t,r,i,o){if(o)process.nextTick(o)};t.lutimesSync=function(){}}}function chmodFix(r){if(!r)return r;return function(i,o,a){return r.call(t,i,o,(function(t){if(chownErOk(t))t=null;if(a)a.apply(this,arguments)}))}}function chmodFixSync(r){if(!r)return r;return function(i,o){try{return r.call(t,i,o)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(r){if(!r)return r;return function(i,o,a,l){return r.call(t,i,o,a,(function(t){if(chownErOk(t))t=null;if(l)l.apply(this,arguments)}))}}function chownFixSync(r){if(!r)return r;return function(i,o,a){try{return r.call(t,i,o,a)}catch(t){if(!chownErOk(t))throw t}}}function statFix(r){if(!r)return r;return function(i,o,a){if(typeof o==="function"){a=o;o=null}function callback(t,r){if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}if(a)a.apply(this,arguments)}return o?r.call(t,i,o,callback):r.call(t,i,callback)}}function statFixSync(r){if(!r)return r;return function(i,o){var a=o?r.call(t,i,o):r.call(t,i);if(a){if(a.uid<0)a.uid+=4294967296;if(a.gid<0)a.gid+=4294967296}return a}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var r=!process.getuid||process.getuid()!==0;if(r){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},8490:t=>{"use strict";const r=new Set([200,203,204,206,300,301,404,405,410,414,501]);const i=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]);const o=new Set([500,502,503,504]);const a={date:true,connection:true,"keep-alive":true,"proxy-authenticate":true,"proxy-authorization":true,te:true,trailer:true,"transfer-encoding":true,upgrade:true};const l={"content-length":true,"content-encoding":true,"transfer-encoding":true,"content-range":true};function toNumberOrZero(t){const r=parseInt(t,10);return isFinite(r)?r:0}function isErrorResponse(t){if(!t){return true}return o.has(t.status)}function parseCacheControl(t){const r={};if(!t)return r;const i=t.trim().split(/\s*,\s*/);for(const t of i){const[i,o]=t.split(/\s*=\s*/,2);r[i]=o===undefined?true:o.replace(/^"|"$/g,"")}return r}function formatCacheControl(t){let r=[];for(const i in t){const o=t[i];r.push(o===true?i:i+"="+o)}if(!r.length){return undefined}return r.join(", ")}t.exports=class CachePolicy{constructor(t,r,{shared:i,cacheHeuristic:o,immutableMinTimeToLive:a,ignoreCargoCult:l,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!r||!r.headers){throw Error("Response headers missing")}this._assertRequestHasHeaders(t);this._responseTime=this.now();this._isShared=i!==false;this._cacheHeuristic=undefined!==o?o:.1;this._immutableMinTtl=undefined!==a?a:24*3600*1e3;this._status="status"in r?r.status:200;this._resHeaders=r.headers;this._rescc=parseCacheControl(r.headers["cache-control"]);this._method="method"in t?t.method:"GET";this._url=t.url;this._host=t.headers.host;this._noAuthorization=!t.headers.authorization;this._reqHeaders=r.headers.vary?t.headers:null;this._reqcc=parseCacheControl(t.headers["cache-control"]);if(l&&"pre-check"in this._rescc&&"post-check"in this._rescc){delete this._rescc["pre-check"];delete this._rescc["post-check"];delete this._rescc["no-cache"];delete this._rescc["no-store"];delete this._rescc["must-revalidate"];this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":formatCacheControl(this._rescc)});delete this._resHeaders.expires;delete this._resHeaders.pragma}if(r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)){this._rescc["no-cache"]=true}}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())&&i.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(t){if(!t||!t.headers){throw Error("Request headers missing")}}satisfiesWithoutRevalidation(t){this._assertRequestHasHeaders(t);const r=parseCacheControl(t.headers["cache-control"]);if(r["no-cache"]||/no-cache/.test(t.headers.pragma)){return false}if(r["max-age"]&&this.age()>r["max-age"]){return false}if(r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]){return false}if(this.stale()){const t=r["max-stale"]&&!this._rescc["must-revalidate"]&&(true===r["max-stale"]||r["max-stale"]>this.age()-this.maxAge());if(!t){return false}}return this._requestMatches(t,false)}_requestMatches(t,r){return(!this._url||this._url===t.url)&&this._host===t.headers.host&&(!t.method||this._method===t.method||r&&"HEAD"===t.method)&&this._varyMatches(t)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(t){if(!this._resHeaders.vary){return true}if(this._resHeaders.vary==="*"){return false}const r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const i of r){if(t.headers[i]!==this._reqHeaders[i])return false}return true}_copyWithoutHopByHopHeaders(t){const r={};for(const i in t){if(a[i])continue;r[i]=t[i]}if(t.connection){const i=t.connection.trim().split(/\s*,\s*/);for(const t of i){delete r[t]}}if(r.warning){const t=r.warning.split(/,/).filter((t=>!/^\s*1[0-9][0-9]/.test(t)));if(!t.length){delete r.warning}else{r.warning=t.join(",").trim()}}return r}responseHeaders(){const t=this._copyWithoutHopByHopHeaders(this._resHeaders);const r=this.age();if(r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24){t.warning=(t.warning?`${t.warning}, `:"")+'113 - "rfc7234 5.5.4"'}t.age=`${Math.round(r)}`;t.date=new Date(this.now()).toUTCString();return t}date(){const t=Date.parse(this._resHeaders.date);if(isFinite(t)){return t}return this._responseTime}age(){let t=this._ageValue();const r=(this.now()-this._responseTime)/1e3;return t+r}_ageValue(){return toNumberOrZero(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]){return 0}if(this._isShared&&(this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)){return 0}if(this._resHeaders.vary==="*"){return 0}if(this._isShared){if(this._rescc["proxy-revalidate"]){return 0}if(this._rescc["s-maxage"]){return toNumberOrZero(this._rescc["s-maxage"])}}if(this._rescc["max-age"]){return toNumberOrZero(this._rescc["max-age"])}const t=this._rescc.immutable?this._immutableMinTtl:0;const r=this.date();if(this._resHeaders.expires){const i=Date.parse(this._resHeaders.expires);if(Number.isNaN(i)||i<r){return 0}return Math.max(t,(i-r)/1e3)}if(this._resHeaders["last-modified"]){const i=Date.parse(this._resHeaders["last-modified"]);if(isFinite(i)&&r>i){return Math.max(t,(r-i)/1e3*this._cacheHeuristic)}}return t}timeToLive(){const t=this.maxAge()-this.age();const r=t+toNumberOrZero(this._rescc["stale-if-error"]);const i=t+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,t,r,i)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(t){return new this(undefined,undefined,{_fromObject:t})}_fromObject(t){if(this._responseTime)throw Error("Reinitialized");if(!t||t.v!==1)throw Error("Invalid serialization");this._responseTime=t.t;this._isShared=t.sh;this._cacheHeuristic=t.ch;this._immutableMinTtl=t.imm!==undefined?t.imm:24*3600*1e3;this._status=t.st;this._resHeaders=t.resh;this._rescc=t.rescc;this._method=t.m;this._url=t.u;this._host=t.h;this._noAuthorization=t.a;this._reqHeaders=t.reqh;this._reqcc=t.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(t){this._assertRequestHasHeaders(t);const r=this._copyWithoutHopByHopHeaders(t.headers);delete r["if-range"];if(!this._requestMatches(t,true)||!this.storable()){delete r["if-none-match"];delete r["if-modified-since"];return r}if(this._resHeaders.etag){r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag}const i=r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET";if(i){delete r["if-modified-since"];if(r["if-none-match"]){const t=r["if-none-match"].split(/,/).filter((t=>!/^\s*W\//.test(t)));if(!t.length){delete r["if-none-match"]}else{r["if-none-match"]=t.join(",").trim()}}}else if(this._resHeaders["last-modified"]&&!r["if-modified-since"]){r["if-modified-since"]=this._resHeaders["last-modified"]}return r}revalidatedPolicy(t,r){this._assertRequestHasHeaders(t);if(this._useStaleIfError()&&isErrorResponse(r)){return{modified:false,matches:false,policy:this}}if(!r||!r.headers){throw Error("Response headers missing")}let i=false;if(r.status!==undefined&&r.status!=304){i=false}else if(r.headers.etag&&!/^\s*W\//.test(r.headers.etag)){i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag}else if(this._resHeaders.etag&&r.headers.etag){i=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,"")}else if(this._resHeaders["last-modified"]){i=this._resHeaders["last-modified"]===r.headers["last-modified"]}else{if(!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]){i=true}}if(!i){return{policy:new this.constructor(t,r),modified:r.status!=304,matches:false}}const o={};for(const t in this._resHeaders){o[t]=t in r.headers&&!l[t]?r.headers[t]:this._resHeaders[t]}const a=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(t,a,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:false,matches:true}}}},2066:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(2361);const l=i(4404);const c=i(5158);const u=i(2625);const h=i(390);const d=Symbol("currentStreamCount");const p=Symbol("request");const m=Symbol("cachedOriginSet");const y=Symbol("gracefullyClosing");const g=Symbol("length");const b=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"];const getSortedIndex=(t,r,i)=>{let o=0;let a=t.length;while(o<a){const l=o+a>>>1;if(i(t[l],r)){o=l+1}else{a=l}}return o};const compareSessions=(t,r)=>t.remoteSettings.maxConcurrentStreams>r.remoteSettings.maxConcurrentStreams;const closeCoveredSessions=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(o[m].length>0&&o[m].length<r[m].length&&o[m].every((t=>r[m].includes(t)))&&o[d]+r[d]<=r.remoteSettings.maxConcurrentStreams){gracefullyClose(o)}}};const closeSessionIfCovered=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(r[m].length>0&&r[m].length<o[m].length&&r[m].every((t=>o[m].includes(t)))&&r[d]+o[d]<=o.remoteSettings.maxConcurrentStreams){gracefullyClose(r);return true}}return false};const gracefullyClose=t=>{t[y]=true;if(t[d]===0){t.close()}};class Agent extends a{constructor({timeout:t=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:i=10,maxCachedTlsSessions:o=100}={}){super();this.sessions={};this.queue={};this.timeout=t;this.maxSessions=r;this.maxEmptySessions=i;this._emptySessionCount=0;this._sessionCount=0;this.settings={enablePush:false,initialWindowSize:1024*1024*32};this.tlsSessionCache=new u({maxSize:o})}get protocol(){return"https:"}normalizeOptions(t){let r="";for(let i=0;i<b.length;i++){const o=b[i];r+=":";if(t&&t[o]!==undefined){r+=t[o]}}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(const t in this.queue){for(const r in this.queue[t]){const i=this.queue[t][r];if(!i.completed){i.completed=true;i()}}}}_isBetterSession(t,r){return t>r}_accept(t,r,i,o){let a=0;while(a<r.length&&t[d]<t.remoteSettings.maxConcurrentStreams){r[a].resolve(t);a++}r.splice(0,a);if(r.length>0){this.getSession(i,o,r);r.length=0}}getSession(t,r,i){return new Promise(((a,l)=>{if(Array.isArray(i)&&i.length>0){i=[...i];a()}else{i=[{resolve:a,reject:l}]}try{if(typeof t==="string"){t=new o(t)}else if(!(t instanceof o)){throw new TypeError("The `origin` argument needs to be a string or an URL object")}if(r){const{servername:i}=r;const{hostname:o}=t;if(i&&o!==i){throw new Error(`Origin ${o} differs from servername ${i}`)}}}catch(t){for(let r=0;r<i.length;r++){i[r].reject(t)}return}const u=this.normalizeOptions(r);const h=t.origin;if(u in this.sessions){const t=this.sessions[u];let o=-1;let a=-1;let l;for(let r=0;r<t.length;r++){const i=t[r];const c=i.remoteSettings.maxConcurrentStreams;if(c<o){break}if(!i[m].includes(h)){continue}const u=i[d];if(u>=c||i[y]||i.destroyed){continue}if(!l){o=c}if(this._isBetterSession(u,a)){l=i;a=u}}if(l){this._accept(l,i,h,r);return}}if(u in this.queue){if(h in this.queue[u]){this.queue[u][h].listeners.push(...i);return}}else{this.queue[u]={[g]:0}}const removeFromQueue=()=>{if(u in this.queue&&this.queue[u][h]===entry){delete this.queue[u][h];if(--this.queue[u][g]===0){delete this.queue[u]}}};const entry=async()=>{this._sessionCount++;const o=`${h}:${u}`;let a=false;let l;try{const b={...r};if(b.settings===undefined){b.settings=this.settings}if(b.session===undefined){b.session=this.tlsSessionCache.get(o)}const v=b.createConnection||this.createConnection;l=await v.call(this,t,b);b.createConnection=()=>l;const _=c.connect(t,b);_[d]=0;_[y]=false;const getOriginSet=()=>{const{socket:t}=_;let r;if(t.servername===false){t.servername=t.remoteAddress;r=_.originSet;t.servername=false}else{r=_.originSet}return r};const isFree=()=>_[d]<_.remoteSettings.maxConcurrentStreams;_.socket.once("session",(t=>{this.tlsSessionCache.set(o,t)}));_.once("error",(t=>{for(let r=0;r<i.length;r++){i[r].reject(t)}this.tlsSessionCache.delete(o)}));_.setTimeout(this.timeout,(()=>{_.destroy()}));_.once("close",(()=>{this._sessionCount--;if(a){this._emptySessionCount--;const t=this.sessions[u];if(t.length===1){delete this.sessions[u]}else{t.splice(t.indexOf(_),1)}}else{removeFromQueue();const t=new Error("Session closed without receiving a SETTINGS frame");t.code="HTTP2WRAPPER_NOSETTINGS";for(let r=0;r<i.length;r++){i[r].reject(t)}}this._processQueue()}));const processListeners=()=>{const t=this.queue[u];if(!t){return}const r=_[m];for(let i=0;i<r.length;i++){const o=r[i];if(o in t){const{listeners:r,completed:i}=t[o];let a=0;while(a<r.length&&isFree()){r[a].resolve(_);a++}t[o].listeners.splice(0,a);if(t[o].listeners.length===0&&!i){delete t[o];if(--t[g]===0){delete this.queue[u];break}}if(!isFree()){break}}}};_.on("origin",(()=>{_[m]=getOriginSet()||[];_[y]=false;closeSessionIfCovered(this.sessions[u],_);if(_[y]||!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}));_.once("remoteSettings",(()=>{if(entry.destroyed){const t=new Error("Agent has been destroyed");for(let r=0;r<i.length;r++){i[r].reject(t)}_.destroy();return}if(_.setLocalWindowSize){_.setLocalWindowSize(1024*1024*4)}_[m]=getOriginSet()||[];if(_.socket.encrypted){const t=_[m][0];if(t!==h){const r=new Error(`Requested origin ${h} does not match server ${t}`);for(let t=0;t<i.length;t++){i[t].reject(r)}_.destroy();return}}removeFromQueue();{const t=this.sessions;if(u in t){const r=t[u];r.splice(getSortedIndex(r,_,compareSessions),0,_)}else{t[u]=[_]}}a=true;this._emptySessionCount++;this.emit("session",_);this._accept(_,i,h,r);if(_[d]===0&&this._emptySessionCount>this.maxEmptySessions){this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions)}_.on("remoteSettings",(()=>{if(!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}))}));_[p]=_.request;_.request=(t,r)=>{if(_[y]){throw new Error("The session is gracefully closing. No new streams are allowed.")}const i=_[p](t,r);_.ref();if(_[d]++===0){this._emptySessionCount--}i.once("close",(()=>{if(--_[d]===0){this._emptySessionCount++;_.unref();if(this._emptySessionCount>this.maxEmptySessions||_[y]){_.close();return}}if(_.destroyed||_.closed){return}if(isFree()&&!closeSessionIfCovered(this.sessions[u],_)){closeCoveredSessions(this.sessions[u],_);processListeners();if(_[d]===0){this._processQueue()}}}));return i}}catch(t){removeFromQueue();this._sessionCount--;for(let r=0;r<i.length;r++){i[r].reject(t)}}};entry.listeners=i;entry.completed=false;entry.destroyed=false;this.queue[u][h]=entry;this.queue[u][g]++;this._processQueue()}))}request(t,r,i,o){return new Promise(((a,l)=>{this.getSession(t,r,[{reject:l,resolve:t=>{try{const r=t.request(i,o);h(r);a(r)}catch(t){l(t)}}}])}))}async createConnection(t,r){return Agent.connect(t,r)}static connect(t,r){r.ALPNProtocols=["h2"];const i=t.port||443;const o=t.hostname;if(typeof r.servername==="undefined"){r.servername=o}const a=l.connect(i,o,r);if(r.socket){a._peername={family:undefined,address:undefined,port:i}}return a}closeEmptySessions(t=Number.POSITIVE_INFINITY){let r=0;const{sessions:i}=this;for(const o in i){const a=i[o];for(let i=0;i<a.length;i++){const o=a[i];if(o[d]===0){r++;o.close();if(r>=t){return r}}}}return r}destroy(t){const{sessions:r,queue:i}=this;for(const i in r){const o=r[i];for(let r=0;r<o.length;r++){o[r].destroy(t)}}for(const t in i){const r=i[t];for(const t in r){r[t].destroyed=true}}this.queue={};this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}}Agent.kCurrentStreamCount=d;Agent.kGracefullyClosing=y;t.exports={Agent:Agent,globalAgent:new Agent}},574:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const l=i(3685);const c=i(5687);const u=i(3374);const h=i(2625);const{Agent:d,globalAgent:p}=i(2066);const m=i(8594);const y=i(2199);const g=i(390);const b=new h({maxSize:100});const v=new Map;const installSocket=(t,r,i)=>{r._httpMessage={shouldKeepAlive:true};const onFree=()=>{t.emit("free",r,i)};r.on("free",onFree);const onClose=()=>{t.removeSocket(r,i)};r.on("close",onClose);const onTimeout=()=>{const{freeSockets:i}=t;for(const t of Object.values(i)){if(t.includes(r)){r.destroy();return}}};r.on("timeout",onTimeout);const onRemove=()=>{t.removeSocket(r,i);r.off("close",onClose);r.off("free",onFree);r.off("timeout",onTimeout);r.off("agentRemove",onRemove)};r.on("agentRemove",onRemove);t.emit("free",r,i)};const createResolveProtocol=(t,r=new Map,i=undefined)=>async o=>{const a=`${o.host}:${o.port}:${o.ALPNProtocols.sort()}`;if(!t.has(a)){if(r.has(a)){const t=await r.get(a);return{alpnProtocol:t.alpnProtocol}}const{path:l}=o;o.path=o.socketPath;const c=u(o,i);r.set(a,c);try{const i=await c;t.set(a,i.alpnProtocol);r.delete(a);o.path=l;return i}catch(t){r.delete(a);o.path=l;throw t}}return{alpnProtocol:t.get(a)}};const _=createResolveProtocol(b,v);t.exports=async(t,r,i)=>{if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}r.ALPNProtocols=r.ALPNProtocols||["h2","http/1.1"];if(!Array.isArray(r.ALPNProtocols)||r.ALPNProtocols.length===0){throw new Error("The `ALPNProtocols` option must be an Array with at least one entry")}r.protocol=r.protocol||"https:";const u=r.protocol==="https:";r.host=r.hostname||r.host||"localhost";r.session=r.tlsSession;r.servername=r.servername||y(r.headers&&r.headers.host||r.host);r.port=r.port||(u?443:80);r._defaultAgent=u?c.globalAgent:l.globalAgent;const h=r.resolveProtocol||_;let{agent:b}=r;if(b!==undefined&&b!==false&&b.constructor.name!=="Object"){throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties")}if(u){r.resolveSocket=true;let{socket:t,alpnProtocol:o,timeout:a}=await h(r);if(a){if(t){t.destroy()}const i=new Error(`Timed out resolving ALPN: ${r.timeout} ms`);i.code="ETIMEDOUT";i.ms=r.timeout;throw i}if(t&&r.createConnection){t.destroy();t=undefined}delete r.resolveSocket;const l=o==="h2";if(b){b=l?b.http2:b.https;r.agent=b}if(b===undefined){b=l?p:c.globalAgent}if(t){if(b===false){t.destroy()}else{const i=(l?d:c.Agent).prototype.createConnection;if(b.createConnection===i){if(l){r._reuseSocket=t}else{installSocket(b,t,r)}}else{t.destroy()}}}if(l){return g(new m(r,i))}}else if(b){r.agent=b.http}return g(l.request(r,i))};t.exports.protocolCache=b;t.exports.resolveProtocol=_;t.exports.createResolveProtocol=createResolveProtocol},8594:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const l=i(5158);const{Writable:c}=i(2781);const{Agent:u,globalAgent:h}=i(2066);const d=i(6128);const p=i(455);const{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_PROTOCOL:y,ERR_HTTP_HEADERS_SENT:g}=i(6060);const b=i(3123);const v=i(8260);const _=i(8217);const{HTTP2_HEADER_STATUS:w,HTTP2_HEADER_METHOD:E,HTTP2_HEADER_PATH:S,HTTP2_HEADER_AUTHORITY:R,HTTP2_METHOD_CONNECT:O}=l.constants;const x=Symbol("headers");const T=Symbol("origin");const k=Symbol("session");const A=Symbol("options");const C=Symbol("flushedHeaders");const P=Symbol("jobs");const I=Symbol("pendingAgentPromise");class ClientRequest extends c{constructor(t,r,i){super({autoDestroy:false,emitClose:false});if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}if(r.h2session){this[k]=r.h2session;if(this[k].destroyed){throw new Error("The session has been closed already")}this.protocol=this[k].socket.encrypted?"https:":"http:"}else if(r.agent===false){this.agent=new u({maxEmptySessions:0})}else if(typeof r.agent==="undefined"||r.agent===null){this.agent=h}else if(typeof r.agent.request==="function"){this.agent=r.agent}else{throw new m("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent)}if(this.agent){this.protocol=this.agent.protocol}if(r.protocol&&r.protocol!==this.protocol){throw new y(r.protocol,this.protocol)}if(!r.port){r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443}r.host=r.hostname||r.host||"localhost";delete r.hostname;const{timeout:l}=r;r.timeout=undefined;this[x]=Object.create(null);this[P]=[];this[I]=undefined;this.socket=null;this.connection=null;this.method=r.method||"GET";if(!(this.method==="CONNECT"&&(r.path==="/"||r.path===undefined))){this.path=r.path}this.res=null;this.aborted=false;this.reusedSocket=false;const{headers:c}=r;if(c){for(const t in c){this.setHeader(t,c[t])}}if(r.auth&&!("authorization"in this[x])){this[x].authorization="Basic "+Buffer.from(r.auth).toString("base64")}r.session=r.tlsSession;r.path=r.socketPath;this[A]=r;this[T]=new o(`${this.protocol}//${r.servername||r.host}:${r.port}`);const d=r._reuseSocket;if(d){r.createConnection=(...t)=>{if(d.destroyed){return this.agent.createConnection(...t)}return d};this.agent.getSession(this[T],this[A]).catch((()=>{}))}if(l){this.setTimeout(l)}if(i){this.once("response",i)}this[C]=false}get method(){return this[x][E]}set method(t){if(t){this[x][E]=t.toUpperCase()}}get path(){const t=this.method==="CONNECT"?R:S;return this[x][t]}set path(t){if(t){const r=this.method==="CONNECT"?R:S;this[x][r]=t}}get host(){return this[T].hostname}set host(t){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(t,r,i){if(this._mustNotHaveABody){i(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();const callWrite=()=>this._request.write(t,r,i);if(this._request){callWrite()}else{this[P].push(callWrite)}}_final(t){this.flushHeaders();const callEnd=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){t();return}this._request.end(t)};if(this._request){callEnd()}else{this[P].push(callEnd)}}abort(){if(this.res&&this.res.complete){return}if(!this.aborted){process.nextTick((()=>this.emit("abort")))}this.aborted=true;this.destroy()}async _destroy(t,r){if(this.res){this.res._dump()}if(this._request){this._request.destroy()}else{process.nextTick((()=>{this.emit("close")}))}try{await this[I]}catch(r){if(this.aborted){t=r}}r(t)}async flushHeaders(){if(this[C]||this.destroyed){return}this[C]=true;const t=this.method===O;const onStream=r=>{this._request=r;if(this.destroyed){r.destroy();return}if(!t){p(r,this,["timeout","continue"])}r.once("error",(t=>{this.destroy(t)}));r.once("aborted",(()=>{const{res:t}=this;if(t){t.aborted=true;t.emit("aborted");t.destroy()}else{this.destroy(new Error("The server aborted the HTTP/2 stream"))}}));const onResponse=(i,o,a)=>{const l=new d(this.socket,r.readableHighWaterMark);this.res=l;l.url=`${this[T].origin}${this.path}`;l.req=this;l.statusCode=i[w];l.headers=i;l.rawHeaders=a;l.once("end",(()=>{l.complete=true;l.socket=null;l.connection=null}));if(t){l.upgrade=true;if(this.emit("connect",l,r,Buffer.alloc(0))){this.emit("close")}else{r.destroy()}}else{r.on("data",(t=>{if(!l._dumped&&!l.push(t)){r.pause()}}));r.once("end",(()=>{if(!this.aborted){l.push(null)}}));if(!this.emit("response",l)){l._dump()}}};r.once("response",onResponse);r.once("headers",(t=>this.emit("information",{statusCode:t[w]})));r.once("trailers",((t,r,i)=>{const{res:o}=this;if(o===null){onResponse(t,r,i);return}o.trailers=t;o.rawTrailers=i}));r.once("close",(()=>{const{aborted:t,res:r}=this;if(r){if(t){r.aborted=true;r.emit("aborted");r.destroy()}const finish=()=>{r.emit("close");this.destroy();this.emit("close")};if(r.readable){r.once("end",finish)}else{finish()}return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated"));this.emit("close");return}this.destroy();this.emit("close")}));this.socket=new Proxy(r,_);for(const t of this[P]){t()}this.emit("socket",this.socket)};if(!(R in this[x])&&!t){this[x][R]=this[T].host}if(this[k]){try{onStream(this[k].request(this[x]))}catch(t){this.destroy(t)}}else{this.reusedSocket=true;try{const t=this.agent.request(this[T],this[A],this[x]);this[I]=t;onStream(await t);this[I]=false}catch(t){this[I]=false;this.destroy(t)}}}get connection(){return this.socket}set connection(t){this.socket=t}getHeaderNames(){return Object.keys(this[x])}hasHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return Boolean(this[x][t.toLowerCase()])}getHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return this[x][t.toLowerCase()]}get headersSent(){return this[C]}removeHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}if(this.headersSent){throw new g("remove")}delete this[x][t.toLowerCase()]}setHeader(t,r){if(this.headersSent){throw new g("set")}b(t);v(t,r);const i=t.toLowerCase();if(i==="connection"){if(r.toLowerCase()==="keep-alive"){return}throw new Error(`Invalid 'connection' header: ${r}`)}if(i==="host"&&this.method==="CONNECT"){this[x][R]=r}else{this[x][i]=r}}setNoDelay(){}setSocketKeepAlive(){}setTimeout(t,r){const applyTimeout=()=>this._request.setTimeout(t,r);if(this._request){applyTimeout()}else{this[P].push(applyTimeout)}return this}get maxHeadersCount(){if(!this.destroyed&&this._request){return this._request.session.localSettings.maxHeaderListSize}return undefined}set maxHeadersCount(t){}}t.exports=ClientRequest},6128:(t,r,i)=>{"use strict";const{Readable:o}=i(2781);class IncomingMessage extends o{constructor(t,r){super({emitClose:false,autoDestroy:true,highWaterMark:r});this.statusCode=null;this.statusMessage="";this.httpVersion="2.0";this.httpVersionMajor=2;this.httpVersionMinor=0;this.headers={};this.trailers={};this.req=null;this.aborted=false;this.complete=false;this.upgrade=null;this.rawHeaders=[];this.rawTrailers=[];this.socket=t;this._dumped=false}get connection(){return this.socket}set connection(t){this.socket=t}_destroy(t,r){if(!this.readableEnded){this.aborted=true}r();this.req._request.destroy(t)}setTimeout(t,r){this.req.setTimeout(t,r);return this}_dump(){if(!this._dumped){this._dumped=true;this.removeAllListeners("data");this.resume()}}_read(){if(this.req){this.req._request.resume()}}}t.exports=IncomingMessage},8115:(t,r,i)=>{"use strict";const o=i(5158);const{Agent:a,globalAgent:l}=i(2066);const c=i(8594);const u=i(6128);const h=i(574);const{HttpOverHttp2:d,HttpsOverHttp2:p}=i(7984);const m=i(5586);const{Http2OverHttp:y,Http2OverHttps:g}=i(642);const b=i(3123);const v=i(8260);const request=(t,r,i)=>new c(t,r,i);const get=(t,r,i)=>{const o=new c(t,r,i);o.end();return o};t.exports={...o,ClientRequest:c,IncomingMessage:u,Agent:a,globalAgent:l,request:request,get:get,auto:h,proxies:{HttpOverHttp2:d,HttpsOverHttp2:p,Http2OverHttp2:m,Http2OverHttp:y,Http2OverHttps:g},validateHeaderName:b,validateHeaderValue:v}},4415:t=>{"use strict";t.exports=t=>{const{username:r,password:i}=t.proxyOptions.url;if(r||i){const t=`${r}:${i}`;const o=`Basic ${Buffer.from(t).toString("base64")}`;return{"proxy-authorization":o,authorization:o}}return{}}},7984:(t,r,i)=>{"use strict";const o=i(4404);const a=i(3685);const l=i(5687);const c=i(9391);const{globalAgent:u}=i(2066);const h=i(7085);const d=i(5870);const p=i(4415);const createConnection=(t,r,i)=>{(async()=>{try{const{proxyOptions:a}=t;const{url:d,headers:m,raw:y}=a;const g=await u.request(d,a,{...p(t),...m,":method":"CONNECT",":authority":`${r.host}:${r.port}`});g.once("error",i);g.once("response",(a=>{const u=a[":status"];if(u!==200){i(new h(u));return}const d=t instanceof l.Agent;if(y&&d){r.socket=g;const t=o.connect(r);t.once("close",(()=>{g.destroy()}));i(null,t);return}const p=new c(g);p.encrypted=false;p._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};i(null,p)}))}catch(t){i(t)}})()};class HttpOverHttp2 extends a.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}class HttpsOverHttp2 extends l.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}t.exports={HttpOverHttp2:HttpOverHttp2,HttpsOverHttp2:HttpsOverHttp2}},642:(t,r,i)=>{"use strict";const o=i(3685);const a=i(5687);const l=i(8080);const c=i(4415);const getStream=t=>new Promise(((r,i)=>{const onConnect=(o,a,l)=>{a.unshift(l);t.off("error",i);r([a,o.statusCode])};t.once("error",i);t.once("connect",onConnect)}));class Http2OverHttp extends l{async _getProxyStream(t){const{proxyOptions:r}=this;const{url:i,headers:l}=this.proxyOptions;const u=i.protocol==="https:"?a:o;const h=u.request({...r,hostname:i.hostname,port:i.port,path:t,headers:{...c(this),...l,host:t},method:"CONNECT"}).end();return getStream(h)}}t.exports={Http2OverHttp:Http2OverHttp,Http2OverHttps:Http2OverHttp}},5586:(t,r,i)=>{"use strict";const{globalAgent:o}=i(2066);const a=i(8080);const l=i(4415);const getStatusCode=t=>new Promise(((r,i)=>{t.once("error",i);t.once("response",(o=>{t.off("error",i);r(o[":status"])}))}));class Http2OverHttp2 extends a{async _getProxyStream(t){const{proxyOptions:r}=this;const i={...l(this),...r.headers,":method":"CONNECT",":authority":t};const a=await o.request(r.url,r,i);const c=await getStatusCode(a);return[a,c]}}t.exports=Http2OverHttp2},8080:(t,r,i)=>{"use strict";const{Agent:o}=i(2066);const a=i(9391);const l=i(7085);const c=i(5870);class Http2OverHttpX extends o{constructor(t){super(t);c(this,t.proxyOptions)}async createConnection(t,r){const i=`${t.hostname}:${t.port||443}`;const[o,c]=await this._getProxyStream(i);if(c!==200){throw new l(c)}if(this.proxyOptions.raw){r.socket=o}else{const t=new a(o);t.encrypted=false;t._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};return t}return super.createConnection(t,r)}}t.exports=Http2OverHttpX},5870:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(2115);t.exports=(t,r)=>{a("proxyOptions",r,["object"]);a("proxyOptions.headers",r.headers,["object","undefined"]);a("proxyOptions.raw",r.raw,["boolean","undefined"]);a("proxyOptions.url",r.url,[o,"string"]);const i=new o(r.url);t.proxyOptions={raw:true,...r,headers:{...r.headers},url:i}}},7085:t=>{"use strict";class UnexpectedStatusCodeError extends Error{constructor(t){super(`The proxy server rejected the request with status code ${t}`);this.statusCode=t}}t.exports=UnexpectedStatusCodeError},2199:(t,r,i)=>{"use strict";const{isIP:o}=i(1808);const a=i(9491);const getHost=t=>{if(t[0]==="["){const r=t.indexOf("]");a(r!==-1);return t.slice(1,r)}const r=t.indexOf(":");if(r===-1){return t}return t.slice(0,r)};t.exports=t=>{const r=getHost(t);if(o(r)){return""}return r}},2115:t=>{"use strict";const checkType=(t,r,i)=>{const o=i.some((t=>{const i=typeof t;if(i==="string"){return typeof r===t}return r instanceof t}));if(!o){const o=i.map((t=>typeof t==="string"?t:t.name));throw new TypeError(`Expected '${t}' to be a type of ${o.join(" or ")}, got ${typeof r}`)}};t.exports=checkType},390:t=>{"use strict";t.exports=t=>{if(t.listenerCount("error")!==0){return}t.__destroy=t._destroy;t._destroy=(...r)=>{const i=r.pop();t.__destroy(...r,(async t=>{await Promise.resolve();i(t)}))};const onError=r=>{Promise.resolve().then((()=>{t.emit("error",r)}))};t.once("error",onError);Promise.resolve().then((()=>{t.off("error",onError)}));return t}},6060:t=>{"use strict";const makeError=(r,i,o)=>{t.exports[i]=class NodeError extends r{constructor(...t){super(typeof o==="string"?o:o(t));this.name=`${super.name} [${i}]`;this.code=i}}};makeError(TypeError,"ERR_INVALID_ARG_TYPE",(t=>{const r=t[0].includes(".")?"property":"argument";let i=t[1];const o=Array.isArray(i);if(o){i=`${i.slice(0,-1).join(", ")} or ${i.slice(-1)}`}return`The "${t[0]}" ${r} must be ${o?"one of":"of"} type ${i}. Received ${typeof t[2]}`}));makeError(TypeError,"ERR_INVALID_PROTOCOL",(t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`));makeError(Error,"ERR_HTTP_HEADERS_SENT",(t=>`Cannot ${t[0]} headers after they are sent to the client`));makeError(TypeError,"ERR_INVALID_HTTP_TOKEN",(t=>`${t[0]} must be a valid HTTP token [${t[1]}]`));makeError(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",(t=>`Invalid value "${t[0]} for header "${t[1]}"`));makeError(TypeError,"ERR_INVALID_CHAR",(t=>`Invalid character in ${t[0]} [${t[1]}]`));makeError(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")},7812:t=>{"use strict";t.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return true;default:return false}}},9391:(t,r,i)=>{"use strict";const o=i(2781);const a=i(4404);const l=new a.TLSSocket(new o.PassThrough)._handle._parentWrap.constructor;t.exports=l},455:t=>{"use strict";t.exports=(t,r,i)=>{for(const o of i){t.on(o,((...t)=>r.emit(o,...t)))}}},8217:(t,r,i)=>{"use strict";const{ERR_HTTP2_NO_SOCKET_MANIPULATION:o}=i(6060);const a={has(t,r){const i=t.session===undefined?t:t.session.socket;return r in t||r in i},get(t,r){switch(r){case"on":case"once":case"end":case"emit":case"destroy":return t[r].bind(t);case"writable":case"destroyed":return t[r];case"readable":if(t.destroyed){return false}return t.readable;case"setTimeout":{const{session:r}=t;if(r!==undefined){return r.setTimeout.bind(r)}return t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new o;default:{const i=t.session===undefined?t:t.session.socket;const o=i[r];return typeof o==="function"?o.bind(i):o}}},getPrototypeOf(t){if(t.session!==undefined){return Reflect.getPrototypeOf(t.session.socket)}return Reflect.getPrototypeOf(t)},set(t,r,i){switch(r){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":t[r]=i;return true;case"setTimeout":{const{session:r}=t;if(r===undefined){t.setTimeout=i}else{r.setTimeout=i}return true}case"write":case"read":case"pause":case"resume":throw new o;default:{const o=t.session===undefined?t:t.session.socket;o[r]=i;return true}}}};t.exports=a},3123:(t,r,i)=>{"use strict";const{ERR_INVALID_HTTP_TOKEN:o}=i(6060);const a=i(7812);const l=/^[\^`\-\w!#$%&*+.|~]+$/;t.exports=t=>{if(typeof t!=="string"||!l.test(t)&&!a(t)){throw new o("Header name",t)}}},8260:(t,r,i)=>{"use strict";const{ERR_HTTP_INVALID_HEADER_VALUE:o,ERR_INVALID_CHAR:a}=i(6060);const l=/[^\t\u0020-\u007E\u0080-\u00FF]/;t.exports=(t,r)=>{if(typeof r==="undefined"){throw new o(r,t)}if(l.test(r)){throw new a("header content",t)}}},2058:t=>{function makeArray(t){return Array.isArray(t)?t:[t]}const r="";const i=" ";const o="\\";const a=/^\s+$/;const l=/^\\!/;const c=/^\\#/;const u=/\r?\n/g;const h=/^\.*\/|^\.+$/;const d="/";const p=typeof Symbol!=="undefined"?Symbol.for("node-ignore"):"node-ignore";const define=(t,r,i)=>Object.defineProperty(t,r,{value:i});const m=/([0-z])-([0-z])/g;const RETURN_FALSE=()=>false;const sanitizeRange=t=>t.replace(m,((t,i,o)=>i.charCodeAt(0)<=o.charCodeAt(0)?t:r));const cleanRangeBackSlash=t=>{const{length:r}=t;return t.slice(0,r-r%2)};const y=[[/\\?\s+$/,t=>t.indexOf("\\")===0?i:r],[/\\\s/g,()=>i],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function startingReplacer(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,r,i)=>r+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,r)=>`${r}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>o],[/\\\\/g,()=>o],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,r,i,a,l)=>r===o?`\\[${i}${cleanRangeBackSlash(a)}${l}`:l==="]"?a.length%2===0?`[${sanitizeRange(i)}${a}]`:"[]":"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,r)=>{const i=r?`${r}[^/]+`:"[^/]*";return`${i}(?=$|\\/$)`}]];const g=Object.create(null);const makeRegex=(t,r)=>{let i=g[t];if(!i){i=y.reduce(((r,i)=>r.replace(i[0],i[1].bind(t))),t);g[t]=i}return r?new RegExp(i,"i"):new RegExp(i)};const isString=t=>typeof t==="string";const checkPattern=t=>t&&isString(t)&&!a.test(t)&&t.indexOf("#")!==0;const splitPattern=t=>t.split(u);class IgnoreRule{constructor(t,r,i,o){this.origin=t;this.pattern=r;this.negative=i;this.regex=o}}const createRule=(t,r)=>{const i=t;let o=false;if(t.indexOf("!")===0){o=true;t=t.substr(1)}t=t.replace(l,"!").replace(c,"#");const a=makeRegex(t,r);return new IgnoreRule(i,t,o,a)};const throwError=(t,r)=>{throw new r(t)};const checkPath=(t,r,i)=>{if(!isString(t)){return i(`path must be a string, but got \`${r}\``,TypeError)}if(!t){return i(`path must not be empty`,TypeError)}if(checkPath.isNotRelative(t)){const t="`path.relative()`d";return i(`path should be a ${t} string, but got "${r}"`,RangeError)}return true};const isNotRelative=t=>h.test(t);checkPath.isNotRelative=isNotRelative;checkPath.convert=t=>t;class Ignore{constructor({ignorecase:t=true,ignoreCase:r=t,allowRelativePaths:i=false}={}){define(this,p,true);this._rules=[];this._ignoreCase=r;this._allowRelativePaths=i;this._initCache()}_initCache(){this._ignoreCache=Object.create(null);this._testCache=Object.create(null)}_addPattern(t){if(t&&t[p]){this._rules=this._rules.concat(t._rules);this._added=true;return}if(checkPattern(t)){const r=createRule(t,this._ignoreCase);this._added=true;this._rules.push(r)}}add(t){this._added=false;makeArray(isString(t)?splitPattern(t):t).forEach(this._addPattern,this);if(this._added){this._initCache()}return this}addPattern(t){return this.add(t)}_testOne(t,r){let i=false;let o=false;this._rules.forEach((a=>{const{negative:l}=a;if(o===l&&i!==o||l&&!i&&!o&&!r){return}const c=a.regex.test(t);if(c){i=!l;o=l}}));return{ignored:i,unignored:o}}_test(t,r,i,o){const a=t&&checkPath.convert(t);checkPath(a,t,this._allowRelativePaths?RETURN_FALSE:throwError);return this._t(a,r,i,o)}_t(t,r,i,o){if(t in r){return r[t]}if(!o){o=t.split(d)}o.pop();if(!o.length){return r[t]=this._testOne(t,i)}const a=this._t(o.join(d)+d,r,i,o);return r[t]=a.ignored?a:this._testOne(t,i)}ignores(t){return this._test(t,this._ignoreCache,false).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return makeArray(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,true)}}const factory=t=>new Ignore(t);const isPathValid=t=>checkPath(t&&checkPath.convert(t),t,RETURN_FALSE);factory.isPathValid=isPathValid;factory.default=factory;t.exports=factory;if(typeof process!=="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const makePosix=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");checkPath.convert=makePosix;const t=/^[a-z]:\//i;checkPath.isNotRelative=r=>t.test(r)||isNotRelative(r)}},7022:(t,r,i)=>{var o=i(7564);var a=Object.create(null);var l=i(3306);t.exports=o(inflight);function inflight(t,r){if(a[t]){a[t].push(r);return null}else{a[t]=[r];return makeres(t)}}function makeres(t){return l((function RES(){var r=a[t];var i=r.length;var o=slice(arguments);try{for(var l=0;l<i;l++){r[l].apply(null,o)}}finally{if(r.length>i){r.splice(0,i);process.nextTick((function(){RES.apply(null,o)}))}else{delete a[t]}}}))}function slice(t){var r=t.length;var i=[];for(var o=0;o<r;o++)i[o]=t[o];return i}},3193:(t,r,i)=>{try{var o=i(3837);if(typeof o.inherits!=="function")throw"";t.exports=o.inherits}catch(r){t.exports=i(1140)}},1140:t=>{if(typeof Object.create==="function"){t.exports=function inherits(t,r){if(r){t.super_=r;t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}})}}}else{t.exports=function inherits(t,r){if(r){t.super_=r;var TempCtor=function(){};TempCtor.prototype=r.prototype;t.prototype=new TempCtor;t.prototype.constructor=t}}}},9764:(t,r)=>{r.parse=r.decode=decode;r.stringify=r.encode=encode;r.safe=safe;r.unsafe=unsafe;var i=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(t,r){var o=[];var a="";if(typeof r==="string"){r={section:r,whitespace:false}}else{r=r||{};r.whitespace=r.whitespace===true}var l=r.whitespace?" = ":"=";Object.keys(t).forEach((function(r,c,u){var h=t[r];if(h&&Array.isArray(h)){h.forEach((function(t){a+=safe(r+"[]")+l+safe(t)+"\n"}))}else if(h&&typeof h==="object")o.push(r);else a+=safe(r)+l+safe(h)+i}));if(r.section&&a.length)a="["+safe(r.section)+"]"+i+a;o.forEach((function(o,l,c){var u=dotSplit(o).join("\\.");var h=(r.section?r.section+".":"")+u;var d=encode(t[o],{section:h,whitespace:r.whitespace});if(a.length&&d.length)a+=i;a+=d}));return a}function dotSplit(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(t){return t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(t){var r={};var i=r;var o=null;var a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var l=t.split(/[\r\n]+/g);l.forEach((function(t,l,c){if(!t||t.match(/^\s*[;#]/))return;var u=t.match(a);if(!u)return;if(u[1]!==undefined){o=unsafe(u[1]);if(o==="__proto__"){i={};return}i=r[o]=r[o]||{};return}var h=unsafe(u[2]);if(h==="__proto__")return;var d=u[3]?unsafe(u[4]):true;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(h.length>2&&h.slice(-2)==="[]"){h=h.substring(0,h.length-2);if(h==="__proto__")return;if(!i[h])i[h]=[];else if(!Array.isArray(i[h]))i[h]=[i[h]]}if(Array.isArray(i[h]))i[h].push(d);else i[h]=d}));Object.keys(r).filter((function(t,i,o){if(!r[t]||typeof r[t]!=="object"||Array.isArray(r[t]))return false;var a=dotSplit(t);var l=r;var c=a.pop();var u=c.replace(/\\\./g,".");a.forEach((function(t,r,i){if(t==="__proto__")return;if(!l[t]||typeof l[t]!=="object")l[t]={};l=l[t]}));if(l===r&&u===c)return false;l[u]=r[t];return true})).forEach((function(t,i,o){delete r[t]}));return r}function isQuoted(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function safe(t){return typeof t!=="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&isQuoted(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(t,r){t=(t||"").trim();if(isQuoted(t)){if(t.charAt(0)==="'")t=t.substr(1,t.length-2);try{t=JSON.parse(t)}catch(t){}}else{var i=false;var o="";for(var a=0,l=t.length;a<l;a++){var c=t.charAt(a);if(i){if("\\;#".indexOf(c)!==-1)o+=c;else o+="\\"+c;i=false}else if(";#".indexOf(c)!==-1)break;else if(c==="\\")i=true;else o+=c}if(i)o+="\\";return o.trim()}return t}},4055:t=>{
|
|
35
85
|
/*!
|
|
36
86
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
37
87
|
*
|
|
38
88
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
39
89
|
* Licensed under the MIT License.
|
|
40
90
|
*/
|
|
41
|
-
t.exports=function isExtglob(t){if(typeof t!=="string"||t===""){return false}var r;while(r=/(\\).|([@?!+*]\(.*\))/g.exec(t)){if(r[2])return true;t=t.slice(r.index+r[0].length)}return false}},
|
|
91
|
+
t.exports=function isExtglob(t){if(typeof t!=="string"||t===""){return false}var r;while(r=/(\\).|([@?!+*]\(.*\))/g.exec(t)){if(r[2])return true;t=t.slice(r.index+r[0].length)}return false}},162:(t,r,i)=>{
|
|
42
92
|
/*!
|
|
43
93
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
44
94
|
*
|
|
45
95
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
46
96
|
* Released under the MIT License.
|
|
47
97
|
*/
|
|
48
|
-
var o=i(
|
|
98
|
+
var o=i(4055);var a={"{":"}","(":")","[":"]"};var strictCheck=function(t){if(t[0]==="!"){return true}var r=0;var i=-2;var o=-2;var l=-2;var c=-2;var u=-2;while(r<t.length){if(t[r]==="*"){return true}if(t[r+1]==="?"&&/[\].+)]/.test(t[r])){return true}if(o!==-1&&t[r]==="["&&t[r+1]!=="]"){if(o<r){o=t.indexOf("]",r)}if(o>r){if(u===-1||u>o){return true}u=t.indexOf("\\",r);if(u===-1||u>o){return true}}}if(l!==-1&&t[r]==="{"&&t[r+1]!=="}"){l=t.indexOf("}",r);if(l>r){u=t.indexOf("\\",r);if(u===-1||u>l){return true}}}if(c!==-1&&t[r]==="("&&t[r+1]==="?"&&/[:!=]/.test(t[r+2])&&t[r+3]!==")"){c=t.indexOf(")",r);if(c>r){u=t.indexOf("\\",r);if(u===-1||u>c){return true}}}if(i!==-1&&t[r]==="("&&t[r+1]!=="|"){if(i<r){i=t.indexOf("|",r)}if(i!==-1&&t[i+1]!==")"){c=t.indexOf(")",i);if(c>i){u=t.indexOf("\\",i);if(u===-1||u>c){return true}}}}if(t[r]==="\\"){var h=t[r+1];r+=2;var d=a[h];if(d){var p=t.indexOf(d,r);if(p!==-1){r=p+1}}if(t[r]==="!"){return true}}else{r++}}return false};var relaxedCheck=function(t){if(t[0]==="!"){return true}var r=0;while(r<t.length){if(/[*?{}()[\]]/.test(t[r])){return true}if(t[r]==="\\"){var i=t[r+1];r+=2;var o=a[i];if(o){var l=t.indexOf(o,r);if(l!==-1){r=l+1}}if(t[r]==="!"){return true}}else{r++}}return false};t.exports=function isGlob(t,r){if(typeof t!=="string"||t===""){return false}if(o(t)){return true}var i=strictCheck;if(r&&r.strict===false){i=relaxedCheck}return i(t)}},2773:t=>{"use strict";
|
|
49
99
|
/*!
|
|
50
100
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|
51
101
|
*
|
|
52
102
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
53
103
|
* Released under the MIT License.
|
|
54
|
-
*/t.exports=function(t){if(typeof t==="number"){return t-t===0}if(typeof t==="string"&&t.trim()!==""){return Number.isFinite?Number.isFinite(+t):isFinite(+t)}return false}},2212:(t,r,i)=>{var o=i(7147);var a;if(process.platform==="win32"||global.TESTING_WINDOWS){a=i(476)}else{a=i(5836)}t.exports=isexe;isexe.sync=sync;function isexe(t,r,i){if(typeof r==="function"){i=r;r={}}if(!i){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(i,o){isexe(t,r||{},(function(t,r){if(t){o(t)}else{i(r)}}))}))}a(t,r||{},(function(t,o){if(t){if(t.code==="EACCES"||r&&r.ignoreErrors){t=null;o=false}}i(t,o)}))}function sync(t,r){try{return a.sync(t,r||{})}catch(t){if(r&&r.ignoreErrors||t.code==="EACCES"){return false}else{throw t}}}},5836:(t,r,i)=>{t.exports=isexe;isexe.sync=sync;var o=i(7147);function isexe(t,r,i){o.stat(t,(function(t,o){i(t,t?false:checkStat(o,r))}))}function sync(t,r){return checkStat(o.statSync(t),r)}function checkStat(t,r){return t.isFile()&&checkMode(t,r)}function checkMode(t,r){var i=t.mode;var o=t.uid;var a=t.gid;var c=r.uid!==undefined?r.uid:process.getuid&&process.getuid();var l=r.gid!==undefined?r.gid:process.getgid&&process.getgid();var u=parseInt("100",8);var h=parseInt("010",8);var d=parseInt("001",8);var p=u|h;var m=i&d||i&h&&a===l||i&u&&o===c||i&p&&c===0;return m}},476:(t,r,i)=>{t.exports=isexe;isexe.sync=sync;var o=i(7147);function checkPathExt(t,r){var i=r.pathExt!==undefined?r.pathExt:process.env.PATHEXT;if(!i){return true}i=i.split(";");if(i.indexOf("")!==-1){return true}for(var o=0;o<i.length;o++){var a=i[o].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a){return true}}return false}function checkStat(t,r,i){if(!t.isSymbolicLink()&&!t.isFile()){return false}return checkPathExt(r,i)}function isexe(t,r,i){o.stat(t,(function(o,a){i(o,o?false:checkStat(a,t,r))}))}function sync(t,r){return checkStat(o.statSync(t),t,r)}},9792:(t,r)=>{r.stringify=function stringify(t){if("undefined"==typeof t)return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON)t=t.toJSON();if(t&&"object"===typeof t){var r="";var i=Array.isArray(t);r=i?"[":"{";var o=true;for(var a in t){var c="function"==typeof t[a]||!i&&"undefined"===typeof t[a];if(Object.hasOwnProperty.call(t,a)&&!c){if(!o)r+=",";o=false;if(i){if(t[a]==undefined)r+="null";else r+=stringify(t[a])}else if(t[a]!==void 0){r+=stringify(a)+":"+stringify(t[a])}}}r+=i?"]":"}";return r}else if("string"===typeof t){return JSON.stringify(/^:/.test(t)?":"+t:t)}else if("undefined"===typeof t){return"null"}else return JSON.stringify(t)};r.parse=function(t){return JSON.parse(t,(function(t,r){if("string"===typeof r){if(/^:base64:/.test(r))return Buffer.from(r.substring(8),"base64");else return/^:/.test(r)?r.substring(1):r}return r}))}},5326:(t,r,i)=>{"use strict";const o=i(2361);const a=i(9792);BigInt.prototype.toJSON=function(){return this.toString()};const loadStore=t=>{const r={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd"};if(t.adapter||t.uri){const i=t.adapter||/^[^:]*/.exec(t.uri)[0];return new(require(r[i]))(t)}return new Map};class Keyv extends o{constructor(t,r){super();this.opts=Object.assign({namespace:"keyv",serialize:a.stringify,deserialize:a.parse},typeof t==="string"?{uri:t}:t,r);if(!this.opts.store){const t=Object.assign({},this.opts);this.opts.store=loadStore(t)}if(typeof this.opts.store.on==="function"){this.opts.store.on("error",(t=>this.emit("error",t)))}this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(t){return`${this.opts.namespace}:${t}`}get(t,r){const i=this._getKeyPrefix(t);const{store:o}=this.opts;return Promise.resolve().then((()=>o.get(i))).then((t=>typeof t==="string"?this.opts.deserialize(t):t)).then((i=>{if(i===undefined||i===null){return undefined}if(typeof i.expires==="number"&&Date.now()>i.expires){this.delete(t);return undefined}return r&&r.raw?i:i.value}))}set(t,r,i){const o=this._getKeyPrefix(t);if(typeof i==="undefined"){i=this.opts.ttl}if(i===0){i=undefined}const{store:a}=this.opts;return Promise.resolve().then((()=>{const t=typeof i==="number"?Date.now()+i:null;if(typeof r==="symbol"){this.emit("error","symbol cannot be serialized")}r={value:r,expires:t};return this.opts.serialize(r)})).then((t=>a.set(o,t,i))).then((()=>true))}delete(t){const r=this._getKeyPrefix(t);const{store:i}=this.opts;return Promise.resolve().then((()=>i.delete(r)))}clear(){const{store:t}=this.opts;return Promise.resolve().then((()=>t.clear()))}}t.exports=Keyv},5761:t=>{"use strict";const{FORCE_COLOR:r,NODE_DISABLE_COLORS:i,TERM:o}=process.env;const a={enabled:!i&&o!=="dumb"&&r!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(t,r){let i=0,o,a="",c="";for(;i<t.length;i++){o=t[i];a+=o.open;c+=o.close;if(r.includes(o.close)){r=r.replace(o.rgx,o.close+o.open)}}return a+r+c}function chain(t,r){let i={has:t,keys:r};i.reset=a.reset.bind(i);i.bold=a.bold.bind(i);i.dim=a.dim.bind(i);i.italic=a.italic.bind(i);i.underline=a.underline.bind(i);i.inverse=a.inverse.bind(i);i.hidden=a.hidden.bind(i);i.strikethrough=a.strikethrough.bind(i);i.black=a.black.bind(i);i.red=a.red.bind(i);i.green=a.green.bind(i);i.yellow=a.yellow.bind(i);i.blue=a.blue.bind(i);i.magenta=a.magenta.bind(i);i.cyan=a.cyan.bind(i);i.white=a.white.bind(i);i.gray=a.gray.bind(i);i.grey=a.grey.bind(i);i.bgBlack=a.bgBlack.bind(i);i.bgRed=a.bgRed.bind(i);i.bgGreen=a.bgGreen.bind(i);i.bgYellow=a.bgYellow.bind(i);i.bgBlue=a.bgBlue.bind(i);i.bgMagenta=a.bgMagenta.bind(i);i.bgCyan=a.bgCyan.bind(i);i.bgWhite=a.bgWhite.bind(i);return i}function init(t,r){let i={open:`[${t}m`,close:`[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(r){if(this!==void 0&&this.has!==void 0){this.has.includes(t)||(this.has.push(t),this.keys.push(i));return r===void 0?this:a.enabled?run(this.keys,r+""):r+""}return r===void 0?chain([t],[i]):a.enabled?run([i],r+""):r+""}}t.exports=a},7976:t=>{"use strict";t.exports=t=>{const r={};for(const[i,o]of Object.entries(t)){r[i.toLowerCase()]=o}return r}},8465:(t,r,i)=>{"use strict";const o=i(7147);const a=i(1017);const{promisify:c}=i(3837);const l=i(8999);const u=l.satisfies(process.version,">=10.12.0");const checkPath=t=>{if(process.platform==="win32"){const r=/[<>:"|?*]/.test(t.replace(a.parse(t).root,""));if(r){const r=new Error(`Path contains invalid characters: ${t}`);r.code="EINVAL";throw r}}};const processOptions=t=>{const r={mode:511,fs:o};return{...r,...t}};const permissionError=t=>{const r=new Error(`operation not permitted, mkdir '${t}'`);r.code="EPERM";r.errno=-4048;r.path=t;r.syscall="mkdir";return r};const makeDir=async(t,r)=>{checkPath(t);r=processOptions(r);const i=c(r.fs.mkdir);const l=c(r.fs.stat);if(u&&r.fs.mkdir===o.mkdir){const o=a.resolve(t);await i(o,{mode:r.mode,recursive:true});return o}const make=async t=>{try{await i(t,r.mode);return t}catch(r){if(r.code==="EPERM"){throw r}if(r.code==="ENOENT"){if(a.dirname(t)===t){throw permissionError(t)}if(r.message.includes("null bytes")){throw r}await make(a.dirname(t));return make(t)}try{const r=await l(t);if(!r.isDirectory()){throw new Error("The path is not a directory")}}catch(t){throw r}return t}};return make(a.resolve(t))};t.exports=makeDir;t.exports.sync=(t,r)=>{checkPath(t);r=processOptions(r);if(u&&r.fs.mkdirSync===o.mkdirSync){const i=a.resolve(t);o.mkdirSync(i,{mode:r.mode,recursive:true});return i}const make=t=>{try{r.fs.mkdirSync(t,r.mode)}catch(i){if(i.code==="EPERM"){throw i}if(i.code==="ENOENT"){if(a.dirname(t)===t){throw permissionError(t)}if(i.message.includes("null bytes")){throw i}make(a.dirname(t));return make(t)}try{if(!r.fs.statSync(t).isDirectory()){throw new Error("The path is not a directory")}}catch(t){throw i}}return t};return make(a.resolve(t))}},1382:(t,r,i)=>{"use strict";const o=i(2781);const a=o.PassThrough;const c=Array.prototype.slice;t.exports=merge2;function merge2(){const t=[];const r=c.call(arguments);let i=false;let o=r[r.length-1];if(o&&!Array.isArray(o)&&o.pipe==null){r.pop()}else{o={}}const l=o.end!==false;const u=o.pipeError===true;if(o.objectMode==null){o.objectMode=true}if(o.highWaterMark==null){o.highWaterMark=64*1024}const h=a(o);function addStream(){for(let r=0,i=arguments.length;r<i;r++){t.push(pauseStreams(arguments[r],o))}mergeStream();return this}function mergeStream(){if(i){return}i=true;let r=t.shift();if(!r){process.nextTick(endStream);return}if(!Array.isArray(r)){r=[r]}let o=r.length+1;function next(){if(--o>0){return}i=false;mergeStream()}function pipe(t){function onend(){t.removeListener("merge2UnpipeEnd",onend);t.removeListener("end",onend);if(u){t.removeListener("error",onerror)}next()}function onerror(t){h.emit("error",t)}if(t._readableState.endEmitted){return next()}t.on("merge2UnpipeEnd",onend);t.on("end",onend);if(u){t.on("error",onerror)}t.pipe(h,{end:false});t.resume()}for(let t=0;t<r.length;t++){pipe(r[t])}next()}function endStream(){i=false;h.emit("queueDrain");if(l){h.end()}}h.setMaxListeners(0);h.add=addStream;h.on("unpipe",(function(t){t.emit("merge2UnpipeEnd")}));if(r.length){addStream.apply(null,r)}return h}function pauseStreams(t,r){if(!Array.isArray(t)){if(!t._readableState&&t.pipe){t=t.pipe(a(r))}if(!t._readableState||!t.pause||!t.pipe){throw new Error("Only readable stream can be merged.")}t.pause()}else{for(let i=0,o=t.length;i<o;i++){t[i]=pauseStreams(t[i],r)}}return t}},1224:(t,r,i)=>{"use strict";const o=i(3837);const a=i(1570);const c=i(376);const l=i(8658);const isEmptyString=t=>t===""||t==="./";const micromatch=(t,r,i)=>{r=[].concat(r);t=[].concat(t);let o=new Set;let a=new Set;let l=new Set;let u=0;let onResult=t=>{l.add(t.output);if(i&&i.onResult){i.onResult(t)}};for(let l=0;l<r.length;l++){let h=c(String(r[l]),{...i,onResult:onResult},true);let d=h.state.negated||h.state.negatedExtglob;if(d)u++;for(let r of t){let t=h(r,true);let i=d?!t.isMatch:t.isMatch;if(!i)continue;if(d){o.add(t.output)}else{o.delete(t.output);a.add(t.output)}}}let h=u===r.length?[...l]:[...a];let d=h.filter((t=>!o.has(t)));if(i&&d.length===0){if(i.failglob===true){throw new Error(`No matches found for "${r.join(", ")}"`)}if(i.nonull===true||i.nullglob===true){return i.unescape?r.map((t=>t.replace(/\\/g,""))):r}}return d};micromatch.match=micromatch;micromatch.matcher=(t,r)=>c(t,r);micromatch.isMatch=(t,r,i)=>c(r,i)(t);micromatch.any=micromatch.isMatch;micromatch.not=(t,r,i={})=>{r=[].concat(r).map(String);let o=new Set;let a=[];let onResult=t=>{if(i.onResult)i.onResult(t);a.push(t.output)};let c=micromatch(t,r,{...i,onResult:onResult});for(let t of a){if(!c.includes(t)){o.add(t)}}return[...o]};micromatch.contains=(t,r,i)=>{if(typeof t!=="string"){throw new TypeError(`Expected a string: "${o.inspect(t)}"`)}if(Array.isArray(r)){return r.some((r=>micromatch.contains(t,r,i)))}if(typeof r==="string"){if(isEmptyString(t)||isEmptyString(r)){return false}if(t.includes(r)||t.startsWith("./")&&t.slice(2).includes(r)){return true}}return micromatch.isMatch(t,r,{...i,contains:true})};micromatch.matchKeys=(t,r,i)=>{if(!l.isObject(t)){throw new TypeError("Expected the first argument to be an object")}let o=micromatch(Object.keys(t),r,i);let a={};for(let r of o)a[r]=t[r];return a};micromatch.some=(t,r,i)=>{let o=[].concat(t);for(let t of[].concat(r)){let r=c(String(t),i);if(o.some((t=>r(t)))){return true}}return false};micromatch.every=(t,r,i)=>{let o=[].concat(t);for(let t of[].concat(r)){let r=c(String(t),i);if(!o.every((t=>r(t)))){return false}}return true};micromatch.all=(t,r,i)=>{if(typeof t!=="string"){throw new TypeError(`Expected a string: "${o.inspect(t)}"`)}return[].concat(r).every((r=>c(r,i)(t)))};micromatch.capture=(t,r,i)=>{let o=l.isWindows(i);let a=c.makeRe(String(t),{...i,capture:true});let u=a.exec(o?l.toPosixSlashes(r):r);if(u){return u.slice(1).map((t=>t===void 0?"":t))}};micromatch.makeRe=(...t)=>c.makeRe(...t);micromatch.scan=(...t)=>c.scan(...t);micromatch.parse=(t,r)=>{let i=[];for(let o of[].concat(t||[])){for(let t of a(String(o),r)){i.push(c.parse(t,r))}}return i};micromatch.braces=(t,r)=>{if(typeof t!=="string")throw new TypeError("Expected a string");if(r&&r.nobrace===true||!/\{.*\}/.test(t)){return[t]}return a(t,r)};micromatch.braceExpand=(t,r)=>{if(typeof t!=="string")throw new TypeError("Expected a string");return micromatch.braces(t,{...r,expand:true})};t.exports=micromatch},9958:t=>{"use strict";const r=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];t.exports=(t,i)=>{const o=new Set(Object.keys(t).concat(r));for(const r of o){if(r in i){continue}i[r]=typeof t[r]==="function"?t[r].bind(t):t[r]}}},2693:t=>{"use strict";const r=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];t.exports=(t,i)=>{if(i._readableState.autoDestroy){throw new Error("The second stream must have the `autoDestroy` option set to `false`")}const o=new Set(Object.keys(t).concat(r));const a={};for(const r of o){if(r in i){continue}a[r]={get(){const i=t[r];const o=typeof i==="function";return o?i.bind(t):i},set(i){t[r]=i},enumerable:true,configurable:false}}Object.defineProperties(i,a);t.once("aborted",(()=>{i.destroy();i.emit("aborted")}));t.once("close",(()=>{if(t.complete){if(i.readable){i.once("end",(()=>{i.emit("close")}))}else{i.emit("close")}}else{i.emit("close")}}));return i}},4235:(t,r,i)=>{t.exports=minimatch;minimatch.Minimatch=Minimatch;var o=function(){try{return i(1017)}catch(t){}}()||{sep:"/"};minimatch.sep=o.sep;var a=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var c=i(7847);var l={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var u="[^/]";var h=u+"*?";var d="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var p="(?:(?!(?:\\/|^)\\.).)*?";var m=charSet("().*{}+?[]^$\\!");function charSet(t){return t.split("").reduce((function(t,r){t[r]=true;return t}),{})}var g=/\/+/;minimatch.filter=filter;function filter(t,r){r=r||{};return function(i,o,a){return minimatch(i,t,r)}}function ext(t,r){r=r||{};var i={};Object.keys(t).forEach((function(r){i[r]=t[r]}));Object.keys(r).forEach((function(t){i[t]=r[t]}));return i}minimatch.defaults=function(t){if(!t||typeof t!=="object"||!Object.keys(t).length){return minimatch}var r=minimatch;var i=function minimatch(i,o,a){return r(i,o,ext(t,a))};i.Minimatch=function Minimatch(i,o){return new r.Minimatch(i,ext(t,o))};i.Minimatch.defaults=function defaults(i){return r.defaults(ext(t,i)).Minimatch};i.filter=function filter(i,o){return r.filter(i,ext(t,o))};i.defaults=function defaults(i){return r.defaults(ext(t,i))};i.makeRe=function makeRe(i,o){return r.makeRe(i,ext(t,o))};i.braceExpand=function braceExpand(i,o){return r.braceExpand(i,ext(t,o))};i.match=function(i,o,a){return r.match(i,o,ext(t,a))};return i};Minimatch.defaults=function(t){return minimatch.defaults(t).Minimatch};function minimatch(t,r,i){assertValidPattern(r);if(!i)i={};if(!i.nocomment&&r.charAt(0)==="#"){return false}return new Minimatch(r,i).match(t)}function Minimatch(t,r){if(!(this instanceof Minimatch)){return new Minimatch(t,r)}assertValidPattern(t);if(!r)r={};t=t.trim();if(!r.allowWindowsEscape&&o.sep!=="/"){t=t.split(o.sep).join("/")}this.options=r;this.set=[];this.pattern=t;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!r.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var t=this.pattern;var r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();var i=this.globSet=this.braceExpand();if(r.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,i);i=this.globParts=i.map((function(t){return t.split(g)}));this.debug(this.pattern,i);i=i.map((function(t,r,i){return t.map(this.parse,this)}),this);this.debug(this.pattern,i);i=i.filter((function(t){return t.indexOf(false)===-1}));this.debug(this.pattern,i);this.set=i}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var t=this.pattern;var r=false;var i=this.options;var o=0;if(i.nonegate)return;for(var a=0,c=t.length;a<c&&t.charAt(a)==="!";a++){r=!r;o++}if(o)this.pattern=t.substr(o);this.negate=r}minimatch.braceExpand=function(t,r){return braceExpand(t,r)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(t,r){if(!r){if(this instanceof Minimatch){r=this.options}else{r={}}}t=typeof t==="undefined"?this.pattern:t;assertValidPattern(t);if(r.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return c(t)}var y=1024*64;var assertValidPattern=function(t){if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>y){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var b={};function parse(t,r){assertValidPattern(t);var i=this.options;if(t==="**"){if(!i.noglobstar)return a;else t="*"}if(t==="")return"";var o="";var c=!!i.nocase;var d=false;var p=[];var g=[];var y;var v=false;var _=-1;var w=-1;var E=t.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var S=this;function clearStateChar(){if(y){switch(y){case"*":o+=h;c=true;break;case"?":o+=u;c=true;break;default:o+="\\"+y;break}S.debug("clearStateChar %j %j",y,o);y=false}}for(var O=0,R=t.length,x;O<R&&(x=t.charAt(O));O++){this.debug("%s\t%s %s %j",t,O,o,x);if(d&&m[x]){o+="\\"+x;d=false;continue}switch(x){case"/":{return false}case"\\":clearStateChar();d=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s\t%s %s %j <-- stateChar",t,O,o,x);if(v){this.debug(" in class");if(x==="!"&&O===w+1)x="^";o+=x;continue}S.debug("call clearStateChar %j",y);clearStateChar();y=x;if(i.noext)clearStateChar();continue;case"(":if(v){o+="(";continue}if(!y){o+="\\(";continue}p.push({type:y,start:O-1,reStart:o.length,open:l[y].open,close:l[y].close});o+=y==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",y,o);y=false;continue;case")":if(v||!p.length){o+="\\)";continue}clearStateChar();c=true;var A=p.pop();o+=A.close;if(A.type==="!"){g.push(A)}A.reEnd=o.length;continue;case"|":if(v||!p.length||d){o+="\\|";d=false;continue}clearStateChar();o+="|";continue;case"[":clearStateChar();if(v){o+="\\"+x;continue}v=true;w=O;_=o.length;o+=x;continue;case"]":if(O===w+1||!v){o+="\\"+x;d=false;continue}var T=t.substring(w+1,O);try{RegExp("["+T+"]")}catch(t){var k=this.parse(T,b);o=o.substr(0,_)+"\\["+k[0]+"\\]";c=c||k[1];v=false;continue}c=true;v=false;o+=x;continue;default:clearStateChar();if(d){d=false}else if(m[x]&&!(x==="^"&&v)){o+="\\"}o+=x}}if(v){T=t.substr(w+1);k=this.parse(T,b);o=o.substr(0,_)+"\\["+k[0];c=c||k[1]}for(A=p.pop();A;A=p.pop()){var C=o.slice(A.reStart+A.open.length);this.debug("setting tail",o,A);C=C.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(t,r,i){if(!i){i="\\"}return r+r+i+"|"}));this.debug("tail=%j\n %s",C,C,A,o);var P=A.type==="*"?h:A.type==="?"?u:"\\"+A.type;c=true;o=o.slice(0,A.reStart)+P+"\\("+C}clearStateChar();if(d){o+="\\\\"}var I=false;switch(o.charAt(0)){case"[":case".":case"(":I=true}for(var L=g.length-1;L>-1;L--){var N=g[L];var M=o.slice(0,N.reStart);var D=o.slice(N.reStart,N.reEnd-8);var j=o.slice(N.reEnd-8,N.reEnd);var $=o.slice(N.reEnd);j+=$;var H=M.split("(").length-1;var B=$;for(O=0;O<H;O++){B=B.replace(/\)[+*?]?/,"")}$=B;var U="";if($===""&&r!==b){U="$"}var q=M+D+$+U+j;o=q}if(o!==""&&c){o="(?=.)"+o}if(I){o=E+o}if(r===b){return[o,c]}if(!c){return globUnescape(t)}var G=i.nocase?"i":"";try{var V=new RegExp("^"+o+"$",G)}catch(t){return new RegExp("$.")}V._glob=t;V._src=o;return V}minimatch.makeRe=function(t,r){return new Minimatch(t,r||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var t=this.set;if(!t.length){this.regexp=false;return this.regexp}var r=this.options;var i=r.noglobstar?h:r.dot?d:p;var o=r.nocase?"i":"";var c=t.map((function(t){return t.map((function(t){return t===a?i:typeof t==="string"?regExpEscape(t):t._src})).join("\\/")})).join("|");c="^(?:"+c+")$";if(this.negate)c="^(?!"+c+").*$";try{this.regexp=new RegExp(c,o)}catch(t){this.regexp=false}return this.regexp}minimatch.match=function(t,r,i){i=i||{};var o=new Minimatch(r,i);t=t.filter((function(t){return o.match(t)}));if(o.options.nonull&&!t.length){t.push(r)}return t};Minimatch.prototype.match=function match(t,r){if(typeof r==="undefined")r=this.partial;this.debug("match",t,this.pattern);if(this.comment)return false;if(this.empty)return t==="";if(t==="/"&&r)return true;var i=this.options;if(o.sep!=="/"){t=t.split(o.sep).join("/")}t=t.split(g);this.debug(this.pattern,"split",t);var a=this.set;this.debug(this.pattern,"set",a);var c;var l;for(l=t.length-1;l>=0;l--){c=t[l];if(c)break}for(l=0;l<a.length;l++){var u=a[l];var h=t;if(i.matchBase&&u.length===1){h=[c]}var d=this.matchOne(h,u,r);if(d){if(i.flipNegate)return true;return!this.negate}}if(i.flipNegate)return false;return this.negate};Minimatch.prototype.matchOne=function(t,r,i){var o=this.options;this.debug("matchOne",{this:this,file:t,pattern:r});this.debug("matchOne",t.length,r.length);for(var c=0,l=0,u=t.length,h=r.length;c<u&&l<h;c++,l++){this.debug("matchOne loop");var d=r[l];var p=t[c];this.debug(r,d,p);if(d===false)return false;if(d===a){this.debug("GLOBSTAR",[r,d,p]);var m=c;var g=l+1;if(g===h){this.debug("** at the end");for(;c<u;c++){if(t[c]==="."||t[c]===".."||!o.dot&&t[c].charAt(0)===".")return false}return true}while(m<u){var y=t[m];this.debug("\nglobstar while",t,m,r,g,y);if(this.matchOne(t.slice(m),r.slice(g),i)){this.debug("globstar found match!",m,u,y);return true}else{if(y==="."||y===".."||!o.dot&&y.charAt(0)==="."){this.debug("dot detected!",t,m,r,g);break}this.debug("globstar swallow a segment, and continue");m++}}if(i){this.debug("\n>>> no match, partial?",t,m,r,g);if(m===u)return true}return false}var b;if(typeof d==="string"){b=p===d;this.debug("string match",d,p,b)}else{b=p.match(d);this.debug("pattern match",d,p,b)}if(!b)return false}if(c===u&&l===h){return true}else if(c===u){return i}else if(l===h){return c===u-1&&t[c]===""}throw new Error("wtf?")};function globUnescape(t){return t.replace(/\\(.)/g,"$1")}function regExpEscape(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},7120:t=>{t.exports=function(t,r){if(!r)r={};var i={bools:{},strings:{},unknownFn:null};if(typeof r["unknown"]==="function"){i.unknownFn=r["unknown"]}if(typeof r["boolean"]==="boolean"&&r["boolean"]){i.allBools=true}else{[].concat(r["boolean"]).filter(Boolean).forEach((function(t){i.bools[t]=true}))}var o={};Object.keys(r.alias||{}).forEach((function(t){o[t]=[].concat(r.alias[t]);o[t].forEach((function(r){o[r]=[t].concat(o[t].filter((function(t){return r!==t})))}))}));[].concat(r.string).filter(Boolean).forEach((function(t){i.strings[t]=true;if(o[t]){i.strings[o[t]]=true}}));var a=r["default"]||{};var c={_:[]};Object.keys(i.bools).forEach((function(t){setArg(t,a[t]===undefined?false:a[t])}));var l=[];if(t.indexOf("--")!==-1){l=t.slice(t.indexOf("--")+1);t=t.slice(0,t.indexOf("--"))}function argDefined(t,r){return i.allBools&&/^--[^=]+$/.test(r)||i.strings[t]||i.bools[t]||o[t]}function setArg(t,r,a){if(a&&i.unknownFn&&!argDefined(t,a)){if(i.unknownFn(a)===false)return}var l=!i.strings[t]&&isNumber(r)?Number(r):r;setKey(c,t.split("."),l);(o[t]||[]).forEach((function(t){setKey(c,t.split("."),l)}))}function setKey(t,r,o){var a=t;for(var c=0;c<r.length-1;c++){var l=r[c];if(l==="__proto__")return;if(a[l]===undefined)a[l]={};if(a[l]===Object.prototype||a[l]===Number.prototype||a[l]===String.prototype)a[l]={};if(a[l]===Array.prototype)a[l]=[];a=a[l]}var l=r[r.length-1];if(l==="__proto__")return;if(a===Object.prototype||a===Number.prototype||a===String.prototype)a={};if(a===Array.prototype)a=[];if(a[l]===undefined||i.bools[l]||typeof a[l]==="boolean"){a[l]=o}else if(Array.isArray(a[l])){a[l].push(o)}else{a[l]=[a[l],o]}}function aliasIsBoolean(t){return o[t].some((function(t){return i.bools[t]}))}for(var u=0;u<t.length;u++){var h=t[u];if(/^--.+=/.test(h)){var d=h.match(/^--([^=]+)=([\s\S]*)$/);var p=d[1];var m=d[2];if(i.bools[p]){m=m!=="false"}setArg(p,m,h)}else if(/^--no-.+/.test(h)){var p=h.match(/^--no-(.+)/)[1];setArg(p,false,h)}else if(/^--.+/.test(h)){var p=h.match(/^--(.+)/)[1];var g=t[u+1];if(g!==undefined&&!/^-/.test(g)&&!i.bools[p]&&!i.allBools&&(o[p]?!aliasIsBoolean(p):true)){setArg(p,g,h);u++}else if(/^(true|false)$/.test(g)){setArg(p,g==="true",h);u++}else{setArg(p,i.strings[p]?"":true,h)}}else if(/^-[^-]+/.test(h)){var y=h.slice(1,-1).split("");var b=false;for(var v=0;v<y.length;v++){var g=h.slice(v+2);if(g==="-"){setArg(y[v],g,h);continue}if(/[A-Za-z]/.test(y[v])&&/=/.test(g)){setArg(y[v],g.split("=")[1],h);b=true;break}if(/[A-Za-z]/.test(y[v])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){setArg(y[v],g,h);b=true;break}if(y[v+1]&&y[v+1].match(/\W/)){setArg(y[v],h.slice(v+2),h);b=true;break}else{setArg(y[v],i.strings[y[v]]?"":true,h)}}var p=h.slice(-1)[0];if(!b&&p!=="-"){if(t[u+1]&&!/^(-|--)[^-]/.test(t[u+1])&&!i.bools[p]&&(o[p]?!aliasIsBoolean(p):true)){setArg(p,t[u+1],h);u++}else if(t[u+1]&&/^(true|false)$/.test(t[u+1])){setArg(p,t[u+1]==="true",h);u++}else{setArg(p,i.strings[p]?"":true,h)}}}else{if(!i.unknownFn||i.unknownFn(h)!==false){c._.push(i.strings["_"]||!isNumber(h)?h:Number(h))}if(r.stopEarly){c._.push.apply(c._,t.slice(u+1));break}}}Object.keys(a).forEach((function(t){if(!hasKey(c,t.split("."))){setKey(c,t.split("."),a[t]);(o[t]||[]).forEach((function(r){setKey(c,r.split("."),a[t])}))}}));if(r["--"]){c["--"]=new Array;l.forEach((function(t){c["--"].push(t)}))}else{l.forEach((function(t){c._.push(t)}))}return c};function hasKey(t,r){var i=t;r.slice(0,-1).forEach((function(t){i=i[t]||{}}));var o=r[r.length-1];return o in i}function isNumber(t){if(typeof t==="number")return true;if(/^0x[0-9a-f]+$/i.test(t))return true;return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}},6150:(t,r,i)=>{"use strict";const o=typeof process==="object"&&process?process:{stdout:null,stderr:null};const a=i(2361);const c=i(2781);const l=i(605);const u=i(1576).StringDecoder;const h=Symbol("EOF");const d=Symbol("maybeEmitEnd");const p=Symbol("emittedEnd");const m=Symbol("emittingEnd");const g=Symbol("emittedError");const y=Symbol("closed");const b=Symbol("read");const v=Symbol("flush");const _=Symbol("flushChunk");const w=Symbol("encoding");const E=Symbol("decoder");const S=Symbol("flowing");const O=Symbol("paused");const R=Symbol("resume");const x=Symbol("bufferLength");const A=Symbol("bufferPush");const T=Symbol("bufferShift");const k=Symbol("objectMode");const C=Symbol("destroyed");const P=global._MP_NO_ITERATOR_SYMBOLS_!=="1";const I=P&&Symbol.asyncIterator||Symbol("asyncIterator not implemented");const L=P&&Symbol.iterator||Symbol("iterator not implemented");const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBuffer=t=>t instanceof ArrayBuffer||typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);t.exports=class Minipass extends c{constructor(t){super();this[S]=false;this[O]=false;this.pipes=new l;this.buffer=new l;this[k]=t&&t.objectMode||false;if(this[k])this[w]=null;else this[w]=t&&t.encoding||null;if(this[w]==="buffer")this[w]=null;this[E]=this[w]?new u(this[w]):null;this[h]=false;this[p]=false;this[m]=false;this[y]=false;this[g]=null;this.writable=true;this.readable=true;this[x]=0;this[C]=false}get bufferLength(){return this[x]}get encoding(){return this[w]}set encoding(t){if(this[k])throw new Error("cannot set encoding in objectMode");if(this[w]&&t!==this[w]&&(this[E]&&this[E].lastNeed||this[x]))throw new Error("cannot change encoding");if(this[w]!==t){this[E]=t?new u(t):null;if(this.buffer.length)this.buffer=this.buffer.map((t=>this[E].write(t)))}this[w]=t}setEncoding(t){this.encoding=t}get objectMode(){return this[k]}set objectMode(t){this[k]=this[k]||!!t}write(t,r,i){if(this[h])throw new Error("write after end");if(this[C]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof r==="function")i=r,r="utf8";if(!r)r="utf8";if(!this[k]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(isArrayBuffer(t))t=Buffer.from(t);else if(typeof t!=="string")this.objectMode=true}if(!this.objectMode&&!t.length){if(this[x]!==0)this.emit("readable");if(i)i();return this.flowing}if(typeof t==="string"&&!this[k]&&!(r===this[w]&&!this[E].lastNeed)){t=Buffer.from(t,r)}if(Buffer.isBuffer(t)&&this[w])t=this[E].write(t);if(this.flowing){if(this[x]!==0)this[v](true);this.flowing?this.emit("data",t):this[A](t)}else this[A](t);if(this[x]!==0)this.emit("readable");if(i)i();return this.flowing}read(t){if(this[C])return null;try{if(this[x]===0||t===0||t>this[x])return null;if(this[k])t=null;if(this.buffer.length>1&&!this[k]){if(this.encoding)this.buffer=new l([Array.from(this.buffer).join("")]);else this.buffer=new l([Buffer.concat(Array.from(this.buffer),this[x])])}return this[b](t||null,this.buffer.head.value)}finally{this[d]()}}[b](t,r){if(t===r.length||t===null)this[T]();else{this.buffer.head.value=r.slice(t);r=r.slice(0,t);this[x]-=t}this.emit("data",r);if(!this.buffer.length&&!this[h])this.emit("drain");return r}end(t,r,i){if(typeof t==="function")i=t,t=null;if(typeof r==="function")i=r,r="utf8";if(t)this.write(t,r);if(i)this.once("end",i);this[h]=true;this.writable=false;if(this.flowing||!this[O])this[d]();return this}[R](){if(this[C])return;this[O]=false;this[S]=true;this.emit("resume");if(this.buffer.length)this[v]();else if(this[h])this[d]();else this.emit("drain")}resume(){return this[R]()}pause(){this[S]=false;this[O]=true}get destroyed(){return this[C]}get flowing(){return this[S]}get paused(){return this[O]}[A](t){if(this[k])this[x]+=1;else this[x]+=t.length;return this.buffer.push(t)}[T](){if(this.buffer.length){if(this[k])this[x]-=1;else this[x]-=this.buffer.head.value.length}return this.buffer.shift()}[v](t){do{}while(this[_](this[T]()));if(!t&&!this.buffer.length&&!this[h])this.emit("drain")}[_](t){return t?(this.emit("data",t),this.flowing):false}pipe(t,r){if(this[C])return;const i=this[p];r=r||{};if(t===o.stdout||t===o.stderr)r.end=false;else r.end=r.end!==false;const a={dest:t,opts:r,ondrain:t=>this[R]()};this.pipes.push(a);t.on("drain",a.ondrain);this[R]();if(i&&a.opts.end)a.dest.end();return t}addListener(t,r){return this.on(t,r)}on(t,r){try{return super.on(t,r)}finally{if(t==="data"&&!this.pipes.length&&!this.flowing)this[R]();else if(isEndish(t)&&this[p]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[g]){r.call(this,this[g])}}}get emittedEnd(){return this[p]}[d](){if(!this[m]&&!this[p]&&!this[C]&&this.buffer.length===0&&this[h]){this[m]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[y])this.emit("close");this[m]=false}}emit(t,r){if(t!=="error"&&t!=="close"&&t!==C&&this[C])return;else if(t==="data"){if(!r)return;if(this.pipes.length)this.pipes.forEach((t=>t.dest.write(r)===false&&this.pause()))}else if(t==="end"){if(this[p]===true)return;this[p]=true;this.readable=false;if(this[E]){r=this[E].end();if(r){this.pipes.forEach((t=>t.dest.write(r)));super.emit("data",r)}}this.pipes.forEach((t=>{t.dest.removeListener("drain",t.ondrain);if(t.opts.end)t.dest.end()}))}else if(t==="close"){this[y]=true;if(!this[p]&&!this[C])return}else if(t==="error"){this[g]=r}const i=new Array(arguments.length);i[0]=t;i[1]=r;if(arguments.length>2){for(let t=2;t<arguments.length;t++){i[t]=arguments[t]}}try{return super.emit.apply(this,i)}finally{if(!isEndish(t))this[d]();else this.removeAllListeners(t)}}collect(){const t=[];if(!this[k])t.dataLength=0;const r=this.promise();this.on("data",(r=>{t.push(r);if(!this[k])t.dataLength+=r.length}));return r.then((()=>t))}concat(){return this[k]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then((t=>this[k]?Promise.reject(new Error("cannot concat in objectMode")):this[w]?t.join(""):Buffer.concat(t,t.dataLength)))}promise(){return new Promise(((t,r)=>{this.on(C,(()=>r(new Error("stream destroyed"))));this.on("error",(t=>r(t)));this.on("end",(()=>t()))}))}[I](){const next=()=>{const t=this.read();if(t!==null)return Promise.resolve({done:false,value:t});if(this[h])return Promise.resolve({done:true});let r=null;let i=null;const onerr=t=>{this.removeListener("data",ondata);this.removeListener("end",onend);i(t)};const ondata=t=>{this.removeListener("error",onerr);this.removeListener("end",onend);this.pause();r({value:t,done:!!this[h]})};const onend=()=>{this.removeListener("error",onerr);this.removeListener("data",ondata);r({done:true})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,o)=>{i=o;r=t;this.once(C,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next}}[L](){const next=()=>{const t=this.read();const r=t===null;return{value:t,done:r}};return{next:next}}destroy(t){if(this[C]){if(t)this.emit("error",t);else this.emit(C);return this}this[C]=true;this.buffer=new l;this[x]=0;if(typeof this.close==="function"&&!this[y])this.close();if(t)this.emit("error",t);else this.emit(C);return this}static isStream(t){return!!t&&(t instanceof Minipass||t instanceof c||t instanceof a&&(typeof t.pipe==="function"||typeof t.write==="function"&&typeof t.end==="function"))}}},2400:(t,r,i)=>{const o=i(9796).constants||{ZLIB_VERNUM:4736};t.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,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,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},o))},3954:(t,r,i)=>{"use strict";const o=i(9491);const a=i(4300).Buffer;const c=i(9796);const l=r.constants=i(2400);const u=i(6150);const h=a.concat;const d=Symbol("_superWrite");class ZlibError extends Error{constructor(t){super("zlib: "+t.message);this.code=t.code;this.errno=t.errno;if(!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+t.message;Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const p=Symbol("opts");const m=Symbol("flushFlag");const g=Symbol("finishFlushFlag");const y=Symbol("fullFlushFlag");const b=Symbol("handle");const v=Symbol("onError");const _=Symbol("sawError");const w=Symbol("level");const E=Symbol("strategy");const S=Symbol("ended");const O=Symbol("_defaultFullFlush");class ZlibBase extends u{constructor(t,r){if(!t||typeof t!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(t);this[_]=false;this[S]=false;this[p]=t;this[m]=t.flush;this[g]=t.finishFlush;try{this[b]=new c[r](t)}catch(t){throw new ZlibError(t)}this[v]=t=>{if(this[_])return;this[_]=true;this.close();this.emit("error",t)};this[b].on("error",(t=>this[v](new ZlibError(t))));this.once("end",(()=>this.close))}close(){if(this[b]){this[b].close();this[b]=null;this.emit("close")}}reset(){if(!this[_]){o(this[b],"zlib binding closed");return this[b].reset()}}flush(t){if(this.ended)return;if(typeof t!=="number")t=this[y];this.write(Object.assign(a.alloc(0),{[m]:t}))}end(t,r,i){if(t)this.write(t,r);this.flush(this[g]);this[S]=true;return super.end(null,null,i)}get ended(){return this[S]}write(t,r,i){if(typeof r==="function")i=r,r="utf8";if(typeof t==="string")t=a.from(t,r);if(this[_])return;o(this[b],"zlib binding closed");const c=this[b]._handle;const l=c.close;c.close=()=>{};const u=this[b].close;this[b].close=()=>{};a.concat=t=>t;let p;try{const r=typeof t[m]==="number"?t[m]:this[m];p=this[b]._processChunk(t,r);a.concat=h}catch(t){a.concat=h;this[v](new ZlibError(t))}finally{if(this[b]){this[b]._handle=c;c.close=l;this[b].close=u;this[b].removeAllListeners("error")}}if(this[b])this[b].on("error",(t=>this[v](new ZlibError(t))));let g;if(p){if(Array.isArray(p)&&p.length>0){g=this[d](a.from(p[0]));for(let t=1;t<p.length;t++){g=this[d](p[t])}}else{g=this[d](a.from(p))}}if(i)i();return g}[d](t){return super.write(t)}}class Zlib extends ZlibBase{constructor(t,r){t=t||{};t.flush=t.flush||l.Z_NO_FLUSH;t.finishFlush=t.finishFlush||l.Z_FINISH;super(t,r);this[y]=l.Z_FULL_FLUSH;this[w]=t.level;this[E]=t.strategy}params(t,r){if(this[_])return;if(!this[b])throw new Error("cannot switch params when binding is closed");if(!this[b].params)throw new Error("not supported in this implementation");if(this[w]!==t||this[E]!==r){this.flush(l.Z_SYNC_FLUSH);o(this[b],"zlib binding closed");const i=this[b].flush;this[b].flush=(t,r)=>{this.flush(t);r()};try{this[b].params(t,r)}finally{this[b].flush=i}if(this[b]){this[w]=t;this[E]=r}}}}class Deflate extends Zlib{constructor(t){super(t,"Deflate")}}class Inflate extends Zlib{constructor(t){super(t,"Inflate")}}const R=Symbol("_portable");class Gzip extends Zlib{constructor(t){super(t,"Gzip");this[R]=t&&!!t.portable}[d](t){if(!this[R])return super[d](t);this[R]=false;t[9]=255;return super[d](t)}}class Gunzip extends Zlib{constructor(t){super(t,"Gunzip")}}class DeflateRaw extends Zlib{constructor(t){super(t,"DeflateRaw")}}class InflateRaw extends Zlib{constructor(t){super(t,"InflateRaw")}}class Unzip extends Zlib{constructor(t){super(t,"Unzip")}}class Brotli extends ZlibBase{constructor(t,r){t=t||{};t.flush=t.flush||l.BROTLI_OPERATION_PROCESS;t.finishFlush=t.finishFlush||l.BROTLI_OPERATION_FINISH;super(t,r);this[y]=l.BROTLI_OPERATION_FLUSH}}class BrotliCompress extends Brotli{constructor(t){super(t,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(t){super(t,"BrotliDecompress")}}r.Deflate=Deflate;r.Inflate=Inflate;r.Gzip=Gzip;r.Gunzip=Gunzip;r.DeflateRaw=DeflateRaw;r.InflateRaw=InflateRaw;r.Unzip=Unzip;if(typeof c.BrotliCompress==="function"){r.BrotliCompress=BrotliCompress;r.BrotliDecompress=BrotliDecompress}else{r.BrotliCompress=r.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}},9060:(t,r,i)=>{const o=i(516);const a=i(6393);const{mkdirpNative:c,mkdirpNativeSync:l}=i(6536);const{mkdirpManual:u,mkdirpManualSync:h}=i(5621);const{useNative:d,useNativeSync:p}=i(1835);const mkdirp=(t,r)=>{t=a(t);r=o(r);return d(r)?c(t,r):u(t,r)};const mkdirpSync=(t,r)=>{t=a(t);r=o(r);return p(r)?l(t,r):h(t,r)};mkdirp.sync=mkdirpSync;mkdirp.native=(t,r)=>c(a(t),o(r));mkdirp.manual=(t,r)=>u(a(t),o(r));mkdirp.nativeSync=(t,r)=>l(a(t),o(r));mkdirp.manualSync=(t,r)=>h(a(t),o(r));t.exports=mkdirp},4173:(t,r,i)=>{const{dirname:o}=i(1017);const findMade=(t,r,i=undefined)=>{if(i===r)return Promise.resolve();return t.statAsync(r).then((t=>t.isDirectory()?i:undefined),(i=>i.code==="ENOENT"?findMade(t,o(r),r):undefined))};const findMadeSync=(t,r,i=undefined)=>{if(i===r)return undefined;try{return t.statSync(r).isDirectory()?i:undefined}catch(i){return i.code==="ENOENT"?findMadeSync(t,o(r),r):undefined}};t.exports={findMade:findMade,findMadeSync:findMadeSync}},5621:(t,r,i)=>{const{dirname:o}=i(1017);const mkdirpManual=(t,r,i)=>{r.recursive=false;const a=o(t);if(a===t){return r.mkdirAsync(t,r).catch((t=>{if(t.code!=="EISDIR")throw t}))}return r.mkdirAsync(t,r).then((()=>i||t),(o=>{if(o.code==="ENOENT")return mkdirpManual(a,r).then((i=>mkdirpManual(t,r,i)));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;return r.statAsync(t).then((t=>{if(t.isDirectory())return i;else throw o}),(()=>{throw o}))}))};const mkdirpManualSync=(t,r,i)=>{const a=o(t);r.recursive=false;if(a===t){try{return r.mkdirSync(t,r)}catch(t){if(t.code!=="EISDIR")throw t;else return}}try{r.mkdirSync(t,r);return i||t}catch(o){if(o.code==="ENOENT")return mkdirpManualSync(t,r,mkdirpManualSync(a,r,i));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;try{if(!r.statSync(t).isDirectory())throw o}catch(t){throw o}}};t.exports={mkdirpManual:mkdirpManual,mkdirpManualSync:mkdirpManualSync}},6536:(t,r,i)=>{const{dirname:o}=i(1017);const{findMade:a,findMadeSync:c}=i(4173);const{mkdirpManual:l,mkdirpManualSync:u}=i(5621);const mkdirpNative=(t,r)=>{r.recursive=true;const i=o(t);if(i===t)return r.mkdirAsync(t,r);return a(r,t).then((i=>r.mkdirAsync(t,r).then((()=>i)).catch((i=>{if(i.code==="ENOENT")return l(t,r);else throw i}))))};const mkdirpNativeSync=(t,r)=>{r.recursive=true;const i=o(t);if(i===t)return r.mkdirSync(t,r);const a=c(r,t);try{r.mkdirSync(t,r);return a}catch(i){if(i.code==="ENOENT")return u(t,r);else throw i}};t.exports={mkdirpNative:mkdirpNative,mkdirpNativeSync:mkdirpNativeSync}},516:(t,r,i)=>{const{promisify:o}=i(3837);const a=i(7147);const optsArg=t=>{if(!t)t={mode:511,fs:a};else if(typeof t==="object")t={mode:511,fs:a,...t};else if(typeof t==="number")t={mode:t,fs:a};else if(typeof t==="string")t={mode:parseInt(t,8),fs:a};else throw new TypeError("invalid options argument");t.mkdir=t.mkdir||t.fs.mkdir||a.mkdir;t.mkdirAsync=o(t.mkdir);t.stat=t.stat||t.fs.stat||a.stat;t.statAsync=o(t.stat);t.statSync=t.statSync||t.fs.statSync||a.statSync;t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||a.mkdirSync;return t};t.exports=optsArg},6393:(t,r,i)=>{const o=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:a,parse:c}=i(1017);const pathArg=t=>{if(/\0/.test(t)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"})}t=a(t);if(o==="win32"){const r=/[*|"<>?:]/;const{root:i}=c(t);if(r.test(t.substr(i.length))){throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}}return t};t.exports=pathArg},1835:(t,r,i)=>{const o=i(7147);const a=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const c=a.replace(/^v/,"").split(".");const l=+c[0]>10||+c[0]===10&&+c[1]>=12;const u=!l?()=>false:t=>t.mkdir===o.mkdir;const h=!l?()=>false:t=>t.mkdirSync===o.mkdirSync;t.exports={useNative:u,useNativeSync:h}},5842:(t,r,i)=>{var o=i(3837).inherits;var NestedError=function(t,r){this.nested=r;if(t instanceof Error){r=t}else if(typeof t!=="undefined"){Object.defineProperty(this,"message",{value:t,writable:true,enumerable:false,configurable:true})}Error.captureStackTrace(this,this.constructor);var i=Object.getOwnPropertyDescriptor(this,"stack");var o=buildStackDescriptor(i,r);Object.defineProperty(this,"stack",o)};function buildStackDescriptor(t,r){if(t.get){return{get:function(){var r=t.get.call(this);return buildCombinedStacks(r,this.nested)}}}else{var i=t.value;return{value:buildCombinedStacks(i,r)}}}function buildCombinedStacks(t,r){if(r){t+="\nCaused By: "+r.stack}return t}o(NestedError,Error);NestedError.prototype.name="NestedError";t.exports=NestedError},5521:t=>{"use strict";const r="text/plain";const i="us-ascii";const testParameter=(t,r)=>r.some((r=>r instanceof RegExp?r.test(t):r===t));const normalizeDataURL=(t,{stripHash:o})=>{const a=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!a){throw new Error(`Invalid URL: ${t}`)}let{type:c,data:l,hash:u}=a.groups;const h=c.split(";");u=o?"":u;let d=false;if(h[h.length-1]==="base64"){h.pop();d=true}const p=(h.shift()||"").toLowerCase();const m=h.map((t=>{let[r,o=""]=t.split("=").map((t=>t.trim()));if(r==="charset"){o=o.toLowerCase();if(o===i){return""}}return`${r}${o?`=${o}`:""}`})).filter(Boolean);const g=[...m];if(d){g.push("base64")}if(g.length!==0||p&&p!==r){g.unshift(p)}return`data:${g.join(";")},${d?l.trim():l}${u?`#${u}`:""}`};const normalizeUrl=(t,r)=>{r={defaultProtocol:"http:",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,sortQueryParameters:true,...r};t=t.trim();if(/^data:/i.test(t)){return normalizeDataURL(t,r)}if(/^view-source:/i.test(t)){throw new Error("`view-source:` is not supported as it is a non-standard protocol")}const i=t.startsWith("//");const o=!i&&/^\.*\//.test(t);if(!o){t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,r.defaultProtocol)}const a=new URL(t);if(r.forceHttp&&r.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(r.forceHttp&&a.protocol==="https:"){a.protocol="http:"}if(r.forceHttps&&a.protocol==="http:"){a.protocol="https:"}if(r.stripAuthentication){a.username="";a.password=""}if(r.stripHash){a.hash=""}else if(r.stripTextFragment){a.hash=a.hash.replace(/#?:~:text.*?$/i,"")}if(a.pathname){a.pathname=a.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")}if(a.pathname){try{a.pathname=decodeURI(a.pathname)}catch(t){}}if(r.removeDirectoryIndex===true){r.removeDirectoryIndex=[/^index\.[a-z]+$/]}if(Array.isArray(r.removeDirectoryIndex)&&r.removeDirectoryIndex.length>0){let t=a.pathname.split("/");const i=t[t.length-1];if(testParameter(i,r.removeDirectoryIndex)){t=t.slice(0,t.length-1);a.pathname=t.slice(1).join("/")+"/"}}if(a.hostname){a.hostname=a.hostname.replace(/\.$/,"");if(r.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(a.hostname)){a.hostname=a.hostname.replace(/^www\./,"")}}if(Array.isArray(r.removeQueryParameters)){for(const t of[...a.searchParams.keys()]){if(testParameter(t,r.removeQueryParameters)){a.searchParams.delete(t)}}}if(r.removeQueryParameters===true){a.search=""}if(r.sortQueryParameters){a.searchParams.sort()}if(r.removeTrailingSlash){a.pathname=a.pathname.replace(/\/$/,"")}const c=t;t=a.toString();if(!r.removeSingleSlash&&a.pathname==="/"&&!c.endsWith("/")&&a.hash===""){t=t.replace(/\/$/,"")}if((r.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&r.removeSingleSlash){t=t.replace(/\/$/,"")}if(i&&!r.normalizeProtocol){t=t.replace(/^http:\/\//,"//")}if(r.stripProtocol){t=t.replace(/^(?:https?:)?\/\//,"")}return t};t.exports=normalizeUrl},4556:(t,r,i)=>{var o=i(2928);t.exports=o(once);t.exports.strict=o(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(t){var f=function(){if(f.called)return f.value;f.called=true;return f.value=t.apply(this,arguments)};f.called=false;return f}function onceStrict(t){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=t.apply(this,arguments)};var r=t.name||"Function wrapped with `once`";f.onceError=r+" shouldn't be called more than once";f.called=false;return f}},2248:(t,r,i)=>{"use strict";const o=i(8760);const a=Symbol.asyncIterator||"@@asyncIterator";const normalizeEmitter=t=>{const r=t.on||t.addListener||t.addEventListener;const i=t.off||t.removeListener||t.removeEventListener;if(!r||!i){throw new TypeError("Emitter is not compatible")}return{addListener:r.bind(t),removeListener:i.bind(t)}};const toArray=t=>Array.isArray(t)?t:[t];const multiple=(t,r,i)=>{let a;const c=new Promise(((o,c)=>{i={rejectionEvents:["error"],multiArgs:false,resolveImmediately:false,...i};if(!(i.count>=0&&(i.count===Infinity||Number.isInteger(i.count)))){throw new TypeError("The `count` option should be at least 0 or more")}const l=toArray(r);const u=[];const{addListener:h,removeListener:d}=normalizeEmitter(t);const onItem=(...t)=>{const r=i.multiArgs?t:t[0];if(i.filter&&!i.filter(r)){return}u.push(r);if(i.count===u.length){a();o(u)}};const rejectHandler=t=>{a();c(t)};a=()=>{for(const t of l){d(t,onItem)}for(const t of i.rejectionEvents){d(t,rejectHandler)}};for(const t of l){h(t,onItem)}for(const t of i.rejectionEvents){h(t,rejectHandler)}if(i.resolveImmediately){o(u)}}));c.cancel=a;if(typeof i.timeout==="number"){const t=o(c,i.timeout);t.cancel=a;return t}return c};const pEvent=(t,r,i)=>{if(typeof i==="function"){i={filter:i}}i={...i,count:1,resolveImmediately:false};const o=multiple(t,r,i);const a=o.then((t=>t[0]));a.cancel=o.cancel;return a};t.exports=pEvent;t.exports["default"]=pEvent;t.exports.multiple=multiple;t.exports.iterator=(t,r,i)=>{if(typeof i==="function"){i={filter:i}}const o=toArray(r);i={rejectionEvents:["error"],resolutionEvents:[],limit:Infinity,multiArgs:false,...i};const{limit:c}=i;const l=c>=0&&(c===Infinity||Number.isInteger(c));if(!l){throw new TypeError("The `limit` option should be a non-negative integer or Infinity")}if(c===0){return{[Symbol.asyncIterator](){return this},async next(){return{done:true,value:undefined}}}}const{addListener:u,removeListener:h}=normalizeEmitter(t);let d=false;let p;let m=false;const g=[];const y=[];let b=0;let v=false;const valueHandler=(...t)=>{b++;v=b===c;const r=i.multiArgs?t:t[0];if(g.length>0){const{resolve:t}=g.shift();t({done:false,value:r});if(v){cancel()}return}y.push(r);if(v){cancel()}};const cancel=()=>{d=true;for(const t of o){h(t,valueHandler)}for(const t of i.rejectionEvents){h(t,rejectHandler)}for(const t of i.resolutionEvents){h(t,resolveHandler)}while(g.length>0){const{resolve:t}=g.shift();t({done:true,value:undefined})}};const rejectHandler=(...t)=>{p=i.multiArgs?t:t[0];if(g.length>0){const{reject:t}=g.shift();t(p)}else{m=true}cancel()};const resolveHandler=(...t)=>{const r=i.multiArgs?t:t[0];if(i.filter&&!i.filter(r)){return}if(g.length>0){const{resolve:t}=g.shift();t({done:true,value:r})}else{y.push(r)}cancel()};for(const t of o){u(t,valueHandler)}for(const t of i.rejectionEvents){u(t,rejectHandler)}for(const t of i.resolutionEvents){u(t,resolveHandler)}return{[a](){return this},async next(){if(y.length>0){const t=y.shift();return{done:d&&y.length===0&&!v,value:t}}if(m){m=false;throw p}if(d){return{done:true,value:undefined}}return new Promise(((t,r)=>g.push({resolve:t,reject:r})))},async return(t){cancel();return{done:d,value:t}}}};t.exports.TimeoutError=o.TimeoutError},7948:t=>{"use strict";t.exports=(t,r)=>{r=r||(()=>{});return t.then((t=>new Promise((t=>{t(r())})).then((()=>t))),(t=>new Promise((t=>{t(r())})).then((()=>{throw t}))))}},8760:(t,r,i)=>{"use strict";const o=i(7948);class TimeoutError extends Error{constructor(t){super(t);this.name="TimeoutError"}}const pTimeout=(t,r,i)=>new Promise(((a,c)=>{if(typeof r!=="number"||r<0){throw new TypeError("Expected `milliseconds` to be a positive number")}if(r===Infinity){a(t);return}const l=setTimeout((()=>{if(typeof i==="function"){try{a(i())}catch(t){c(t)}return}const o=typeof i==="string"?i:`Promise timed out after ${r} milliseconds`;const l=i instanceof Error?i:new TimeoutError(o);if(typeof t.cancel==="function"){t.cancel()}c(l)}),r);o(t.then(a,c),(()=>{clearTimeout(l)}))}));t.exports=pTimeout;t.exports["default"]=pTimeout;t.exports.TimeoutError=TimeoutError},4249:t=>{"use strict";function posix(t){return t.charAt(0)==="/"}function win32(t){var r=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var i=r.exec(t);var o=i[1]||"";var a=Boolean(o&&o.charAt(1)!==":");return Boolean(i[2]||a)}t.exports=process.platform==="win32"?win32:posix;t.exports.posix=posix;t.exports.win32=win32},7460:t=>{"use strict";const pathKey=(t={})=>{const r=t.env||process.env;const i=t.platform||process.platform;if(i!=="win32"){return"PATH"}return Object.keys(r).reverse().find((t=>t.toUpperCase()==="PATH"))||"Path"};t.exports=pathKey;t.exports["default"]=pathKey},9223:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(7147);async function isType(t,r,i){if(typeof i!=="string"){throw new TypeError(`Expected a string, got ${typeof i}`)}try{const c=await o(a[t])(i);return c[r]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}function isTypeSync(t,r,i){if(typeof i!=="string"){throw new TypeError(`Expected a string, got ${typeof i}`)}try{return a[t](i)[r]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}r.isFile=isType.bind(null,"stat","isFile");r.isDirectory=isType.bind(null,"stat","isDirectory");r.isSymlink=isType.bind(null,"lstat","isSymbolicLink");r.isFileSync=isTypeSync.bind(null,"statSync","isFile");r.isDirectorySync=isTypeSync.bind(null,"statSync","isDirectory");r.isSymlinkSync=isTypeSync.bind(null,"lstatSync","isSymbolicLink")},376:(t,r,i)=>{"use strict";t.exports=i(7631)},7820:(t,r,i)=>{"use strict";const o=i(1017);const a="\\\\/";const c=`[^${a}]`;const l="\\.";const u="\\+";const h="\\?";const d="\\/";const p="(?=.)";const m="[^/]";const g=`(?:${d}|$)`;const y=`(?:^|${d})`;const b=`${l}{1,2}${g}`;const v=`(?!${l})`;const _=`(?!${y}${b})`;const w=`(?!${l}{0,1}${g})`;const E=`(?!${b})`;const S=`[^.${d}]`;const O=`${m}*?`;const R={DOT_LITERAL:l,PLUS_LITERAL:u,QMARK_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:p,QMARK:m,END_ANCHOR:g,DOTS_SLASH:b,NO_DOT:v,NO_DOTS:_,NO_DOT_SLASH:w,NO_DOTS_SLASH:E,QMARK_NO_DOT:S,STAR:O,START_ANCHOR:y};const x={...R,SLASH_LITERAL:`[${a}]`,QMARK:c,STAR:`${c}*?`,DOTS_SLASH:`${l}{1,2}(?:[${a}]|$)`,NO_DOT:`(?!${l})`,NO_DOTS:`(?!(?:^|[${a}])${l}{1,2}(?:[${a}]|$))`,NO_DOT_SLASH:`(?!${l}{0,1}(?:[${a}]|$))`,NO_DOTS_SLASH:`(?!${l}{1,2}(?:[${a}]|$))`,QMARK_NO_DOT:`[^.${a}]`,START_ANCHOR:`(?:^|[${a}])`,END_ANCHOR:`(?:[${a}]|$)`};const A={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:A,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:o.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?x:R}}},6986:(t,r,i)=>{"use strict";const o=i(7820);const a=i(8658);const{MAX_LENGTH:c,POSIX_REGEX_SOURCE:l,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:h,REPLACEMENTS:d}=o;const expandRange=(t,r)=>{if(typeof r.expandRange==="function"){return r.expandRange(...t,r)}t.sort();const i=`[${t.join("-")}]`;try{new RegExp(i)}catch(r){return t.map((t=>a.escapeRegex(t))).join("..")}return i};const syntaxError=(t,r)=>`Missing ${t}: "${r}" - use "\\\\${r}" to match literal characters`;const parse=(t,r)=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}t=d[t]||t;const i={...r};const p=typeof i.maxLength==="number"?Math.min(c,i.maxLength):c;let m=t.length;if(m>p){throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`)}const g={type:"bos",value:"",output:i.prepend||""};const y=[g];const b=i.capture?"":"?:";const v=a.isWindows(r);const _=o.globChars(v);const w=o.extglobChars(_);const{DOT_LITERAL:E,PLUS_LITERAL:S,SLASH_LITERAL:O,ONE_CHAR:R,DOTS_SLASH:x,NO_DOT:A,NO_DOT_SLASH:T,NO_DOTS_SLASH:k,QMARK:C,QMARK_NO_DOT:P,STAR:I,START_ANCHOR:L}=_;const globstar=t=>`(${b}(?:(?!${L}${t.dot?x:E}).)*?)`;const N=i.dot?"":A;const M=i.dot?C:P;let D=i.bash===true?globstar(i):I;if(i.capture){D=`(${D})`}if(typeof i.noext==="boolean"){i.noextglob=i.noext}const j={input:t,index:-1,start:0,dot:i.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:y};t=a.removePrefix(t,j);m=t.length;const $=[];const H=[];const B=[];let U=g;let q;const eos=()=>j.index===m-1;const G=j.peek=(r=1)=>t[j.index+r];const V=j.advance=()=>t[++j.index]||"";const remaining=()=>t.slice(j.index+1);const consume=(t="",r=0)=>{j.consumed+=t;j.index+=r};const append=t=>{j.output+=t.output!=null?t.output:t.value;consume(t.value)};const negate=()=>{let t=1;while(G()==="!"&&(G(2)!=="("||G(3)==="?")){V();j.start++;t++}if(t%2===0){return false}j.negated=true;j.start++;return true};const increment=t=>{j[t]++;B.push(t)};const decrement=t=>{j[t]--;B.pop()};const push=t=>{if(U.type==="globstar"){const r=j.braces>0&&(t.type==="comma"||t.type==="brace");const i=t.extglob===true||$.length&&(t.type==="pipe"||t.type==="paren");if(t.type!=="slash"&&t.type!=="paren"&&!r&&!i){j.output=j.output.slice(0,-U.output.length);U.type="star";U.value="*";U.output=D;j.output+=U.output}}if($.length&&t.type!=="paren"){$[$.length-1].inner+=t.value}if(t.value||t.output)append(t);if(U&&U.type==="text"&&t.type==="text"){U.value+=t.value;U.output=(U.output||"")+t.value;return}t.prev=U;y.push(t);U=t};const extglobOpen=(t,r)=>{const o={...w[r],conditions:1,inner:""};o.prev=U;o.parens=j.parens;o.output=j.output;const a=(i.capture?"(":"")+o.open;increment("parens");push({type:t,value:r,output:j.output?"":R});push({type:"paren",extglob:true,value:V(),output:a});$.push(o)};const extglobClose=t=>{let o=t.close+(i.capture?")":"");let a;if(t.type==="negate"){let c=D;if(t.inner&&t.inner.length>1&&t.inner.includes("/")){c=globstar(i)}if(c!==D||eos()||/^\)+$/.test(remaining())){o=t.close=`)$))${c}`}if(t.inner.includes("*")&&(a=remaining())&&/^\.[^\\/.]+$/.test(a)){const i=parse(a,{...r,fastpaths:false}).output;o=t.close=`)${i})${c})`}if(t.prev.type==="bos"){j.negatedExtglob=true}}push({type:"paren",extglob:true,value:q,output:o});decrement("parens")};if(i.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let o=false;let c=t.replace(h,((t,r,i,a,c,l)=>{if(a==="\\"){o=true;return t}if(a==="?"){if(r){return r+a+(c?C.repeat(c.length):"")}if(l===0){return M+(c?C.repeat(c.length):"")}return C.repeat(i.length)}if(a==="."){return E.repeat(i.length)}if(a==="*"){if(r){return r+a+(c?D:"")}return D}return r?t:`\\${t}`}));if(o===true){if(i.unescape===true){c=c.replace(/\\/g,"")}else{c=c.replace(/\\+/g,(t=>t.length%2===0?"\\\\":t?"\\":""))}}if(c===t&&i.contains===true){j.output=t;return j}j.output=a.wrapOutput(c,j,r);return j}while(!eos()){q=V();if(q==="\0"){continue}if(q==="\\"){const t=G();if(t==="/"&&i.bash!==true){continue}if(t==="."||t===";"){continue}if(!t){q+="\\";push({type:"text",value:q});continue}const r=/^\\+/.exec(remaining());let o=0;if(r&&r[0].length>2){o=r[0].length;j.index+=o;if(o%2!==0){q+="\\"}}if(i.unescape===true){q=V()}else{q+=V()}if(j.brackets===0){push({type:"text",value:q});continue}}if(j.brackets>0&&(q!=="]"||U.value==="["||U.value==="[^")){if(i.posix!==false&&q===":"){const t=U.value.slice(1);if(t.includes("[")){U.posix=true;if(t.includes(":")){const t=U.value.lastIndexOf("[");const r=U.value.slice(0,t);const i=U.value.slice(t+2);const o=l[i];if(o){U.value=r+o;j.backtrack=true;V();if(!g.output&&y.indexOf(U)===1){g.output=R}continue}}}}if(q==="["&&G()!==":"||q==="-"&&G()==="]"){q=`\\${q}`}if(q==="]"&&(U.value==="["||U.value==="[^")){q=`\\${q}`}if(i.posix===true&&q==="!"&&U.value==="["){q="^"}U.value+=q;append({value:q});continue}if(j.quotes===1&&q!=='"'){q=a.escapeRegex(q);U.value+=q;append({value:q});continue}if(q==='"'){j.quotes=j.quotes===1?0:1;if(i.keepQuotes===true){push({type:"text",value:q})}continue}if(q==="("){increment("parens");push({type:"paren",value:q});continue}if(q===")"){if(j.parens===0&&i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const t=$[$.length-1];if(t&&j.parens===t.parens+1){extglobClose($.pop());continue}push({type:"paren",value:q,output:j.parens?")":"\\)"});decrement("parens");continue}if(q==="["){if(i.nobracket===true||!remaining().includes("]")){if(i.nobracket!==true&&i.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}q=`\\${q}`}else{increment("brackets")}push({type:"bracket",value:q});continue}if(q==="]"){if(i.nobracket===true||U&&U.type==="bracket"&&U.value.length===1){push({type:"text",value:q,output:`\\${q}`});continue}if(j.brackets===0){if(i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:q,output:`\\${q}`});continue}decrement("brackets");const t=U.value.slice(1);if(U.posix!==true&&t[0]==="^"&&!t.includes("/")){q=`/${q}`}U.value+=q;append({value:q});if(i.literalBrackets===false||a.hasRegexChars(t)){continue}const r=a.escapeRegex(U.value);j.output=j.output.slice(0,-U.value.length);if(i.literalBrackets===true){j.output+=r;U.value=r;continue}U.value=`(${b}${r}|${U.value})`;j.output+=U.value;continue}if(q==="{"&&i.nobrace!==true){increment("braces");const t={type:"brace",value:q,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};H.push(t);push(t);continue}if(q==="}"){const t=H[H.length-1];if(i.nobrace===true||!t){push({type:"text",value:q,output:q});continue}let r=")";if(t.dots===true){const t=y.slice();const o=[];for(let r=t.length-1;r>=0;r--){y.pop();if(t[r].type==="brace"){break}if(t[r].type!=="dots"){o.unshift(t[r].value)}}r=expandRange(o,i);j.backtrack=true}if(t.comma!==true&&t.dots!==true){const i=j.output.slice(0,t.outputIndex);const o=j.tokens.slice(t.tokensIndex);t.value=t.output="\\{";q=r="\\}";j.output=i;for(const t of o){j.output+=t.output||t.value}}push({type:"brace",value:q,output:r});decrement("braces");H.pop();continue}if(q==="|"){if($.length>0){$[$.length-1].conditions++}push({type:"text",value:q});continue}if(q===","){let t=q;const r=H[H.length-1];if(r&&B[B.length-1]==="braces"){r.comma=true;t="|"}push({type:"comma",value:q,output:t});continue}if(q==="/"){if(U.type==="dot"&&j.index===j.start+1){j.start=j.index+1;j.consumed="";j.output="";y.pop();U=g;continue}push({type:"slash",value:q,output:O});continue}if(q==="."){if(j.braces>0&&U.type==="dot"){if(U.value===".")U.output=E;const t=H[H.length-1];U.type="dots";U.output+=q;U.value+=q;t.dots=true;continue}if(j.braces+j.parens===0&&U.type!=="bos"&&U.type!=="slash"){push({type:"text",value:q,output:E});continue}push({type:"dot",value:q,output:E});continue}if(q==="?"){const t=U&&U.value==="(";if(!t&&i.noextglob!==true&&G()==="("&&G(2)!=="?"){extglobOpen("qmark",q);continue}if(U&&U.type==="paren"){const t=G();let r=q;if(t==="<"&&!a.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(U.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(remaining())){r=`\\${q}`}push({type:"text",value:q,output:r});continue}if(i.dot!==true&&(U.type==="slash"||U.type==="bos")){push({type:"qmark",value:q,output:P});continue}push({type:"qmark",value:q,output:C});continue}if(q==="!"){if(i.noextglob!==true&&G()==="("){if(G(2)!=="?"||!/[!=<:]/.test(G(3))){extglobOpen("negate",q);continue}}if(i.nonegate!==true&&j.index===0){negate();continue}}if(q==="+"){if(i.noextglob!==true&&G()==="("&&G(2)!=="?"){extglobOpen("plus",q);continue}if(U&&U.value==="("||i.regex===false){push({type:"plus",value:q,output:S});continue}if(U&&(U.type==="bracket"||U.type==="paren"||U.type==="brace")||j.parens>0){push({type:"plus",value:q});continue}push({type:"plus",value:S});continue}if(q==="@"){if(i.noextglob!==true&&G()==="("&&G(2)!=="?"){push({type:"at",extglob:true,value:q,output:""});continue}push({type:"text",value:q});continue}if(q!=="*"){if(q==="$"||q==="^"){q=`\\${q}`}const t=u.exec(remaining());if(t){q+=t[0];j.index+=t[0].length}push({type:"text",value:q});continue}if(U&&(U.type==="globstar"||U.star===true)){U.type="star";U.star=true;U.value+=q;U.output=D;j.backtrack=true;j.globstar=true;consume(q);continue}let r=remaining();if(i.noextglob!==true&&/^\([^?]/.test(r)){extglobOpen("star",q);continue}if(U.type==="star"){if(i.noglobstar===true){consume(q);continue}const o=U.prev;const a=o.prev;const c=o.type==="slash"||o.type==="bos";const l=a&&(a.type==="star"||a.type==="globstar");if(i.bash===true&&(!c||r[0]&&r[0]!=="/")){push({type:"star",value:q,output:""});continue}const u=j.braces>0&&(o.type==="comma"||o.type==="brace");const h=$.length&&(o.type==="pipe"||o.type==="paren");if(!c&&o.type!=="paren"&&!u&&!h){push({type:"star",value:q,output:""});continue}while(r.slice(0,3)==="/**"){const i=t[j.index+4];if(i&&i!=="/"){break}r=r.slice(3);consume("/**",3)}if(o.type==="bos"&&eos()){U.type="globstar";U.value+=q;U.output=globstar(i);j.output=U.output;j.globstar=true;consume(q);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&!l&&eos()){j.output=j.output.slice(0,-(o.output+U.output).length);o.output=`(?:${o.output}`;U.type="globstar";U.output=globstar(i)+(i.strictSlashes?")":"|$)");U.value+=q;j.globstar=true;j.output+=o.output+U.output;consume(q);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&r[0]==="/"){const t=r[1]!==void 0?"|$":"";j.output=j.output.slice(0,-(o.output+U.output).length);o.output=`(?:${o.output}`;U.type="globstar";U.output=`${globstar(i)}${O}|${O}${t})`;U.value+=q;j.output+=o.output+U.output;j.globstar=true;consume(q+V());push({type:"slash",value:"/",output:""});continue}if(o.type==="bos"&&r[0]==="/"){U.type="globstar";U.value+=q;U.output=`(?:^|${O}|${globstar(i)}${O})`;j.output=U.output;j.globstar=true;consume(q+V());push({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-U.output.length);U.type="globstar";U.output=globstar(i);U.value+=q;j.output+=U.output;j.globstar=true;consume(q);continue}const o={type:"star",value:q,output:D};if(i.bash===true){o.output=".*?";if(U.type==="bos"||U.type==="slash"){o.output=N+o.output}push(o);continue}if(U&&(U.type==="bracket"||U.type==="paren")&&i.regex===true){o.output=q;push(o);continue}if(j.index===j.start||U.type==="slash"||U.type==="dot"){if(U.type==="dot"){j.output+=T;U.output+=T}else if(i.dot===true){j.output+=k;U.output+=k}else{j.output+=N;U.output+=N}if(G()!=="*"){j.output+=R;U.output+=R}}push(o)}while(j.brackets>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));j.output=a.escapeLast(j.output,"[");decrement("brackets")}while(j.parens>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));j.output=a.escapeLast(j.output,"(");decrement("parens")}while(j.braces>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));j.output=a.escapeLast(j.output,"{");decrement("braces")}if(i.strictSlashes!==true&&(U.type==="star"||U.type==="bracket")){push({type:"maybe_slash",value:"",output:`${O}?`})}if(j.backtrack===true){j.output="";for(const t of j.tokens){j.output+=t.output!=null?t.output:t.value;if(t.suffix){j.output+=t.suffix}}}return j};parse.fastpaths=(t,r)=>{const i={...r};const l=typeof i.maxLength==="number"?Math.min(c,i.maxLength):c;const u=t.length;if(u>l){throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${l}`)}t=d[t]||t;const h=a.isWindows(r);const{DOT_LITERAL:p,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:y,NO_DOT:b,NO_DOTS:v,NO_DOTS_SLASH:_,STAR:w,START_ANCHOR:E}=o.globChars(h);const S=i.dot?v:b;const O=i.dot?_:b;const R=i.capture?"":"?:";const x={negated:false,prefix:""};let A=i.bash===true?".*?":w;if(i.capture){A=`(${A})`}const globstar=t=>{if(t.noglobstar===true)return A;return`(${R}(?:(?!${E}${t.dot?y:p}).)*?)`};const create=t=>{switch(t){case"*":return`${S}${g}${A}`;case".*":return`${p}${g}${A}`;case"*.*":return`${S}${A}${p}${g}${A}`;case"*/*":return`${S}${A}${m}${g}${O}${A}`;case"**":return S+globstar(i);case"**/*":return`(?:${S}${globstar(i)}${m})?${O}${g}${A}`;case"**/*.*":return`(?:${S}${globstar(i)}${m})?${O}${A}${p}${g}${A}`;case"**/.*":return`(?:${S}${globstar(i)}${m})?${p}${g}${A}`;default:{const r=/^(.*?)\.(\w+)$/.exec(t);if(!r)return;const i=create(r[1]);if(!i)return;return i+p+r[2]}}};const T=a.removePrefix(t,x);let k=create(T);if(k&&i.strictSlashes!==true){k+=`${m}?`}return k};t.exports=parse},7631:(t,r,i)=>{"use strict";const o=i(1017);const a=i(8640);const c=i(6986);const l=i(8658);const u=i(7820);const isObject=t=>t&&typeof t==="object"&&!Array.isArray(t);const picomatch=(t,r,i=false)=>{if(Array.isArray(t)){const o=t.map((t=>picomatch(t,r,i)));const arrayMatcher=t=>{for(const r of o){const i=r(t);if(i)return i}return false};return arrayMatcher}const o=isObject(t)&&t.tokens&&t.input;if(t===""||typeof t!=="string"&&!o){throw new TypeError("Expected pattern to be a non-empty string")}const a=r||{};const c=l.isWindows(r);const u=o?picomatch.compileRe(t,r):picomatch.makeRe(t,r,false,true);const h=u.state;delete u.state;let isIgnored=()=>false;if(a.ignore){const t={...r,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(a.ignore,t,i)}const matcher=(i,o=false)=>{const{isMatch:l,match:d,output:p}=picomatch.test(i,u,r,{glob:t,posix:c});const m={glob:t,state:h,regex:u,posix:c,input:i,output:p,match:d,isMatch:l};if(typeof a.onResult==="function"){a.onResult(m)}if(l===false){m.isMatch=false;return o?m:false}if(isIgnored(i)){if(typeof a.onIgnore==="function"){a.onIgnore(m)}m.isMatch=false;return o?m:false}if(typeof a.onMatch==="function"){a.onMatch(m)}return o?m:true};if(i){matcher.state=h}return matcher};picomatch.test=(t,r,i,{glob:o,posix:a}={})=>{if(typeof t!=="string"){throw new TypeError("Expected input to be a string")}if(t===""){return{isMatch:false,output:""}}const c=i||{};const u=c.format||(a?l.toPosixSlashes:null);let h=t===o;let d=h&&u?u(t):t;if(h===false){d=u?u(t):t;h=d===o}if(h===false||c.capture===true){if(c.matchBase===true||c.basename===true){h=picomatch.matchBase(t,r,i,a)}else{h=r.exec(d)}}return{isMatch:Boolean(h),match:h,output:d}};picomatch.matchBase=(t,r,i,a=l.isWindows(i))=>{const c=r instanceof RegExp?r:picomatch.makeRe(r,i);return c.test(o.basename(t))};picomatch.isMatch=(t,r,i)=>picomatch(r,i)(t);picomatch.parse=(t,r)=>{if(Array.isArray(t))return t.map((t=>picomatch.parse(t,r)));return c(t,{...r,fastpaths:false})};picomatch.scan=(t,r)=>a(t,r);picomatch.compileRe=(t,r,i=false,o=false)=>{if(i===true){return t.output}const a=r||{};const c=a.contains?"":"^";const l=a.contains?"":"$";let u=`${c}(?:${t.output})${l}`;if(t&&t.negated===true){u=`^(?!${u}).*$`}const h=picomatch.toRegex(u,r);if(o===true){h.state=t}return h};picomatch.makeRe=(t,r={},i=false,o=false)=>{if(!t||typeof t!=="string"){throw new TypeError("Expected a non-empty string")}let a={negated:false,fastpaths:true};if(r.fastpaths!==false&&(t[0]==="."||t[0]==="*")){a.output=c.fastpaths(t,r)}if(!a.output){a=c(t,r)}return picomatch.compileRe(a,r,i,o)};picomatch.toRegex=(t,r)=>{try{const i=r||{};return new RegExp(t,i.flags||(i.nocase?"i":""))}catch(t){if(r&&r.debug===true)throw t;return/$^/}};picomatch.constants=u;t.exports=picomatch},8640:(t,r,i)=>{"use strict";const o=i(8658);const{CHAR_ASTERISK:a,CHAR_AT:c,CHAR_BACKWARD_SLASH:l,CHAR_COMMA:u,CHAR_DOT:h,CHAR_EXCLAMATION_MARK:d,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_LEFT_PARENTHESES:g,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_PLUS:b,CHAR_QUESTION_MARK:v,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:w,CHAR_RIGHT_SQUARE_BRACKET:E}=i(7820);const isPathSeparator=t=>t===p||t===l;const depth=t=>{if(t.isPrefix!==true){t.depth=t.isGlobstar?Infinity:1}};const scan=(t,r)=>{const i=r||{};const S=t.length-1;const O=i.parts===true||i.scanToEnd===true;const R=[];const x=[];const A=[];let T=t;let k=-1;let C=0;let P=0;let I=false;let L=false;let N=false;let M=false;let D=false;let j=false;let $=false;let H=false;let B=false;let U=false;let q=0;let G;let V;let z={value:"",depth:0,isGlob:false};const eos=()=>k>=S;const peek=()=>T.charCodeAt(k+1);const advance=()=>{G=V;return T.charCodeAt(++k)};while(k<S){V=advance();let t;if(V===l){$=z.backslashes=true;V=advance();if(V===m){j=true}continue}if(j===true||V===m){q++;while(eos()!==true&&(V=advance())){if(V===l){$=z.backslashes=true;advance();continue}if(V===m){q++;continue}if(j!==true&&V===h&&(V=advance())===h){I=z.isBrace=true;N=z.isGlob=true;U=true;if(O===true){continue}break}if(j!==true&&V===u){I=z.isBrace=true;N=z.isGlob=true;U=true;if(O===true){continue}break}if(V===_){q--;if(q===0){j=false;I=z.isBrace=true;U=true;break}}}if(O===true){continue}break}if(V===p){R.push(k);x.push(z);z={value:"",depth:0,isGlob:false};if(U===true)continue;if(G===h&&k===C+1){C+=2;continue}P=k+1;continue}if(i.noext!==true){const t=V===b||V===c||V===a||V===v||V===d;if(t===true&&peek()===g){N=z.isGlob=true;M=z.isExtglob=true;U=true;if(V===d&&k===C){B=true}if(O===true){while(eos()!==true&&(V=advance())){if(V===l){$=z.backslashes=true;V=advance();continue}if(V===w){N=z.isGlob=true;U=true;break}}continue}break}}if(V===a){if(G===a)D=z.isGlobstar=true;N=z.isGlob=true;U=true;if(O===true){continue}break}if(V===v){N=z.isGlob=true;U=true;if(O===true){continue}break}if(V===y){while(eos()!==true&&(t=advance())){if(t===l){$=z.backslashes=true;advance();continue}if(t===E){L=z.isBracket=true;N=z.isGlob=true;U=true;break}}if(O===true){continue}break}if(i.nonegate!==true&&V===d&&k===C){H=z.negated=true;C++;continue}if(i.noparen!==true&&V===g){N=z.isGlob=true;if(O===true){while(eos()!==true&&(V=advance())){if(V===g){$=z.backslashes=true;V=advance();continue}if(V===w){U=true;break}}continue}break}if(N===true){U=true;if(O===true){continue}break}}if(i.noext===true){M=false;N=false}let W=T;let Y="";let K="";if(C>0){Y=T.slice(0,C);T=T.slice(C);P-=C}if(W&&N===true&&P>0){W=T.slice(0,P);K=T.slice(P)}else if(N===true){W="";K=T}else{W=T}if(W&&W!==""&&W!=="/"&&W!==T){if(isPathSeparator(W.charCodeAt(W.length-1))){W=W.slice(0,-1)}}if(i.unescape===true){if(K)K=o.removeBackslashes(K);if(W&&$===true){W=o.removeBackslashes(W)}}const X={prefix:Y,input:t,start:C,base:W,glob:K,isBrace:I,isBracket:L,isGlob:N,isExtglob:M,isGlobstar:D,negated:H,negatedExtglob:B};if(i.tokens===true){X.maxDepth=0;if(!isPathSeparator(V)){x.push(z)}X.tokens=x}if(i.parts===true||i.tokens===true){let r;for(let o=0;o<R.length;o++){const a=r?r+1:C;const c=R[o];const l=t.slice(a,c);if(i.tokens){if(o===0&&C!==0){x[o].isPrefix=true;x[o].value=Y}else{x[o].value=l}depth(x[o]);X.maxDepth+=x[o].depth}if(o!==0||l!==""){A.push(l)}r=c}if(r&&r+1<t.length){const o=t.slice(r+1);A.push(o);if(i.tokens){x[x.length-1].value=o;depth(x[x.length-1]);X.maxDepth+=x[x.length-1].depth}}X.slashes=R;X.parts=A}return X};t.exports=scan},8658:(t,r,i)=>{"use strict";const o=i(1017);const a=process.platform==="win32";const{REGEX_BACKSLASH:c,REGEX_REMOVE_BACKSLASH:l,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:h}=i(7820);r.isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);r.hasRegexChars=t=>u.test(t);r.isRegexChar=t=>t.length===1&&r.hasRegexChars(t);r.escapeRegex=t=>t.replace(h,"\\$1");r.toPosixSlashes=t=>t.replace(c,"/");r.removeBackslashes=t=>t.replace(l,(t=>t==="\\"?"":t));r.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);if(t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10){return true}return false};r.isWindows=t=>{if(t&&typeof t.windows==="boolean"){return t.windows}return a===true||o.sep==="\\"};r.escapeLast=(t,i,o)=>{const a=t.lastIndexOf(i,o);if(a===-1)return t;if(t[a-1]==="\\")return r.escapeLast(t,i,a-1);return`${t.slice(0,a)}\\${t.slice(a)}`};r.removePrefix=(t,r={})=>{let i=t;if(i.startsWith("./")){i=i.slice(2);r.prefix="./"}return i};r.wrapOutput=(t,r={},i={})=>{const o=i.contains?"":"^";const a=i.contains?"":"$";let c=`${o}(?:${t})${a}`;if(r.negated===true){c=`(?:^(?!${c}).*$)`}return c}},304:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},657:(t,r,i)=>{"use strict";const o=i(304);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},8908:(t,r,i)=>{"use strict";const o=i(304);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},2757:(t,r,i)=>{"use strict";t.exports={DatePart:i(304),Meridiem:i(8534),Day:i(657),Hours:i(8908),Milliseconds:i(7765),Minutes:i(1616),Month:i(3985),Seconds:i(4122),Year:i(6729)}},8534:(t,r,i)=>{"use strict";const o=i(304);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},7765:(t,r,i)=>{"use strict";const o=i(304);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},1616:(t,r,i)=>{"use strict";const o=i(304);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},3985:(t,r,i)=>{"use strict";const o=i(304);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},4122:(t,r,i)=>{"use strict";const o=i(304);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},6729:(t,r,i)=>{"use strict";const o=i(304);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},7005:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5761);const a=i(6705);const c=i(9270),l=c.erase,u=c.cursor;const h=i(5559),d=h.style,p=h.clear,m=h.figures,g=h.wrap,y=h.entriesToDisplay;const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=d.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=p("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}complete(t){var r=this;return _asyncToGenerator((function*(){const i=r.completing=r.suggest(r.input,r.choices);const o=yield i;if(r.completing!==i)return;r.suggestions=o.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));r.completing=false;const a=Math.max(o.length-1,0);r.moveSelect(Math.min(a,r.select));t&&t()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let c;let l=i?m.arrowUp:a?m.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;l=(r?o.cyan(m.pointer)+" ":" ")+l;if(t.description){c=` - ${t.description}`;if(l.length+u.length+c.length>=this.out.columns||t.description.split(/\r?\n/).length>1){c="\n"+g(t.description,{margin:3,width:this.out.columns})}}return l+" "+u+o.gray(c||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(p(this.outputText,this.out.columns));super.render();let t=y(this.select,this.choices.length,this.limit),r=t.startIndex,i=t.endIndex;this.outputText=[d.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),d.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const t=this.suggestions.slice(r,i).map(((t,o)=>this.renderOption(t,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(t||o.gray(this.fallback.title))}this.out.write(l.line+u.to(0)+this.outputText)}}t.exports=AutocompletePrompt},4870:(t,r,i)=>{"use strict";const o=i(5761);const a=i(9270),c=a.cursor;const l=i(5);const u=i(5559),h=u.clear,d=u.style,p=u.figures;class AutocompleteMultiselectPrompt extends l{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=h("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${p.arrowUp}/${p.arrowDown}: Highlight option\n ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(p.radioOn):p.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);super.render();let t=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},3323:(t,r,i)=>{"use strict";const o=i(5761);const a=i(6705);const c=i(5559),l=c.style,u=c.clear;const h=i(9270),d=h.erase,p=h.cursor;class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(d.line+p.to(0)+this.outputText)}}t.exports=ConfirmPrompt},882:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5761);const a=i(6705);const c=i(5559),l=c.style,u=c.clear,h=c.figures;const d=i(9270),p=d.erase,m=d.cursor;const g=i(2757),y=g.DatePart,b=g.Meridiem,v=g.Day,_=g.Hours,w=g.Milliseconds,E=g.Minutes,S=g.Month,O=g.Seconds,R=g.Year;const x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const A={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new v(t),3:t=>new S(t),4:t=>new R(t),5:t=>new b(t),6:t=>new _(t),7:t=>new E(t),8:t=>new O(t),9:t=>new w(t)};const T={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(T,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=u("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=x.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in A?A[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof y)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r==="string"){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color="red";t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof y)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(p.line+m.to(0)+this.outputText)}}t.exports=DatePrompt},8931:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(2591),SelectPrompt:i(8234),TogglePrompt:i(2731),DatePrompt:i(882),NumberPrompt:i(7635),MultiselectPrompt:i(5),AutocompletePrompt:i(7005),AutocompleteMultiselectPrompt:i(4870),ConfirmPrompt:i(3323)}},5:(t,r,i)=>{"use strict";const o=i(5761);const a=i(9270),c=a.cursor;const l=i(6705);const u=i(5559),h=u.clear,d=u.figures,p=u.style,m=u.wrap,g=u.entriesToDisplay;class MultiselectPrompt extends l{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=h("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${d.arrowUp}/${d.arrowDown}: Highlight option\n`+` ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const c=(r.selected?o.green(d.radioOn):d.radioOff)+" "+a+" ";let l,u;if(r.disabled){l=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{l=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){u=` - ${r.description}`;if(c.length+l.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1){u="\n"+m(r.description,{margin:c.length,width:this.out.columns})}}}return c+l+o.gray(u||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let r=g(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,a=r.endIndex;let c,l=[];for(let r=i;r<a;r++){if(r===i&&i>0){c=d.arrowUp}else if(r===a-1&&a<t.length){c=d.arrowDown}else{c=" "}l.push(this.renderOption(this.cursor,t[r],r,c))}return"\n"+l.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);super.render();let t=[p.symbol(this.done,this.aborted),o.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=MultiselectPrompt},7635:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5761);const a=i(6705);const c=i(9270),l=c.cursor,u=c.erase;const h=i(5559),d=h.style,p=h.figures,m=h.clear,g=h.lines;const y=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||y.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color=`red`;t.fire();t.render();return}let r=t.value;t.value=r!==``?r:t.initial;t.done=true;t.aborted=false;t.error=false;t.fire();t.render();t.out.write(`\n`);t.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(g(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns));this.out.write(m(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(u.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore)}}t.exports=NumberPrompt},6705:(t,r,i)=>{"use strict";const o=i(4521);const a=i(5559),c=a.action;const l=i(2361);const u=i(9270),h=u.beep,d=u.cursor;const p=i(5761);class Prompt extends l{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=c(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(d.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(p);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},8234:(t,r,i)=>{"use strict";const o=i(5761);const a=i(6705);const c=i(5559),l=c.style,u=c.clear,h=c.figures,d=c.wrap,p=c.entriesToDisplay;const m=i(9270),g=m.cursor;class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=u("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(g.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();let t=p(this.cursor,this.choices.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex;this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let t=r;t<i;t++){let a,c,l="",u=this.choices[t];if(t===r&&r>0){c=h.arrowUp}else if(t===i-1&&i<this.choices.length){c=h.arrowDown}else{c=" "}if(u.disabled){a=this.cursor===t?o.gray().underline(u.title):o.strikethrough().gray(u.title);c=(this.cursor===t?o.bold().gray(h.pointer)+" ":" ")+c}else{a=this.cursor===t?o.cyan().underline(u.title):u.title;c=(this.cursor===t?o.cyan(h.pointer)+" ":" ")+c;if(u.description&&this.cursor===t){l=` - ${u.description}`;if(c.length+a.length+l.length>=this.out.columns||u.description.split(/\r?\n/).length>1){l="\n"+d(u.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${c} ${a}${o.gray(l)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},2591:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5761);const a=i(6705);const c=i(9270),l=c.erase,u=c.cursor;const h=i(5559),d=h.style,p=h.clear,m=h.lines,g=h.figures;class TextPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=p(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){t.value=t.value||t.initial;t.cursorOffset=0;t.cursor=t.rendered.length;yield t.validate();if(t.error){t.red=true;t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(m(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":g.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore+u.move(this.cursorOffset,0))}}t.exports=TextPrompt},2731:(t,r,i)=>{"use strict";const o=i(5761);const a=i(6705);const c=i(5559),l=c.style,u=c.clear;const h=i(9270),d=h.cursor,p=h.erase;class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(p.line+d.to(0)+this.outputText)}}t.exports=TogglePrompt},6097:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r){o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,l=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();c=t.done;return t},e:function e(t){l=true;u=t},f:function f(){try{if(!c&&i.return!=null)i.return()}finally{if(l)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5608);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const c={};const l=prompt._override||{};t=[].concat(t);let u,h,d,p,m,g;const y=function(){var t=_asyncToGenerator((function*(t,r,i=false){if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?yield t.format(r,c):r}));return function getFormattedAnswer(r,i){return t.apply(this,arguments)}}();var b=_createForOfIteratorHelper(t),v;try{for(b.s();!(v=b.n()).done;){h=v.value;var _=h;p=_.name;m=_.type;if(typeof m==="function"){m=yield m(u,_objectSpread({},c),h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?yield r(u,_objectSpread({},c),g):r}g=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}var w=h;p=w.name;m=w.type;if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(l[h.name]!==undefined){u=yield y(h,l[h.name]);if(u!==undefined){c[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):yield o[m](h);c[p]=u=yield y(h,u,true);d=yield r(h,u,c)}catch(t){d=!(yield i(h,c))}if(d)return c}}catch(t){b.e(t)}finally{b.f()}return c}));return _prompt.apply(this,arguments)}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},5608:(t,r,i)=>{"use strict";const o=r;const a=i(8931);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,c)=>{const l=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;l.on("state",r.onState||noop);l.on("submit",(t=>o(h(t))));l.on("exit",(t=>o(d(t))));l.on("abort",(t=>c(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},2151:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},2292:(t,r,i)=>{"use strict";function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,l=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();c=t.done;return t},e:function e(t){l=true;u=t},f:function f(){try{if(!c&&i.return!=null)i.return()}finally{if(l)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}const o=i(8452);const a=i(9270),c=a.erase,l=a.cursor;const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return c.line+l.to(0);let i=0;const o=t.split(/\r?\n/);var a=_createForOfIteratorHelper(o),u;try{for(a.s();!(u=a.n()).done;){let t=u.value;i+=1+Math.floor(Math.max(width(t)-1,0)/r)}}catch(t){a.e(t)}finally{a.f()}return c.lines(i)}},2273:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},5083:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},5559:(t,r,i)=>{"use strict";t.exports={action:i(2151),clear:i(2292),style:i(1918),strip:i(8452),figures:i(5083),lines:i(7085),wrap:i(9750),entriesToDisplay:i(2273)}},7085:(t,r,i)=>{"use strict";const o=i(8452);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},8452:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},1918:(t,r,i)=>{"use strict";const o=i(5761);const a=i(5083);const c=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>c[t]||c.default;const l=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?l.aborted:i?l.exited:t?l.done:l.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:c,render:render,symbols:l,symbol:symbol,delimiter:delimiter,item:item}},9750:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},6718:(t,r,i)=>{function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;r<t.length;r++){if(i[r]>t[r])return false;if(t[r]>i[r])return true}return false}t.exports=isNodeLT("8.6.0")?i(6097):i(230)},1345:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},5333:(t,r,i)=>{"use strict";const o=i(1345);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},2144:(t,r,i)=>{"use strict";const o=i(1345);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},2669:(t,r,i)=>{"use strict";t.exports={DatePart:i(1345),Meridiem:i(4120),Day:i(5333),Hours:i(2144),Milliseconds:i(6317),Minutes:i(124),Month:i(2702),Seconds:i(682),Year:i(9036)}},4120:(t,r,i)=>{"use strict";const o=i(1345);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},6317:(t,r,i)=>{"use strict";const o=i(1345);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},124:(t,r,i)=>{"use strict";const o=i(1345);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},2702:(t,r,i)=>{"use strict";const o=i(1345);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},682:(t,r,i)=>{"use strict";const o=i(1345);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},9036:(t,r,i)=>{"use strict";const o=i(1345);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},7286:(t,r,i)=>{"use strict";const o=i(5761);const a=i(2);const{erase:c,cursor:l}=i(9270);const{style:u,clear:h,figures:d,wrap:p,entriesToDisplay:m}=i(9378);const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=u.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=h("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}async complete(t){const r=this.completing=this.suggest(this.input,this.choices);const i=await r;if(this.completing!==r)return;this.suggestions=i.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));this.completing=false;const o=Math.max(i.length-1,0);this.moveSelect(Math.min(o,this.select));t&&t()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let c;let l=i?d.arrowUp:a?d.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;l=(r?o.cyan(d.pointer)+" ":" ")+l;if(t.description){c=` - ${t.description}`;if(l.length+u.length+c.length>=this.out.columns||t.description.split(/\r?\n/).length>1){c="\n"+p(t.description,{margin:3,width:this.out.columns})}}return l+" "+u+o.gray(c||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=m(this.select,this.choices.length,this.limit);this.outputText=[u.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const i=this.suggestions.slice(t,r).map(((i,o)=>this.renderOption(i,this.select===o+t,o===0&&t>0,o+t===r-1&&r<this.choices.length))).join("\n");this.outputText+=`\n`+(i||o.gray(this.fallback.title))}this.out.write(c.line+l.to(0)+this.outputText)}}t.exports=AutocompletePrompt},9711:(t,r,i)=>{"use strict";const o=i(5761);const{cursor:a}=i(9270);const c=i(3033);const{clear:l,style:u,figures:h}=i(9378);class AutocompleteMultiselectPrompt extends c{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=l("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(h.radioOn):h.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=l(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},2590:(t,r,i)=>{const o=i(5761);const a=i(2);const{style:c,clear:l}=i(9378);const{erase:u,cursor:h}=i(9270);class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(u.line+h.to(0)+this.outputText)}}t.exports=ConfirmPrompt},8513:(t,r,i)=>{"use strict";const o=i(5761);const a=i(2);const{style:c,clear:l,figures:u}=i(9378);const{erase:h,cursor:d}=i(9270);const{DatePart:p,Meridiem:m,Day:g,Hours:y,Milliseconds:b,Minutes:v,Month:_,Seconds:w,Year:E}=i(2669);const S=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const O={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new g(t),3:t=>new _(t),4:t=>new E(t),5:t=>new m(t),6:t=>new y(t),7:t=>new v(t),8:t=>new w(t),9:t=>new b(t)};const R={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(R,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=l("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=S.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in O?O[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof p)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t==="string"){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof p)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:u.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(h.line+d.to(0)+this.outputText)}}t.exports=DatePrompt},3716:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(8601),SelectPrompt:i(6667),TogglePrompt:i(5372),DatePrompt:i(8513),NumberPrompt:i(7156),MultiselectPrompt:i(3033),AutocompletePrompt:i(7286),AutocompleteMultiselectPrompt:i(9711),ConfirmPrompt:i(2590)}},3033:(t,r,i)=>{"use strict";const o=i(5761);const{cursor:a}=i(9270);const c=i(2);const{clear:l,figures:u,style:h,wrap:d,entriesToDisplay:p}=i(9378);class MultiselectPrompt extends c{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=l("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${u.arrowUp}/${u.arrowDown}: Highlight option\n`+` ${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const c=(r.selected?o.green(u.radioOn):u.radioOff)+" "+a+" ";let l,h;if(r.disabled){l=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{l=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){h=` - ${r.description}`;if(c.length+l.length+h.length>=this.out.columns||r.description.split(/\r?\n/).length>1){h="\n"+d(r.description,{margin:c.length,width:this.out.columns})}}}return c+l+o.gray(h||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let{startIndex:r,endIndex:i}=p(this.cursor,t.length,this.optionsPerPage);let a,c=[];for(let o=r;o<i;o++){if(o===r&&r>0){a=u.arrowUp}else if(o===i-1&&i<t.length){a=u.arrowDown}else{a=" "}c.push(this.renderOption(this.cursor,t[o],o,a))}return"\n"+c.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[h.symbol(this.done,this.aborted),o.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=l(t,this.out.columns)}}t.exports=MultiselectPrompt},7156:(t,r,i)=>{const o=i(5761);const a=i(2);const{cursor:c,erase:l}=i(9270);const{style:u,figures:h,clear:d,lines:p}=i(9378);const m=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||m.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let t=this.value;this.value=t!==``?t:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore)}}t.exports=NumberPrompt},2:(t,r,i)=>{"use strict";const o=i(4521);const{action:a}=i(9378);const c=i(2361);const{beep:l,cursor:u}=i(9270);const h=i(5761);class Prompt extends c{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=a(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(u.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(l)}render(){this.onRender(h);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},6667:(t,r,i)=>{"use strict";const o=i(5761);const a=i(2);const{style:c,clear:l,figures:u,wrap:h,entriesToDisplay:d}=i(9378);const{cursor:p}=i(9270);class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=l("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=d(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let i=t;i<r;i++){let a,c,l="",d=this.choices[i];if(i===t&&t>0){c=u.arrowUp}else if(i===r-1&&r<this.choices.length){c=u.arrowDown}else{c=" "}if(d.disabled){a=this.cursor===i?o.gray().underline(d.title):o.strikethrough().gray(d.title);c=(this.cursor===i?o.bold().gray(u.pointer)+" ":" ")+c}else{a=this.cursor===i?o.cyan().underline(d.title):d.title;c=(this.cursor===i?o.cyan(u.pointer)+" ":" ")+c;if(d.description&&this.cursor===i){l=` - ${d.description}`;if(c.length+a.length+l.length>=this.out.columns||d.description.split(/\r?\n/).length>1){l="\n"+h(d.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${c} ${a}${o.gray(l)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},8601:(t,r,i)=>{const o=i(5761);const a=i(2);const{erase:c,cursor:l}=i(9270);const{style:u,clear:h,lines:d,figures:p}=i(9378);class TextPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=h(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(d(this.outputError,this.out.columns)-1)+h(this.outputError,this.out.columns));this.out.write(h(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore+l.move(this.cursorOffset,0))}}t.exports=TextPrompt},5372:(t,r,i)=>{const o=i(5761);const a=i(2);const{style:c,clear:l}=i(9378);const{cursor:u,erase:h}=i(9270);class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(h.line+u.to(0)+this.outputText)}}t.exports=TogglePrompt},230:(t,r,i)=>{"use strict";const o=i(4099);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const c={};const l=prompt._override||{};t=[].concat(t);let u,h,d,p,m,g;const getFormattedAnswer=async(t,r,i=false)=>{if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?await t.format(r,c):r};for(h of t){({name:p,type:m}=h);if(typeof m==="function"){m=await m(u,{...c},h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?await r(u,{...c},g):r}g=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}({name:p,type:m}=h);if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(l[h.name]!==undefined){u=await getFormattedAnswer(h,l[h.name]);if(u!==undefined){c[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):await o[m](h);c[p]=u=await getFormattedAnswer(h,u,true);d=await r(h,u,c)}catch(t){d=!await i(h,c)}if(d)return c}return c}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},4099:(t,r,i)=>{"use strict";const o=r;const a=i(3716);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,c)=>{const l=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;l.on("state",r.onState||noop);l.on("submit",(t=>o(h(t))));l.on("exit",(t=>o(d(t))));l.on("abort",(t=>c(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},6354:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},7884:(t,r,i)=>{"use strict";const o=i(4952);const{erase:a,cursor:c}=i(9270);const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return a.line+c.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o){i+=1+Math.floor(Math.max(width(t)-1,0)/r)}return a.lines(i)}},7268:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},5706:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},9378:(t,r,i)=>{"use strict";t.exports={action:i(6354),clear:i(7884),style:i(135),strip:i(4952),figures:i(5706),lines:i(587),wrap:i(1546),entriesToDisplay:i(7268)}},587:(t,r,i)=>{"use strict";const o=i(4952);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},4952:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},135:(t,r,i)=>{"use strict";const o=i(5761);const a=i(5706);const c=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>c[t]||c.default;const l=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?l.aborted:i?l.exited:t?l.done:l.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:c,render:render,symbols:l,symbol:symbol,delimiter:delimiter,item:item}},1546:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},6405:(t,r,i)=>{var o=i(4556);var a=i(1328);var c=i(7147);var noop=function(){};var l=/^v?\.0/.test(process.version);var isFn=function(t){return typeof t==="function"};var isFS=function(t){if(!l)return false;if(!c)return false;return(t instanceof(c.ReadStream||noop)||t instanceof(c.WriteStream||noop))&&isFn(t.close)};var isRequest=function(t){return t.setHeader&&isFn(t.abort)};var destroyer=function(t,r,i,c){c=o(c);var l=false;t.on("close",(function(){l=true}));a(t,{readable:r,writable:i},(function(t){if(t)return c(t);l=true;c()}));var u=false;return function(r){if(l)return;if(u)return;u=true;if(isFS(t))return t.close(noop);if(isRequest(t))return t.abort();if(isFn(t.destroy))return t.destroy();c(r||new Error("stream was destroyed"))}};var call=function(t){t()};var pipe=function(t,r){return t.pipe(r)};var pump=function(){var t=Array.prototype.slice.call(arguments);var r=isFn(t[t.length-1]||noop)&&t.pop()||noop;if(Array.isArray(t[0]))t=t[0];if(t.length<2)throw new Error("pump requires two streams per minimum");var i;var o=t.map((function(a,c){var l=c<t.length-1;var u=c>0;return destroyer(a,l,u,(function(t){if(!i)i=t;if(t)o.forEach(call);if(l)return;o.forEach(call);r(i)}))}));return t.reduce(pipe)};t.exports=pump},8453:t=>{
|
|
104
|
+
*/t.exports=function(t){if(typeof t==="number"){return t-t===0}if(typeof t==="string"&&t.trim()!==""){return Number.isFinite?Number.isFinite(+t):isFinite(+t)}return false}},6116:t=>{var r={}.toString;t.exports=Array.isArray||function(t){return r.call(t)=="[object Array]"}},9774:(t,r,i)=>{var o=i(7147);var a;if(process.platform==="win32"||global.TESTING_WINDOWS){a=i(5660)}else{a=i(75)}t.exports=isexe;isexe.sync=sync;function isexe(t,r,i){if(typeof r==="function"){i=r;r={}}if(!i){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(i,o){isexe(t,r||{},(function(t,r){if(t){o(t)}else{i(r)}}))}))}a(t,r||{},(function(t,o){if(t){if(t.code==="EACCES"||r&&r.ignoreErrors){t=null;o=false}}i(t,o)}))}function sync(t,r){try{return a.sync(t,r||{})}catch(t){if(r&&r.ignoreErrors||t.code==="EACCES"){return false}else{throw t}}}},75:(t,r,i)=>{t.exports=isexe;isexe.sync=sync;var o=i(7147);function isexe(t,r,i){o.stat(t,(function(t,o){i(t,t?false:checkStat(o,r))}))}function sync(t,r){return checkStat(o.statSync(t),r)}function checkStat(t,r){return t.isFile()&&checkMode(t,r)}function checkMode(t,r){var i=t.mode;var o=t.uid;var a=t.gid;var l=r.uid!==undefined?r.uid:process.getuid&&process.getuid();var c=r.gid!==undefined?r.gid:process.getgid&&process.getgid();var u=parseInt("100",8);var h=parseInt("010",8);var d=parseInt("001",8);var p=u|h;var m=i&d||i&h&&a===c||i&u&&o===l||i&p&&l===0;return m}},5660:(t,r,i)=>{t.exports=isexe;isexe.sync=sync;var o=i(7147);function checkPathExt(t,r){var i=r.pathExt!==undefined?r.pathExt:process.env.PATHEXT;if(!i){return true}i=i.split(";");if(i.indexOf("")!==-1){return true}for(var o=0;o<i.length;o++){var a=i[o].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a){return true}}return false}function checkStat(t,r,i){if(!t.isSymbolicLink()&&!t.isFile()){return false}return checkPathExt(r,i)}function isexe(t,r,i){o.stat(t,(function(o,a){i(o,o?false:checkStat(a,t,r))}))}function sync(t,r){return checkStat(o.statSync(t),t,r)}},6020:(t,r)=>{r.stringify=function stringify(t){if("undefined"==typeof t)return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON)t=t.toJSON();if(t&&"object"===typeof t){var r="";var i=Array.isArray(t);r=i?"[":"{";var o=true;for(var a in t){var l="function"==typeof t[a]||!i&&"undefined"===typeof t[a];if(Object.hasOwnProperty.call(t,a)&&!l){if(!o)r+=",";o=false;if(i){if(t[a]==undefined)r+="null";else r+=stringify(t[a])}else if(t[a]!==void 0){r+=stringify(a)+":"+stringify(t[a])}}}r+=i?"]":"}";return r}else if("string"===typeof t){return JSON.stringify(/^:/.test(t)?":"+t:t)}else if("undefined"===typeof t){return"null"}else return JSON.stringify(t)};r.parse=function(t){return JSON.parse(t,(function(t,r){if("string"===typeof r){if(/^:base64:/.test(r))return Buffer.from(r.substring(8),"base64");else return/^:/.test(r)?r.substring(1):r}return r}))}},9276:(t,r,i)=>{"use strict";const o=i(2361);const a=i(6020);BigInt.prototype.toJSON=function(){return this.toString()};const loadStore=t=>{const r={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd"};if(t.adapter||t.uri){const i=t.adapter||/^[^:]*/.exec(t.uri)[0];return new(require(r[i]))(t)}return new Map};class Keyv extends o{constructor(t,r){super();this.opts=Object.assign({namespace:"keyv",serialize:a.stringify,deserialize:a.parse},typeof t==="string"?{uri:t}:t,r);if(!this.opts.store){const t=Object.assign({},this.opts);this.opts.store=loadStore(t)}if(typeof this.opts.store.on==="function"){this.opts.store.on("error",(t=>this.emit("error",t)))}this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(t){return`${this.opts.namespace}:${t}`}get(t,r){const i=this._getKeyPrefix(t);const{store:o}=this.opts;return Promise.resolve().then((()=>o.get(i))).then((t=>typeof t==="string"?this.opts.deserialize(t):t)).then((i=>{if(i===undefined||i===null){return undefined}if(typeof i.expires==="number"&&Date.now()>i.expires){this.delete(t);return undefined}return r&&r.raw?i:i.value}))}set(t,r,i){const o=this._getKeyPrefix(t);if(typeof i==="undefined"){i=this.opts.ttl}if(i===0){i=undefined}const{store:a}=this.opts;return Promise.resolve().then((()=>{const t=typeof i==="number"?Date.now()+i:null;if(typeof r==="symbol"){this.emit("error","symbol cannot be serialized")}r={value:r,expires:t};return this.opts.serialize(r)})).then((t=>a.set(o,t,i))).then((()=>true))}delete(t){const r=this._getKeyPrefix(t);const{store:i}=this.opts;return Promise.resolve().then((()=>i.delete(r)))}clear(){const{store:t}=this.opts;return Promise.resolve().then((()=>t.clear()))}}t.exports=Keyv},4425:t=>{"use strict";const{FORCE_COLOR:r,NODE_DISABLE_COLORS:i,TERM:o}=process.env;const a={enabled:!i&&o!=="dumb"&&r!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(t,r){let i=0,o,a="",l="";for(;i<t.length;i++){o=t[i];a+=o.open;l+=o.close;if(r.includes(o.close)){r=r.replace(o.rgx,o.close+o.open)}}return a+r+l}function chain(t,r){let i={has:t,keys:r};i.reset=a.reset.bind(i);i.bold=a.bold.bind(i);i.dim=a.dim.bind(i);i.italic=a.italic.bind(i);i.underline=a.underline.bind(i);i.inverse=a.inverse.bind(i);i.hidden=a.hidden.bind(i);i.strikethrough=a.strikethrough.bind(i);i.black=a.black.bind(i);i.red=a.red.bind(i);i.green=a.green.bind(i);i.yellow=a.yellow.bind(i);i.blue=a.blue.bind(i);i.magenta=a.magenta.bind(i);i.cyan=a.cyan.bind(i);i.white=a.white.bind(i);i.gray=a.gray.bind(i);i.grey=a.grey.bind(i);i.bgBlack=a.bgBlack.bind(i);i.bgRed=a.bgRed.bind(i);i.bgGreen=a.bgGreen.bind(i);i.bgYellow=a.bgYellow.bind(i);i.bgBlue=a.bgBlue.bind(i);i.bgMagenta=a.bgMagenta.bind(i);i.bgCyan=a.bgCyan.bind(i);i.bgWhite=a.bgWhite.bind(i);return i}function init(t,r){let i={open:`[${t}m`,close:`[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(r){if(this!==void 0&&this.has!==void 0){this.has.includes(t)||(this.has.push(t),this.keys.push(i));return r===void 0?this:a.enabled?run(this.keys,r+""):r+""}return r===void 0?chain([t],[i]):a.enabled?run([i],r+""):r+""}}t.exports=a},9338:(t,r,i)=>{var o=i(3837);var a=i(1250);t.exports={Readable:Readable,Writable:Writable};o.inherits(Readable,a);o.inherits(Writable,a);function beforeFirstCall(t,r,i){t[r]=function(){delete t[r];i.apply(this,arguments);return this[r].apply(this,arguments)}}function Readable(t,r){if(!(this instanceof Readable))return new Readable(t,r);a.call(this,r);beforeFirstCall(this,"_read",(function(){var i=t.call(this,r);var o=this.emit.bind(this,"error");i.on("error",o);i.pipe(this)}));this.emit("readable")}function Writable(t,r){if(!(this instanceof Writable))return new Writable(t,r);a.call(this,r);beforeFirstCall(this,"_write",(function(){var i=t.call(this,r);var o=this.emit.bind(this,"error");i.on("error",o);this.pipe(i)}));this.emit("writable")}},3442:t=>{var r=9007199254740991;var i="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]";var l=/^(?:0|[1-9]\d*)$/;function apply(t,r,i){switch(i.length){case 0:return t.call(r);case 1:return t.call(r,i[0]);case 2:return t.call(r,i[0],i[1]);case 3:return t.call(r,i[0],i[1],i[2])}return t.apply(r,i)}function baseTimes(t,r){var i=-1,o=Array(t);while(++i<t){o[i]=r(i)}return o}var c=Object.prototype;var u=c.hasOwnProperty;var h=c.toString;var d=c.propertyIsEnumerable;var p=Math.max;function arrayLikeKeys(t,r){var i=m(t)||isArguments(t)?baseTimes(t.length,String):[];var o=i.length,a=!!o;for(var l in t){if((r||u.call(t,l))&&!(a&&(l=="length"||isIndex(l,o)))){i.push(l)}}return i}function assignInDefaults(t,r,i,o){if(t===undefined||eq(t,c[i])&&!u.call(o,i)){return r}return t}function assignValue(t,r,i){var o=t[r];if(!(u.call(t,r)&&eq(o,i))||i===undefined&&!(r in t)){t[r]=i}}function baseKeysIn(t){if(!isObject(t)){return nativeKeysIn(t)}var r=isPrototype(t),i=[];for(var o in t){if(!(o=="constructor"&&(r||!u.call(t,o)))){i.push(o)}}return i}function baseRest(t,r){r=p(r===undefined?t.length-1:r,0);return function(){var i=arguments,o=-1,a=p(i.length-r,0),l=Array(a);while(++o<a){l[o]=i[r+o]}o=-1;var c=Array(r+1);while(++o<r){c[o]=i[o]}c[r]=l;return apply(t,this,c)}}function copyObject(t,r,i,o){i||(i={});var a=-1,l=r.length;while(++a<l){var c=r[a];var u=o?o(i[c],t[c],c,i,t):undefined;assignValue(i,c,u===undefined?t[c]:u)}return i}function createAssigner(t){return baseRest((function(r,i){var o=-1,a=i.length,l=a>1?i[a-1]:undefined,c=a>2?i[2]:undefined;l=t.length>3&&typeof l=="function"?(a--,l):undefined;if(c&&isIterateeCall(i[0],i[1],c)){l=a<3?undefined:l;a=1}r=Object(r);while(++o<a){var u=i[o];if(u){t(r,u,o,l)}}return r}))}function isIndex(t,i){i=i==null?r:i;return!!i&&(typeof t=="number"||l.test(t))&&(t>-1&&t%1==0&&t<i)}function isIterateeCall(t,r,i){if(!isObject(i)){return false}var o=typeof r;if(o=="number"?isArrayLike(i)&&isIndex(r,i.length):o=="string"&&r in i){return eq(i[r],t)}return false}function isPrototype(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||c;return t===i}function nativeKeysIn(t){var r=[];if(t!=null){for(var i in Object(t)){r.push(i)}}return r}function eq(t,r){return t===r||t!==t&&r!==r}function isArguments(t){return isArrayLikeObject(t)&&u.call(t,"callee")&&(!d.call(t,"callee")||h.call(t)==i)}var m=Array.isArray;function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction(t)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function isFunction(t){var r=isObject(t)?h.call(t):"";return r==o||r==a}function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}function isObject(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function isObjectLike(t){return!!t&&typeof t=="object"}var y=createAssigner((function(t,r,i,o){copyObject(r,keysIn(r),t,o)}));var g=baseRest((function(t){t.push(undefined,assignInDefaults);return apply(y,undefined,t)}));function keysIn(t){return isArrayLike(t)?arrayLikeKeys(t,true):baseKeysIn(t)}t.exports=g},1015:t=>{var r=200;var i="__lodash_hash_undefined__";var o=9007199254740991;var a="[object Arguments]",l="[object Function]",c="[object GeneratorFunction]";var u=/[\\^$.*+?()[\]{}|]/g;var h=/^\[object .+?Constructor\]$/;var d=typeof global=="object"&&global&&global.Object===Object&&global;var p=typeof self=="object"&&self&&self.Object===Object&&self;var m=d||p||Function("return this")();function apply(t,r,i){switch(i.length){case 0:return t.call(r);case 1:return t.call(r,i[0]);case 2:return t.call(r,i[0],i[1]);case 3:return t.call(r,i[0],i[1],i[2])}return t.apply(r,i)}function arrayIncludes(t,r){var i=t?t.length:0;return!!i&&baseIndexOf(t,r,0)>-1}function arrayIncludesWith(t,r,i){var o=-1,a=t?t.length:0;while(++o<a){if(i(r,t[o])){return true}}return false}function arrayMap(t,r){var i=-1,o=t?t.length:0,a=Array(o);while(++i<o){a[i]=r(t[i],i,t)}return a}function arrayPush(t,r){var i=-1,o=r.length,a=t.length;while(++i<o){t[a+i]=r[i]}return t}function baseFindIndex(t,r,i,o){var a=t.length,l=i+(o?1:-1);while(o?l--:++l<a){if(r(t[l],l,t)){return l}}return-1}function baseIndexOf(t,r,i){if(r!==r){return baseFindIndex(t,baseIsNaN,i)}var o=i-1,a=t.length;while(++o<a){if(t[o]===r){return o}}return-1}function baseIsNaN(t){return t!==t}function baseUnary(t){return function(r){return t(r)}}function cacheHas(t,r){return t.has(r)}function getValue(t,r){return t==null?undefined:t[r]}function isHostObject(t){var r=false;if(t!=null&&typeof t.toString!="function"){try{r=!!(t+"")}catch(t){}}return r}var y=Array.prototype,g=Function.prototype,b=Object.prototype;var v=m["__core-js_shared__"];var _=function(){var t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var w=g.toString;var E=b.hasOwnProperty;var S=b.toString;var R=RegExp("^"+w.call(E).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var O=m.Symbol,x=b.propertyIsEnumerable,T=y.splice,k=O?O.isConcatSpreadable:undefined;var A=Math.max;var C=getNative(m,"Map"),P=getNative(Object,"create");function Hash(t){var r=-1,i=t?t.length:0;this.clear();while(++r<i){var o=t[r];this.set(o[0],o[1])}}function hashClear(){this.__data__=P?P(null):{}}function hashDelete(t){return this.has(t)&&delete this.__data__[t]}function hashGet(t){var r=this.__data__;if(P){var o=r[t];return o===i?undefined:o}return E.call(r,t)?r[t]:undefined}function hashHas(t){var r=this.__data__;return P?r[t]!==undefined:E.call(r,t)}function hashSet(t,r){var o=this.__data__;o[t]=P&&r===undefined?i:r;return this}Hash.prototype.clear=hashClear;Hash.prototype["delete"]=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(t){var r=-1,i=t?t.length:0;this.clear();while(++r<i){var o=t[r];this.set(o[0],o[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(t){var r=this.__data__,i=assocIndexOf(r,t);if(i<0){return false}var o=r.length-1;if(i==o){r.pop()}else{T.call(r,i,1)}return true}function listCacheGet(t){var r=this.__data__,i=assocIndexOf(r,t);return i<0?undefined:r[i][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,r){var i=this.__data__,o=assocIndexOf(i,t);if(o<0){i.push([t,r])}else{i[o][1]=r}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(t){var r=-1,i=t?t.length:0;this.clear();while(++r<i){var o=t[r];this.set(o[0],o[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(C||ListCache),string:new Hash}}function mapCacheDelete(t){return getMapData(this,t)["delete"](t)}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,r){getMapData(this,t).set(t,r);return this}MapCache.prototype.clear=mapCacheClear;MapCache.prototype["delete"]=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function SetCache(t){var r=-1,i=t?t.length:0;this.__data__=new MapCache;while(++r<i){this.add(t[r])}}function setCacheAdd(t){this.__data__.set(t,i);return this}function setCacheHas(t){return this.__data__.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function assocIndexOf(t,r){var i=t.length;while(i--){if(eq(t[i][0],r)){return i}}return-1}function baseDifference(t,i,o,a){var l=-1,c=arrayIncludes,u=true,h=t.length,d=[],p=i.length;if(!h){return d}if(o){i=arrayMap(i,baseUnary(o))}if(a){c=arrayIncludesWith;u=false}else if(i.length>=r){c=cacheHas;u=false;i=new SetCache(i)}e:while(++l<h){var m=t[l],y=o?o(m):m;m=a||m!==0?m:0;if(u&&y===y){var g=p;while(g--){if(i[g]===y){continue e}}d.push(m)}else if(!c(i,y,a)){d.push(m)}}return d}function baseFlatten(t,r,i,o,a){var l=-1,c=t.length;i||(i=isFlattenable);a||(a=[]);while(++l<c){var u=t[l];if(r>0&&i(u)){if(r>1){baseFlatten(u,r-1,i,o,a)}else{arrayPush(a,u)}}else if(!o){a[a.length]=u}}return a}function baseIsNative(t){if(!isObject(t)||isMasked(t)){return false}var r=isFunction(t)||isHostObject(t)?R:h;return r.test(toSource(t))}function baseRest(t,r){r=A(r===undefined?t.length-1:r,0);return function(){var i=arguments,o=-1,a=A(i.length-r,0),l=Array(a);while(++o<a){l[o]=i[r+o]}o=-1;var c=Array(r+1);while(++o<r){c[o]=i[o]}c[r]=l;return apply(t,this,c)}}function getMapData(t,r){var i=t.__data__;return isKeyable(r)?i[typeof r=="string"?"string":"hash"]:i.map}function getNative(t,r){var i=getValue(t,r);return baseIsNative(i)?i:undefined}function isFlattenable(t){return L(t)||isArguments(t)||!!(k&&t&&t[k])}function isKeyable(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}function isMasked(t){return!!_&&_ in t}function toSource(t){if(t!=null){try{return w.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var I=baseRest((function(t,r){return isArrayLikeObject(t)?baseDifference(t,baseFlatten(r,1,isArrayLikeObject,true)):[]}));function eq(t,r){return t===r||t!==t&&r!==r}function isArguments(t){return isArrayLikeObject(t)&&E.call(t,"callee")&&(!x.call(t,"callee")||S.call(t)==a)}var L=Array.isArray;function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction(t)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function isFunction(t){var r=isObject(t)?S.call(t):"";return r==l||r==c}function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=o}function isObject(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function isObjectLike(t){return!!t&&typeof t=="object"}t.exports=I},3715:t=>{var r=9007199254740991;var i="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]";var l=typeof global=="object"&&global&&global.Object===Object&&global;var c=typeof self=="object"&&self&&self.Object===Object&&self;var u=l||c||Function("return this")();function arrayPush(t,r){var i=-1,o=r.length,a=t.length;while(++i<o){t[a+i]=r[i]}return t}var h=Object.prototype;var d=h.hasOwnProperty;var p=h.toString;var m=u.Symbol,y=h.propertyIsEnumerable,g=m?m.isConcatSpreadable:undefined;function baseFlatten(t,r,i,o,a){var l=-1,c=t.length;i||(i=isFlattenable);a||(a=[]);while(++l<c){var u=t[l];if(r>0&&i(u)){if(r>1){baseFlatten(u,r-1,i,o,a)}else{arrayPush(a,u)}}else if(!o){a[a.length]=u}}return a}function isFlattenable(t){return b(t)||isArguments(t)||!!(g&&t&&t[g])}function flatten(t){var r=t?t.length:0;return r?baseFlatten(t,1):[]}function isArguments(t){return isArrayLikeObject(t)&&d.call(t,"callee")&&(!y.call(t,"callee")||p.call(t)==i)}var b=Array.isArray;function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction(t)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function isFunction(t){var r=isObject(t)?p.call(t):"";return r==o||r==a}function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}function isObject(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function isObjectLike(t){return!!t&&typeof t=="object"}t.exports=flatten},6130:t=>{var r="[object Object]";function isHostObject(t){var r=false;if(t!=null&&typeof t.toString!="function"){try{r=!!(t+"")}catch(t){}}return r}function overArg(t,r){return function(i){return t(r(i))}}var i=Function.prototype,o=Object.prototype;var a=i.toString;var l=o.hasOwnProperty;var c=a.call(Object);var u=o.toString;var h=overArg(Object.getPrototypeOf,Object);function isObjectLike(t){return!!t&&typeof t=="object"}function isPlainObject(t){if(!isObjectLike(t)||u.call(t)!=r||isHostObject(t)){return false}var i=h(t);if(i===null){return true}var o=l.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&a.call(o)==c}t.exports=isPlainObject},6669:t=>{var r=200;var i="__lodash_hash_undefined__";var o=1/0,a=9007199254740991;var l="[object Arguments]",c="[object Function]",u="[object GeneratorFunction]";var h=/[\\^$.*+?()[\]{}|]/g;var d=/^\[object .+?Constructor\]$/;var p=typeof global=="object"&&global&&global.Object===Object&&global;var m=typeof self=="object"&&self&&self.Object===Object&&self;var y=p||m||Function("return this")();function apply(t,r,i){switch(i.length){case 0:return t.call(r);case 1:return t.call(r,i[0]);case 2:return t.call(r,i[0],i[1]);case 3:return t.call(r,i[0],i[1],i[2])}return t.apply(r,i)}function arrayIncludes(t,r){var i=t?t.length:0;return!!i&&baseIndexOf(t,r,0)>-1}function arrayIncludesWith(t,r,i){var o=-1,a=t?t.length:0;while(++o<a){if(i(r,t[o])){return true}}return false}function arrayPush(t,r){var i=-1,o=r.length,a=t.length;while(++i<o){t[a+i]=r[i]}return t}function baseFindIndex(t,r,i,o){var a=t.length,l=i+(o?1:-1);while(o?l--:++l<a){if(r(t[l],l,t)){return l}}return-1}function baseIndexOf(t,r,i){if(r!==r){return baseFindIndex(t,baseIsNaN,i)}var o=i-1,a=t.length;while(++o<a){if(t[o]===r){return o}}return-1}function baseIsNaN(t){return t!==t}function cacheHas(t,r){return t.has(r)}function getValue(t,r){return t==null?undefined:t[r]}function isHostObject(t){var r=false;if(t!=null&&typeof t.toString!="function"){try{r=!!(t+"")}catch(t){}}return r}function setToArray(t){var r=-1,i=Array(t.size);t.forEach((function(t){i[++r]=t}));return i}var g=Array.prototype,b=Function.prototype,v=Object.prototype;var _=y["__core-js_shared__"];var w=function(){var t=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var E=b.toString;var S=v.hasOwnProperty;var R=v.toString;var O=RegExp("^"+E.call(S).replace(h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=y.Symbol,T=v.propertyIsEnumerable,k=g.splice,A=x?x.isConcatSpreadable:undefined;var C=Math.max;var P=getNative(y,"Map"),I=getNative(y,"Set"),L=getNative(Object,"create");function Hash(t){var r=-1,i=t?t.length:0;this.clear();while(++r<i){var o=t[r];this.set(o[0],o[1])}}function hashClear(){this.__data__=L?L(null):{}}function hashDelete(t){return this.has(t)&&delete this.__data__[t]}function hashGet(t){var r=this.__data__;if(L){var o=r[t];return o===i?undefined:o}return S.call(r,t)?r[t]:undefined}function hashHas(t){var r=this.__data__;return L?r[t]!==undefined:S.call(r,t)}function hashSet(t,r){var o=this.__data__;o[t]=L&&r===undefined?i:r;return this}Hash.prototype.clear=hashClear;Hash.prototype["delete"]=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(t){var r=-1,i=t?t.length:0;this.clear();while(++r<i){var o=t[r];this.set(o[0],o[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(t){var r=this.__data__,i=assocIndexOf(r,t);if(i<0){return false}var o=r.length-1;if(i==o){r.pop()}else{k.call(r,i,1)}return true}function listCacheGet(t){var r=this.__data__,i=assocIndexOf(r,t);return i<0?undefined:r[i][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,r){var i=this.__data__,o=assocIndexOf(i,t);if(o<0){i.push([t,r])}else{i[o][1]=r}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(t){var r=-1,i=t?t.length:0;this.clear();while(++r<i){var o=t[r];this.set(o[0],o[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(P||ListCache),string:new Hash}}function mapCacheDelete(t){return getMapData(this,t)["delete"](t)}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,r){getMapData(this,t).set(t,r);return this}MapCache.prototype.clear=mapCacheClear;MapCache.prototype["delete"]=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function SetCache(t){var r=-1,i=t?t.length:0;this.__data__=new MapCache;while(++r<i){this.add(t[r])}}function setCacheAdd(t){this.__data__.set(t,i);return this}function setCacheHas(t){return this.__data__.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function assocIndexOf(t,r){var i=t.length;while(i--){if(eq(t[i][0],r)){return i}}return-1}function baseFlatten(t,r,i,o,a){var l=-1,c=t.length;i||(i=isFlattenable);a||(a=[]);while(++l<c){var u=t[l];if(r>0&&i(u)){if(r>1){baseFlatten(u,r-1,i,o,a)}else{arrayPush(a,u)}}else if(!o){a[a.length]=u}}return a}function baseIsNative(t){if(!isObject(t)||isMasked(t)){return false}var r=isFunction(t)||isHostObject(t)?O:d;return r.test(toSource(t))}function baseRest(t,r){r=C(r===undefined?t.length-1:r,0);return function(){var i=arguments,o=-1,a=C(i.length-r,0),l=Array(a);while(++o<a){l[o]=i[r+o]}o=-1;var c=Array(r+1);while(++o<r){c[o]=i[o]}c[r]=l;return apply(t,this,c)}}function baseUniq(t,i,o){var a=-1,l=arrayIncludes,c=t.length,u=true,h=[],d=h;if(o){u=false;l=arrayIncludesWith}else if(c>=r){var p=i?null:D(t);if(p){return setToArray(p)}u=false;l=cacheHas;d=new SetCache}else{d=i?[]:h}e:while(++a<c){var m=t[a],y=i?i(m):m;m=o||m!==0?m:0;if(u&&y===y){var g=d.length;while(g--){if(d[g]===y){continue e}}if(i){d.push(y)}h.push(m)}else if(!l(d,y,o)){if(d!==h){d.push(y)}h.push(m)}}return h}var D=!(I&&1/setToArray(new I([,-0]))[1]==o)?noop:function(t){return new I(t)};function getMapData(t,r){var i=t.__data__;return isKeyable(r)?i[typeof r=="string"?"string":"hash"]:i.map}function getNative(t,r){var i=getValue(t,r);return baseIsNative(i)?i:undefined}function isFlattenable(t){return N(t)||isArguments(t)||!!(A&&t&&t[A])}function isKeyable(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}function isMasked(t){return!!w&&w in t}function toSource(t){if(t!=null){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var M=baseRest((function(t){return baseUniq(baseFlatten(t,1,isArrayLikeObject,true))}));function eq(t,r){return t===r||t!==t&&r!==r}function isArguments(t){return isArrayLikeObject(t)&&S.call(t,"callee")&&(!T.call(t,"callee")||R.call(t)==l)}var N=Array.isArray;function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction(t)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function isFunction(t){var r=isObject(t)?R.call(t):"";return r==c||r==u}function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=a}function isObject(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function isObjectLike(t){return!!t&&typeof t=="object"}function noop(){}t.exports=M},6822:t=>{"use strict";t.exports=t=>{const r={};for(const[i,o]of Object.entries(t)){r[i.toLowerCase()]=o}return r}},3550:(t,r,i)=>{"use strict";const o=i(7147);const a=i(1017);const{promisify:l}=i(3837);const c=i(8985);const u=c.satisfies(process.version,">=10.12.0");const checkPath=t=>{if(process.platform==="win32"){const r=/[<>:"|?*]/.test(t.replace(a.parse(t).root,""));if(r){const r=new Error(`Path contains invalid characters: ${t}`);r.code="EINVAL";throw r}}};const processOptions=t=>{const r={mode:511,fs:o};return{...r,...t}};const permissionError=t=>{const r=new Error(`operation not permitted, mkdir '${t}'`);r.code="EPERM";r.errno=-4048;r.path=t;r.syscall="mkdir";return r};const makeDir=async(t,r)=>{checkPath(t);r=processOptions(r);const i=l(r.fs.mkdir);const c=l(r.fs.stat);if(u&&r.fs.mkdir===o.mkdir){const o=a.resolve(t);await i(o,{mode:r.mode,recursive:true});return o}const make=async t=>{try{await i(t,r.mode);return t}catch(r){if(r.code==="EPERM"){throw r}if(r.code==="ENOENT"){if(a.dirname(t)===t){throw permissionError(t)}if(r.message.includes("null bytes")){throw r}await make(a.dirname(t));return make(t)}try{const r=await c(t);if(!r.isDirectory()){throw new Error("The path is not a directory")}}catch(t){throw r}return t}};return make(a.resolve(t))};t.exports=makeDir;t.exports.sync=(t,r)=>{checkPath(t);r=processOptions(r);if(u&&r.fs.mkdirSync===o.mkdirSync){const i=a.resolve(t);o.mkdirSync(i,{mode:r.mode,recursive:true});return i}const make=t=>{try{r.fs.mkdirSync(t,r.mode)}catch(i){if(i.code==="EPERM"){throw i}if(i.code==="ENOENT"){if(a.dirname(t)===t){throw permissionError(t)}if(i.message.includes("null bytes")){throw i}make(a.dirname(t));return make(t)}try{if(!r.fs.statSync(t).isDirectory()){throw new Error("The path is not a directory")}}catch(t){throw i}}return t};return make(a.resolve(t))}},5628:(t,r,i)=>{"use strict";const o=i(2781);const a=o.PassThrough;const l=Array.prototype.slice;t.exports=merge2;function merge2(){const t=[];const r=l.call(arguments);let i=false;let o=r[r.length-1];if(o&&!Array.isArray(o)&&o.pipe==null){r.pop()}else{o={}}const c=o.end!==false;const u=o.pipeError===true;if(o.objectMode==null){o.objectMode=true}if(o.highWaterMark==null){o.highWaterMark=64*1024}const h=a(o);function addStream(){for(let r=0,i=arguments.length;r<i;r++){t.push(pauseStreams(arguments[r],o))}mergeStream();return this}function mergeStream(){if(i){return}i=true;let r=t.shift();if(!r){process.nextTick(endStream);return}if(!Array.isArray(r)){r=[r]}let o=r.length+1;function next(){if(--o>0){return}i=false;mergeStream()}function pipe(t){function onend(){t.removeListener("merge2UnpipeEnd",onend);t.removeListener("end",onend);if(u){t.removeListener("error",onerror)}next()}function onerror(t){h.emit("error",t)}if(t._readableState.endEmitted){return next()}t.on("merge2UnpipeEnd",onend);t.on("end",onend);if(u){t.on("error",onerror)}t.pipe(h,{end:false});t.resume()}for(let t=0;t<r.length;t++){pipe(r[t])}next()}function endStream(){i=false;h.emit("queueDrain");if(c){h.end()}}h.setMaxListeners(0);h.add=addStream;h.on("unpipe",(function(t){t.emit("merge2UnpipeEnd")}));if(r.length){addStream.apply(null,r)}return h}function pauseStreams(t,r){if(!Array.isArray(t)){if(!t._readableState&&t.pipe){t=t.pipe(a(r))}if(!t._readableState||!t.pause||!t.pipe){throw new Error("Only readable stream can be merged.")}t.pause()}else{for(let i=0,o=t.length;i<o;i++){t[i]=pauseStreams(t[i],r)}}return t}},1888:(t,r,i)=>{"use strict";const o=i(3837);const a=i(4526);const l=i(2040);const c=i(5187);const isEmptyString=t=>t===""||t==="./";const micromatch=(t,r,i)=>{r=[].concat(r);t=[].concat(t);let o=new Set;let a=new Set;let c=new Set;let u=0;let onResult=t=>{c.add(t.output);if(i&&i.onResult){i.onResult(t)}};for(let c=0;c<r.length;c++){let h=l(String(r[c]),{...i,onResult:onResult},true);let d=h.state.negated||h.state.negatedExtglob;if(d)u++;for(let r of t){let t=h(r,true);let i=d?!t.isMatch:t.isMatch;if(!i)continue;if(d){o.add(t.output)}else{o.delete(t.output);a.add(t.output)}}}let h=u===r.length?[...c]:[...a];let d=h.filter((t=>!o.has(t)));if(i&&d.length===0){if(i.failglob===true){throw new Error(`No matches found for "${r.join(", ")}"`)}if(i.nonull===true||i.nullglob===true){return i.unescape?r.map((t=>t.replace(/\\/g,""))):r}}return d};micromatch.match=micromatch;micromatch.matcher=(t,r)=>l(t,r);micromatch.isMatch=(t,r,i)=>l(r,i)(t);micromatch.any=micromatch.isMatch;micromatch.not=(t,r,i={})=>{r=[].concat(r).map(String);let o=new Set;let a=[];let onResult=t=>{if(i.onResult)i.onResult(t);a.push(t.output)};let l=micromatch(t,r,{...i,onResult:onResult});for(let t of a){if(!l.includes(t)){o.add(t)}}return[...o]};micromatch.contains=(t,r,i)=>{if(typeof t!=="string"){throw new TypeError(`Expected a string: "${o.inspect(t)}"`)}if(Array.isArray(r)){return r.some((r=>micromatch.contains(t,r,i)))}if(typeof r==="string"){if(isEmptyString(t)||isEmptyString(r)){return false}if(t.includes(r)||t.startsWith("./")&&t.slice(2).includes(r)){return true}}return micromatch.isMatch(t,r,{...i,contains:true})};micromatch.matchKeys=(t,r,i)=>{if(!c.isObject(t)){throw new TypeError("Expected the first argument to be an object")}let o=micromatch(Object.keys(t),r,i);let a={};for(let r of o)a[r]=t[r];return a};micromatch.some=(t,r,i)=>{let o=[].concat(t);for(let t of[].concat(r)){let r=l(String(t),i);if(o.some((t=>r(t)))){return true}}return false};micromatch.every=(t,r,i)=>{let o=[].concat(t);for(let t of[].concat(r)){let r=l(String(t),i);if(!o.every((t=>r(t)))){return false}}return true};micromatch.all=(t,r,i)=>{if(typeof t!=="string"){throw new TypeError(`Expected a string: "${o.inspect(t)}"`)}return[].concat(r).every((r=>l(r,i)(t)))};micromatch.capture=(t,r,i)=>{let o=c.isWindows(i);let a=l.makeRe(String(t),{...i,capture:true});let u=a.exec(o?c.toPosixSlashes(r):r);if(u){return u.slice(1).map((t=>t===void 0?"":t))}};micromatch.makeRe=(...t)=>l.makeRe(...t);micromatch.scan=(...t)=>l.scan(...t);micromatch.parse=(t,r)=>{let i=[];for(let o of[].concat(t||[])){for(let t of a(String(o),r)){i.push(l.parse(t,r))}}return i};micromatch.braces=(t,r)=>{if(typeof t!=="string")throw new TypeError("Expected a string");if(r&&r.nobrace===true||!/\{.*\}/.test(t)){return[t]}return a(t,r)};micromatch.braceExpand=(t,r)=>{if(typeof t!=="string")throw new TypeError("Expected a string");return micromatch.braces(t,{...r,expand:true})};t.exports=micromatch},7145:t=>{"use strict";const r=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];t.exports=(t,i)=>{const o=new Set(Object.keys(t).concat(r));for(const r of o){if(r in i){continue}i[r]=typeof t[r]==="function"?t[r].bind(t):t[r]}}},1138:t=>{"use strict";const r=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];t.exports=(t,i)=>{if(i._readableState.autoDestroy){throw new Error("The second stream must have the `autoDestroy` option set to `false`")}const o=new Set(Object.keys(t).concat(r));const a={};for(const r of o){if(r in i){continue}a[r]={get(){const i=t[r];const o=typeof i==="function";return o?i.bind(t):i},set(i){t[r]=i},enumerable:true,configurable:false}}Object.defineProperties(i,a);t.once("aborted",(()=>{i.destroy();i.emit("aborted")}));t.once("close",(()=>{if(t.complete){if(i.readable){i.once("end",(()=>{i.emit("close")}))}else{i.emit("close")}}else{i.emit("close")}}));return i}},5909:(t,r,i)=>{t.exports=minimatch;minimatch.Minimatch=Minimatch;var o=function(){try{return i(1017)}catch(t){}}()||{sep:"/"};minimatch.sep=o.sep;var a=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var l=i(70);var c={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var u="[^/]";var h=u+"*?";var d="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var p="(?:(?!(?:\\/|^)\\.).)*?";var m=charSet("().*{}+?[]^$\\!");function charSet(t){return t.split("").reduce((function(t,r){t[r]=true;return t}),{})}var y=/\/+/;minimatch.filter=filter;function filter(t,r){r=r||{};return function(i,o,a){return minimatch(i,t,r)}}function ext(t,r){r=r||{};var i={};Object.keys(t).forEach((function(r){i[r]=t[r]}));Object.keys(r).forEach((function(t){i[t]=r[t]}));return i}minimatch.defaults=function(t){if(!t||typeof t!=="object"||!Object.keys(t).length){return minimatch}var r=minimatch;var i=function minimatch(i,o,a){return r(i,o,ext(t,a))};i.Minimatch=function Minimatch(i,o){return new r.Minimatch(i,ext(t,o))};i.Minimatch.defaults=function defaults(i){return r.defaults(ext(t,i)).Minimatch};i.filter=function filter(i,o){return r.filter(i,ext(t,o))};i.defaults=function defaults(i){return r.defaults(ext(t,i))};i.makeRe=function makeRe(i,o){return r.makeRe(i,ext(t,o))};i.braceExpand=function braceExpand(i,o){return r.braceExpand(i,ext(t,o))};i.match=function(i,o,a){return r.match(i,o,ext(t,a))};return i};Minimatch.defaults=function(t){return minimatch.defaults(t).Minimatch};function minimatch(t,r,i){assertValidPattern(r);if(!i)i={};if(!i.nocomment&&r.charAt(0)==="#"){return false}return new Minimatch(r,i).match(t)}function Minimatch(t,r){if(!(this instanceof Minimatch)){return new Minimatch(t,r)}assertValidPattern(t);if(!r)r={};t=t.trim();if(!r.allowWindowsEscape&&o.sep!=="/"){t=t.split(o.sep).join("/")}this.options=r;this.set=[];this.pattern=t;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!r.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var t=this.pattern;var r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();var i=this.globSet=this.braceExpand();if(r.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,i);i=this.globParts=i.map((function(t){return t.split(y)}));this.debug(this.pattern,i);i=i.map((function(t,r,i){return t.map(this.parse,this)}),this);this.debug(this.pattern,i);i=i.filter((function(t){return t.indexOf(false)===-1}));this.debug(this.pattern,i);this.set=i}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var t=this.pattern;var r=false;var i=this.options;var o=0;if(i.nonegate)return;for(var a=0,l=t.length;a<l&&t.charAt(a)==="!";a++){r=!r;o++}if(o)this.pattern=t.substr(o);this.negate=r}minimatch.braceExpand=function(t,r){return braceExpand(t,r)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(t,r){if(!r){if(this instanceof Minimatch){r=this.options}else{r={}}}t=typeof t==="undefined"?this.pattern:t;assertValidPattern(t);if(r.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return l(t)}var g=1024*64;var assertValidPattern=function(t){if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>g){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var b={};function parse(t,r){assertValidPattern(t);var i=this.options;if(t==="**"){if(!i.noglobstar)return a;else t="*"}if(t==="")return"";var o="";var l=!!i.nocase;var d=false;var p=[];var y=[];var g;var v=false;var _=-1;var w=-1;var E=t.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var S=this;function clearStateChar(){if(g){switch(g){case"*":o+=h;l=true;break;case"?":o+=u;l=true;break;default:o+="\\"+g;break}S.debug("clearStateChar %j %j",g,o);g=false}}for(var R=0,O=t.length,x;R<O&&(x=t.charAt(R));R++){this.debug("%s\t%s %s %j",t,R,o,x);if(d&&m[x]){o+="\\"+x;d=false;continue}switch(x){case"/":{return false}case"\\":clearStateChar();d=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s\t%s %s %j <-- stateChar",t,R,o,x);if(v){this.debug(" in class");if(x==="!"&&R===w+1)x="^";o+=x;continue}S.debug("call clearStateChar %j",g);clearStateChar();g=x;if(i.noext)clearStateChar();continue;case"(":if(v){o+="(";continue}if(!g){o+="\\(";continue}p.push({type:g,start:R-1,reStart:o.length,open:c[g].open,close:c[g].close});o+=g==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",g,o);g=false;continue;case")":if(v||!p.length){o+="\\)";continue}clearStateChar();l=true;var T=p.pop();o+=T.close;if(T.type==="!"){y.push(T)}T.reEnd=o.length;continue;case"|":if(v||!p.length||d){o+="\\|";d=false;continue}clearStateChar();o+="|";continue;case"[":clearStateChar();if(v){o+="\\"+x;continue}v=true;w=R;_=o.length;o+=x;continue;case"]":if(R===w+1||!v){o+="\\"+x;d=false;continue}var k=t.substring(w+1,R);try{RegExp("["+k+"]")}catch(t){var A=this.parse(k,b);o=o.substr(0,_)+"\\["+A[0]+"\\]";l=l||A[1];v=false;continue}l=true;v=false;o+=x;continue;default:clearStateChar();if(d){d=false}else if(m[x]&&!(x==="^"&&v)){o+="\\"}o+=x}}if(v){k=t.substr(w+1);A=this.parse(k,b);o=o.substr(0,_)+"\\["+A[0];l=l||A[1]}for(T=p.pop();T;T=p.pop()){var C=o.slice(T.reStart+T.open.length);this.debug("setting tail",o,T);C=C.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(t,r,i){if(!i){i="\\"}return r+r+i+"|"}));this.debug("tail=%j\n %s",C,C,T,o);var P=T.type==="*"?h:T.type==="?"?u:"\\"+T.type;l=true;o=o.slice(0,T.reStart)+P+"\\("+C}clearStateChar();if(d){o+="\\\\"}var I=false;switch(o.charAt(0)){case"[":case".":case"(":I=true}for(var L=y.length-1;L>-1;L--){var D=y[L];var M=o.slice(0,D.reStart);var N=o.slice(D.reStart,D.reEnd-8);var j=o.slice(D.reEnd-8,D.reEnd);var B=o.slice(D.reEnd);j+=B;var $=M.split("(").length-1;var H=B;for(R=0;R<$;R++){H=H.replace(/\)[+*?]?/,"")}B=H;var U="";if(B===""&&r!==b){U="$"}var q=M+N+B+U+j;o=q}if(o!==""&&l){o="(?=.)"+o}if(I){o=E+o}if(r===b){return[o,l]}if(!l){return globUnescape(t)}var z=i.nocase?"i":"";try{var G=new RegExp("^"+o+"$",z)}catch(t){return new RegExp("$.")}G._glob=t;G._src=o;return G}minimatch.makeRe=function(t,r){return new Minimatch(t,r||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var t=this.set;if(!t.length){this.regexp=false;return this.regexp}var r=this.options;var i=r.noglobstar?h:r.dot?d:p;var o=r.nocase?"i":"";var l=t.map((function(t){return t.map((function(t){return t===a?i:typeof t==="string"?regExpEscape(t):t._src})).join("\\/")})).join("|");l="^(?:"+l+")$";if(this.negate)l="^(?!"+l+").*$";try{this.regexp=new RegExp(l,o)}catch(t){this.regexp=false}return this.regexp}minimatch.match=function(t,r,i){i=i||{};var o=new Minimatch(r,i);t=t.filter((function(t){return o.match(t)}));if(o.options.nonull&&!t.length){t.push(r)}return t};Minimatch.prototype.match=function match(t,r){if(typeof r==="undefined")r=this.partial;this.debug("match",t,this.pattern);if(this.comment)return false;if(this.empty)return t==="";if(t==="/"&&r)return true;var i=this.options;if(o.sep!=="/"){t=t.split(o.sep).join("/")}t=t.split(y);this.debug(this.pattern,"split",t);var a=this.set;this.debug(this.pattern,"set",a);var l;var c;for(c=t.length-1;c>=0;c--){l=t[c];if(l)break}for(c=0;c<a.length;c++){var u=a[c];var h=t;if(i.matchBase&&u.length===1){h=[l]}var d=this.matchOne(h,u,r);if(d){if(i.flipNegate)return true;return!this.negate}}if(i.flipNegate)return false;return this.negate};Minimatch.prototype.matchOne=function(t,r,i){var o=this.options;this.debug("matchOne",{this:this,file:t,pattern:r});this.debug("matchOne",t.length,r.length);for(var l=0,c=0,u=t.length,h=r.length;l<u&&c<h;l++,c++){this.debug("matchOne loop");var d=r[c];var p=t[l];this.debug(r,d,p);if(d===false)return false;if(d===a){this.debug("GLOBSTAR",[r,d,p]);var m=l;var y=c+1;if(y===h){this.debug("** at the end");for(;l<u;l++){if(t[l]==="."||t[l]===".."||!o.dot&&t[l].charAt(0)===".")return false}return true}while(m<u){var g=t[m];this.debug("\nglobstar while",t,m,r,y,g);if(this.matchOne(t.slice(m),r.slice(y),i)){this.debug("globstar found match!",m,u,g);return true}else{if(g==="."||g===".."||!o.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,m,r,y);break}this.debug("globstar swallow a segment, and continue");m++}}if(i){this.debug("\n>>> no match, partial?",t,m,r,y);if(m===u)return true}return false}var b;if(typeof d==="string"){b=p===d;this.debug("string match",d,p,b)}else{b=p.match(d);this.debug("pattern match",d,p,b)}if(!b)return false}if(l===u&&c===h){return true}else if(l===u){return i}else if(c===h){return l===u-1&&t[l]===""}throw new Error("wtf?")};function globUnescape(t){return t.replace(/\\(.)/g,"$1")}function regExpEscape(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},6780:t=>{t.exports=function(t,r){if(!r)r={};var i={bools:{},strings:{},unknownFn:null};if(typeof r["unknown"]==="function"){i.unknownFn=r["unknown"]}if(typeof r["boolean"]==="boolean"&&r["boolean"]){i.allBools=true}else{[].concat(r["boolean"]).filter(Boolean).forEach((function(t){i.bools[t]=true}))}var o={};Object.keys(r.alias||{}).forEach((function(t){o[t]=[].concat(r.alias[t]);o[t].forEach((function(r){o[r]=[t].concat(o[t].filter((function(t){return r!==t})))}))}));[].concat(r.string).filter(Boolean).forEach((function(t){i.strings[t]=true;if(o[t]){i.strings[o[t]]=true}}));var a=r["default"]||{};var l={_:[]};Object.keys(i.bools).forEach((function(t){setArg(t,a[t]===undefined?false:a[t])}));var c=[];if(t.indexOf("--")!==-1){c=t.slice(t.indexOf("--")+1);t=t.slice(0,t.indexOf("--"))}function argDefined(t,r){return i.allBools&&/^--[^=]+$/.test(r)||i.strings[t]||i.bools[t]||o[t]}function setArg(t,r,a){if(a&&i.unknownFn&&!argDefined(t,a)){if(i.unknownFn(a)===false)return}var c=!i.strings[t]&&isNumber(r)?Number(r):r;setKey(l,t.split("."),c);(o[t]||[]).forEach((function(t){setKey(l,t.split("."),c)}))}function setKey(t,r,o){var a=t;for(var l=0;l<r.length-1;l++){var c=r[l];if(c==="__proto__")return;if(a[c]===undefined)a[c]={};if(a[c]===Object.prototype||a[c]===Number.prototype||a[c]===String.prototype)a[c]={};if(a[c]===Array.prototype)a[c]=[];a=a[c]}var c=r[r.length-1];if(c==="__proto__")return;if(a===Object.prototype||a===Number.prototype||a===String.prototype)a={};if(a===Array.prototype)a=[];if(a[c]===undefined||i.bools[c]||typeof a[c]==="boolean"){a[c]=o}else if(Array.isArray(a[c])){a[c].push(o)}else{a[c]=[a[c],o]}}function aliasIsBoolean(t){return o[t].some((function(t){return i.bools[t]}))}for(var u=0;u<t.length;u++){var h=t[u];if(/^--.+=/.test(h)){var d=h.match(/^--([^=]+)=([\s\S]*)$/);var p=d[1];var m=d[2];if(i.bools[p]){m=m!=="false"}setArg(p,m,h)}else if(/^--no-.+/.test(h)){var p=h.match(/^--no-(.+)/)[1];setArg(p,false,h)}else if(/^--.+/.test(h)){var p=h.match(/^--(.+)/)[1];var y=t[u+1];if(y!==undefined&&!/^-/.test(y)&&!i.bools[p]&&!i.allBools&&(o[p]?!aliasIsBoolean(p):true)){setArg(p,y,h);u++}else if(/^(true|false)$/.test(y)){setArg(p,y==="true",h);u++}else{setArg(p,i.strings[p]?"":true,h)}}else if(/^-[^-]+/.test(h)){var g=h.slice(1,-1).split("");var b=false;for(var v=0;v<g.length;v++){var y=h.slice(v+2);if(y==="-"){setArg(g[v],y,h);continue}if(/[A-Za-z]/.test(g[v])&&/=/.test(y)){setArg(g[v],y.split("=")[1],h);b=true;break}if(/[A-Za-z]/.test(g[v])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){setArg(g[v],y,h);b=true;break}if(g[v+1]&&g[v+1].match(/\W/)){setArg(g[v],h.slice(v+2),h);b=true;break}else{setArg(g[v],i.strings[g[v]]?"":true,h)}}var p=h.slice(-1)[0];if(!b&&p!=="-"){if(t[u+1]&&!/^(-|--)[^-]/.test(t[u+1])&&!i.bools[p]&&(o[p]?!aliasIsBoolean(p):true)){setArg(p,t[u+1],h);u++}else if(t[u+1]&&/^(true|false)$/.test(t[u+1])){setArg(p,t[u+1]==="true",h);u++}else{setArg(p,i.strings[p]?"":true,h)}}}else{if(!i.unknownFn||i.unknownFn(h)!==false){l._.push(i.strings["_"]||!isNumber(h)?h:Number(h))}if(r.stopEarly){l._.push.apply(l._,t.slice(u+1));break}}}Object.keys(a).forEach((function(t){if(!hasKey(l,t.split("."))){setKey(l,t.split("."),a[t]);(o[t]||[]).forEach((function(r){setKey(l,r.split("."),a[t])}))}}));if(r["--"]){l["--"]=new Array;c.forEach((function(t){l["--"].push(t)}))}else{c.forEach((function(t){l._.push(t)}))}return l};function hasKey(t,r){var i=t;r.slice(0,-1).forEach((function(t){i=i[t]||{}}));var o=r[r.length-1];return o in i}function isNumber(t){if(typeof t==="number")return true;if(/^0x[0-9a-f]+$/i.test(t))return true;return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}},2103:(t,r,i)=>{"use strict";const o=typeof process==="object"&&process?process:{stdout:null,stderr:null};const a=i(2361);const l=i(2781);const c=i(1064);const u=i(1576).StringDecoder;const h=Symbol("EOF");const d=Symbol("maybeEmitEnd");const p=Symbol("emittedEnd");const m=Symbol("emittingEnd");const y=Symbol("emittedError");const g=Symbol("closed");const b=Symbol("read");const v=Symbol("flush");const _=Symbol("flushChunk");const w=Symbol("encoding");const E=Symbol("decoder");const S=Symbol("flowing");const R=Symbol("paused");const O=Symbol("resume");const x=Symbol("bufferLength");const T=Symbol("bufferPush");const k=Symbol("bufferShift");const A=Symbol("objectMode");const C=Symbol("destroyed");const P=global._MP_NO_ITERATOR_SYMBOLS_!=="1";const I=P&&Symbol.asyncIterator||Symbol("asyncIterator not implemented");const L=P&&Symbol.iterator||Symbol("iterator not implemented");const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBuffer=t=>t instanceof ArrayBuffer||typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);t.exports=class Minipass extends l{constructor(t){super();this[S]=false;this[R]=false;this.pipes=new c;this.buffer=new c;this[A]=t&&t.objectMode||false;if(this[A])this[w]=null;else this[w]=t&&t.encoding||null;if(this[w]==="buffer")this[w]=null;this[E]=this[w]?new u(this[w]):null;this[h]=false;this[p]=false;this[m]=false;this[g]=false;this[y]=null;this.writable=true;this.readable=true;this[x]=0;this[C]=false}get bufferLength(){return this[x]}get encoding(){return this[w]}set encoding(t){if(this[A])throw new Error("cannot set encoding in objectMode");if(this[w]&&t!==this[w]&&(this[E]&&this[E].lastNeed||this[x]))throw new Error("cannot change encoding");if(this[w]!==t){this[E]=t?new u(t):null;if(this.buffer.length)this.buffer=this.buffer.map((t=>this[E].write(t)))}this[w]=t}setEncoding(t){this.encoding=t}get objectMode(){return this[A]}set objectMode(t){this[A]=this[A]||!!t}write(t,r,i){if(this[h])throw new Error("write after end");if(this[C]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof r==="function")i=r,r="utf8";if(!r)r="utf8";if(!this[A]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(isArrayBuffer(t))t=Buffer.from(t);else if(typeof t!=="string")this.objectMode=true}if(!this.objectMode&&!t.length){if(this[x]!==0)this.emit("readable");if(i)i();return this.flowing}if(typeof t==="string"&&!this[A]&&!(r===this[w]&&!this[E].lastNeed)){t=Buffer.from(t,r)}if(Buffer.isBuffer(t)&&this[w])t=this[E].write(t);if(this.flowing){if(this[x]!==0)this[v](true);this.flowing?this.emit("data",t):this[T](t)}else this[T](t);if(this[x]!==0)this.emit("readable");if(i)i();return this.flowing}read(t){if(this[C])return null;try{if(this[x]===0||t===0||t>this[x])return null;if(this[A])t=null;if(this.buffer.length>1&&!this[A]){if(this.encoding)this.buffer=new c([Array.from(this.buffer).join("")]);else this.buffer=new c([Buffer.concat(Array.from(this.buffer),this[x])])}return this[b](t||null,this.buffer.head.value)}finally{this[d]()}}[b](t,r){if(t===r.length||t===null)this[k]();else{this.buffer.head.value=r.slice(t);r=r.slice(0,t);this[x]-=t}this.emit("data",r);if(!this.buffer.length&&!this[h])this.emit("drain");return r}end(t,r,i){if(typeof t==="function")i=t,t=null;if(typeof r==="function")i=r,r="utf8";if(t)this.write(t,r);if(i)this.once("end",i);this[h]=true;this.writable=false;if(this.flowing||!this[R])this[d]();return this}[O](){if(this[C])return;this[R]=false;this[S]=true;this.emit("resume");if(this.buffer.length)this[v]();else if(this[h])this[d]();else this.emit("drain")}resume(){return this[O]()}pause(){this[S]=false;this[R]=true}get destroyed(){return this[C]}get flowing(){return this[S]}get paused(){return this[R]}[T](t){if(this[A])this[x]+=1;else this[x]+=t.length;return this.buffer.push(t)}[k](){if(this.buffer.length){if(this[A])this[x]-=1;else this[x]-=this.buffer.head.value.length}return this.buffer.shift()}[v](t){do{}while(this[_](this[k]()));if(!t&&!this.buffer.length&&!this[h])this.emit("drain")}[_](t){return t?(this.emit("data",t),this.flowing):false}pipe(t,r){if(this[C])return;const i=this[p];r=r||{};if(t===o.stdout||t===o.stderr)r.end=false;else r.end=r.end!==false;const a={dest:t,opts:r,ondrain:t=>this[O]()};this.pipes.push(a);t.on("drain",a.ondrain);this[O]();if(i&&a.opts.end)a.dest.end();return t}addListener(t,r){return this.on(t,r)}on(t,r){try{return super.on(t,r)}finally{if(t==="data"&&!this.pipes.length&&!this.flowing)this[O]();else if(isEndish(t)&&this[p]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[y]){r.call(this,this[y])}}}get emittedEnd(){return this[p]}[d](){if(!this[m]&&!this[p]&&!this[C]&&this.buffer.length===0&&this[h]){this[m]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[g])this.emit("close");this[m]=false}}emit(t,r){if(t!=="error"&&t!=="close"&&t!==C&&this[C])return;else if(t==="data"){if(!r)return;if(this.pipes.length)this.pipes.forEach((t=>t.dest.write(r)===false&&this.pause()))}else if(t==="end"){if(this[p]===true)return;this[p]=true;this.readable=false;if(this[E]){r=this[E].end();if(r){this.pipes.forEach((t=>t.dest.write(r)));super.emit("data",r)}}this.pipes.forEach((t=>{t.dest.removeListener("drain",t.ondrain);if(t.opts.end)t.dest.end()}))}else if(t==="close"){this[g]=true;if(!this[p]&&!this[C])return}else if(t==="error"){this[y]=r}const i=new Array(arguments.length);i[0]=t;i[1]=r;if(arguments.length>2){for(let t=2;t<arguments.length;t++){i[t]=arguments[t]}}try{return super.emit.apply(this,i)}finally{if(!isEndish(t))this[d]();else this.removeAllListeners(t)}}collect(){const t=[];if(!this[A])t.dataLength=0;const r=this.promise();this.on("data",(r=>{t.push(r);if(!this[A])t.dataLength+=r.length}));return r.then((()=>t))}concat(){return this[A]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then((t=>this[A]?Promise.reject(new Error("cannot concat in objectMode")):this[w]?t.join(""):Buffer.concat(t,t.dataLength)))}promise(){return new Promise(((t,r)=>{this.on(C,(()=>r(new Error("stream destroyed"))));this.on("error",(t=>r(t)));this.on("end",(()=>t()))}))}[I](){const next=()=>{const t=this.read();if(t!==null)return Promise.resolve({done:false,value:t});if(this[h])return Promise.resolve({done:true});let r=null;let i=null;const onerr=t=>{this.removeListener("data",ondata);this.removeListener("end",onend);i(t)};const ondata=t=>{this.removeListener("error",onerr);this.removeListener("end",onend);this.pause();r({value:t,done:!!this[h]})};const onend=()=>{this.removeListener("error",onerr);this.removeListener("data",ondata);r({done:true})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,o)=>{i=o;r=t;this.once(C,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next}}[L](){const next=()=>{const t=this.read();const r=t===null;return{value:t,done:r}};return{next:next}}destroy(t){if(this[C]){if(t)this.emit("error",t);else this.emit(C);return this}this[C]=true;this.buffer=new c;this[x]=0;if(typeof this.close==="function"&&!this[g])this.close();if(t)this.emit("error",t);else this.emit(C);return this}static isStream(t){return!!t&&(t instanceof Minipass||t instanceof l||t instanceof a&&(typeof t.pipe==="function"||typeof t.write==="function"&&typeof t.end==="function"))}}},8837:(t,r,i)=>{const o=i(9796).constants||{ZLIB_VERNUM:4736};t.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,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,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},o))},2762:(t,r,i)=>{"use strict";const o=i(9491);const a=i(4300).Buffer;const l=i(9796);const c=r.constants=i(8837);const u=i(2103);const h=a.concat;const d=Symbol("_superWrite");class ZlibError extends Error{constructor(t){super("zlib: "+t.message);this.code=t.code;this.errno=t.errno;if(!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+t.message;Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const p=Symbol("opts");const m=Symbol("flushFlag");const y=Symbol("finishFlushFlag");const g=Symbol("fullFlushFlag");const b=Symbol("handle");const v=Symbol("onError");const _=Symbol("sawError");const w=Symbol("level");const E=Symbol("strategy");const S=Symbol("ended");const R=Symbol("_defaultFullFlush");class ZlibBase extends u{constructor(t,r){if(!t||typeof t!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(t);this[_]=false;this[S]=false;this[p]=t;this[m]=t.flush;this[y]=t.finishFlush;try{this[b]=new l[r](t)}catch(t){throw new ZlibError(t)}this[v]=t=>{if(this[_])return;this[_]=true;this.close();this.emit("error",t)};this[b].on("error",(t=>this[v](new ZlibError(t))));this.once("end",(()=>this.close))}close(){if(this[b]){this[b].close();this[b]=null;this.emit("close")}}reset(){if(!this[_]){o(this[b],"zlib binding closed");return this[b].reset()}}flush(t){if(this.ended)return;if(typeof t!=="number")t=this[g];this.write(Object.assign(a.alloc(0),{[m]:t}))}end(t,r,i){if(t)this.write(t,r);this.flush(this[y]);this[S]=true;return super.end(null,null,i)}get ended(){return this[S]}write(t,r,i){if(typeof r==="function")i=r,r="utf8";if(typeof t==="string")t=a.from(t,r);if(this[_])return;o(this[b],"zlib binding closed");const l=this[b]._handle;const c=l.close;l.close=()=>{};const u=this[b].close;this[b].close=()=>{};a.concat=t=>t;let p;try{const r=typeof t[m]==="number"?t[m]:this[m];p=this[b]._processChunk(t,r);a.concat=h}catch(t){a.concat=h;this[v](new ZlibError(t))}finally{if(this[b]){this[b]._handle=l;l.close=c;this[b].close=u;this[b].removeAllListeners("error")}}if(this[b])this[b].on("error",(t=>this[v](new ZlibError(t))));let y;if(p){if(Array.isArray(p)&&p.length>0){y=this[d](a.from(p[0]));for(let t=1;t<p.length;t++){y=this[d](p[t])}}else{y=this[d](a.from(p))}}if(i)i();return y}[d](t){return super.write(t)}}class Zlib extends ZlibBase{constructor(t,r){t=t||{};t.flush=t.flush||c.Z_NO_FLUSH;t.finishFlush=t.finishFlush||c.Z_FINISH;super(t,r);this[g]=c.Z_FULL_FLUSH;this[w]=t.level;this[E]=t.strategy}params(t,r){if(this[_])return;if(!this[b])throw new Error("cannot switch params when binding is closed");if(!this[b].params)throw new Error("not supported in this implementation");if(this[w]!==t||this[E]!==r){this.flush(c.Z_SYNC_FLUSH);o(this[b],"zlib binding closed");const i=this[b].flush;this[b].flush=(t,r)=>{this.flush(t);r()};try{this[b].params(t,r)}finally{this[b].flush=i}if(this[b]){this[w]=t;this[E]=r}}}}class Deflate extends Zlib{constructor(t){super(t,"Deflate")}}class Inflate extends Zlib{constructor(t){super(t,"Inflate")}}const O=Symbol("_portable");class Gzip extends Zlib{constructor(t){super(t,"Gzip");this[O]=t&&!!t.portable}[d](t){if(!this[O])return super[d](t);this[O]=false;t[9]=255;return super[d](t)}}class Gunzip extends Zlib{constructor(t){super(t,"Gunzip")}}class DeflateRaw extends Zlib{constructor(t){super(t,"DeflateRaw")}}class InflateRaw extends Zlib{constructor(t){super(t,"InflateRaw")}}class Unzip extends Zlib{constructor(t){super(t,"Unzip")}}class Brotli extends ZlibBase{constructor(t,r){t=t||{};t.flush=t.flush||c.BROTLI_OPERATION_PROCESS;t.finishFlush=t.finishFlush||c.BROTLI_OPERATION_FINISH;super(t,r);this[g]=c.BROTLI_OPERATION_FLUSH}}class BrotliCompress extends Brotli{constructor(t){super(t,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(t){super(t,"BrotliDecompress")}}r.Deflate=Deflate;r.Inflate=Inflate;r.Gzip=Gzip;r.Gunzip=Gunzip;r.DeflateRaw=DeflateRaw;r.InflateRaw=InflateRaw;r.Unzip=Unzip;if(typeof l.BrotliCompress==="function"){r.BrotliCompress=BrotliCompress;r.BrotliDecompress=BrotliDecompress}else{r.BrotliCompress=r.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}},6340:(t,r,i)=>{const o=i(4804);const a=i(9540);const{mkdirpNative:l,mkdirpNativeSync:c}=i(4531);const{mkdirpManual:u,mkdirpManualSync:h}=i(6390);const{useNative:d,useNativeSync:p}=i(8725);const mkdirp=(t,r)=>{t=a(t);r=o(r);return d(r)?l(t,r):u(t,r)};const mkdirpSync=(t,r)=>{t=a(t);r=o(r);return p(r)?c(t,r):h(t,r)};mkdirp.sync=mkdirpSync;mkdirp.native=(t,r)=>l(a(t),o(r));mkdirp.manual=(t,r)=>u(a(t),o(r));mkdirp.nativeSync=(t,r)=>c(a(t),o(r));mkdirp.manualSync=(t,r)=>h(a(t),o(r));t.exports=mkdirp},9632:(t,r,i)=>{const{dirname:o}=i(1017);const findMade=(t,r,i=undefined)=>{if(i===r)return Promise.resolve();return t.statAsync(r).then((t=>t.isDirectory()?i:undefined),(i=>i.code==="ENOENT"?findMade(t,o(r),r):undefined))};const findMadeSync=(t,r,i=undefined)=>{if(i===r)return undefined;try{return t.statSync(r).isDirectory()?i:undefined}catch(i){return i.code==="ENOENT"?findMadeSync(t,o(r),r):undefined}};t.exports={findMade:findMade,findMadeSync:findMadeSync}},6390:(t,r,i)=>{const{dirname:o}=i(1017);const mkdirpManual=(t,r,i)=>{r.recursive=false;const a=o(t);if(a===t){return r.mkdirAsync(t,r).catch((t=>{if(t.code!=="EISDIR")throw t}))}return r.mkdirAsync(t,r).then((()=>i||t),(o=>{if(o.code==="ENOENT")return mkdirpManual(a,r).then((i=>mkdirpManual(t,r,i)));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;return r.statAsync(t).then((t=>{if(t.isDirectory())return i;else throw o}),(()=>{throw o}))}))};const mkdirpManualSync=(t,r,i)=>{const a=o(t);r.recursive=false;if(a===t){try{return r.mkdirSync(t,r)}catch(t){if(t.code!=="EISDIR")throw t;else return}}try{r.mkdirSync(t,r);return i||t}catch(o){if(o.code==="ENOENT")return mkdirpManualSync(t,r,mkdirpManualSync(a,r,i));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;try{if(!r.statSync(t).isDirectory())throw o}catch(t){throw o}}};t.exports={mkdirpManual:mkdirpManual,mkdirpManualSync:mkdirpManualSync}},4531:(t,r,i)=>{const{dirname:o}=i(1017);const{findMade:a,findMadeSync:l}=i(9632);const{mkdirpManual:c,mkdirpManualSync:u}=i(6390);const mkdirpNative=(t,r)=>{r.recursive=true;const i=o(t);if(i===t)return r.mkdirAsync(t,r);return a(r,t).then((i=>r.mkdirAsync(t,r).then((()=>i)).catch((i=>{if(i.code==="ENOENT")return c(t,r);else throw i}))))};const mkdirpNativeSync=(t,r)=>{r.recursive=true;const i=o(t);if(i===t)return r.mkdirSync(t,r);const a=l(r,t);try{r.mkdirSync(t,r);return a}catch(i){if(i.code==="ENOENT")return u(t,r);else throw i}};t.exports={mkdirpNative:mkdirpNative,mkdirpNativeSync:mkdirpNativeSync}},4804:(t,r,i)=>{const{promisify:o}=i(3837);const a=i(7147);const optsArg=t=>{if(!t)t={mode:511,fs:a};else if(typeof t==="object")t={mode:511,fs:a,...t};else if(typeof t==="number")t={mode:t,fs:a};else if(typeof t==="string")t={mode:parseInt(t,8),fs:a};else throw new TypeError("invalid options argument");t.mkdir=t.mkdir||t.fs.mkdir||a.mkdir;t.mkdirAsync=o(t.mkdir);t.stat=t.stat||t.fs.stat||a.stat;t.statAsync=o(t.stat);t.statSync=t.statSync||t.fs.statSync||a.statSync;t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||a.mkdirSync;return t};t.exports=optsArg},9540:(t,r,i)=>{const o=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:a,parse:l}=i(1017);const pathArg=t=>{if(/\0/.test(t)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"})}t=a(t);if(o==="win32"){const r=/[*|"<>?:]/;const{root:i}=l(t);if(r.test(t.substr(i.length))){throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}}return t};t.exports=pathArg},8725:(t,r,i)=>{const o=i(7147);const a=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const l=a.replace(/^v/,"").split(".");const c=+l[0]>10||+l[0]===10&&+l[1]>=12;const u=!c?()=>false:t=>t.mkdir===o.mkdir;const h=!c?()=>false:t=>t.mkdirSync===o.mkdirSync;t.exports={useNative:u,useNativeSync:h}},5800:(t,r,i)=>{var o=i(3837).inherits;var NestedError=function(t,r){this.nested=r;if(t instanceof Error){r=t}else if(typeof t!=="undefined"){Object.defineProperty(this,"message",{value:t,writable:true,enumerable:false,configurable:true})}Error.captureStackTrace(this,this.constructor);var i=Object.getOwnPropertyDescriptor(this,"stack");var o=buildStackDescriptor(i,r);Object.defineProperty(this,"stack",o)};function buildStackDescriptor(t,r){if(t.get){return{get:function(){var r=t.get.call(this);return buildCombinedStacks(r,this.nested)}}}else{var i=t.value;return{value:buildCombinedStacks(i,r)}}}function buildCombinedStacks(t,r){if(r){t+="\nCaused By: "+r.stack}return t}o(NestedError,Error);NestedError.prototype.name="NestedError";t.exports=NestedError},4838:t=>{
|
|
105
|
+
/*!
|
|
106
|
+
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
107
|
+
*
|
|
108
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
109
|
+
* Released under the MIT License.
|
|
110
|
+
*/
|
|
111
|
+
t.exports=function(t,r){if(typeof t!=="string"){throw new TypeError("expected path to be a string")}if(t==="\\"||t==="/")return"/";var i=t.length;if(i<=1)return t;var o="";if(i>4&&t[3]==="\\"){var a=t[2];if((a==="?"||a===".")&&t.slice(0,2)==="\\\\"){t=t.slice(2);o="//"}}var l=t.split(/[/\\]+/);if(r!==false&&l[l.length-1]===""){l.pop()}return o+l.join("/")}},1191:t=>{"use strict";const r="text/plain";const i="us-ascii";const testParameter=(t,r)=>r.some((r=>r instanceof RegExp?r.test(t):r===t));const normalizeDataURL=(t,{stripHash:o})=>{const a=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!a){throw new Error(`Invalid URL: ${t}`)}let{type:l,data:c,hash:u}=a.groups;const h=l.split(";");u=o?"":u;let d=false;if(h[h.length-1]==="base64"){h.pop();d=true}const p=(h.shift()||"").toLowerCase();const m=h.map((t=>{let[r,o=""]=t.split("=").map((t=>t.trim()));if(r==="charset"){o=o.toLowerCase();if(o===i){return""}}return`${r}${o?`=${o}`:""}`})).filter(Boolean);const y=[...m];if(d){y.push("base64")}if(y.length!==0||p&&p!==r){y.unshift(p)}return`data:${y.join(";")},${d?c.trim():c}${u?`#${u}`:""}`};const normalizeUrl=(t,r)=>{r={defaultProtocol:"http:",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,sortQueryParameters:true,...r};t=t.trim();if(/^data:/i.test(t)){return normalizeDataURL(t,r)}if(/^view-source:/i.test(t)){throw new Error("`view-source:` is not supported as it is a non-standard protocol")}const i=t.startsWith("//");const o=!i&&/^\.*\//.test(t);if(!o){t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,r.defaultProtocol)}const a=new URL(t);if(r.forceHttp&&r.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(r.forceHttp&&a.protocol==="https:"){a.protocol="http:"}if(r.forceHttps&&a.protocol==="http:"){a.protocol="https:"}if(r.stripAuthentication){a.username="";a.password=""}if(r.stripHash){a.hash=""}else if(r.stripTextFragment){a.hash=a.hash.replace(/#?:~:text.*?$/i,"")}if(a.pathname){a.pathname=a.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")}if(a.pathname){try{a.pathname=decodeURI(a.pathname)}catch(t){}}if(r.removeDirectoryIndex===true){r.removeDirectoryIndex=[/^index\.[a-z]+$/]}if(Array.isArray(r.removeDirectoryIndex)&&r.removeDirectoryIndex.length>0){let t=a.pathname.split("/");const i=t[t.length-1];if(testParameter(i,r.removeDirectoryIndex)){t=t.slice(0,t.length-1);a.pathname=t.slice(1).join("/")+"/"}}if(a.hostname){a.hostname=a.hostname.replace(/\.$/,"");if(r.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(a.hostname)){a.hostname=a.hostname.replace(/^www\./,"")}}if(Array.isArray(r.removeQueryParameters)){for(const t of[...a.searchParams.keys()]){if(testParameter(t,r.removeQueryParameters)){a.searchParams.delete(t)}}}if(r.removeQueryParameters===true){a.search=""}if(r.sortQueryParameters){a.searchParams.sort()}if(r.removeTrailingSlash){a.pathname=a.pathname.replace(/\/$/,"")}const l=t;t=a.toString();if(!r.removeSingleSlash&&a.pathname==="/"&&!l.endsWith("/")&&a.hash===""){t=t.replace(/\/$/,"")}if((r.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&r.removeSingleSlash){t=t.replace(/\/$/,"")}if(i&&!r.normalizeProtocol){t=t.replace(/^http:\/\//,"//")}if(r.stripProtocol){t=t.replace(/^(?:https?:)?\/\//,"")}return t};t.exports=normalizeUrl},3306:(t,r,i)=>{var o=i(7564);t.exports=o(once);t.exports.strict=o(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(t){var f=function(){if(f.called)return f.value;f.called=true;return f.value=t.apply(this,arguments)};f.called=false;return f}function onceStrict(t){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=t.apply(this,arguments)};var r=t.name||"Function wrapped with `once`";f.onceError=r+" shouldn't be called more than once";f.called=false;return f}},9286:(t,r,i)=>{"use strict";const o=i(9847);const a=Symbol.asyncIterator||"@@asyncIterator";const normalizeEmitter=t=>{const r=t.on||t.addListener||t.addEventListener;const i=t.off||t.removeListener||t.removeEventListener;if(!r||!i){throw new TypeError("Emitter is not compatible")}return{addListener:r.bind(t),removeListener:i.bind(t)}};const toArray=t=>Array.isArray(t)?t:[t];const multiple=(t,r,i)=>{let a;const l=new Promise(((o,l)=>{i={rejectionEvents:["error"],multiArgs:false,resolveImmediately:false,...i};if(!(i.count>=0&&(i.count===Infinity||Number.isInteger(i.count)))){throw new TypeError("The `count` option should be at least 0 or more")}const c=toArray(r);const u=[];const{addListener:h,removeListener:d}=normalizeEmitter(t);const onItem=(...t)=>{const r=i.multiArgs?t:t[0];if(i.filter&&!i.filter(r)){return}u.push(r);if(i.count===u.length){a();o(u)}};const rejectHandler=t=>{a();l(t)};a=()=>{for(const t of c){d(t,onItem)}for(const t of i.rejectionEvents){d(t,rejectHandler)}};for(const t of c){h(t,onItem)}for(const t of i.rejectionEvents){h(t,rejectHandler)}if(i.resolveImmediately){o(u)}}));l.cancel=a;if(typeof i.timeout==="number"){const t=o(l,i.timeout);t.cancel=a;return t}return l};const pEvent=(t,r,i)=>{if(typeof i==="function"){i={filter:i}}i={...i,count:1,resolveImmediately:false};const o=multiple(t,r,i);const a=o.then((t=>t[0]));a.cancel=o.cancel;return a};t.exports=pEvent;t.exports["default"]=pEvent;t.exports.multiple=multiple;t.exports.iterator=(t,r,i)=>{if(typeof i==="function"){i={filter:i}}const o=toArray(r);i={rejectionEvents:["error"],resolutionEvents:[],limit:Infinity,multiArgs:false,...i};const{limit:l}=i;const c=l>=0&&(l===Infinity||Number.isInteger(l));if(!c){throw new TypeError("The `limit` option should be a non-negative integer or Infinity")}if(l===0){return{[Symbol.asyncIterator](){return this},async next(){return{done:true,value:undefined}}}}const{addListener:u,removeListener:h}=normalizeEmitter(t);let d=false;let p;let m=false;const y=[];const g=[];let b=0;let v=false;const valueHandler=(...t)=>{b++;v=b===l;const r=i.multiArgs?t:t[0];if(y.length>0){const{resolve:t}=y.shift();t({done:false,value:r});if(v){cancel()}return}g.push(r);if(v){cancel()}};const cancel=()=>{d=true;for(const t of o){h(t,valueHandler)}for(const t of i.rejectionEvents){h(t,rejectHandler)}for(const t of i.resolutionEvents){h(t,resolveHandler)}while(y.length>0){const{resolve:t}=y.shift();t({done:true,value:undefined})}};const rejectHandler=(...t)=>{p=i.multiArgs?t:t[0];if(y.length>0){const{reject:t}=y.shift();t(p)}else{m=true}cancel()};const resolveHandler=(...t)=>{const r=i.multiArgs?t:t[0];if(i.filter&&!i.filter(r)){return}if(y.length>0){const{resolve:t}=y.shift();t({done:true,value:r})}else{g.push(r)}cancel()};for(const t of o){u(t,valueHandler)}for(const t of i.rejectionEvents){u(t,rejectHandler)}for(const t of i.resolutionEvents){u(t,resolveHandler)}return{[a](){return this},async next(){if(g.length>0){const t=g.shift();return{done:d&&g.length===0&&!v,value:t}}if(m){m=false;throw p}if(d){return{done:true,value:undefined}}return new Promise(((t,r)=>y.push({resolve:t,reject:r})))},async return(t){cancel();return{done:d,value:t}}}};t.exports.TimeoutError=o.TimeoutError},4015:t=>{"use strict";t.exports=(t,r)=>{r=r||(()=>{});return t.then((t=>new Promise((t=>{t(r())})).then((()=>t))),(t=>new Promise((t=>{t(r())})).then((()=>{throw t}))))}},9847:(t,r,i)=>{"use strict";const o=i(4015);class TimeoutError extends Error{constructor(t){super(t);this.name="TimeoutError"}}const pTimeout=(t,r,i)=>new Promise(((a,l)=>{if(typeof r!=="number"||r<0){throw new TypeError("Expected `milliseconds` to be a positive number")}if(r===Infinity){a(t);return}const c=setTimeout((()=>{if(typeof i==="function"){try{a(i())}catch(t){l(t)}return}const o=typeof i==="string"?i:`Promise timed out after ${r} milliseconds`;const c=i instanceof Error?i:new TimeoutError(o);if(typeof t.cancel==="function"){t.cancel()}l(c)}),r);o(t.then(a,l),(()=>{clearTimeout(c)}))}));t.exports=pTimeout;t.exports["default"]=pTimeout;t.exports.TimeoutError=TimeoutError},8830:t=>{"use strict";function posix(t){return t.charAt(0)==="/"}function win32(t){var r=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var i=r.exec(t);var o=i[1]||"";var a=Boolean(o&&o.charAt(1)!==":");return Boolean(i[2]||a)}t.exports=process.platform==="win32"?win32:posix;t.exports.posix=posix;t.exports.win32=win32},8430:t=>{"use strict";const pathKey=(t={})=>{const r=t.env||process.env;const i=t.platform||process.platform;if(i!=="win32"){return"PATH"}return Object.keys(r).reverse().find((t=>t.toUpperCase()==="PATH"))||"Path"};t.exports=pathKey;t.exports["default"]=pathKey},1733:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(7147);async function isType(t,r,i){if(typeof i!=="string"){throw new TypeError(`Expected a string, got ${typeof i}`)}try{const l=await o(a[t])(i);return l[r]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}function isTypeSync(t,r,i){if(typeof i!=="string"){throw new TypeError(`Expected a string, got ${typeof i}`)}try{return a[t](i)[r]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}r.isFile=isType.bind(null,"stat","isFile");r.isDirectory=isType.bind(null,"stat","isDirectory");r.isSymlink=isType.bind(null,"lstat","isSymbolicLink");r.isFileSync=isTypeSync.bind(null,"statSync","isFile");r.isDirectorySync=isTypeSync.bind(null,"statSync","isDirectory");r.isSymlinkSync=isTypeSync.bind(null,"lstatSync","isSymbolicLink")},2040:(t,r,i)=>{"use strict";t.exports=i(5713)},4168:(t,r,i)=>{"use strict";const o=i(1017);const a="\\\\/";const l=`[^${a}]`;const c="\\.";const u="\\+";const h="\\?";const d="\\/";const p="(?=.)";const m="[^/]";const y=`(?:${d}|$)`;const g=`(?:^|${d})`;const b=`${c}{1,2}${y}`;const v=`(?!${c})`;const _=`(?!${g}${b})`;const w=`(?!${c}{0,1}${y})`;const E=`(?!${b})`;const S=`[^.${d}]`;const R=`${m}*?`;const O={DOT_LITERAL:c,PLUS_LITERAL:u,QMARK_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:p,QMARK:m,END_ANCHOR:y,DOTS_SLASH:b,NO_DOT:v,NO_DOTS:_,NO_DOT_SLASH:w,NO_DOTS_SLASH:E,QMARK_NO_DOT:S,STAR:R,START_ANCHOR:g};const x={...O,SLASH_LITERAL:`[${a}]`,QMARK:l,STAR:`${l}*?`,DOTS_SLASH:`${c}{1,2}(?:[${a}]|$)`,NO_DOT:`(?!${c})`,NO_DOTS:`(?!(?:^|[${a}])${c}{1,2}(?:[${a}]|$))`,NO_DOT_SLASH:`(?!${c}{0,1}(?:[${a}]|$))`,NO_DOTS_SLASH:`(?!${c}{1,2}(?:[${a}]|$))`,QMARK_NO_DOT:`[^.${a}]`,START_ANCHOR:`(?:^|[${a}])`,END_ANCHOR:`(?:[${a}]|$)`};const T={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:T,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:o.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?x:O}}},9086:(t,r,i)=>{"use strict";const o=i(4168);const a=i(5187);const{MAX_LENGTH:l,POSIX_REGEX_SOURCE:c,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:h,REPLACEMENTS:d}=o;const expandRange=(t,r)=>{if(typeof r.expandRange==="function"){return r.expandRange(...t,r)}t.sort();const i=`[${t.join("-")}]`;try{new RegExp(i)}catch(r){return t.map((t=>a.escapeRegex(t))).join("..")}return i};const syntaxError=(t,r)=>`Missing ${t}: "${r}" - use "\\\\${r}" to match literal characters`;const parse=(t,r)=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}t=d[t]||t;const i={...r};const p=typeof i.maxLength==="number"?Math.min(l,i.maxLength):l;let m=t.length;if(m>p){throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`)}const y={type:"bos",value:"",output:i.prepend||""};const g=[y];const b=i.capture?"":"?:";const v=a.isWindows(r);const _=o.globChars(v);const w=o.extglobChars(_);const{DOT_LITERAL:E,PLUS_LITERAL:S,SLASH_LITERAL:R,ONE_CHAR:O,DOTS_SLASH:x,NO_DOT:T,NO_DOT_SLASH:k,NO_DOTS_SLASH:A,QMARK:C,QMARK_NO_DOT:P,STAR:I,START_ANCHOR:L}=_;const globstar=t=>`(${b}(?:(?!${L}${t.dot?x:E}).)*?)`;const D=i.dot?"":T;const M=i.dot?C:P;let N=i.bash===true?globstar(i):I;if(i.capture){N=`(${N})`}if(typeof i.noext==="boolean"){i.noextglob=i.noext}const j={input:t,index:-1,start:0,dot:i.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:g};t=a.removePrefix(t,j);m=t.length;const B=[];const $=[];const H=[];let U=y;let q;const eos=()=>j.index===m-1;const z=j.peek=(r=1)=>t[j.index+r];const G=j.advance=()=>t[++j.index]||"";const remaining=()=>t.slice(j.index+1);const consume=(t="",r=0)=>{j.consumed+=t;j.index+=r};const append=t=>{j.output+=t.output!=null?t.output:t.value;consume(t.value)};const negate=()=>{let t=1;while(z()==="!"&&(z(2)!=="("||z(3)==="?")){G();j.start++;t++}if(t%2===0){return false}j.negated=true;j.start++;return true};const increment=t=>{j[t]++;H.push(t)};const decrement=t=>{j[t]--;H.pop()};const push=t=>{if(U.type==="globstar"){const r=j.braces>0&&(t.type==="comma"||t.type==="brace");const i=t.extglob===true||B.length&&(t.type==="pipe"||t.type==="paren");if(t.type!=="slash"&&t.type!=="paren"&&!r&&!i){j.output=j.output.slice(0,-U.output.length);U.type="star";U.value="*";U.output=N;j.output+=U.output}}if(B.length&&t.type!=="paren"){B[B.length-1].inner+=t.value}if(t.value||t.output)append(t);if(U&&U.type==="text"&&t.type==="text"){U.value+=t.value;U.output=(U.output||"")+t.value;return}t.prev=U;g.push(t);U=t};const extglobOpen=(t,r)=>{const o={...w[r],conditions:1,inner:""};o.prev=U;o.parens=j.parens;o.output=j.output;const a=(i.capture?"(":"")+o.open;increment("parens");push({type:t,value:r,output:j.output?"":O});push({type:"paren",extglob:true,value:G(),output:a});B.push(o)};const extglobClose=t=>{let o=t.close+(i.capture?")":"");let a;if(t.type==="negate"){let l=N;if(t.inner&&t.inner.length>1&&t.inner.includes("/")){l=globstar(i)}if(l!==N||eos()||/^\)+$/.test(remaining())){o=t.close=`)$))${l}`}if(t.inner.includes("*")&&(a=remaining())&&/^\.[^\\/.]+$/.test(a)){const i=parse(a,{...r,fastpaths:false}).output;o=t.close=`)${i})${l})`}if(t.prev.type==="bos"){j.negatedExtglob=true}}push({type:"paren",extglob:true,value:q,output:o});decrement("parens")};if(i.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let o=false;let l=t.replace(h,((t,r,i,a,l,c)=>{if(a==="\\"){o=true;return t}if(a==="?"){if(r){return r+a+(l?C.repeat(l.length):"")}if(c===0){return M+(l?C.repeat(l.length):"")}return C.repeat(i.length)}if(a==="."){return E.repeat(i.length)}if(a==="*"){if(r){return r+a+(l?N:"")}return N}return r?t:`\\${t}`}));if(o===true){if(i.unescape===true){l=l.replace(/\\/g,"")}else{l=l.replace(/\\+/g,(t=>t.length%2===0?"\\\\":t?"\\":""))}}if(l===t&&i.contains===true){j.output=t;return j}j.output=a.wrapOutput(l,j,r);return j}while(!eos()){q=G();if(q==="\0"){continue}if(q==="\\"){const t=z();if(t==="/"&&i.bash!==true){continue}if(t==="."||t===";"){continue}if(!t){q+="\\";push({type:"text",value:q});continue}const r=/^\\+/.exec(remaining());let o=0;if(r&&r[0].length>2){o=r[0].length;j.index+=o;if(o%2!==0){q+="\\"}}if(i.unescape===true){q=G()}else{q+=G()}if(j.brackets===0){push({type:"text",value:q});continue}}if(j.brackets>0&&(q!=="]"||U.value==="["||U.value==="[^")){if(i.posix!==false&&q===":"){const t=U.value.slice(1);if(t.includes("[")){U.posix=true;if(t.includes(":")){const t=U.value.lastIndexOf("[");const r=U.value.slice(0,t);const i=U.value.slice(t+2);const o=c[i];if(o){U.value=r+o;j.backtrack=true;G();if(!y.output&&g.indexOf(U)===1){y.output=O}continue}}}}if(q==="["&&z()!==":"||q==="-"&&z()==="]"){q=`\\${q}`}if(q==="]"&&(U.value==="["||U.value==="[^")){q=`\\${q}`}if(i.posix===true&&q==="!"&&U.value==="["){q="^"}U.value+=q;append({value:q});continue}if(j.quotes===1&&q!=='"'){q=a.escapeRegex(q);U.value+=q;append({value:q});continue}if(q==='"'){j.quotes=j.quotes===1?0:1;if(i.keepQuotes===true){push({type:"text",value:q})}continue}if(q==="("){increment("parens");push({type:"paren",value:q});continue}if(q===")"){if(j.parens===0&&i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const t=B[B.length-1];if(t&&j.parens===t.parens+1){extglobClose(B.pop());continue}push({type:"paren",value:q,output:j.parens?")":"\\)"});decrement("parens");continue}if(q==="["){if(i.nobracket===true||!remaining().includes("]")){if(i.nobracket!==true&&i.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}q=`\\${q}`}else{increment("brackets")}push({type:"bracket",value:q});continue}if(q==="]"){if(i.nobracket===true||U&&U.type==="bracket"&&U.value.length===1){push({type:"text",value:q,output:`\\${q}`});continue}if(j.brackets===0){if(i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:q,output:`\\${q}`});continue}decrement("brackets");const t=U.value.slice(1);if(U.posix!==true&&t[0]==="^"&&!t.includes("/")){q=`/${q}`}U.value+=q;append({value:q});if(i.literalBrackets===false||a.hasRegexChars(t)){continue}const r=a.escapeRegex(U.value);j.output=j.output.slice(0,-U.value.length);if(i.literalBrackets===true){j.output+=r;U.value=r;continue}U.value=`(${b}${r}|${U.value})`;j.output+=U.value;continue}if(q==="{"&&i.nobrace!==true){increment("braces");const t={type:"brace",value:q,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};$.push(t);push(t);continue}if(q==="}"){const t=$[$.length-1];if(i.nobrace===true||!t){push({type:"text",value:q,output:q});continue}let r=")";if(t.dots===true){const t=g.slice();const o=[];for(let r=t.length-1;r>=0;r--){g.pop();if(t[r].type==="brace"){break}if(t[r].type!=="dots"){o.unshift(t[r].value)}}r=expandRange(o,i);j.backtrack=true}if(t.comma!==true&&t.dots!==true){const i=j.output.slice(0,t.outputIndex);const o=j.tokens.slice(t.tokensIndex);t.value=t.output="\\{";q=r="\\}";j.output=i;for(const t of o){j.output+=t.output||t.value}}push({type:"brace",value:q,output:r});decrement("braces");$.pop();continue}if(q==="|"){if(B.length>0){B[B.length-1].conditions++}push({type:"text",value:q});continue}if(q===","){let t=q;const r=$[$.length-1];if(r&&H[H.length-1]==="braces"){r.comma=true;t="|"}push({type:"comma",value:q,output:t});continue}if(q==="/"){if(U.type==="dot"&&j.index===j.start+1){j.start=j.index+1;j.consumed="";j.output="";g.pop();U=y;continue}push({type:"slash",value:q,output:R});continue}if(q==="."){if(j.braces>0&&U.type==="dot"){if(U.value===".")U.output=E;const t=$[$.length-1];U.type="dots";U.output+=q;U.value+=q;t.dots=true;continue}if(j.braces+j.parens===0&&U.type!=="bos"&&U.type!=="slash"){push({type:"text",value:q,output:E});continue}push({type:"dot",value:q,output:E});continue}if(q==="?"){const t=U&&U.value==="(";if(!t&&i.noextglob!==true&&z()==="("&&z(2)!=="?"){extglobOpen("qmark",q);continue}if(U&&U.type==="paren"){const t=z();let r=q;if(t==="<"&&!a.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(U.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(remaining())){r=`\\${q}`}push({type:"text",value:q,output:r});continue}if(i.dot!==true&&(U.type==="slash"||U.type==="bos")){push({type:"qmark",value:q,output:P});continue}push({type:"qmark",value:q,output:C});continue}if(q==="!"){if(i.noextglob!==true&&z()==="("){if(z(2)!=="?"||!/[!=<:]/.test(z(3))){extglobOpen("negate",q);continue}}if(i.nonegate!==true&&j.index===0){negate();continue}}if(q==="+"){if(i.noextglob!==true&&z()==="("&&z(2)!=="?"){extglobOpen("plus",q);continue}if(U&&U.value==="("||i.regex===false){push({type:"plus",value:q,output:S});continue}if(U&&(U.type==="bracket"||U.type==="paren"||U.type==="brace")||j.parens>0){push({type:"plus",value:q});continue}push({type:"plus",value:S});continue}if(q==="@"){if(i.noextglob!==true&&z()==="("&&z(2)!=="?"){push({type:"at",extglob:true,value:q,output:""});continue}push({type:"text",value:q});continue}if(q!=="*"){if(q==="$"||q==="^"){q=`\\${q}`}const t=u.exec(remaining());if(t){q+=t[0];j.index+=t[0].length}push({type:"text",value:q});continue}if(U&&(U.type==="globstar"||U.star===true)){U.type="star";U.star=true;U.value+=q;U.output=N;j.backtrack=true;j.globstar=true;consume(q);continue}let r=remaining();if(i.noextglob!==true&&/^\([^?]/.test(r)){extglobOpen("star",q);continue}if(U.type==="star"){if(i.noglobstar===true){consume(q);continue}const o=U.prev;const a=o.prev;const l=o.type==="slash"||o.type==="bos";const c=a&&(a.type==="star"||a.type==="globstar");if(i.bash===true&&(!l||r[0]&&r[0]!=="/")){push({type:"star",value:q,output:""});continue}const u=j.braces>0&&(o.type==="comma"||o.type==="brace");const h=B.length&&(o.type==="pipe"||o.type==="paren");if(!l&&o.type!=="paren"&&!u&&!h){push({type:"star",value:q,output:""});continue}while(r.slice(0,3)==="/**"){const i=t[j.index+4];if(i&&i!=="/"){break}r=r.slice(3);consume("/**",3)}if(o.type==="bos"&&eos()){U.type="globstar";U.value+=q;U.output=globstar(i);j.output=U.output;j.globstar=true;consume(q);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&!c&&eos()){j.output=j.output.slice(0,-(o.output+U.output).length);o.output=`(?:${o.output}`;U.type="globstar";U.output=globstar(i)+(i.strictSlashes?")":"|$)");U.value+=q;j.globstar=true;j.output+=o.output+U.output;consume(q);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&r[0]==="/"){const t=r[1]!==void 0?"|$":"";j.output=j.output.slice(0,-(o.output+U.output).length);o.output=`(?:${o.output}`;U.type="globstar";U.output=`${globstar(i)}${R}|${R}${t})`;U.value+=q;j.output+=o.output+U.output;j.globstar=true;consume(q+G());push({type:"slash",value:"/",output:""});continue}if(o.type==="bos"&&r[0]==="/"){U.type="globstar";U.value+=q;U.output=`(?:^|${R}|${globstar(i)}${R})`;j.output=U.output;j.globstar=true;consume(q+G());push({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-U.output.length);U.type="globstar";U.output=globstar(i);U.value+=q;j.output+=U.output;j.globstar=true;consume(q);continue}const o={type:"star",value:q,output:N};if(i.bash===true){o.output=".*?";if(U.type==="bos"||U.type==="slash"){o.output=D+o.output}push(o);continue}if(U&&(U.type==="bracket"||U.type==="paren")&&i.regex===true){o.output=q;push(o);continue}if(j.index===j.start||U.type==="slash"||U.type==="dot"){if(U.type==="dot"){j.output+=k;U.output+=k}else if(i.dot===true){j.output+=A;U.output+=A}else{j.output+=D;U.output+=D}if(z()!=="*"){j.output+=O;U.output+=O}}push(o)}while(j.brackets>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));j.output=a.escapeLast(j.output,"[");decrement("brackets")}while(j.parens>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));j.output=a.escapeLast(j.output,"(");decrement("parens")}while(j.braces>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));j.output=a.escapeLast(j.output,"{");decrement("braces")}if(i.strictSlashes!==true&&(U.type==="star"||U.type==="bracket")){push({type:"maybe_slash",value:"",output:`${R}?`})}if(j.backtrack===true){j.output="";for(const t of j.tokens){j.output+=t.output!=null?t.output:t.value;if(t.suffix){j.output+=t.suffix}}}return j};parse.fastpaths=(t,r)=>{const i={...r};const c=typeof i.maxLength==="number"?Math.min(l,i.maxLength):l;const u=t.length;if(u>c){throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${c}`)}t=d[t]||t;const h=a.isWindows(r);const{DOT_LITERAL:p,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:g,NO_DOT:b,NO_DOTS:v,NO_DOTS_SLASH:_,STAR:w,START_ANCHOR:E}=o.globChars(h);const S=i.dot?v:b;const R=i.dot?_:b;const O=i.capture?"":"?:";const x={negated:false,prefix:""};let T=i.bash===true?".*?":w;if(i.capture){T=`(${T})`}const globstar=t=>{if(t.noglobstar===true)return T;return`(${O}(?:(?!${E}${t.dot?g:p}).)*?)`};const create=t=>{switch(t){case"*":return`${S}${y}${T}`;case".*":return`${p}${y}${T}`;case"*.*":return`${S}${T}${p}${y}${T}`;case"*/*":return`${S}${T}${m}${y}${R}${T}`;case"**":return S+globstar(i);case"**/*":return`(?:${S}${globstar(i)}${m})?${R}${y}${T}`;case"**/*.*":return`(?:${S}${globstar(i)}${m})?${R}${T}${p}${y}${T}`;case"**/.*":return`(?:${S}${globstar(i)}${m})?${p}${y}${T}`;default:{const r=/^(.*?)\.(\w+)$/.exec(t);if(!r)return;const i=create(r[1]);if(!i)return;return i+p+r[2]}}};const k=a.removePrefix(t,x);let A=create(k);if(A&&i.strictSlashes!==true){A+=`${m}?`}return A};t.exports=parse},5713:(t,r,i)=>{"use strict";const o=i(1017);const a=i(5152);const l=i(9086);const c=i(5187);const u=i(4168);const isObject=t=>t&&typeof t==="object"&&!Array.isArray(t);const picomatch=(t,r,i=false)=>{if(Array.isArray(t)){const o=t.map((t=>picomatch(t,r,i)));const arrayMatcher=t=>{for(const r of o){const i=r(t);if(i)return i}return false};return arrayMatcher}const o=isObject(t)&&t.tokens&&t.input;if(t===""||typeof t!=="string"&&!o){throw new TypeError("Expected pattern to be a non-empty string")}const a=r||{};const l=c.isWindows(r);const u=o?picomatch.compileRe(t,r):picomatch.makeRe(t,r,false,true);const h=u.state;delete u.state;let isIgnored=()=>false;if(a.ignore){const t={...r,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(a.ignore,t,i)}const matcher=(i,o=false)=>{const{isMatch:c,match:d,output:p}=picomatch.test(i,u,r,{glob:t,posix:l});const m={glob:t,state:h,regex:u,posix:l,input:i,output:p,match:d,isMatch:c};if(typeof a.onResult==="function"){a.onResult(m)}if(c===false){m.isMatch=false;return o?m:false}if(isIgnored(i)){if(typeof a.onIgnore==="function"){a.onIgnore(m)}m.isMatch=false;return o?m:false}if(typeof a.onMatch==="function"){a.onMatch(m)}return o?m:true};if(i){matcher.state=h}return matcher};picomatch.test=(t,r,i,{glob:o,posix:a}={})=>{if(typeof t!=="string"){throw new TypeError("Expected input to be a string")}if(t===""){return{isMatch:false,output:""}}const l=i||{};const u=l.format||(a?c.toPosixSlashes:null);let h=t===o;let d=h&&u?u(t):t;if(h===false){d=u?u(t):t;h=d===o}if(h===false||l.capture===true){if(l.matchBase===true||l.basename===true){h=picomatch.matchBase(t,r,i,a)}else{h=r.exec(d)}}return{isMatch:Boolean(h),match:h,output:d}};picomatch.matchBase=(t,r,i,a=c.isWindows(i))=>{const l=r instanceof RegExp?r:picomatch.makeRe(r,i);return l.test(o.basename(t))};picomatch.isMatch=(t,r,i)=>picomatch(r,i)(t);picomatch.parse=(t,r)=>{if(Array.isArray(t))return t.map((t=>picomatch.parse(t,r)));return l(t,{...r,fastpaths:false})};picomatch.scan=(t,r)=>a(t,r);picomatch.compileRe=(t,r,i=false,o=false)=>{if(i===true){return t.output}const a=r||{};const l=a.contains?"":"^";const c=a.contains?"":"$";let u=`${l}(?:${t.output})${c}`;if(t&&t.negated===true){u=`^(?!${u}).*$`}const h=picomatch.toRegex(u,r);if(o===true){h.state=t}return h};picomatch.makeRe=(t,r={},i=false,o=false)=>{if(!t||typeof t!=="string"){throw new TypeError("Expected a non-empty string")}let a={negated:false,fastpaths:true};if(r.fastpaths!==false&&(t[0]==="."||t[0]==="*")){a.output=l.fastpaths(t,r)}if(!a.output){a=l(t,r)}return picomatch.compileRe(a,r,i,o)};picomatch.toRegex=(t,r)=>{try{const i=r||{};return new RegExp(t,i.flags||(i.nocase?"i":""))}catch(t){if(r&&r.debug===true)throw t;return/$^/}};picomatch.constants=u;t.exports=picomatch},5152:(t,r,i)=>{"use strict";const o=i(5187);const{CHAR_ASTERISK:a,CHAR_AT:l,CHAR_BACKWARD_SLASH:c,CHAR_COMMA:u,CHAR_DOT:h,CHAR_EXCLAMATION_MARK:d,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_LEFT_PARENTHESES:y,CHAR_LEFT_SQUARE_BRACKET:g,CHAR_PLUS:b,CHAR_QUESTION_MARK:v,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:w,CHAR_RIGHT_SQUARE_BRACKET:E}=i(4168);const isPathSeparator=t=>t===p||t===c;const depth=t=>{if(t.isPrefix!==true){t.depth=t.isGlobstar?Infinity:1}};const scan=(t,r)=>{const i=r||{};const S=t.length-1;const R=i.parts===true||i.scanToEnd===true;const O=[];const x=[];const T=[];let k=t;let A=-1;let C=0;let P=0;let I=false;let L=false;let D=false;let M=false;let N=false;let j=false;let B=false;let $=false;let H=false;let U=false;let q=0;let z;let G;let W={value:"",depth:0,isGlob:false};const eos=()=>A>=S;const peek=()=>k.charCodeAt(A+1);const advance=()=>{z=G;return k.charCodeAt(++A)};while(A<S){G=advance();let t;if(G===c){B=W.backslashes=true;G=advance();if(G===m){j=true}continue}if(j===true||G===m){q++;while(eos()!==true&&(G=advance())){if(G===c){B=W.backslashes=true;advance();continue}if(G===m){q++;continue}if(j!==true&&G===h&&(G=advance())===h){I=W.isBrace=true;D=W.isGlob=true;U=true;if(R===true){continue}break}if(j!==true&&G===u){I=W.isBrace=true;D=W.isGlob=true;U=true;if(R===true){continue}break}if(G===_){q--;if(q===0){j=false;I=W.isBrace=true;U=true;break}}}if(R===true){continue}break}if(G===p){O.push(A);x.push(W);W={value:"",depth:0,isGlob:false};if(U===true)continue;if(z===h&&A===C+1){C+=2;continue}P=A+1;continue}if(i.noext!==true){const t=G===b||G===l||G===a||G===v||G===d;if(t===true&&peek()===y){D=W.isGlob=true;M=W.isExtglob=true;U=true;if(G===d&&A===C){H=true}if(R===true){while(eos()!==true&&(G=advance())){if(G===c){B=W.backslashes=true;G=advance();continue}if(G===w){D=W.isGlob=true;U=true;break}}continue}break}}if(G===a){if(z===a)N=W.isGlobstar=true;D=W.isGlob=true;U=true;if(R===true){continue}break}if(G===v){D=W.isGlob=true;U=true;if(R===true){continue}break}if(G===g){while(eos()!==true&&(t=advance())){if(t===c){B=W.backslashes=true;advance();continue}if(t===E){L=W.isBracket=true;D=W.isGlob=true;U=true;break}}if(R===true){continue}break}if(i.nonegate!==true&&G===d&&A===C){$=W.negated=true;C++;continue}if(i.noparen!==true&&G===y){D=W.isGlob=true;if(R===true){while(eos()!==true&&(G=advance())){if(G===y){B=W.backslashes=true;G=advance();continue}if(G===w){U=true;break}}continue}break}if(D===true){U=true;if(R===true){continue}break}}if(i.noext===true){M=false;D=false}let V=k;let Y="";let Z="";if(C>0){Y=k.slice(0,C);k=k.slice(C);P-=C}if(V&&D===true&&P>0){V=k.slice(0,P);Z=k.slice(P)}else if(D===true){V="";Z=k}else{V=k}if(V&&V!==""&&V!=="/"&&V!==k){if(isPathSeparator(V.charCodeAt(V.length-1))){V=V.slice(0,-1)}}if(i.unescape===true){if(Z)Z=o.removeBackslashes(Z);if(V&&B===true){V=o.removeBackslashes(V)}}const K={prefix:Y,input:t,start:C,base:V,glob:Z,isBrace:I,isBracket:L,isGlob:D,isExtglob:M,isGlobstar:N,negated:$,negatedExtglob:H};if(i.tokens===true){K.maxDepth=0;if(!isPathSeparator(G)){x.push(W)}K.tokens=x}if(i.parts===true||i.tokens===true){let r;for(let o=0;o<O.length;o++){const a=r?r+1:C;const l=O[o];const c=t.slice(a,l);if(i.tokens){if(o===0&&C!==0){x[o].isPrefix=true;x[o].value=Y}else{x[o].value=c}depth(x[o]);K.maxDepth+=x[o].depth}if(o!==0||c!==""){T.push(c)}r=l}if(r&&r+1<t.length){const o=t.slice(r+1);T.push(o);if(i.tokens){x[x.length-1].value=o;depth(x[x.length-1]);K.maxDepth+=x[x.length-1].depth}}K.slashes=O;K.parts=T}return K};t.exports=scan},5187:(t,r,i)=>{"use strict";const o=i(1017);const a=process.platform==="win32";const{REGEX_BACKSLASH:l,REGEX_REMOVE_BACKSLASH:c,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:h}=i(4168);r.isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);r.hasRegexChars=t=>u.test(t);r.isRegexChar=t=>t.length===1&&r.hasRegexChars(t);r.escapeRegex=t=>t.replace(h,"\\$1");r.toPosixSlashes=t=>t.replace(l,"/");r.removeBackslashes=t=>t.replace(c,(t=>t==="\\"?"":t));r.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);if(t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10){return true}return false};r.isWindows=t=>{if(t&&typeof t.windows==="boolean"){return t.windows}return a===true||o.sep==="\\"};r.escapeLast=(t,i,o)=>{const a=t.lastIndexOf(i,o);if(a===-1)return t;if(t[a-1]==="\\")return r.escapeLast(t,i,a-1);return`${t.slice(0,a)}\\${t.slice(a)}`};r.removePrefix=(t,r={})=>{let i=t;if(i.startsWith("./")){i=i.slice(2);r.prefix="./"}return i};r.wrapOutput=(t,r={},i={})=>{const o=i.contains?"":"^";const a=i.contains?"":"$";let l=`${o}(?:${t})${a}`;if(r.negated===true){l=`(?:^(?!${l}).*$)`}return l}},9748:t=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){t.exports={nextTick:nextTick}}else{t.exports=process}function nextTick(t,r,i,o){if(typeof t!=="function"){throw new TypeError('"callback" argument must be a function')}var a=arguments.length;var l,c;switch(a){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick((function afterTickOne(){t.call(null,r)}));case 3:return process.nextTick((function afterTickTwo(){t.call(null,r,i)}));case 4:return process.nextTick((function afterTickThree(){t.call(null,r,i,o)}));default:l=new Array(a-1);c=0;while(c<l.length){l[c++]=arguments[c]}return process.nextTick((function afterTick(){t.apply(null,l)}))}}},8883:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},9849:(t,r,i)=>{"use strict";const o=i(8883);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},9310:(t,r,i)=>{"use strict";const o=i(8883);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},5447:(t,r,i)=>{"use strict";t.exports={DatePart:i(8883),Meridiem:i(9931),Day:i(9849),Hours:i(9310),Milliseconds:i(2002),Minutes:i(4105),Month:i(664),Seconds:i(2485),Year:i(3155)}},9931:(t,r,i)=>{"use strict";const o=i(8883);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},2002:(t,r,i)=>{"use strict";const o=i(8883);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},4105:(t,r,i)=>{"use strict";const o=i(8883);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},664:(t,r,i)=>{"use strict";const o=i(8883);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},2485:(t,r,i)=>{"use strict";const o=i(8883);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},3155:(t,r,i)=>{"use strict";const o=i(8883);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},7887:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(4425);const a=i(6738);const l=i(3797),c=l.erase,u=l.cursor;const h=i(9969),d=h.style,p=h.clear,m=h.figures,y=h.wrap,g=h.entriesToDisplay;const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=d.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=p("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}complete(t){var r=this;return _asyncToGenerator((function*(){const i=r.completing=r.suggest(r.input,r.choices);const o=yield i;if(r.completing!==i)return;r.suggestions=o.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));r.completing=false;const a=Math.max(o.length-1,0);r.moveSelect(Math.min(a,r.select));t&&t()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let l;let c=i?m.arrowUp:a?m.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;c=(r?o.cyan(m.pointer)+" ":" ")+c;if(t.description){l=` - ${t.description}`;if(c.length+u.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1){l="\n"+y(t.description,{margin:3,width:this.out.columns})}}return c+" "+u+o.gray(l||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(p(this.outputText,this.out.columns));super.render();let t=g(this.select,this.choices.length,this.limit),r=t.startIndex,i=t.endIndex;this.outputText=[d.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),d.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const t=this.suggestions.slice(r,i).map(((t,o)=>this.renderOption(t,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(t||o.gray(this.fallback.title))}this.out.write(c.line+u.to(0)+this.outputText)}}t.exports=AutocompletePrompt},4080:(t,r,i)=>{"use strict";const o=i(4425);const a=i(3797),l=a.cursor;const c=i(9644);const u=i(9969),h=u.clear,d=u.style,p=u.figures;class AutocompleteMultiselectPrompt extends c{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=h("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${p.arrowUp}/${p.arrowDown}: Highlight option\n ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(p.radioOn):p.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let t=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},6814:(t,r,i)=>{"use strict";const o=i(4425);const a=i(6738);const l=i(9969),c=l.style,u=l.clear;const h=i(3797),d=h.erase,p=h.cursor;class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(d.line+p.to(0)+this.outputText)}}t.exports=ConfirmPrompt},1401:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(4425);const a=i(6738);const l=i(9969),c=l.style,u=l.clear,h=l.figures;const d=i(3797),p=d.erase,m=d.cursor;const y=i(5447),g=y.DatePart,b=y.Meridiem,v=y.Day,_=y.Hours,w=y.Milliseconds,E=y.Minutes,S=y.Month,R=y.Seconds,O=y.Year;const x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const T={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new v(t),3:t=>new S(t),4:t=>new O(t),5:t=>new b(t),6:t=>new _(t),7:t=>new E(t),8:t=>new R(t),9:t=>new w(t)};const k={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(k,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=u("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=x.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in T?T[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof g)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r==="string"){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color="red";t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof g)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(p.line+m.to(0)+this.outputText)}}t.exports=DatePrompt},9387:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(9301),SelectPrompt:i(6262),TogglePrompt:i(5320),DatePrompt:i(1401),NumberPrompt:i(1590),MultiselectPrompt:i(9644),AutocompletePrompt:i(7887),AutocompleteMultiselectPrompt:i(4080),ConfirmPrompt:i(6814)}},9644:(t,r,i)=>{"use strict";const o=i(4425);const a=i(3797),l=a.cursor;const c=i(6738);const u=i(9969),h=u.clear,d=u.figures,p=u.style,m=u.wrap,y=u.entriesToDisplay;class MultiselectPrompt extends c{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=h("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${d.arrowUp}/${d.arrowDown}: Highlight option\n`+` ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const l=(r.selected?o.green(d.radioOn):d.radioOff)+" "+a+" ";let c,u;if(r.disabled){c=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{c=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){u=` - ${r.description}`;if(l.length+c.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1){u="\n"+m(r.description,{margin:l.length,width:this.out.columns})}}}return l+c+o.gray(u||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let r=y(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,a=r.endIndex;let l,c=[];for(let r=i;r<a;r++){if(r===i&&i>0){l=d.arrowUp}else if(r===a-1&&a<t.length){l=d.arrowDown}else{l=" "}c.push(this.renderOption(this.cursor,t[r],r,l))}return"\n"+c.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let t=[p.symbol(this.done,this.aborted),o.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=MultiselectPrompt},1590:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(4425);const a=i(6738);const l=i(3797),c=l.cursor,u=l.erase;const h=i(9969),d=h.style,p=h.figures,m=h.clear,y=h.lines;const g=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||g.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color=`red`;t.fire();t.render();return}let r=t.value;t.value=r!==``?r:t.initial;t.done=true;t.aborted=false;t.error=false;t.fire();t.render();t.out.write(`\n`);t.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(y(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns));this.out.write(m(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(u.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore)}}t.exports=NumberPrompt},6738:(t,r,i)=>{"use strict";const o=i(4521);const a=i(9969),l=a.action;const c=i(2361);const u=i(3797),h=u.beep,d=u.cursor;const p=i(4425);class Prompt extends c{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=l(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(d.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(p);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},6262:(t,r,i)=>{"use strict";const o=i(4425);const a=i(6738);const l=i(9969),c=l.style,u=l.clear,h=l.figures,d=l.wrap,p=l.entriesToDisplay;const m=i(3797),y=m.cursor;class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=u("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(y.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();let t=p(this.cursor,this.choices.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex;this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let t=r;t<i;t++){let a,l,c="",u=this.choices[t];if(t===r&&r>0){l=h.arrowUp}else if(t===i-1&&i<this.choices.length){l=h.arrowDown}else{l=" "}if(u.disabled){a=this.cursor===t?o.gray().underline(u.title):o.strikethrough().gray(u.title);l=(this.cursor===t?o.bold().gray(h.pointer)+" ":" ")+l}else{a=this.cursor===t?o.cyan().underline(u.title):u.title;l=(this.cursor===t?o.cyan(h.pointer)+" ":" ")+l;if(u.description&&this.cursor===t){c=` - ${u.description}`;if(l.length+a.length+c.length>=this.out.columns||u.description.split(/\r?\n/).length>1){c="\n"+d(u.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${l} ${a}${o.gray(c)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},9301:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(4425);const a=i(6738);const l=i(3797),c=l.erase,u=l.cursor;const h=i(9969),d=h.style,p=h.clear,m=h.lines,y=h.figures;class TextPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=p(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){t.value=t.value||t.initial;t.cursorOffset=0;t.cursor=t.rendered.length;yield t.validate();if(t.error){t.red=true;t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(m(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":y.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore+u.move(this.cursorOffset,0))}}t.exports=TextPrompt},5320:(t,r,i)=>{"use strict";const o=i(4425);const a=i(6738);const l=i(9969),c=l.style,u=l.clear;const h=i(3797),d=h.cursor,p=h.erase;class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(p.line+d.to(0)+this.outputText)}}t.exports=TogglePrompt},9586:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r){o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,c=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){c=true;u=t},f:function f(){try{if(!l&&i.return!=null)i.return()}finally{if(c)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(770);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const l={};const c=prompt._override||{};t=[].concat(t);let u,h,d,p,m,y;const g=function(){var t=_asyncToGenerator((function*(t,r,i=false){if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?yield t.format(r,l):r}));return function getFormattedAnswer(r,i){return t.apply(this,arguments)}}();var b=_createForOfIteratorHelper(t),v;try{for(b.s();!(v=b.n()).done;){h=v.value;var _=h;p=_.name;m=_.type;if(typeof m==="function"){m=yield m(u,_objectSpread({},l),h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?yield r(u,_objectSpread({},l),y):r}y=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}var w=h;p=w.name;m=w.type;if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(c[h.name]!==undefined){u=yield g(h,c[h.name]);if(u!==undefined){l[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):yield o[m](h);l[p]=u=yield g(h,u,true);d=yield r(h,u,l)}catch(t){d=!(yield i(h,l))}if(d)return l}}catch(t){b.e(t)}finally{b.f()}return l}));return _prompt.apply(this,arguments)}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},770:(t,r,i)=>{"use strict";const o=r;const a=i(9387);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,l)=>{const c=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;c.on("state",r.onState||noop);c.on("submit",(t=>o(h(t))));c.on("exit",(t=>o(d(t))));c.on("abort",(t=>l(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},2302:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},4766:(t,r,i)=>{"use strict";function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,c=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){c=true;u=t},f:function f(){try{if(!l&&i.return!=null)i.return()}finally{if(c)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}const o=i(6426);const a=i(3797),l=a.erase,c=a.cursor;const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return l.line+c.to(0);let i=0;const o=t.split(/\r?\n/);var a=_createForOfIteratorHelper(o),u;try{for(a.s();!(u=a.n()).done;){let t=u.value;i+=1+Math.floor(Math.max(width(t)-1,0)/r)}}catch(t){a.e(t)}finally{a.f()}return l.lines(i)}},2711:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},4862:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},9969:(t,r,i)=>{"use strict";t.exports={action:i(2302),clear:i(4766),style:i(8540),strip:i(6426),figures:i(4862),lines:i(5093),wrap:i(1689),entriesToDisplay:i(2711)}},5093:(t,r,i)=>{"use strict";const o=i(6426);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},6426:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},8540:(t,r,i)=>{"use strict";const o=i(4425);const a=i(4862);const l=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>l[t]||l.default;const c=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?c.aborted:i?c.exited:t?c.done:c.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:l,render:render,symbols:c,symbol:symbol,delimiter:delimiter,item:item}},1689:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},2279:(t,r,i)=>{function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;r<t.length;r++){if(i[r]>t[r])return false;if(t[r]>i[r])return true}return false}t.exports=isNodeLT("8.6.0")?i(9586):i(5882)},2663:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},2726:(t,r,i)=>{"use strict";const o=i(2663);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},7139:(t,r,i)=>{"use strict";const o=i(2663);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},7264:(t,r,i)=>{"use strict";t.exports={DatePart:i(2663),Meridiem:i(5917),Day:i(2726),Hours:i(7139),Milliseconds:i(5269),Minutes:i(7284),Month:i(8850),Seconds:i(8958),Year:i(3543)}},5917:(t,r,i)=>{"use strict";const o=i(2663);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},5269:(t,r,i)=>{"use strict";const o=i(2663);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},7284:(t,r,i)=>{"use strict";const o=i(2663);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},8850:(t,r,i)=>{"use strict";const o=i(2663);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},8958:(t,r,i)=>{"use strict";const o=i(2663);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},3543:(t,r,i)=>{"use strict";const o=i(2663);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},4330:(t,r,i)=>{"use strict";const o=i(4425);const a=i(8117);const{erase:l,cursor:c}=i(3797);const{style:u,clear:h,figures:d,wrap:p,entriesToDisplay:m}=i(3655);const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=u.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=h("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}async complete(t){const r=this.completing=this.suggest(this.input,this.choices);const i=await r;if(this.completing!==r)return;this.suggestions=i.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));this.completing=false;const o=Math.max(i.length-1,0);this.moveSelect(Math.min(o,this.select));t&&t()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let l;let c=i?d.arrowUp:a?d.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;c=(r?o.cyan(d.pointer)+" ":" ")+c;if(t.description){l=` - ${t.description}`;if(c.length+u.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1){l="\n"+p(t.description,{margin:3,width:this.out.columns})}}return c+" "+u+o.gray(l||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=m(this.select,this.choices.length,this.limit);this.outputText=[u.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const i=this.suggestions.slice(t,r).map(((i,o)=>this.renderOption(i,this.select===o+t,o===0&&t>0,o+t===r-1&&r<this.choices.length))).join("\n");this.outputText+=`\n`+(i||o.gray(this.fallback.title))}this.out.write(l.line+c.to(0)+this.outputText)}}t.exports=AutocompletePrompt},8020:(t,r,i)=>{"use strict";const o=i(4425);const{cursor:a}=i(3797);const l=i(3615);const{clear:c,style:u,figures:h}=i(3655);class AutocompleteMultiselectPrompt extends l{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=c("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(h.radioOn):h.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=c(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},2114:(t,r,i)=>{const o=i(4425);const a=i(8117);const{style:l,clear:c}=i(3655);const{erase:u,cursor:h}=i(3797);class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(u.line+h.to(0)+this.outputText)}}t.exports=ConfirmPrompt},2173:(t,r,i)=>{"use strict";const o=i(4425);const a=i(8117);const{style:l,clear:c,figures:u}=i(3655);const{erase:h,cursor:d}=i(3797);const{DatePart:p,Meridiem:m,Day:y,Hours:g,Milliseconds:b,Minutes:v,Month:_,Seconds:w,Year:E}=i(7264);const S=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const R={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new y(t),3:t=>new _(t),4:t=>new E(t),5:t=>new m(t),6:t=>new g(t),7:t=>new v(t),8:t=>new w(t),9:t=>new b(t)};const O={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(O,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=c("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=S.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in R?R[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof p)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t==="string"){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof p)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:u.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(h.line+d.to(0)+this.outputText)}}t.exports=DatePrompt},7972:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(4126),SelectPrompt:i(4017),TogglePrompt:i(7239),DatePrompt:i(2173),NumberPrompt:i(6550),MultiselectPrompt:i(3615),AutocompletePrompt:i(4330),AutocompleteMultiselectPrompt:i(8020),ConfirmPrompt:i(2114)}},3615:(t,r,i)=>{"use strict";const o=i(4425);const{cursor:a}=i(3797);const l=i(8117);const{clear:c,figures:u,style:h,wrap:d,entriesToDisplay:p}=i(3655);class MultiselectPrompt extends l{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=c("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${u.arrowUp}/${u.arrowDown}: Highlight option\n`+` ${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const l=(r.selected?o.green(u.radioOn):u.radioOff)+" "+a+" ";let c,h;if(r.disabled){c=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{c=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){h=` - ${r.description}`;if(l.length+c.length+h.length>=this.out.columns||r.description.split(/\r?\n/).length>1){h="\n"+d(r.description,{margin:l.length,width:this.out.columns})}}}return l+c+o.gray(h||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let{startIndex:r,endIndex:i}=p(this.cursor,t.length,this.optionsPerPage);let a,l=[];for(let o=r;o<i;o++){if(o===r&&r>0){a=u.arrowUp}else if(o===i-1&&i<t.length){a=u.arrowDown}else{a=" "}l.push(this.renderOption(this.cursor,t[o],o,a))}return"\n"+l.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[h.symbol(this.done,this.aborted),o.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=c(t,this.out.columns)}}t.exports=MultiselectPrompt},6550:(t,r,i)=>{const o=i(4425);const a=i(8117);const{cursor:l,erase:c}=i(3797);const{style:u,figures:h,clear:d,lines:p}=i(3655);const m=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||m.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let t=this.value;this.value=t!==``?t:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore)}}t.exports=NumberPrompt},8117:(t,r,i)=>{"use strict";const o=i(4521);const{action:a}=i(3655);const l=i(2361);const{beep:c,cursor:u}=i(3797);const h=i(4425);class Prompt extends l{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=a(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(u.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(h);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},4017:(t,r,i)=>{"use strict";const o=i(4425);const a=i(8117);const{style:l,clear:c,figures:u,wrap:h,entriesToDisplay:d}=i(3655);const{cursor:p}=i(3797);class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=c("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=d(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let i=t;i<r;i++){let a,l,c="",d=this.choices[i];if(i===t&&t>0){l=u.arrowUp}else if(i===r-1&&r<this.choices.length){l=u.arrowDown}else{l=" "}if(d.disabled){a=this.cursor===i?o.gray().underline(d.title):o.strikethrough().gray(d.title);l=(this.cursor===i?o.bold().gray(u.pointer)+" ":" ")+l}else{a=this.cursor===i?o.cyan().underline(d.title):d.title;l=(this.cursor===i?o.cyan(u.pointer)+" ":" ")+l;if(d.description&&this.cursor===i){c=` - ${d.description}`;if(l.length+a.length+c.length>=this.out.columns||d.description.split(/\r?\n/).length>1){c="\n"+h(d.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${l} ${a}${o.gray(c)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},4126:(t,r,i)=>{const o=i(4425);const a=i(8117);const{erase:l,cursor:c}=i(3797);const{style:u,clear:h,lines:d,figures:p}=i(3655);class TextPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=h(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(d(this.outputError,this.out.columns)-1)+h(this.outputError,this.out.columns));this.out.write(h(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0))}}t.exports=TextPrompt},7239:(t,r,i)=>{const o=i(4425);const a=i(8117);const{style:l,clear:c}=i(3655);const{cursor:u,erase:h}=i(3797);class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(h.line+u.to(0)+this.outputText)}}t.exports=TogglePrompt},5882:(t,r,i)=>{"use strict";const o=i(7377);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const l={};const c=prompt._override||{};t=[].concat(t);let u,h,d,p,m,y;const getFormattedAnswer=async(t,r,i=false)=>{if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?await t.format(r,l):r};for(h of t){({name:p,type:m}=h);if(typeof m==="function"){m=await m(u,{...l},h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?await r(u,{...l},y):r}y=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}({name:p,type:m}=h);if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(c[h.name]!==undefined){u=await getFormattedAnswer(h,c[h.name]);if(u!==undefined){l[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):await o[m](h);l[p]=u=await getFormattedAnswer(h,u,true);d=await r(h,u,l)}catch(t){d=!await i(h,l)}if(d)return l}return l}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},7377:(t,r,i)=>{"use strict";const o=r;const a=i(7972);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,l)=>{const c=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;c.on("state",r.onState||noop);c.on("submit",(t=>o(h(t))));c.on("exit",(t=>o(d(t))));c.on("abort",(t=>l(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},1876:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},8617:(t,r,i)=>{"use strict";const o=i(2213);const{erase:a,cursor:l}=i(3797);const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return a.line+l.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o){i+=1+Math.floor(Math.max(width(t)-1,0)/r)}return a.lines(i)}},7805:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},9445:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},3655:(t,r,i)=>{"use strict";t.exports={action:i(1876),clear:i(8617),style:i(6424),strip:i(2213),figures:i(9445),lines:i(6412),wrap:i(1244),entriesToDisplay:i(7805)}},6412:(t,r,i)=>{"use strict";const o=i(2213);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},2213:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},6424:(t,r,i)=>{"use strict";const o=i(4425);const a=i(9445);const l=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>l[t]||l.default;const c=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?c.aborted:i?c.exited:t?c.done:c.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:l,render:render,symbols:c,symbol:symbol,delimiter:delimiter,item:item}},1244:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},7459:(t,r,i)=>{var o=i(3306);var a=i(1545);var l=i(7147);var noop=function(){};var c=/^v?\.0/.test(process.version);var isFn=function(t){return typeof t==="function"};var isFS=function(t){if(!c)return false;if(!l)return false;return(t instanceof(l.ReadStream||noop)||t instanceof(l.WriteStream||noop))&&isFn(t.close)};var isRequest=function(t){return t.setHeader&&isFn(t.abort)};var destroyer=function(t,r,i,l){l=o(l);var c=false;t.on("close",(function(){c=true}));a(t,{readable:r,writable:i},(function(t){if(t)return l(t);c=true;l()}));var u=false;return function(r){if(c)return;if(u)return;u=true;if(isFS(t))return t.close(noop);if(isRequest(t))return t.abort();if(isFn(t.destroy))return t.destroy();l(r||new Error("stream was destroyed"))}};var call=function(t){t()};var pipe=function(t,r){return t.pipe(r)};var pump=function(){var t=Array.prototype.slice.call(arguments);var r=isFn(t[t.length-1]||noop)&&t.pop()||noop;if(Array.isArray(t[0]))t=t[0];if(t.length<2)throw new Error("pump requires two streams per minimum");var i;var o=t.map((function(a,l){var c=l<t.length-1;var u=l>0;return destroyer(a,c,u,(function(t){if(!i)i=t;if(t)o.forEach(call);if(c)return;o.forEach(call);r(i)}))}));return t.reduce(pipe)};t.exports=pump},5475:t=>{
|
|
55
112
|
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
56
|
-
let r;t.exports=typeof queueMicrotask==="function"?queueMicrotask.bind(typeof window!=="undefined"?window:global):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},2575:t=>{"use strict";class QuickLRU{constructor(t={}){if(!(t.maxSize&&t.maxSize>0)){throw new TypeError("`maxSize` must be a number greater than 0")}this.maxSize=t.maxSize;this.onEviction=t.onEviction;this.cache=new Map;this.oldCache=new Map;this._size=0}_set(t,r){this.cache.set(t,r);this._size++;if(this._size>=this.maxSize){this._size=0;if(typeof this.onEviction==="function"){for(const[t,r]of this.oldCache.entries()){this.onEviction(t,r)}}this.oldCache=this.cache;this.cache=new Map}}get(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){const r=this.oldCache.get(t);this.oldCache.delete(t);this._set(t,r);return r}}set(t,r){if(this.cache.has(t)){this.cache.set(t,r)}else{this._set(t,r)}return this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){return this.oldCache.get(t)}}delete(t){const r=this.cache.delete(t);if(r){this._size--}return this.oldCache.delete(t)||r}clear(){this.cache.clear();this.oldCache.clear();this._size=0}*keys(){for(const[t]of this){yield t}}*values(){for(const[,t]of this){yield t}}*[Symbol.iterator](){for(const t of this.cache){yield t}for(const t of this.oldCache){const[r]=t;if(!this.cache.has(r)){yield t}}}get size(){let t=0;for(const r of this.oldCache.keys()){if(!this.cache.has(r)){t++}}return Math.min(this._size+t,this.maxSize)}}t.exports=QuickLRU},2122:(t,r,i)=>{var o=i(5127);var a=i(1017).join;var c=i(3110);var l="/etc";var u=process.platform==="win32";var h=u?process.env.USERPROFILE:process.env.HOME;t.exports=function(t,r,d,p){if("string"!==typeof t)throw new Error("rc(name): name *must* be string");if(!d)d=i(7120)(process.argv.slice(2));r=("string"===typeof r?o.json(r):r)||{};p=p||o.parse;var m=o.env(t+"_");var g=[r];var y=[];function addConfigFile(t){if(y.indexOf(t)>=0)return;var r=o.file(t);if(r){g.push(p(r));y.push(t)}}if(!u)[a(l,t,"config"),a(l,t+"rc")].forEach(addConfigFile);if(h)[a(h,".config",t,"config"),a(h,".config",t),a(h,"."+t,"config"),a(h,"."+t+"rc")].forEach(addConfigFile);addConfigFile(o.find("."+t+"rc"));if(m.config)addConfigFile(m.config);if(d.config)addConfigFile(d.config);return c.apply(null,g.concat([m,d,y.length?{configs:y,config:y[y.length-1]}:undefined]))}},5127:(t,r,i)=>{"use strict";var o=i(7147);var a=i(809);var c=i(1017);var l=i(2006);var u=r.parse=function(t){if(/^\s*{/.test(t))return JSON.parse(l(t));return a.parse(t)};var h=r.file=function(){var t=[].slice.call(arguments).filter((function(t){return t!=null}));for(var r in t)if("string"!==typeof t[r])return;var i=c.join.apply(null,t);var a;try{return o.readFileSync(i,"utf-8")}catch(t){return}};var d=r.json=function(){var t=h.apply(null,arguments);return t?u(t):null};var p=r.env=function(t,r){r=r||process.env;var i={};var o=t.length;for(var a in r){if(a.toLowerCase().indexOf(t.toLowerCase())===0){var c=a.substring(o).split("__");var l;while((l=c.indexOf(""))>-1){c.splice(l,1)}var u=i;c.forEach((function _buildSubObj(t,i){if(!t||typeof u!=="object")return;if(i===c.length-1)u[t]=r[a];if(u[t]===undefined)u[t]={};u=u[t]}))}}return i};var m=r.find=function(){var t=c.join.apply(null,[].slice.call(arguments));function find(t,r){var i=c.join(t,r);try{o.statSync(i);return i}catch(i){if(c.dirname(t)!==t)return find(c.dirname(t),r)}}return find(process.cwd(),t)}},2951:(t,r,i)=>{const o=i(1105).Buffer;function decodeBase64(t){return o.from(t,"base64").toString("utf8")}function encodeBase64(t){return o.from(t,"utf8").toString("base64")}t.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},6377:(t,r,i)=>{var o=i(7310);var a=i(2951);var c=a.decodeBase64;var l=a.encodeBase64;var u=":_authToken";var h=":username";var d=":_password";t.exports=function(){var t;var r;if(arguments.length>=2){t=arguments[0];r=arguments[1]}else if(typeof arguments[0]==="string"){t=arguments[0]}else{r=arguments[0]}r=r||{};r.npmrc=r.npmrc||i(2122)("npm",{registry:"https://registry.npmjs.org/"});t=t||r.npmrc.registry;return getRegistryAuthInfo(t,r)||getLegacyAuthInfo(r.npmrc)};function getRegistryAuthInfo(t,r){var i=o.parse(t,false,true);var a;while(a!=="/"&&i.pathname!==a){a=i.pathname||"/";var c="//"+i.host+a.replace(/\/$/,"");var l=getAuthInfoForUrl(c,r.npmrc);if(l){return l}if(!r.recursive){return/\/$/.test(t)?undefined:getRegistryAuthInfo(o.resolve(t,"."),r)}i.pathname=o.resolve(normalizePath(a),"..")||"/"}return undefined}function getLegacyAuthInfo(t){if(t._auth){return{token:t._auth,type:"Basic"}}return undefined}function normalizePath(t){return t[t.length-1]==="/"?t:t+"/"}function getAuthInfoForUrl(t,r){var i=getBearerToken(r[t+u]||r[t+"/"+u]);if(i){return i}var o=r[t+h]||r[t+"/"+h];var a=r[t+d]||r[t+"/"+d];var c=getTokenForUsernameAndPassword(o,a);if(c){return c}return undefined}function getBearerToken(t){if(!t){return undefined}var r=t.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]}));return{token:r,type:"Bearer"}}function getTokenForUsernameAndPassword(t,r){if(!t||!r){return undefined}var i=c(r.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]})));var o=l(t+":"+i);return{token:o,type:"Basic",password:i,username:t}}},2404:(t,r,i)=>{"use strict";t.exports=function(t){var r=i(2122)("npm",{registry:"https://registry.npmjs.org/"});var o=r[t+":registry"]||r.registry;return o.slice(-1)==="/"?o:o+"/"}},4459:(t,r,i)=>{"use strict";const o=i(6821);t.exports=(t={},r=o.connect)=>new Promise(((i,o)=>{let a=false;let c;const callback=async()=>{await l;c.off("timeout",onTimeout);c.off("error",o);if(t.resolveSocket){i({alpnProtocol:c.alpnProtocol,socket:c,timeout:a});if(a){await Promise.resolve();c.emit("timeout")}}else{c.destroy();i({alpnProtocol:c.alpnProtocol,timeout:a})}};const onTimeout=async()=>{a=true;callback()};const l=(async()=>{try{c=await r(t,callback);c.on("error",o);c.once("timeout",onTimeout)}catch(t){o(t)}})()}))},1762:(t,r,i)=>{"use strict";const o=i(2781).Readable;const a=i(7976);class Response extends o{constructor(t,r,i,o){if(typeof t!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof r!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(i instanceof Buffer)){throw new TypeError("Argument `body` should be a buffer")}if(typeof o!=="string"){throw new TypeError("Argument `url` should be a string")}super();this.statusCode=t;this.headers=a(r);this.body=i;this.url=o}_read(){this.push(this.body);this.push(null)}}t.exports=Response},2012:(t,r,i)=>{t.exports=i(2763)},2763:(t,r,i)=>{var o=i(4699);r.operation=function(t){var i=r.timeouts(t);return new o(i,{forever:t&&(t.forever||t.retries===Infinity),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};r.timeouts=function(t){if(t instanceof Array){return[].concat(t)}var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var i in t){r[i]=t[i]}if(r.minTimeout>r.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var o=[];for(var a=0;a<r.retries;a++){o.push(this.createTimeout(a,r))}if(t&&t.forever&&!o.length){o.push(this.createTimeout(a,r))}o.sort((function(t,r){return t-r}));return o};r.createTimeout=function(t,r){var i=r.randomize?Math.random()+1:1;var o=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));o=Math.min(o,r.maxTimeout);return o};r.wrap=function(t,i,o){if(i instanceof Array){o=i;i=null}if(!o){o=[];for(var a in t){if(typeof t[a]==="function"){o.push(a)}}}for(var c=0;c<o.length;c++){var l=o[c];var u=t[l];t[l]=function retryWrapper(o){var a=r.operation(i);var c=Array.prototype.slice.call(arguments,1);var l=c.pop();c.push((function(t){if(a.retry(t)){return}if(t){arguments[0]=a.mainError()}l.apply(this,arguments)}));a.attempt((function(){o.apply(t,c)}))}.bind(t,u);t[l].options=i}}},4699:t=>{function RetryOperation(t,r){if(typeof r==="boolean"){r={forever:r}}this._originalTimeouts=JSON.parse(JSON.stringify(t));this._timeouts=t;this._options=r||{};this._maxRetryTime=r&&r.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;this._timer=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}t.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}if(this._timer){clearTimeout(this._timer)}this._timeouts=[];this._cachedTimeouts=null};RetryOperation.prototype.retry=function(t){if(this._timeout){clearTimeout(this._timeout)}if(!t){return false}var r=(new Date).getTime();if(t&&r-this._operationStart>=this._maxRetryTime){this._errors.push(t);this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(t);var i=this._timeouts.shift();if(i===undefined){if(this._cachedTimeouts){this._errors.splice(0,this._errors.length-1);i=this._cachedTimeouts.slice(-1)}else{return false}}var o=this;this._timer=setTimeout((function(){o._attempts++;if(o._operationTimeoutCb){o._timeout=setTimeout((function(){o._operationTimeoutCb(o._attempts)}),o._operationTimeout);if(o._options.unref){o._timeout.unref()}}o._fn(o._attempts)}),i);if(this._options.unref){this._timer.unref()}return true};RetryOperation.prototype.attempt=function(t,r){this._fn=t;if(r){if(r.timeout){this._operationTimeout=r.timeout}if(r.cb){this._operationTimeoutCb=r.cb}}var i=this;if(this._operationTimeoutCb){this._timeout=setTimeout((function(){i._operationTimeoutCb()}),i._operationTimeout)}this._operationStart=(new Date).getTime();this._fn(this._attempts)};RetryOperation.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated");this.attempt(t)};RetryOperation.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated");this.attempt(t)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0){return null}var t={};var r=null;var i=0;for(var o=0;o<this._errors.length;o++){var a=this._errors[o];var c=a.message;var l=(t[c]||0)+1;t[c]=l;if(l>=i){r=a;i=l}}return r}},1816:t=>{"use strict";function reusify(t){var r=new t;var i=r;function get(){var o=r;if(o.next){r=o.next}else{r=new t;i=r}o.next=null;return o}function release(t){i.next=t;i=t}return{get:get,release:release}}t.exports=reusify},2625:(t,r,i)=>{const o=i(9491);const a=i(1017);const c=i(7147);let l=undefined;try{l=i(1978)}catch(t){}const u={nosort:true,silent:true};let h=0;const d=process.platform==="win32";const defaults=t=>{const r=["unlink","chmod","stat","lstat","rmdir","readdir"];r.forEach((r=>{t[r]=t[r]||c[r];r=r+"Sync";t[r]=t[r]||c[r]}));t.maxBusyTries=t.maxBusyTries||3;t.emfileWait=t.emfileWait||1e3;if(t.glob===false){t.disableGlob=true}if(t.disableGlob!==true&&l===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}t.disableGlob=t.disableGlob||false;t.glob=t.glob||u};const rimraf=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o.equal(typeof i,"function","rimraf: callback function required");o(r,"rimraf: invalid options argument provided");o.equal(typeof r,"object","rimraf: options should be object");defaults(r);let a=0;let c=null;let u=0;const next=t=>{c=c||t;if(--u===0)i(c)};const afterGlob=(t,o)=>{if(t)return i(t);u=o.length;if(u===0)return i();o.forEach((t=>{const CB=i=>{if(i){if((i.code==="EBUSY"||i.code==="ENOTEMPTY"||i.code==="EPERM")&&a<r.maxBusyTries){a++;return setTimeout((()=>rimraf_(t,r,CB)),a*100)}if(i.code==="EMFILE"&&h<r.emfileWait){return setTimeout((()=>rimraf_(t,r,CB)),h++)}if(i.code==="ENOENT")i=null}h=0;next(i)};rimraf_(t,r,CB)}))};if(r.disableGlob||!l.hasMagic(t))return afterGlob(null,[t]);r.lstat(t,((i,o)=>{if(!i)return afterGlob(null,[t]);l(t,r.glob,afterGlob)}))};const rimraf_=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.lstat(t,((o,a)=>{if(o&&o.code==="ENOENT")return i(null);if(o&&o.code==="EPERM"&&d)fixWinEPERM(t,r,o,i);if(a&&a.isDirectory())return rmdir(t,r,o,i);r.unlink(t,(o=>{if(o){if(o.code==="ENOENT")return i(null);if(o.code==="EPERM")return d?fixWinEPERM(t,r,o,i):rmdir(t,r,o,i);if(o.code==="EISDIR")return rmdir(t,r,o,i)}return i(o)}))}))};const fixWinEPERM=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.chmod(t,438,(o=>{if(o)a(o.code==="ENOENT"?null:i);else r.stat(t,((o,c)=>{if(o)a(o.code==="ENOENT"?null:i);else if(c.isDirectory())rmdir(t,r,i,a);else r.unlink(t,a)}))}))};const fixWinEPERMSync=(t,r,i)=>{o(t);o(r);try{r.chmodSync(t,438)}catch(t){if(t.code==="ENOENT")return;else throw i}let a;try{a=r.statSync(t)}catch(t){if(t.code==="ENOENT")return;else throw i}if(a.isDirectory())rmdirSync(t,r,i);else r.unlinkSync(t)};const rmdir=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.rmdir(t,(o=>{if(o&&(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM"))rmkids(t,r,a);else if(o&&o.code==="ENOTDIR")a(i);else a(o)}))};const rmkids=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.readdir(t,((o,c)=>{if(o)return i(o);let l=c.length;if(l===0)return r.rmdir(t,i);let u;c.forEach((o=>{rimraf(a.join(t,o),r,(o=>{if(u)return;if(o)return i(u=o);if(--l===0)r.rmdir(t,i)}))}))}))};const rimrafSync=(t,r)=>{r=r||{};defaults(r);o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o(r,"rimraf: missing options");o.equal(typeof r,"object","rimraf: options should be object");let i;if(r.disableGlob||!l.hasMagic(t)){i=[t]}else{try{r.lstatSync(t);i=[t]}catch(o){i=l.sync(t,r.glob)}}if(!i.length)return;for(let t=0;t<i.length;t++){const o=i[t];let a;try{a=r.lstatSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM"&&d)fixWinEPERMSync(o,r,t)}try{if(a&&a.isDirectory())rmdirSync(o,r,null);else r.unlinkSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM")return d?fixWinEPERMSync(o,r,t):rmdirSync(o,r,t);if(t.code!=="EISDIR")throw t;rmdirSync(o,r,t)}}};const rmdirSync=(t,r,i)=>{o(t);o(r);try{r.rmdirSync(t)}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR")throw i;if(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM")rmkidsSync(t,r)}};const rmkidsSync=(t,r)=>{o(t);o(r);r.readdirSync(t).forEach((i=>rimrafSync(a.join(t,i),r)));const i=d?100:1;let c=0;do{let o=true;try{const a=r.rmdirSync(t,r);o=false;return a}finally{if(++c<i&&o)continue}}while(true)};t.exports=rimraf;rimraf.sync=rimrafSync},5341:(t,r,i)=>{
|
|
113
|
+
let r;t.exports=typeof queueMicrotask==="function"?queueMicrotask.bind(typeof window!=="undefined"?window:global):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},2625:t=>{"use strict";class QuickLRU{constructor(t={}){if(!(t.maxSize&&t.maxSize>0)){throw new TypeError("`maxSize` must be a number greater than 0")}this.maxSize=t.maxSize;this.onEviction=t.onEviction;this.cache=new Map;this.oldCache=new Map;this._size=0}_set(t,r){this.cache.set(t,r);this._size++;if(this._size>=this.maxSize){this._size=0;if(typeof this.onEviction==="function"){for(const[t,r]of this.oldCache.entries()){this.onEviction(t,r)}}this.oldCache=this.cache;this.cache=new Map}}get(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){const r=this.oldCache.get(t);this.oldCache.delete(t);this._set(t,r);return r}}set(t,r){if(this.cache.has(t)){this.cache.set(t,r)}else{this._set(t,r)}return this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){return this.oldCache.get(t)}}delete(t){const r=this.cache.delete(t);if(r){this._size--}return this.oldCache.delete(t)||r}clear(){this.cache.clear();this.oldCache.clear();this._size=0}*keys(){for(const[t]of this){yield t}}*values(){for(const[,t]of this){yield t}}*[Symbol.iterator](){for(const t of this.cache){yield t}for(const t of this.oldCache){const[r]=t;if(!this.cache.has(r)){yield t}}}get size(){let t=0;for(const r of this.oldCache.keys()){if(!this.cache.has(r)){t++}}return Math.min(this._size+t,this.maxSize)}}t.exports=QuickLRU},1898:(t,r,i)=>{var o=i(9691);var a=i(1017).join;var l=i(5666);var c="/etc";var u=process.platform==="win32";var h=u?process.env.USERPROFILE:process.env.HOME;t.exports=function(t,r,d,p){if("string"!==typeof t)throw new Error("rc(name): name *must* be string");if(!d)d=i(6780)(process.argv.slice(2));r=("string"===typeof r?o.json(r):r)||{};p=p||o.parse;var m=o.env(t+"_");var y=[r];var g=[];function addConfigFile(t){if(g.indexOf(t)>=0)return;var r=o.file(t);if(r){y.push(p(r));g.push(t)}}if(!u)[a(c,t,"config"),a(c,t+"rc")].forEach(addConfigFile);if(h)[a(h,".config",t,"config"),a(h,".config",t),a(h,"."+t,"config"),a(h,"."+t+"rc")].forEach(addConfigFile);addConfigFile(o.find("."+t+"rc"));if(m.config)addConfigFile(m.config);if(d.config)addConfigFile(d.config);return l.apply(null,y.concat([m,d,g.length?{configs:g,config:g[g.length-1]}:undefined]))}},9691:(t,r,i)=>{"use strict";var o=i(7147);var a=i(9764);var l=i(1017);var c=i(2524);var u=r.parse=function(t){if(/^\s*{/.test(t))return JSON.parse(c(t));return a.parse(t)};var h=r.file=function(){var t=[].slice.call(arguments).filter((function(t){return t!=null}));for(var r in t)if("string"!==typeof t[r])return;var i=l.join.apply(null,t);var a;try{return o.readFileSync(i,"utf-8")}catch(t){return}};var d=r.json=function(){var t=h.apply(null,arguments);return t?u(t):null};var p=r.env=function(t,r){r=r||process.env;var i={};var o=t.length;for(var a in r){if(a.toLowerCase().indexOf(t.toLowerCase())===0){var l=a.substring(o).split("__");var c;while((c=l.indexOf(""))>-1){l.splice(c,1)}var u=i;l.forEach((function _buildSubObj(t,i){if(!t||typeof u!=="object")return;if(i===l.length-1)u[t]=r[a];if(u[t]===undefined)u[t]={};u=u[t]}))}}return i};var m=r.find=function(){var t=l.join.apply(null,[].slice.call(arguments));function find(t,r){var i=l.join(t,r);try{o.statSync(i);return i}catch(i){if(l.dirname(t)!==t)return find(l.dirname(t),r)}}return find(process.cwd(),t)}},8771:(t,r,i)=>{"use strict";var o=i(9748);var a=Object.keys||function(t){var r=[];for(var i in t){r.push(i)}return r};t.exports=Duplex;var l=Object.create(i(9571));l.inherits=i(3193);var c=i(9227);var u=i(3471);l.inherits(Duplex,c);{var h=a(u.prototype);for(var d=0;d<h.length;d++){var p=h[d];if(!Duplex.prototype[p])Duplex.prototype[p]=u.prototype[p]}}function Duplex(t){if(!(this instanceof Duplex))return new Duplex(t);c.call(this,t);u.call(this,t);if(t&&t.readable===false)this.readable=false;if(t&&t.writable===false)this.writable=false;this.allowHalfOpen=true;if(t&&t.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;o.nextTick(onEndNT,this)}function onEndNT(t){t.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(t){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=t;this._writableState.destroyed=t}});Duplex.prototype._destroy=function(t,r){this.push(null);this.end();o.nextTick(r,t)}},6288:(t,r,i)=>{"use strict";t.exports=PassThrough;var o=i(5241);var a=Object.create(i(9571));a.inherits=i(3193);a.inherits(PassThrough,o);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);o.call(this,t)}PassThrough.prototype._transform=function(t,r,i){i(null,t)}},9227:(t,r,i)=>{"use strict";var o=i(9748);t.exports=Readable;var a=i(6116);var l;Readable.ReadableState=ReadableState;var c=i(2361).EventEmitter;var EElistenerCount=function(t,r){return t.listeners(r).length};var u=i(7474);var h=i(7455).Buffer;var d=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return h.from(t)}function _isUint8Array(t){return h.isBuffer(t)||t instanceof d}var p=Object.create(i(9571));p.inherits=i(3193);var m=i(3837);var y=void 0;if(m&&m.debuglog){y=m.debuglog("stream")}else{y=function(){}}var g=i(7255);var b=i(4567);var v;p.inherits(Readable,u);var _=["error","close","destroy","pause","resume"];function prependListener(t,r,i){if(typeof t.prependListener==="function")return t.prependListener(r,i);if(!t._events||!t._events[r])t.on(r,i);else if(a(t._events[r]))t._events[r].unshift(i);else t._events[r]=[i,t._events[r]]}function ReadableState(t,r){l=l||i(8771);t=t||{};var o=r instanceof l;this.objectMode=!!t.objectMode;if(o)this.objectMode=this.objectMode||!!t.readableObjectMode;var a=t.highWaterMark;var c=t.readableHighWaterMark;var u=this.objectMode?16:16*1024;if(a||a===0)this.highWaterMark=a;else if(o&&(c||c===0))this.highWaterMark=c;else this.highWaterMark=u;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new g;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!v)v=i(467).s;this.decoder=new v(t.encoding);this.encoding=t.encoding}}function Readable(t){l=l||i(8771);if(!(this instanceof Readable))return new Readable(t);this._readableState=new ReadableState(t,this);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}u.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(t){if(!this._readableState){return}this._readableState.destroyed=t}});Readable.prototype.destroy=b.destroy;Readable.prototype._undestroy=b.undestroy;Readable.prototype._destroy=function(t,r){this.push(null);r(t)};Readable.prototype.push=function(t,r){var i=this._readableState;var o;if(!i.objectMode){if(typeof t==="string"){r=r||i.defaultEncoding;if(r!==i.encoding){t=h.from(t,r);r=""}o=true}}else{o=true}return readableAddChunk(this,t,r,false,o)};Readable.prototype.unshift=function(t){return readableAddChunk(this,t,null,true,false)};function readableAddChunk(t,r,i,o,a){var l=t._readableState;if(r===null){l.reading=false;onEofChunk(t,l)}else{var c;if(!a)c=chunkInvalid(l,r);if(c){t.emit("error",c)}else if(l.objectMode||r&&r.length>0){if(typeof r!=="string"&&!l.objectMode&&Object.getPrototypeOf(r)!==h.prototype){r=_uint8ArrayToBuffer(r)}if(o){if(l.endEmitted)t.emit("error",new Error("stream.unshift() after end event"));else addChunk(t,l,r,true)}else if(l.ended){t.emit("error",new Error("stream.push() after EOF"))}else{l.reading=false;if(l.decoder&&!i){r=l.decoder.write(r);if(l.objectMode||r.length!==0)addChunk(t,l,r,false);else maybeReadMore(t,l)}else{addChunk(t,l,r,false)}}}else if(!o){l.reading=false}}return needMoreData(l)}function addChunk(t,r,i,o){if(r.flowing&&r.length===0&&!r.sync){t.emit("data",i);t.read(0)}else{r.length+=r.objectMode?1:i.length;if(o)r.buffer.unshift(i);else r.buffer.push(i);if(r.needReadable)emitReadable(t)}maybeReadMore(t,r)}function chunkInvalid(t,r){var i;if(!_isUint8Array(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){i=new TypeError("Invalid non-string/buffer chunk")}return i}function needMoreData(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(t){if(!v)v=i(467).s;this._readableState.decoder=new v(t);this._readableState.encoding=t;return this};var w=8388608;function computeNewHighWaterMark(t){if(t>=w){t=w}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function howMuchToRead(t,r){if(t<=0||r.length===0&&r.ended)return 0;if(r.objectMode)return 1;if(t!==t){if(r.flowing&&r.length)return r.buffer.head.data.length;else return r.length}if(t>r.highWaterMark)r.highWaterMark=computeNewHighWaterMark(t);if(t<=r.length)return t;if(!r.ended){r.needReadable=true;return 0}return r.length}Readable.prototype.read=function(t){y("read",t);t=parseInt(t,10);var r=this._readableState;var i=t;if(t!==0)r.emittedReadable=false;if(t===0&&r.needReadable&&(r.length>=r.highWaterMark||r.ended)){y("read: emitReadable",r.length,r.ended);if(r.length===0&&r.ended)endReadable(this);else emitReadable(this);return null}t=howMuchToRead(t,r);if(t===0&&r.ended){if(r.length===0)endReadable(this);return null}var o=r.needReadable;y("need readable",o);if(r.length===0||r.length-t<r.highWaterMark){o=true;y("length less than watermark",o)}if(r.ended||r.reading){o=false;y("reading or ended",o)}else if(o){y("do read");r.reading=true;r.sync=true;if(r.length===0)r.needReadable=true;this._read(r.highWaterMark);r.sync=false;if(!r.reading)t=howMuchToRead(i,r)}var a;if(t>0)a=fromList(t,r);else a=null;if(a===null){r.needReadable=true;t=0}else{r.length-=t}if(r.length===0){if(!r.ended)r.needReadable=true;if(i!==t&&r.ended)endReadable(this)}if(a!==null)this.emit("data",a);return a};function onEofChunk(t,r){if(r.ended)return;if(r.decoder){var i=r.decoder.end();if(i&&i.length){r.buffer.push(i);r.length+=r.objectMode?1:i.length}}r.ended=true;emitReadable(t)}function emitReadable(t){var r=t._readableState;r.needReadable=false;if(!r.emittedReadable){y("emitReadable",r.flowing);r.emittedReadable=true;if(r.sync)o.nextTick(emitReadable_,t);else emitReadable_(t)}}function emitReadable_(t){y("emit readable");t.emit("readable");flow(t)}function maybeReadMore(t,r){if(!r.readingMore){r.readingMore=true;o.nextTick(maybeReadMore_,t,r)}}function maybeReadMore_(t,r){var i=r.length;while(!r.reading&&!r.flowing&&!r.ended&&r.length<r.highWaterMark){y("maybeReadMore read 0");t.read(0);if(i===r.length)break;else i=r.length}r.readingMore=false}Readable.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(t,r){var i=this;var a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t);break}a.pipesCount+=1;y("pipe count=%d opts=%j",a.pipesCount,r);var l=(!r||r.end!==false)&&t!==process.stdout&&t!==process.stderr;var c=l?onend:unpipe;if(a.endEmitted)o.nextTick(c);else i.once("end",c);t.on("unpipe",onunpipe);function onunpipe(t,r){y("onunpipe");if(t===i){if(r&&r.hasUnpiped===false){r.hasUnpiped=true;cleanup()}}}function onend(){y("onend");t.end()}var u=pipeOnDrain(i);t.on("drain",u);var h=false;function cleanup(){y("cleanup");t.removeListener("close",onclose);t.removeListener("finish",onfinish);t.removeListener("drain",u);t.removeListener("error",onerror);t.removeListener("unpipe",onunpipe);i.removeListener("end",onend);i.removeListener("end",unpipe);i.removeListener("data",ondata);h=true;if(a.awaitDrain&&(!t._writableState||t._writableState.needDrain))u()}var d=false;i.on("data",ondata);function ondata(r){y("ondata");d=false;var o=t.write(r);if(false===o&&!d){if((a.pipesCount===1&&a.pipes===t||a.pipesCount>1&&indexOf(a.pipes,t)!==-1)&&!h){y("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;d=true}i.pause()}}function onerror(r){y("onerror",r);unpipe();t.removeListener("error",onerror);if(EElistenerCount(t,"error")===0)t.emit("error",r)}prependListener(t,"error",onerror);function onclose(){t.removeListener("finish",onfinish);unpipe()}t.once("close",onclose);function onfinish(){y("onfinish");t.removeListener("close",onclose);unpipe()}t.once("finish",onfinish);function unpipe(){y("unpipe");i.unpipe(t)}t.emit("pipe",i);if(!a.flowing){y("pipe resume");i.resume()}return t};function pipeOnDrain(t){return function(){var r=t._readableState;y("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&EElistenerCount(t,"data")){r.flowing=true;flow(t)}}}Readable.prototype.unpipe=function(t){var r=this._readableState;var i={hasUnpiped:false};if(r.pipesCount===0)return this;if(r.pipesCount===1){if(t&&t!==r.pipes)return this;if(!t)t=r.pipes;r.pipes=null;r.pipesCount=0;r.flowing=false;if(t)t.emit("unpipe",this,i);return this}if(!t){var o=r.pipes;var a=r.pipesCount;r.pipes=null;r.pipesCount=0;r.flowing=false;for(var l=0;l<a;l++){o[l].emit("unpipe",this,i)}return this}var c=indexOf(r.pipes,t);if(c===-1)return this;r.pipes.splice(c,1);r.pipesCount-=1;if(r.pipesCount===1)r.pipes=r.pipes[0];t.emit("unpipe",this,i);return this};Readable.prototype.on=function(t,r){var i=u.prototype.on.call(this,t,r);if(t==="data"){if(this._readableState.flowing!==false)this.resume()}else if(t==="readable"){var a=this._readableState;if(!a.endEmitted&&!a.readableListening){a.readableListening=a.needReadable=true;a.emittedReadable=false;if(!a.reading){o.nextTick(nReadingNextTick,this)}else if(a.length){emitReadable(this)}}}return i};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(t){y("readable nexttick read 0");t.read(0)}Readable.prototype.resume=function(){var t=this._readableState;if(!t.flowing){y("resume");t.flowing=true;resume(this,t)}return this};function resume(t,r){if(!r.resumeScheduled){r.resumeScheduled=true;o.nextTick(resume_,t,r)}}function resume_(t,r){if(!r.reading){y("resume read 0");t.read(0)}r.resumeScheduled=false;r.awaitDrain=0;t.emit("resume");flow(t);if(r.flowing&&!r.reading)t.read(0)}Readable.prototype.pause=function(){y("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){y("pause");this._readableState.flowing=false;this.emit("pause")}return this};function flow(t){var r=t._readableState;y("flow",r.flowing);while(r.flowing&&t.read()!==null){}}Readable.prototype.wrap=function(t){var r=this;var i=this._readableState;var o=false;t.on("end",(function(){y("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(a){y("wrapped data");if(i.decoder)a=i.decoder.write(a);if(i.objectMode&&(a===null||a===undefined))return;else if(!i.objectMode&&(!a||!a.length))return;var l=r.push(a);if(!l){o=true;t.pause()}}));for(var a in t){if(this[a]===undefined&&typeof t[a]==="function"){this[a]=function(r){return function(){return t[r].apply(t,arguments)}}(a)}}for(var l=0;l<_.length;l++){t.on(_[l],this.emit.bind(this,_[l]))}this._read=function(r){y("wrapped _read",r);if(o){o=false;t.resume()}};return this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(t,r){if(r.length===0)return null;var i;if(r.objectMode)i=r.buffer.shift();else if(!t||t>=r.length){if(r.decoder)i=r.buffer.join("");else if(r.buffer.length===1)i=r.buffer.head.data;else i=r.buffer.concat(r.length);r.buffer.clear()}else{i=fromListPartial(t,r.buffer,r.decoder)}return i}function fromListPartial(t,r,i){var o;if(t<r.head.data.length){o=r.head.data.slice(0,t);r.head.data=r.head.data.slice(t)}else if(t===r.head.data.length){o=r.shift()}else{o=i?copyFromBufferString(t,r):copyFromBuffer(t,r)}return o}function copyFromBufferString(t,r){var i=r.head;var o=1;var a=i.data;t-=a.length;while(i=i.next){var l=i.data;var c=t>l.length?l.length:t;if(c===l.length)a+=l;else a+=l.slice(0,t);t-=c;if(t===0){if(c===l.length){++o;if(i.next)r.head=i.next;else r.head=r.tail=null}else{r.head=i;i.data=l.slice(c)}break}++o}r.length-=o;return a}function copyFromBuffer(t,r){var i=h.allocUnsafe(t);var o=r.head;var a=1;o.data.copy(i);t-=o.data.length;while(o=o.next){var l=o.data;var c=t>l.length?l.length:t;l.copy(i,i.length-t,0,c);t-=c;if(t===0){if(c===l.length){++a;if(o.next)r.head=o.next;else r.head=r.tail=null}else{r.head=o;o.data=l.slice(c)}break}++a}r.length-=a;return i}function endReadable(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!r.endEmitted){r.ended=true;o.nextTick(endReadableNT,r,t)}}function endReadableNT(t,r){if(!t.endEmitted&&t.length===0){t.endEmitted=true;r.readable=false;r.emit("end")}}function indexOf(t,r){for(var i=0,o=t.length;i<o;i++){if(t[i]===r)return i}return-1}},5241:(t,r,i)=>{"use strict";t.exports=Transform;var o=i(8771);var a=Object.create(i(9571));a.inherits=i(3193);a.inherits(Transform,o);function afterTransform(t,r){var i=this._transformState;i.transforming=false;var o=i.writecb;if(!o){return this.emit("error",new Error("write callback called multiple times"))}i.writechunk=null;i.writecb=null;if(r!=null)this.push(r);o(t);var a=this._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){this._read(a.highWaterMark)}}function Transform(t){if(!(this instanceof Transform))return new Transform(t);o.call(this,t);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",prefinish)}function prefinish(){var t=this;if(typeof this._flush==="function"){this._flush((function(r,i){done(t,r,i)}))}else{done(this,null,null)}}Transform.prototype.push=function(t,r){this._transformState.needTransform=false;return o.prototype.push.call(this,t,r)};Transform.prototype._transform=function(t,r,i){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(t,r,i){var o=this._transformState;o.writecb=i;o.writechunk=t;o.writeencoding=r;if(!o.transforming){var a=this._readableState;if(o.needTransform||a.needReadable||a.length<a.highWaterMark)this._read(a.highWaterMark)}};Transform.prototype._read=function(t){var r=this._transformState;if(r.writechunk!==null&&r.writecb&&!r.transforming){r.transforming=true;this._transform(r.writechunk,r.writeencoding,r.afterTransform)}else{r.needTransform=true}};Transform.prototype._destroy=function(t,r){var i=this;o.prototype._destroy.call(this,t,(function(t){r(t);i.emit("close")}))};function done(t,r,i){if(r)return t.emit("error",r);if(i!=null)t.push(i);if(t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}},3471:(t,r,i)=>{"use strict";var o=i(9748);t.exports=Writable;function WriteReq(t,r,i){this.chunk=t;this.encoding=r;this.callback=i;this.next=null}function CorkedRequest(t){var r=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(r,t)}}var a=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:o.nextTick;var l;Writable.WritableState=WritableState;var c=Object.create(i(9571));c.inherits=i(3193);var u={deprecate:i(343)};var h=i(7474);var d=i(7455).Buffer;var p=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return d.from(t)}function _isUint8Array(t){return d.isBuffer(t)||t instanceof p}var m=i(4567);c.inherits(Writable,h);function nop(){}function WritableState(t,r){l=l||i(8771);t=t||{};var o=r instanceof l;this.objectMode=!!t.objectMode;if(o)this.objectMode=this.objectMode||!!t.writableObjectMode;var a=t.highWaterMark;var c=t.writableHighWaterMark;var u=this.objectMode?16:16*1024;if(a||a===0)this.highWaterMark=a;else if(o&&(c||c===0))this.highWaterMark=c;else this.highWaterMark=u;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var h=t.decodeStrings===false;this.decodeStrings=!h;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){onwrite(r,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(t){if(y.call(this,t))return true;if(this!==Writable)return false;return t&&t._writableState instanceof WritableState}})}else{y=function(t){return t instanceof this}}function Writable(t){l=l||i(8771);if(!y.call(Writable,this)&&!(this instanceof l)){return new Writable(t)}this._writableState=new WritableState(t,this);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}h.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(t,r){var i=new Error("write after end");t.emit("error",i);o.nextTick(r,i)}function validChunk(t,r,i,a){var l=true;var c=false;if(i===null){c=new TypeError("May not write null values to stream")}else if(typeof i!=="string"&&i!==undefined&&!r.objectMode){c=new TypeError("Invalid non-string/buffer chunk")}if(c){t.emit("error",c);o.nextTick(a,c);l=false}return l}Writable.prototype.write=function(t,r,i){var o=this._writableState;var a=false;var l=!o.objectMode&&_isUint8Array(t);if(l&&!d.isBuffer(t)){t=_uint8ArrayToBuffer(t)}if(typeof r==="function"){i=r;r=null}if(l)r="buffer";else if(!r)r=o.defaultEncoding;if(typeof i!=="function")i=nop;if(o.ended)writeAfterEnd(this,i);else if(l||validChunk(this,o,t,i)){o.pendingcb++;a=writeOrBuffer(this,o,l,t,r,i)}return a};Writable.prototype.cork=function(){var t=this._writableState;t.corked++};Writable.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.finished&&!t.bufferProcessing&&t.bufferedRequest)clearBuffer(this,t)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t;return this};function decodeChunk(t,r,i){if(!t.objectMode&&t.decodeStrings!==false&&typeof r==="string"){r=d.from(r,i)}return r}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(t,r,i,o,a,l){if(!i){var c=decodeChunk(r,o,a);if(o!==c){i=true;a="buffer";o=c}}var u=r.objectMode?1:o.length;r.length+=u;var h=r.length<r.highWaterMark;if(!h)r.needDrain=true;if(r.writing||r.corked){var d=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:a,isBuf:i,callback:l,next:null};if(d){d.next=r.lastBufferedRequest}else{r.bufferedRequest=r.lastBufferedRequest}r.bufferedRequestCount+=1}else{doWrite(t,r,false,u,o,a,l)}return h}function doWrite(t,r,i,o,a,l,c){r.writelen=o;r.writecb=c;r.writing=true;r.sync=true;if(i)t._writev(a,r.onwrite);else t._write(a,l,r.onwrite);r.sync=false}function onwriteError(t,r,i,a,l){--r.pendingcb;if(i){o.nextTick(l,a);o.nextTick(finishMaybe,t,r);t._writableState.errorEmitted=true;t.emit("error",a)}else{l(a);t._writableState.errorEmitted=true;t.emit("error",a);finishMaybe(t,r)}}function onwriteStateUpdate(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function onwrite(t,r){var i=t._writableState;var o=i.sync;var l=i.writecb;onwriteStateUpdate(i);if(r)onwriteError(t,i,o,r,l);else{var c=needFinish(i);if(!c&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest){clearBuffer(t,i)}if(o){a(afterWrite,t,i,c,l)}else{afterWrite(t,i,c,l)}}}function afterWrite(t,r,i,o){if(!i)onwriteDrain(t,r);r.pendingcb--;o();finishMaybe(t,r)}function onwriteDrain(t,r){if(r.length===0&&r.needDrain){r.needDrain=false;t.emit("drain")}}function clearBuffer(t,r){r.bufferProcessing=true;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var o=r.bufferedRequestCount;var a=new Array(o);var l=r.corkedRequestsFree;l.entry=i;var c=0;var u=true;while(i){a[c]=i;if(!i.isBuf)u=false;i=i.next;c+=1}a.allBuffers=u;doWrite(t,r,true,r.length,a,"",l.finish);r.pendingcb++;r.lastBufferedRequest=null;if(l.next){r.corkedRequestsFree=l.next;l.next=null}else{r.corkedRequestsFree=new CorkedRequest(r)}r.bufferedRequestCount=0}else{while(i){var h=i.chunk;var d=i.encoding;var p=i.callback;var m=r.objectMode?1:h.length;doWrite(t,r,false,m,h,d,p);i=i.next;r.bufferedRequestCount--;if(r.writing){break}}if(i===null)r.lastBufferedRequest=null}r.bufferedRequest=i;r.bufferProcessing=false}Writable.prototype._write=function(t,r,i){i(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(t,r,i){var o=this._writableState;if(typeof t==="function"){i=t;t=null;r=null}else if(typeof r==="function"){i=r;r=null}if(t!==null&&t!==undefined)this.write(t,r);if(o.corked){o.corked=1;this.uncork()}if(!o.ending&&!o.finished)endWritable(this,o,i)};function needFinish(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function callFinal(t,r){t._final((function(i){r.pendingcb--;if(i){t.emit("error",i)}r.prefinished=true;t.emit("prefinish");finishMaybe(t,r)}))}function prefinish(t,r){if(!r.prefinished&&!r.finalCalled){if(typeof t._final==="function"){r.pendingcb++;r.finalCalled=true;o.nextTick(callFinal,t,r)}else{r.prefinished=true;t.emit("prefinish")}}}function finishMaybe(t,r){var i=needFinish(r);if(i){prefinish(t,r);if(r.pendingcb===0){r.finished=true;t.emit("finish")}}return i}function endWritable(t,r,i){r.ending=true;finishMaybe(t,r);if(i){if(r.finished)o.nextTick(i);else t.once("finish",i)}r.ended=true;t.writable=false}function onCorkedFinish(t,r,i){var o=t.entry;t.entry=null;while(o){var a=o.callback;r.pendingcb--;a(i);o=o.next}if(r.corkedRequestsFree){r.corkedRequestsFree.next=t}else{r.corkedRequestsFree=t}}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function(t){if(!this._writableState){return}this._writableState.destroyed=t}});Writable.prototype.destroy=m.destroy;Writable.prototype._undestroy=m.undestroy;Writable.prototype._destroy=function(t,r){this.end();r(t)}},7255:(t,r,i)=>{"use strict";function _classCallCheck(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=i(7455).Buffer;var a=i(3837);function copyBuffer(t,r,i){t.copy(r,i)}t.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(t){var r={data:t,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length};BufferList.prototype.unshift=function unshift(t){var r={data:t,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(t){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=t+r.data}return i};BufferList.prototype.concat=function concat(t){if(this.length===0)return o.alloc(0);if(this.length===1)return this.head.data;var r=o.allocUnsafe(t>>>0);var i=this.head;var a=0;while(i){copyBuffer(i.data,r,a);a+=i.data.length;i=i.next}return r};return BufferList}();if(a&&a.inspect&&a.inspect.custom){t.exports.prototype[a.inspect.custom]=function(){var t=a.inspect({length:this.length});return this.constructor.name+" "+t}}},4567:(t,r,i)=>{"use strict";var o=i(9748);function destroy(t,r){var i=this;var a=this._readableState&&this._readableState.destroyed;var l=this._writableState&&this._writableState.destroyed;if(a||l){if(r){r(t)}else if(t&&(!this._writableState||!this._writableState.errorEmitted)){o.nextTick(emitErrorNT,this,t)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,(function(t){if(!r&&t){o.nextTick(emitErrorNT,i,t);if(i._writableState){i._writableState.errorEmitted=true}}else if(r){r(t)}}));return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(t,r){t.emit("error",r)}t.exports={destroy:destroy,undestroy:undestroy}},7474:(t,r,i)=>{t.exports=i(2781)},1250:(t,r,i)=>{t.exports=i(7426).PassThrough},7426:(t,r,i)=>{var o=i(2781);if(process.env.READABLE_STREAM==="disable"&&o){t.exports=o;r=t.exports=o.Readable;r.Readable=o.Readable;r.Writable=o.Writable;r.Duplex=o.Duplex;r.Transform=o.Transform;r.PassThrough=o.PassThrough;r.Stream=o}else{r=t.exports=i(9227);r.Stream=o||r;r.Readable=r;r.Writable=i(3471);r.Duplex=i(8771);r.Transform=i(5241);r.PassThrough=i(6288)}},9349:t=>{"use strict";const r={};function createErrorType(t,i,o){if(!o){o=Error}function getMessage(t,r,o){if(typeof i==="string"){return i}else{return i(t,r,o)}}class NodeError extends o{constructor(t,r,i){super(getMessage(t,r,i))}}NodeError.prototype.name=o.name;NodeError.prototype.code=t;r[t]=NodeError}function oneOf(t,r){if(Array.isArray(t)){const i=t.length;t=t.map((t=>String(t)));if(i>2){return`one of ${r} ${t.slice(0,i-1).join(", ")}, or `+t[i-1]}else if(i===2){return`one of ${r} ${t[0]} or ${t[1]}`}else{return`of ${r} ${t[0]}`}}else{return`of ${r} ${String(t)}`}}function startsWith(t,r,i){return t.substr(!i||i<0?0:+i,r.length)===r}function endsWith(t,r,i){if(i===undefined||i>t.length){i=t.length}return t.substring(i-r.length,i)===r}function includes(t,r,i){if(typeof i!=="number"){i=0}if(i+r.length>t.length){return false}else{return t.indexOf(r,i)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(t,r){return'The value "'+r+'" is invalid for option "'+t+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(t,r,i){let o;if(typeof r==="string"&&startsWith(r,"not ")){o="must not be";r=r.replace(/^not /,"")}else{o="must be"}let a;if(endsWith(t," argument")){a=`The ${t} ${o} ${oneOf(r,"type")}`}else{const i=includes(t,".")?"property":"argument";a=`The "${t}" ${i} ${o} ${oneOf(r,"type")}`}a+=`. Received type ${typeof i}`;return a}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");t.exports.q=r},3289:(t,r,i)=>{"use strict";var o=Object.keys||function(t){var r=[];for(var i in t){r.push(i)}return r};t.exports=Duplex;var a=i(4787);var l=i(7513);i(3193)(Duplex,a);{var c=o(l.prototype);for(var u=0;u<c.length;u++){var h=c[u];if(!Duplex.prototype[h])Duplex.prototype[h]=l.prototype[h]}}function Duplex(t){if(!(this instanceof Duplex))return new Duplex(t);a.call(this,t);l.call(this,t);this.allowHalfOpen=true;if(t){if(t.readable===false)this.readable=false;if(t.writable===false)this.writable=false;if(t.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",onend)}}}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});Object.defineProperty(Duplex.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Duplex.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function onend(){if(this._writableState.ended)return;process.nextTick(onEndNT,this)}function onEndNT(t){t.end()}Object.defineProperty(Duplex.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function set(t){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=t;this._writableState.destroyed=t}})},4788:(t,r,i)=>{"use strict";t.exports=PassThrough;var o=i(6551);i(3193)(PassThrough,o);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);o.call(this,t)}PassThrough.prototype._transform=function(t,r,i){i(null,t)}},4787:(t,r,i)=>{"use strict";t.exports=Readable;var o;Readable.ReadableState=ReadableState;var a=i(2361).EventEmitter;var l=function EElistenerCount(t,r){return t.listeners(r).length};var c=i(1455);var u=i(4300).Buffer;var h=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return u.from(t)}function _isUint8Array(t){return u.isBuffer(t)||t instanceof h}var d=i(3837);var p;if(d&&d.debuglog){p=d.debuglog("stream")}else{p=function debug(){}}var m=i(4041);var y=i(4289);var g=i(483),b=g.getHighWaterMark;var v=i(9349).q,_=v.ERR_INVALID_ARG_TYPE,w=v.ERR_STREAM_PUSH_AFTER_EOF,E=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var R;var O;var x;i(3193)(Readable,c);var T=y.errorOrDestroy;var k=["error","close","destroy","pause","resume"];function prependListener(t,r,i){if(typeof t.prependListener==="function")return t.prependListener(r,i);if(!t._events||!t._events[r])t.on(r,i);else if(Array.isArray(t._events[r]))t._events[r].unshift(i);else t._events[r]=[i,t._events[r]]}function ReadableState(t,r,a){o=o||i(3289);t=t||{};if(typeof a!=="boolean")a=r instanceof o;this.objectMode=!!t.objectMode;if(a)this.objectMode=this.objectMode||!!t.readableObjectMode;this.highWaterMark=b(this,t,"readableHighWaterMark",a);this.buffer=new m;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!R)R=i(1862).s;this.decoder=new R(t.encoding);this.encoding=t.encoding}}function Readable(t){o=o||i(3289);if(!(this instanceof Readable))return new Readable(t);var r=this instanceof o;this._readableState=new ReadableState(t,this,r);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}c.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function set(t){if(!this._readableState){return}this._readableState.destroyed=t}});Readable.prototype.destroy=y.destroy;Readable.prototype._undestroy=y.undestroy;Readable.prototype._destroy=function(t,r){r(t)};Readable.prototype.push=function(t,r){var i=this._readableState;var o;if(!i.objectMode){if(typeof t==="string"){r=r||i.defaultEncoding;if(r!==i.encoding){t=u.from(t,r);r=""}o=true}}else{o=true}return readableAddChunk(this,t,r,false,o)};Readable.prototype.unshift=function(t){return readableAddChunk(this,t,null,true,false)};function readableAddChunk(t,r,i,o,a){p("readableAddChunk",r);var l=t._readableState;if(r===null){l.reading=false;onEofChunk(t,l)}else{var c;if(!a)c=chunkInvalid(l,r);if(c){T(t,c)}else if(l.objectMode||r&&r.length>0){if(typeof r!=="string"&&!l.objectMode&&Object.getPrototypeOf(r)!==u.prototype){r=_uint8ArrayToBuffer(r)}if(o){if(l.endEmitted)T(t,new S);else addChunk(t,l,r,true)}else if(l.ended){T(t,new w)}else if(l.destroyed){return false}else{l.reading=false;if(l.decoder&&!i){r=l.decoder.write(r);if(l.objectMode||r.length!==0)addChunk(t,l,r,false);else maybeReadMore(t,l)}else{addChunk(t,l,r,false)}}}else if(!o){l.reading=false;maybeReadMore(t,l)}}return!l.ended&&(l.length<l.highWaterMark||l.length===0)}function addChunk(t,r,i,o){if(r.flowing&&r.length===0&&!r.sync){r.awaitDrain=0;t.emit("data",i)}else{r.length+=r.objectMode?1:i.length;if(o)r.buffer.unshift(i);else r.buffer.push(i);if(r.needReadable)emitReadable(t)}maybeReadMore(t,r)}function chunkInvalid(t,r){var i;if(!_isUint8Array(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){i=new _("chunk",["string","Buffer","Uint8Array"],r)}return i}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(t){if(!R)R=i(1862).s;var r=new R(t);this._readableState.decoder=r;this._readableState.encoding=this._readableState.decoder.encoding;var o=this._readableState.buffer.head;var a="";while(o!==null){a+=r.write(o.data);o=o.next}this._readableState.buffer.clear();if(a!=="")this._readableState.buffer.push(a);this._readableState.length=a.length;return this};var A=1073741824;function computeNewHighWaterMark(t){if(t>=A){t=A}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function howMuchToRead(t,r){if(t<=0||r.length===0&&r.ended)return 0;if(r.objectMode)return 1;if(t!==t){if(r.flowing&&r.length)return r.buffer.head.data.length;else return r.length}if(t>r.highWaterMark)r.highWaterMark=computeNewHighWaterMark(t);if(t<=r.length)return t;if(!r.ended){r.needReadable=true;return 0}return r.length}Readable.prototype.read=function(t){p("read",t);t=parseInt(t,10);var r=this._readableState;var i=t;if(t!==0)r.emittedReadable=false;if(t===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended)){p("read: emitReadable",r.length,r.ended);if(r.length===0&&r.ended)endReadable(this);else emitReadable(this);return null}t=howMuchToRead(t,r);if(t===0&&r.ended){if(r.length===0)endReadable(this);return null}var o=r.needReadable;p("need readable",o);if(r.length===0||r.length-t<r.highWaterMark){o=true;p("length less than watermark",o)}if(r.ended||r.reading){o=false;p("reading or ended",o)}else if(o){p("do read");r.reading=true;r.sync=true;if(r.length===0)r.needReadable=true;this._read(r.highWaterMark);r.sync=false;if(!r.reading)t=howMuchToRead(i,r)}var a;if(t>0)a=fromList(t,r);else a=null;if(a===null){r.needReadable=r.length<=r.highWaterMark;t=0}else{r.length-=t;r.awaitDrain=0}if(r.length===0){if(!r.ended)r.needReadable=true;if(i!==t&&r.ended)endReadable(this)}if(a!==null)this.emit("data",a);return a};function onEofChunk(t,r){p("onEofChunk");if(r.ended)return;if(r.decoder){var i=r.decoder.end();if(i&&i.length){r.buffer.push(i);r.length+=r.objectMode?1:i.length}}r.ended=true;if(r.sync){emitReadable(t)}else{r.needReadable=false;if(!r.emittedReadable){r.emittedReadable=true;emitReadable_(t)}}}function emitReadable(t){var r=t._readableState;p("emitReadable",r.needReadable,r.emittedReadable);r.needReadable=false;if(!r.emittedReadable){p("emitReadable",r.flowing);r.emittedReadable=true;process.nextTick(emitReadable_,t)}}function emitReadable_(t){var r=t._readableState;p("emitReadable_",r.destroyed,r.length,r.ended);if(!r.destroyed&&(r.length||r.ended)){t.emit("readable");r.emittedReadable=false}r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark;flow(t)}function maybeReadMore(t,r){if(!r.readingMore){r.readingMore=true;process.nextTick(maybeReadMore_,t,r)}}function maybeReadMore_(t,r){while(!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&r.length===0)){var i=r.length;p("maybeReadMore read 0");t.read(0);if(i===r.length)break}r.readingMore=false}Readable.prototype._read=function(t){T(this,new E("_read()"))};Readable.prototype.pipe=function(t,r){var i=this;var o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t);break}o.pipesCount+=1;p("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||r.end!==false)&&t!==process.stdout&&t!==process.stderr;var c=a?onend:unpipe;if(o.endEmitted)process.nextTick(c);else i.once("end",c);t.on("unpipe",onunpipe);function onunpipe(t,r){p("onunpipe");if(t===i){if(r&&r.hasUnpiped===false){r.hasUnpiped=true;cleanup()}}}function onend(){p("onend");t.end()}var u=pipeOnDrain(i);t.on("drain",u);var h=false;function cleanup(){p("cleanup");t.removeListener("close",onclose);t.removeListener("finish",onfinish);t.removeListener("drain",u);t.removeListener("error",onerror);t.removeListener("unpipe",onunpipe);i.removeListener("end",onend);i.removeListener("end",unpipe);i.removeListener("data",ondata);h=true;if(o.awaitDrain&&(!t._writableState||t._writableState.needDrain))u()}i.on("data",ondata);function ondata(r){p("ondata");var a=t.write(r);p("dest.write",a);if(a===false){if((o.pipesCount===1&&o.pipes===t||o.pipesCount>1&&indexOf(o.pipes,t)!==-1)&&!h){p("false write response, pause",o.awaitDrain);o.awaitDrain++}i.pause()}}function onerror(r){p("onerror",r);unpipe();t.removeListener("error",onerror);if(l(t,"error")===0)T(t,r)}prependListener(t,"error",onerror);function onclose(){t.removeListener("finish",onfinish);unpipe()}t.once("close",onclose);function onfinish(){p("onfinish");t.removeListener("close",onclose);unpipe()}t.once("finish",onfinish);function unpipe(){p("unpipe");i.unpipe(t)}t.emit("pipe",i);if(!o.flowing){p("pipe resume");i.resume()}return t};function pipeOnDrain(t){return function pipeOnDrainFunctionResult(){var r=t._readableState;p("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&l(t,"data")){r.flowing=true;flow(t)}}}Readable.prototype.unpipe=function(t){var r=this._readableState;var i={hasUnpiped:false};if(r.pipesCount===0)return this;if(r.pipesCount===1){if(t&&t!==r.pipes)return this;if(!t)t=r.pipes;r.pipes=null;r.pipesCount=0;r.flowing=false;if(t)t.emit("unpipe",this,i);return this}if(!t){var o=r.pipes;var a=r.pipesCount;r.pipes=null;r.pipesCount=0;r.flowing=false;for(var l=0;l<a;l++){o[l].emit("unpipe",this,{hasUnpiped:false})}return this}var c=indexOf(r.pipes,t);if(c===-1)return this;r.pipes.splice(c,1);r.pipesCount-=1;if(r.pipesCount===1)r.pipes=r.pipes[0];t.emit("unpipe",this,i);return this};Readable.prototype.on=function(t,r){var i=c.prototype.on.call(this,t,r);var o=this._readableState;if(t==="data"){o.readableListening=this.listenerCount("readable")>0;if(o.flowing!==false)this.resume()}else if(t==="readable"){if(!o.endEmitted&&!o.readableListening){o.readableListening=o.needReadable=true;o.flowing=false;o.emittedReadable=false;p("on readable",o.length,o.reading);if(o.length){emitReadable(this)}else if(!o.reading){process.nextTick(nReadingNextTick,this)}}}return i};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(t,r){var i=c.prototype.removeListener.call(this,t,r);if(t==="readable"){process.nextTick(updateReadableListening,this)}return i};Readable.prototype.removeAllListeners=function(t){var r=c.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){process.nextTick(updateReadableListening,this)}return r};function updateReadableListening(t){var r=t._readableState;r.readableListening=t.listenerCount("readable")>0;if(r.resumeScheduled&&!r.paused){r.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function nReadingNextTick(t){p("readable nexttick read 0");t.read(0)}Readable.prototype.resume=function(){var t=this._readableState;if(!t.flowing){p("resume");t.flowing=!t.readableListening;resume(this,t)}t.paused=false;return this};function resume(t,r){if(!r.resumeScheduled){r.resumeScheduled=true;process.nextTick(resume_,t,r)}}function resume_(t,r){p("resume",r.reading);if(!r.reading){t.read(0)}r.resumeScheduled=false;t.emit("resume");flow(t);if(r.flowing&&!r.reading)t.read(0)}Readable.prototype.pause=function(){p("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){p("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(t){var r=t._readableState;p("flow",r.flowing);while(r.flowing&&t.read()!==null){}}Readable.prototype.wrap=function(t){var r=this;var i=this._readableState;var o=false;t.on("end",(function(){p("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(a){p("wrapped data");if(i.decoder)a=i.decoder.write(a);if(i.objectMode&&(a===null||a===undefined))return;else if(!i.objectMode&&(!a||!a.length))return;var l=r.push(a);if(!l){o=true;t.pause()}}));for(var a in t){if(this[a]===undefined&&typeof t[a]==="function"){this[a]=function methodWrap(r){return function methodWrapReturnFunction(){return t[r].apply(t,arguments)}}(a)}}for(var l=0;l<k.length;l++){t.on(k[l],this.emit.bind(this,k[l]))}this._read=function(r){p("wrapped _read",r);if(o){o=false;t.resume()}};return this};if(typeof Symbol==="function"){Readable.prototype[Symbol.asyncIterator]=function(){if(O===undefined){O=i(5224)}return O(this)}}Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function get(){return this._readableState.highWaterMark}});Object.defineProperty(Readable.prototype,"readableBuffer",{enumerable:false,get:function get(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Readable.prototype,"readableFlowing",{enumerable:false,get:function get(){return this._readableState.flowing},set:function set(t){if(this._readableState){this._readableState.flowing=t}}});Readable._fromList=fromList;Object.defineProperty(Readable.prototype,"readableLength",{enumerable:false,get:function get(){return this._readableState.length}});function fromList(t,r){if(r.length===0)return null;var i;if(r.objectMode)i=r.buffer.shift();else if(!t||t>=r.length){if(r.decoder)i=r.buffer.join("");else if(r.buffer.length===1)i=r.buffer.first();else i=r.buffer.concat(r.length);r.buffer.clear()}else{i=r.buffer.consume(t,r.decoder)}return i}function endReadable(t){var r=t._readableState;p("endReadable",r.endEmitted);if(!r.endEmitted){r.ended=true;process.nextTick(endReadableNT,r,t)}}function endReadableNT(t,r){p("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;r.readable=false;r.emit("end");if(t.autoDestroy){var i=r._writableState;if(!i||i.autoDestroy&&i.finished){r.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(t,r){if(x===undefined){x=i(8720)}return x(Readable,t,r)}}function indexOf(t,r){for(var i=0,o=t.length;i<o;i++){if(t[i]===r)return i}return-1}},6551:(t,r,i)=>{"use strict";t.exports=Transform;var o=i(9349).q,a=o.ERR_METHOD_NOT_IMPLEMENTED,l=o.ERR_MULTIPLE_CALLBACK,c=o.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=o.ERR_TRANSFORM_WITH_LENGTH_0;var h=i(3289);i(3193)(Transform,h);function afterTransform(t,r){var i=this._transformState;i.transforming=false;var o=i.writecb;if(o===null){return this.emit("error",new l)}i.writechunk=null;i.writecb=null;if(r!=null)this.push(r);o(t);var a=this._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){this._read(a.highWaterMark)}}function Transform(t){if(!(this instanceof Transform))return new Transform(t);h.call(this,t);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",prefinish)}function prefinish(){var t=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush((function(r,i){done(t,r,i)}))}else{done(this,null,null)}}Transform.prototype.push=function(t,r){this._transformState.needTransform=false;return h.prototype.push.call(this,t,r)};Transform.prototype._transform=function(t,r,i){i(new a("_transform()"))};Transform.prototype._write=function(t,r,i){var o=this._transformState;o.writecb=i;o.writechunk=t;o.writeencoding=r;if(!o.transforming){var a=this._readableState;if(o.needTransform||a.needReadable||a.length<a.highWaterMark)this._read(a.highWaterMark)}};Transform.prototype._read=function(t){var r=this._transformState;if(r.writechunk!==null&&!r.transforming){r.transforming=true;this._transform(r.writechunk,r.writeencoding,r.afterTransform)}else{r.needTransform=true}};Transform.prototype._destroy=function(t,r){h.prototype._destroy.call(this,t,(function(t){r(t)}))};function done(t,r,i){if(r)return t.emit("error",r);if(i!=null)t.push(i);if(t._writableState.length)throw new u;if(t._transformState.transforming)throw new c;return t.push(null)}},7513:(t,r,i)=>{"use strict";t.exports=Writable;function WriteReq(t,r,i){this.chunk=t;this.encoding=r;this.callback=i;this.next=null}function CorkedRequest(t){var r=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(r,t)}}var o;Writable.WritableState=WritableState;var a={deprecate:i(343)};var l=i(1455);var c=i(4300).Buffer;var u=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return c.from(t)}function _isUint8Array(t){return c.isBuffer(t)||t instanceof u}var h=i(4289);var d=i(483),p=d.getHighWaterMark;var m=i(9349).q,y=m.ERR_INVALID_ARG_TYPE,g=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_MULTIPLE_CALLBACK,v=m.ERR_STREAM_CANNOT_PIPE,_=m.ERR_STREAM_DESTROYED,w=m.ERR_STREAM_NULL_VALUES,E=m.ERR_STREAM_WRITE_AFTER_END,S=m.ERR_UNKNOWN_ENCODING;var R=h.errorOrDestroy;i(3193)(Writable,l);function nop(){}function WritableState(t,r,a){o=o||i(3289);t=t||{};if(typeof a!=="boolean")a=r instanceof o;this.objectMode=!!t.objectMode;if(a)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=p(this,t,"writableHighWaterMark",a);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var l=t.decodeStrings===false;this.decodeStrings=!l;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){onwrite(r,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:a.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var O;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){O=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(t){if(O.call(this,t))return true;if(this!==Writable)return false;return t&&t._writableState instanceof WritableState}})}else{O=function realHasInstance(t){return t instanceof this}}function Writable(t){o=o||i(3289);var r=this instanceof o;if(!r&&!O.call(Writable,this))return new Writable(t);this._writableState=new WritableState(t,this,r);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}l.call(this)}Writable.prototype.pipe=function(){R(this,new v)};function writeAfterEnd(t,r){var i=new E;R(t,i);process.nextTick(r,i)}function validChunk(t,r,i,o){var a;if(i===null){a=new w}else if(typeof i!=="string"&&!r.objectMode){a=new y("chunk",["string","Buffer"],i)}if(a){R(t,a);process.nextTick(o,a);return false}return true}Writable.prototype.write=function(t,r,i){var o=this._writableState;var a=false;var l=!o.objectMode&&_isUint8Array(t);if(l&&!c.isBuffer(t)){t=_uint8ArrayToBuffer(t)}if(typeof r==="function"){i=r;r=null}if(l)r="buffer";else if(!r)r=o.defaultEncoding;if(typeof i!=="function")i=nop;if(o.ending)writeAfterEnd(this,i);else if(l||validChunk(this,o,t,i)){o.pendingcb++;a=writeOrBuffer(this,o,l,t,r,i)}return a};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest)clearBuffer(this,t)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);this._writableState.defaultEncoding=t;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(t,r,i){if(!t.objectMode&&t.decodeStrings!==false&&typeof r==="string"){r=c.from(r,i)}return r}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(t,r,i,o,a,l){if(!i){var c=decodeChunk(r,o,a);if(o!==c){i=true;a="buffer";o=c}}var u=r.objectMode?1:o.length;r.length+=u;var h=r.length<r.highWaterMark;if(!h)r.needDrain=true;if(r.writing||r.corked){var d=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:a,isBuf:i,callback:l,next:null};if(d){d.next=r.lastBufferedRequest}else{r.bufferedRequest=r.lastBufferedRequest}r.bufferedRequestCount+=1}else{doWrite(t,r,false,u,o,a,l)}return h}function doWrite(t,r,i,o,a,l,c){r.writelen=o;r.writecb=c;r.writing=true;r.sync=true;if(r.destroyed)r.onwrite(new _("write"));else if(i)t._writev(a,r.onwrite);else t._write(a,l,r.onwrite);r.sync=false}function onwriteError(t,r,i,o,a){--r.pendingcb;if(i){process.nextTick(a,o);process.nextTick(finishMaybe,t,r);t._writableState.errorEmitted=true;R(t,o)}else{a(o);t._writableState.errorEmitted=true;R(t,o);finishMaybe(t,r)}}function onwriteStateUpdate(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function onwrite(t,r){var i=t._writableState;var o=i.sync;var a=i.writecb;if(typeof a!=="function")throw new b;onwriteStateUpdate(i);if(r)onwriteError(t,i,o,r,a);else{var l=needFinish(i)||t.destroyed;if(!l&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest){clearBuffer(t,i)}if(o){process.nextTick(afterWrite,t,i,l,a)}else{afterWrite(t,i,l,a)}}}function afterWrite(t,r,i,o){if(!i)onwriteDrain(t,r);r.pendingcb--;o();finishMaybe(t,r)}function onwriteDrain(t,r){if(r.length===0&&r.needDrain){r.needDrain=false;t.emit("drain")}}function clearBuffer(t,r){r.bufferProcessing=true;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var o=r.bufferedRequestCount;var a=new Array(o);var l=r.corkedRequestsFree;l.entry=i;var c=0;var u=true;while(i){a[c]=i;if(!i.isBuf)u=false;i=i.next;c+=1}a.allBuffers=u;doWrite(t,r,true,r.length,a,"",l.finish);r.pendingcb++;r.lastBufferedRequest=null;if(l.next){r.corkedRequestsFree=l.next;l.next=null}else{r.corkedRequestsFree=new CorkedRequest(r)}r.bufferedRequestCount=0}else{while(i){var h=i.chunk;var d=i.encoding;var p=i.callback;var m=r.objectMode?1:h.length;doWrite(t,r,false,m,h,d,p);i=i.next;r.bufferedRequestCount--;if(r.writing){break}}if(i===null)r.lastBufferedRequest=null}r.bufferedRequest=i;r.bufferProcessing=false}Writable.prototype._write=function(t,r,i){i(new g("_write()"))};Writable.prototype._writev=null;Writable.prototype.end=function(t,r,i){var o=this._writableState;if(typeof t==="function"){i=t;t=null;r=null}else if(typeof r==="function"){i=r;r=null}if(t!==null&&t!==undefined)this.write(t,r);if(o.corked){o.corked=1;this.uncork()}if(!o.ending)endWritable(this,o,i);return this};Object.defineProperty(Writable.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function needFinish(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function callFinal(t,r){t._final((function(i){r.pendingcb--;if(i){R(t,i)}r.prefinished=true;t.emit("prefinish");finishMaybe(t,r)}))}function prefinish(t,r){if(!r.prefinished&&!r.finalCalled){if(typeof t._final==="function"&&!r.destroyed){r.pendingcb++;r.finalCalled=true;process.nextTick(callFinal,t,r)}else{r.prefinished=true;t.emit("prefinish")}}}function finishMaybe(t,r){var i=needFinish(r);if(i){prefinish(t,r);if(r.pendingcb===0){r.finished=true;t.emit("finish");if(r.autoDestroy){var o=t._readableState;if(!o||o.autoDestroy&&o.endEmitted){t.destroy()}}}}return i}function endWritable(t,r,i){r.ending=true;finishMaybe(t,r);if(i){if(r.finished)process.nextTick(i);else t.once("finish",i)}r.ended=true;t.writable=false}function onCorkedFinish(t,r,i){var o=t.entry;t.entry=null;while(o){var a=o.callback;r.pendingcb--;a(i);o=o.next}r.corkedRequestsFree.next=t}Object.defineProperty(Writable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function set(t){if(!this._writableState){return}this._writableState.destroyed=t}});Writable.prototype.destroy=h.destroy;Writable.prototype._undestroy=h.undestroy;Writable.prototype._destroy=function(t,r){r(t)}},5224:(t,r,i)=>{"use strict";var o;function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}var a=i(6007);var l=Symbol("lastResolve");var c=Symbol("lastReject");var u=Symbol("error");var h=Symbol("ended");var d=Symbol("lastPromise");var p=Symbol("handlePromise");var m=Symbol("stream");function createIterResult(t,r){return{value:t,done:r}}function readAndResolve(t){var r=t[l];if(r!==null){var i=t[m].read();if(i!==null){t[d]=null;t[l]=null;t[c]=null;r(createIterResult(i,false))}}}function onReadable(t){process.nextTick(readAndResolve,t)}function wrapForNext(t,r){return function(i,o){t.then((function(){if(r[h]){i(createIterResult(undefined,true));return}r[p](i,o)}),o)}}var y=Object.getPrototypeOf((function(){}));var g=Object.setPrototypeOf((o={get stream(){return this[m]},next:function next(){var t=this;var r=this[u];if(r!==null){return Promise.reject(r)}if(this[h]){return Promise.resolve(createIterResult(undefined,true))}if(this[m].destroyed){return new Promise((function(r,i){process.nextTick((function(){if(t[u]){i(t[u])}else{r(createIterResult(undefined,true))}}))}))}var i=this[d];var o;if(i){o=new Promise(wrapForNext(i,this))}else{var a=this[m].read();if(a!==null){return Promise.resolve(createIterResult(a,false))}o=new Promise(this[p])}this[d]=o;return o}},_defineProperty(o,Symbol.asyncIterator,(function(){return this})),_defineProperty(o,"return",(function _return(){var t=this;return new Promise((function(r,i){t[m].destroy(null,(function(t){if(t){i(t);return}r(createIterResult(undefined,true))}))}))})),o),y);var b=function createReadableStreamAsyncIterator(t){var r;var i=Object.create(g,(r={},_defineProperty(r,m,{value:t,writable:true}),_defineProperty(r,l,{value:null,writable:true}),_defineProperty(r,c,{value:null,writable:true}),_defineProperty(r,u,{value:null,writable:true}),_defineProperty(r,h,{value:t._readableState.endEmitted,writable:true}),_defineProperty(r,p,{value:function value(t,r){var o=i[m].read();if(o){i[d]=null;i[l]=null;i[c]=null;t(createIterResult(o,false))}else{i[l]=t;i[c]=r}},writable:true}),r));i[d]=null;a(t,(function(t){if(t&&t.code!=="ERR_STREAM_PREMATURE_CLOSE"){var r=i[c];if(r!==null){i[d]=null;i[l]=null;i[c]=null;r(t)}i[u]=t;return}var o=i[l];if(o!==null){i[d]=null;i[l]=null;i[c]=null;o(createIterResult(undefined,true))}i[h]=true}));t.on("readable",onReadable.bind(null,i));return i};t.exports=b},4041:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r)o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}));i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _classCallCheck(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){if(r)_defineProperties(t.prototype,r);if(i)_defineProperties(t,i);return t}var o=i(4300),a=o.Buffer;var l=i(3837),c=l.inspect;var u=c&&c.custom||"inspect";function copyBuffer(t,r,i){a.prototype.copy.call(t,r,i)}t.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}_createClass(BufferList,[{key:"push",value:function push(t){var r={data:t,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function unshift(t){var r={data:t,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(t){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=t+r.data}return i}},{key:"concat",value:function concat(t){if(this.length===0)return a.alloc(0);var r=a.allocUnsafe(t>>>0);var i=this.head;var o=0;while(i){copyBuffer(i.data,r,o);o+=i.data.length;i=i.next}return r}},{key:"consume",value:function consume(t,r){var i;if(t<this.head.data.length){i=this.head.data.slice(0,t);this.head.data=this.head.data.slice(t)}else if(t===this.head.data.length){i=this.shift()}else{i=r?this._getString(t):this._getBuffer(t)}return i}},{key:"first",value:function first(){return this.head.data}},{key:"_getString",value:function _getString(t){var r=this.head;var i=1;var o=r.data;t-=o.length;while(r=r.next){var a=r.data;var l=t>a.length?a.length:t;if(l===a.length)o+=a;else o+=a.slice(0,t);t-=l;if(t===0){if(l===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(l)}break}++i}this.length-=i;return o}},{key:"_getBuffer",value:function _getBuffer(t){var r=a.allocUnsafe(t);var i=this.head;var o=1;i.data.copy(r);t-=i.data.length;while(i=i.next){var l=i.data;var c=t>l.length?l.length:t;l.copy(r,r.length-t,0,c);t-=c;if(t===0){if(c===l.length){++o;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=l.slice(c)}break}++o}this.length-=o;return r}},{key:u,value:function value(t,r){return c(this,_objectSpread({},r,{depth:0,customInspect:false}))}}]);return BufferList}()},4289:t=>{"use strict";function destroy(t,r){var i=this;var o=this._readableState&&this._readableState.destroyed;var a=this._writableState&&this._writableState.destroyed;if(o||a){if(r){r(t)}else if(t){if(!this._writableState){process.nextTick(emitErrorNT,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,(function(t){if(!r&&t){if(!i._writableState){process.nextTick(emitErrorAndCloseNT,i,t)}else if(!i._writableState.errorEmitted){i._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,i,t)}else{process.nextTick(emitCloseNT,i)}}else if(r){process.nextTick(emitCloseNT,i);r(t)}else{process.nextTick(emitCloseNT,i)}}));return this}function emitErrorAndCloseNT(t,r){emitErrorNT(t,r);emitCloseNT(t)}function emitCloseNT(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(t,r){t.emit("error",r)}function errorOrDestroy(t,r){var i=t._readableState;var o=t._writableState;if(i&&i.autoDestroy||o&&o.autoDestroy)t.destroy(r);else t.emit("error",r)}t.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},6007:(t,r,i)=>{"use strict";var o=i(9349).q.ERR_STREAM_PREMATURE_CLOSE;function once(t){var r=false;return function(){if(r)return;r=true;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}t.apply(this,o)}}function noop(){}function isRequest(t){return t.setHeader&&typeof t.abort==="function"}function eos(t,r,i){if(typeof r==="function")return eos(t,null,r);if(!r)r={};i=once(i||noop);var a=r.readable||r.readable!==false&&t.readable;var l=r.writable||r.writable!==false&&t.writable;var c=function onlegacyfinish(){if(!t.writable)h()};var u=t._writableState&&t._writableState.finished;var h=function onfinish(){l=false;u=true;if(!a)i.call(t)};var d=t._readableState&&t._readableState.endEmitted;var p=function onend(){a=false;d=true;if(!l)i.call(t)};var m=function onerror(r){i.call(t,r)};var y=function onclose(){var r;if(a&&!d){if(!t._readableState||!t._readableState.ended)r=new o;return i.call(t,r)}if(l&&!u){if(!t._writableState||!t._writableState.ended)r=new o;return i.call(t,r)}};var g=function onrequest(){t.req.on("finish",h)};if(isRequest(t)){t.on("complete",h);t.on("abort",y);if(t.req)g();else t.on("request",g)}else if(l&&!t._writableState){t.on("end",c);t.on("close",c)}t.on("end",p);t.on("finish",h);if(r.error!==false)t.on("error",m);t.on("close",y);return function(){t.removeListener("complete",h);t.removeListener("abort",y);t.removeListener("request",g);if(t.req)t.req.removeListener("finish",h);t.removeListener("end",c);t.removeListener("close",c);t.removeListener("finish",h);t.removeListener("end",p);t.removeListener("error",m);t.removeListener("close",y)}}t.exports=eos},8720:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r)o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}));i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}var o=i(9349).q.ERR_INVALID_ARG_TYPE;function from(t,r,i){var a;if(r&&typeof r.next==="function"){a=r}else if(r&&r[Symbol.asyncIterator])a=r[Symbol.asyncIterator]();else if(r&&r[Symbol.iterator])a=r[Symbol.iterator]();else throw new o("iterable",["Iterable"],r);var l=new t(_objectSpread({objectMode:true},i));var c=false;l._read=function(){if(!c){c=true;next()}};function next(){return _next2.apply(this,arguments)}function _next2(){_next2=_asyncToGenerator((function*(){try{var t=yield a.next(),r=t.value,i=t.done;if(i){l.push(null)}else if(l.push(yield r)){next()}else{c=false}}catch(t){l.destroy(t)}}));return _next2.apply(this,arguments)}return l}t.exports=from},1522:(t,r,i)=>{"use strict";var o;function once(t){var r=false;return function(){if(r)return;r=true;t.apply(void 0,arguments)}}var a=i(9349).q,l=a.ERR_MISSING_ARGS,c=a.ERR_STREAM_DESTROYED;function noop(t){if(t)throw t}function isRequest(t){return t.setHeader&&typeof t.abort==="function"}function destroyer(t,r,a,l){l=once(l);var u=false;t.on("close",(function(){u=true}));if(o===undefined)o=i(6007);o(t,{readable:r,writable:a},(function(t){if(t)return l(t);u=true;l()}));var h=false;return function(r){if(u)return;if(h)return;h=true;if(isRequest(t))return t.abort();if(typeof t.destroy==="function")return t.destroy();l(r||new c("pipe"))}}function call(t){t()}function pipe(t,r){return t.pipe(r)}function popCallback(t){if(!t.length)return noop;if(typeof t[t.length-1]!=="function")return noop;return t.pop()}function pipeline(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++){r[i]=arguments[i]}var o=popCallback(r);if(Array.isArray(r[0]))r=r[0];if(r.length<2){throw new l("streams")}var a;var c=r.map((function(t,i){var l=i<r.length-1;var u=i>0;return destroyer(t,l,u,(function(t){if(!a)a=t;if(t)c.forEach(call);if(l)return;c.forEach(call);o(a)}))}));return r.reduce(pipe)}t.exports=pipeline},483:(t,r,i)=>{"use strict";var o=i(9349).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(t,r,i){return t.highWaterMark!=null?t.highWaterMark:r?t[i]:null}function getHighWaterMark(t,r,i,a){var l=highWaterMarkFrom(r,a,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var c=a?i:"highWaterMark";throw new o(c,l)}return Math.floor(l)}return t.objectMode?16:16*1024}t.exports={getHighWaterMark:getHighWaterMark}},1455:(t,r,i)=>{t.exports=i(2781)},4381:(t,r,i)=>{var o=i(2781);if(process.env.READABLE_STREAM==="disable"&&o){t.exports=o.Readable;Object.assign(t.exports,o);t.exports.Stream=o}else{r=t.exports=i(4787);r.Stream=o||r;r.Readable=r;r.Writable=i(7513);r.Duplex=i(3289);r.Transform=i(6551);r.PassThrough=i(4788);r.finished=i(6007);r.pipeline=i(1522)}},9619:(t,r,i)=>{t.exports=readdirGlob;const o=i(7147);const{EventEmitter:a}=i(2361);const{Minimatch:l}=i(5909);const{resolve:c}=i(1017);function readdir(t,r){return new Promise(((i,a)=>{o.readdir(t,{withFileTypes:true},((t,o)=>{if(t){switch(t.code){case"ENOTDIR":if(r){a(t)}else{i([])}break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":i([]);break;case"ELOOP":default:a(t);break}}else{i(o)}}))}))}function stat(t,r){return new Promise(((i,a)=>{const l=r?o.stat:o.lstat;l(t,((o,a)=>{if(o){switch(o.code){case"ENOENT":if(r){i(stat(t,false))}else{i(null)}break;default:i(null);break}}else{i(a)}}))}))}async function*exploreWalkAsync(t,r,i,o,a,l){let c=await readdir(r+t,l);for(const l of c){let c=l.name;if(c===undefined){c=l;o=true}const u=t+"/"+c;const h=u.slice(1);const d=r+"/"+h;let p=null;if(o||i){p=await stat(d,i)}if(!p&&l.name!==undefined){p=l}if(p===null){p={isDirectory:()=>false}}if(p.isDirectory()){if(!a(h)){yield{relative:h,absolute:d,stats:p};yield*exploreWalkAsync(u,r,i,o,a,false)}}else{yield{relative:h,absolute:d,stats:p}}}}async function*explore(t,r,i,o){yield*exploreWalkAsync("",t,r,i,o,true)}function readOptions(t){return{pattern:t.pattern,dot:!!t.dot,noglobstar:!!t.noglobstar,matchBase:!!t.matchBase,nocase:!!t.nocase,ignore:t.ignore,skip:t.skip,follow:!!t.follow,stat:!!t.stat,nodir:!!t.nodir,mark:!!t.mark,silent:!!t.silent,absolute:!!t.absolute}}class ReaddirGlob extends a{constructor(t,r,i){super();if(typeof r==="function"){i=r;r=null}this.options=readOptions(r||{});this.matchers=[];if(this.options.pattern){const t=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=t.map((t=>new l(t,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase})))}this.ignoreMatchers=[];if(this.options.ignore){const t=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=t.map((t=>new l(t,{dot:true})))}this.skipMatchers=[];if(this.options.skip){const t=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=t.map((t=>new l(t,{dot:true})))}this.iterator=explore(c(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this));this.paused=false;this.inactive=false;this.aborted=false;if(i){this._matches=[];this.on("match",(t=>this._matches.push(this.options.absolute?t.absolute:t.relative)));this.on("error",(t=>i(t)));this.on("end",(()=>i(null,this._matches)))}setTimeout((()=>this._next()),0)}_shouldSkipDirectory(t){return this.skipMatchers.some((r=>r.match(t)))}_fileMatches(t,r){const i=t+(r?"/":"");return(this.matchers.length===0||this.matchers.some((t=>t.match(i))))&&!this.ignoreMatchers.some((t=>t.match(i)))&&(!this.options.nodir||!r)}_next(){if(!this.paused&&!this.aborted){this.iterator.next().then((t=>{if(!t.done){const r=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,r)){let i=t.value.relative;let o=t.value.absolute;if(this.options.mark&&r){i+="/";o+="/"}if(this.options.stat){this.emit("match",{relative:i,absolute:o,stat:t.value.stats})}else{this.emit("match",{relative:i,absolute:o})}}this._next(this.iterator)}else{this.emit("end")}})).catch((t=>{this.abort();this.emit("error",t);if(!t.code&&!this.options.silent){console.error(t)}}))}else{this.inactive=true}}abort(){this.aborted=true}pause(){this.paused=true}resume(){this.paused=false;if(this.inactive){this.inactive=false;this._next()}}}function readdirGlob(t,r,i){return new ReaddirGlob(t,r,i)}readdirGlob.ReaddirGlob=ReaddirGlob},2031:(t,r,i)=>{const o=i(1420).Buffer;function decodeBase64(t){return o.from(t,"base64").toString("utf8")}function encodeBase64(t){return o.from(t,"utf8").toString("base64")}t.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},6705:(t,r,i)=>{var o=i(7310);var a=i(2031);var l=a.decodeBase64;var c=a.encodeBase64;var u=":_authToken";var h=":username";var d=":_password";t.exports=function(){var t;var r;if(arguments.length>=2){t=arguments[0];r=arguments[1]}else if(typeof arguments[0]==="string"){t=arguments[0]}else{r=arguments[0]}r=r||{};r.npmrc=r.npmrc||i(1898)("npm",{registry:"https://registry.npmjs.org/"});t=t||r.npmrc.registry;return getRegistryAuthInfo(t,r)||getLegacyAuthInfo(r.npmrc)};function getRegistryAuthInfo(t,r){var i=o.parse(t,false,true);var a;while(a!=="/"&&i.pathname!==a){a=i.pathname||"/";var l="//"+i.host+a.replace(/\/$/,"");var c=getAuthInfoForUrl(l,r.npmrc);if(c){return c}if(!r.recursive){return/\/$/.test(t)?undefined:getRegistryAuthInfo(o.resolve(t,"."),r)}i.pathname=o.resolve(normalizePath(a),"..")||"/"}return undefined}function getLegacyAuthInfo(t){if(t._auth){return{token:t._auth,type:"Basic"}}return undefined}function normalizePath(t){return t[t.length-1]==="/"?t:t+"/"}function getAuthInfoForUrl(t,r){var i=getBearerToken(r[t+u]||r[t+"/"+u]);if(i){return i}var o=r[t+h]||r[t+"/"+h];var a=r[t+d]||r[t+"/"+d];var l=getTokenForUsernameAndPassword(o,a);if(l){return l}return undefined}function getBearerToken(t){if(!t){return undefined}var r=t.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]}));return{token:r,type:"Bearer"}}function getTokenForUsernameAndPassword(t,r){if(!t||!r){return undefined}var i=l(r.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]})));var o=c(t+":"+i);return{token:o,type:"Basic",password:i,username:t}}},3389:(t,r,i)=>{"use strict";t.exports=function(t){var r=i(1898)("npm",{registry:"https://registry.npmjs.org/"});var o=r[t+":registry"]||r.registry;return o.slice(-1)==="/"?o:o+"/"}},3374:(t,r,i)=>{"use strict";const o=i(4404);t.exports=(t={},r=o.connect)=>new Promise(((i,o)=>{let a=false;let l;const callback=async()=>{await c;l.off("timeout",onTimeout);l.off("error",o);if(t.resolveSocket){i({alpnProtocol:l.alpnProtocol,socket:l,timeout:a});if(a){await Promise.resolve();l.emit("timeout")}}else{l.destroy();i({alpnProtocol:l.alpnProtocol,timeout:a})}};const onTimeout=async()=>{a=true;callback()};const c=(async()=>{try{l=await r(t,callback);l.on("error",o);l.once("timeout",onTimeout)}catch(t){o(t)}})()}))},3165:(t,r,i)=>{"use strict";const o=i(2781).Readable;const a=i(6822);class Response extends o{constructor(t,r,i,o){if(typeof t!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof r!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(i instanceof Buffer)){throw new TypeError("Argument `body` should be a buffer")}if(typeof o!=="string"){throw new TypeError("Argument `url` should be a string")}super();this.statusCode=t;this.headers=a(r);this.body=i;this.url=o}_read(){this.push(this.body);this.push(null)}}t.exports=Response},2998:(t,r,i)=>{t.exports=i(8609)},8609:(t,r,i)=>{var o=i(6924);r.operation=function(t){var i=r.timeouts(t);return new o(i,{forever:t&&(t.forever||t.retries===Infinity),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};r.timeouts=function(t){if(t instanceof Array){return[].concat(t)}var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var i in t){r[i]=t[i]}if(r.minTimeout>r.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var o=[];for(var a=0;a<r.retries;a++){o.push(this.createTimeout(a,r))}if(t&&t.forever&&!o.length){o.push(this.createTimeout(a,r))}o.sort((function(t,r){return t-r}));return o};r.createTimeout=function(t,r){var i=r.randomize?Math.random()+1:1;var o=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));o=Math.min(o,r.maxTimeout);return o};r.wrap=function(t,i,o){if(i instanceof Array){o=i;i=null}if(!o){o=[];for(var a in t){if(typeof t[a]==="function"){o.push(a)}}}for(var l=0;l<o.length;l++){var c=o[l];var u=t[c];t[c]=function retryWrapper(o){var a=r.operation(i);var l=Array.prototype.slice.call(arguments,1);var c=l.pop();l.push((function(t){if(a.retry(t)){return}if(t){arguments[0]=a.mainError()}c.apply(this,arguments)}));a.attempt((function(){o.apply(t,l)}))}.bind(t,u);t[c].options=i}}},6924:t=>{function RetryOperation(t,r){if(typeof r==="boolean"){r={forever:r}}this._originalTimeouts=JSON.parse(JSON.stringify(t));this._timeouts=t;this._options=r||{};this._maxRetryTime=r&&r.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;this._timer=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}t.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}if(this._timer){clearTimeout(this._timer)}this._timeouts=[];this._cachedTimeouts=null};RetryOperation.prototype.retry=function(t){if(this._timeout){clearTimeout(this._timeout)}if(!t){return false}var r=(new Date).getTime();if(t&&r-this._operationStart>=this._maxRetryTime){this._errors.push(t);this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(t);var i=this._timeouts.shift();if(i===undefined){if(this._cachedTimeouts){this._errors.splice(0,this._errors.length-1);i=this._cachedTimeouts.slice(-1)}else{return false}}var o=this;this._timer=setTimeout((function(){o._attempts++;if(o._operationTimeoutCb){o._timeout=setTimeout((function(){o._operationTimeoutCb(o._attempts)}),o._operationTimeout);if(o._options.unref){o._timeout.unref()}}o._fn(o._attempts)}),i);if(this._options.unref){this._timer.unref()}return true};RetryOperation.prototype.attempt=function(t,r){this._fn=t;if(r){if(r.timeout){this._operationTimeout=r.timeout}if(r.cb){this._operationTimeoutCb=r.cb}}var i=this;if(this._operationTimeoutCb){this._timeout=setTimeout((function(){i._operationTimeoutCb()}),i._operationTimeout)}this._operationStart=(new Date).getTime();this._fn(this._attempts)};RetryOperation.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated");this.attempt(t)};RetryOperation.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated");this.attempt(t)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0){return null}var t={};var r=null;var i=0;for(var o=0;o<this._errors.length;o++){var a=this._errors[o];var l=a.message;var c=(t[l]||0)+1;t[l]=c;if(c>=i){r=a;i=c}}return r}},8509:t=>{"use strict";function reusify(t){var r=new t;var i=r;function get(){var o=r;if(o.next){r=o.next}else{r=new t;i=r}o.next=null;return o}function release(t){i.next=t;i=t}return{get:get,release:release}}t.exports=reusify},93:(t,r,i)=>{const o=i(9491);const a=i(1017);const l=i(7147);let c=undefined;try{c=i(5895)}catch(t){}const u={nosort:true,silent:true};let h=0;const d=process.platform==="win32";const defaults=t=>{const r=["unlink","chmod","stat","lstat","rmdir","readdir"];r.forEach((r=>{t[r]=t[r]||l[r];r=r+"Sync";t[r]=t[r]||l[r]}));t.maxBusyTries=t.maxBusyTries||3;t.emfileWait=t.emfileWait||1e3;if(t.glob===false){t.disableGlob=true}if(t.disableGlob!==true&&c===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}t.disableGlob=t.disableGlob||false;t.glob=t.glob||u};const rimraf=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o.equal(typeof i,"function","rimraf: callback function required");o(r,"rimraf: invalid options argument provided");o.equal(typeof r,"object","rimraf: options should be object");defaults(r);let a=0;let l=null;let u=0;const next=t=>{l=l||t;if(--u===0)i(l)};const afterGlob=(t,o)=>{if(t)return i(t);u=o.length;if(u===0)return i();o.forEach((t=>{const CB=i=>{if(i){if((i.code==="EBUSY"||i.code==="ENOTEMPTY"||i.code==="EPERM")&&a<r.maxBusyTries){a++;return setTimeout((()=>rimraf_(t,r,CB)),a*100)}if(i.code==="EMFILE"&&h<r.emfileWait){return setTimeout((()=>rimraf_(t,r,CB)),h++)}if(i.code==="ENOENT")i=null}h=0;next(i)};rimraf_(t,r,CB)}))};if(r.disableGlob||!c.hasMagic(t))return afterGlob(null,[t]);r.lstat(t,((i,o)=>{if(!i)return afterGlob(null,[t]);c(t,r.glob,afterGlob)}))};const rimraf_=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.lstat(t,((o,a)=>{if(o&&o.code==="ENOENT")return i(null);if(o&&o.code==="EPERM"&&d)fixWinEPERM(t,r,o,i);if(a&&a.isDirectory())return rmdir(t,r,o,i);r.unlink(t,(o=>{if(o){if(o.code==="ENOENT")return i(null);if(o.code==="EPERM")return d?fixWinEPERM(t,r,o,i):rmdir(t,r,o,i);if(o.code==="EISDIR")return rmdir(t,r,o,i)}return i(o)}))}))};const fixWinEPERM=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.chmod(t,438,(o=>{if(o)a(o.code==="ENOENT"?null:i);else r.stat(t,((o,l)=>{if(o)a(o.code==="ENOENT"?null:i);else if(l.isDirectory())rmdir(t,r,i,a);else r.unlink(t,a)}))}))};const fixWinEPERMSync=(t,r,i)=>{o(t);o(r);try{r.chmodSync(t,438)}catch(t){if(t.code==="ENOENT")return;else throw i}let a;try{a=r.statSync(t)}catch(t){if(t.code==="ENOENT")return;else throw i}if(a.isDirectory())rmdirSync(t,r,i);else r.unlinkSync(t)};const rmdir=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.rmdir(t,(o=>{if(o&&(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM"))rmkids(t,r,a);else if(o&&o.code==="ENOTDIR")a(i);else a(o)}))};const rmkids=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.readdir(t,((o,l)=>{if(o)return i(o);let c=l.length;if(c===0)return r.rmdir(t,i);let u;l.forEach((o=>{rimraf(a.join(t,o),r,(o=>{if(u)return;if(o)return i(u=o);if(--c===0)r.rmdir(t,i)}))}))}))};const rimrafSync=(t,r)=>{r=r||{};defaults(r);o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o(r,"rimraf: missing options");o.equal(typeof r,"object","rimraf: options should be object");let i;if(r.disableGlob||!c.hasMagic(t)){i=[t]}else{try{r.lstatSync(t);i=[t]}catch(o){i=c.sync(t,r.glob)}}if(!i.length)return;for(let t=0;t<i.length;t++){const o=i[t];let a;try{a=r.lstatSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM"&&d)fixWinEPERMSync(o,r,t)}try{if(a&&a.isDirectory())rmdirSync(o,r,null);else r.unlinkSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM")return d?fixWinEPERMSync(o,r,t):rmdirSync(o,r,t);if(t.code!=="EISDIR")throw t;rmdirSync(o,r,t)}}};const rmdirSync=(t,r,i)=>{o(t);o(r);try{r.rmdirSync(t)}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR")throw i;if(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM")rmkidsSync(t,r)}};const rmkidsSync=(t,r)=>{o(t);o(r);r.readdirSync(t).forEach((i=>rimrafSync(a.join(t,i),r)));const i=d?100:1;let l=0;do{let o=true;try{const a=r.rmdirSync(t,r);o=false;return a}finally{if(++l<i&&o)continue}}while(true)};t.exports=rimraf;rimraf.sync=rimrafSync},9661:(t,r,i)=>{
|
|
57
114
|
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
58
|
-
t.exports=runParallel;const o=i(
|
|
115
|
+
t.exports=runParallel;const o=i(5475);function runParallel(t,r){let i,a,l;let c=true;if(Array.isArray(t)){i=[];a=t.length}else{l=Object.keys(t);i={};a=l.length}function done(t){function end(){if(r)r(t,i);r=null}if(c)o(end);else end()}function each(t,r,o){i[t]=o;if(--a===0||r){done(r)}}if(!a){done(null)}else if(l){l.forEach((function(r){t[r]((function(t,i){each(r,t,i)}))}))}else{t.forEach((function(t,r){t((function(t,i){each(r,t,i)}))}))}c=false}},7455:(t,r,i)=>{var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){t.exports=o}else{copyProps(o,r);r.Buffer=SafeBuffer}function SafeBuffer(t,r,i){return a(t,r,i)}copyProps(a,SafeBuffer);SafeBuffer.from=function(t,r,i){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return a(t,r,i)};SafeBuffer.alloc=function(t,r,i){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var o=a(t);if(r!==undefined){if(typeof i==="string"){o.fill(r,i)}else{o.fill(r)}}else{o.fill(0)}return o};SafeBuffer.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return a(t)};SafeBuffer.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return o.SlowBuffer(t)}},1420:(t,r,i)=>{
|
|
59
116
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
60
|
-
var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){t.exports=o}else{copyProps(o,r);r.Buffer=SafeBuffer}function SafeBuffer(t,r,i){return a(t,r,i)}SafeBuffer.prototype=Object.create(a.prototype);copyProps(a,SafeBuffer);SafeBuffer.from=function(t,r,i){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return a(t,r,i)};SafeBuffer.alloc=function(t,r,i){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var o=a(t);if(r!==undefined){if(typeof i==="string"){o.fill(r,i)}else{o.fill(r)}}else{o.fill(0)}return o};SafeBuffer.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return a(t)};SafeBuffer.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return o.SlowBuffer(t)}},8999:(t,r)=>{r=t.exports=SemVer;var i;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){i=function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER");console.log.apply(console,t)}}else{i=function(){}}r.SEMVER_SPEC_VERSION="2.0.0";var o=256;var a=Number.MAX_SAFE_INTEGER||9007199254740991;var c=16;var l=r.re=[];var u=r.src=[];var h=r.tokens={};var d=0;function tok(t){h[t]=d++}tok("NUMERICIDENTIFIER");u[h.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");u[h.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");u[h.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");u[h.MAINVERSION]="("+u[h.NUMERICIDENTIFIER]+")\\."+"("+u[h.NUMERICIDENTIFIER]+")\\."+"("+u[h.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");u[h.MAINVERSIONLOOSE]="("+u[h.NUMERICIDENTIFIERLOOSE]+")\\."+"("+u[h.NUMERICIDENTIFIERLOOSE]+")\\."+"("+u[h.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");u[h.PRERELEASEIDENTIFIER]="(?:"+u[h.NUMERICIDENTIFIER]+"|"+u[h.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");u[h.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[h.NUMERICIDENTIFIERLOOSE]+"|"+u[h.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");u[h.PRERELEASE]="(?:-("+u[h.PRERELEASEIDENTIFIER]+"(?:\\."+u[h.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");u[h.PRERELEASELOOSE]="(?:-?("+u[h.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[h.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");u[h.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");u[h.BUILD]="(?:\\+("+u[h.BUILDIDENTIFIER]+"(?:\\."+u[h.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");u[h.FULLPLAIN]="v?"+u[h.MAINVERSION]+u[h.PRERELEASE]+"?"+u[h.BUILD]+"?";u[h.FULL]="^"+u[h.FULLPLAIN]+"$";tok("LOOSEPLAIN");u[h.LOOSEPLAIN]="[v=\\s]*"+u[h.MAINVERSIONLOOSE]+u[h.PRERELEASELOOSE]+"?"+u[h.BUILD]+"?";tok("LOOSE");u[h.LOOSE]="^"+u[h.LOOSEPLAIN]+"$";tok("GTLT");u[h.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");u[h.XRANGEIDENTIFIERLOOSE]=u[h.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");u[h.XRANGEIDENTIFIER]=u[h.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");u[h.XRANGEPLAIN]="[v=\\s]*("+u[h.XRANGEIDENTIFIER]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIER]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIER]+")"+"(?:"+u[h.PRERELEASE]+")?"+u[h.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");u[h.XRANGEPLAINLOOSE]="[v=\\s]*("+u[h.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+u[h.PRERELEASELOOSE]+")?"+u[h.BUILD]+"?"+")?)?";tok("XRANGE");u[h.XRANGE]="^"+u[h.GTLT]+"\\s*"+u[h.XRANGEPLAIN]+"$";tok("XRANGELOOSE");u[h.XRANGELOOSE]="^"+u[h.GTLT]+"\\s*"+u[h.XRANGEPLAINLOOSE]+"$";tok("COERCE");u[h.COERCE]="(^|[^\\d])"+"(\\d{1,"+c+"})"+"(?:\\.(\\d{1,"+c+"}))?"+"(?:\\.(\\d{1,"+c+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");l[h.COERCERTL]=new RegExp(u[h.COERCE],"g");tok("LONETILDE");u[h.LONETILDE]="(?:~>?)";tok("TILDETRIM");u[h.TILDETRIM]="(\\s*)"+u[h.LONETILDE]+"\\s+";l[h.TILDETRIM]=new RegExp(u[h.TILDETRIM],"g");var p="$1~";tok("TILDE");u[h.TILDE]="^"+u[h.LONETILDE]+u[h.XRANGEPLAIN]+"$";tok("TILDELOOSE");u[h.TILDELOOSE]="^"+u[h.LONETILDE]+u[h.XRANGEPLAINLOOSE]+"$";tok("LONECARET");u[h.LONECARET]="(?:\\^)";tok("CARETTRIM");u[h.CARETTRIM]="(\\s*)"+u[h.LONECARET]+"\\s+";l[h.CARETTRIM]=new RegExp(u[h.CARETTRIM],"g");var m="$1^";tok("CARET");u[h.CARET]="^"+u[h.LONECARET]+u[h.XRANGEPLAIN]+"$";tok("CARETLOOSE");u[h.CARETLOOSE]="^"+u[h.LONECARET]+u[h.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");u[h.COMPARATORLOOSE]="^"+u[h.GTLT]+"\\s*("+u[h.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");u[h.COMPARATOR]="^"+u[h.GTLT]+"\\s*("+u[h.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");u[h.COMPARATORTRIM]="(\\s*)"+u[h.GTLT]+"\\s*("+u[h.LOOSEPLAIN]+"|"+u[h.XRANGEPLAIN]+")";l[h.COMPARATORTRIM]=new RegExp(u[h.COMPARATORTRIM],"g");var g="$1$2$3";tok("HYPHENRANGE");u[h.HYPHENRANGE]="^\\s*("+u[h.XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+u[h.XRANGEPLAIN]+")"+"\\s*$";tok("HYPHENRANGELOOSE");u[h.HYPHENRANGELOOSE]="^\\s*("+u[h.XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+u[h.XRANGEPLAINLOOSE]+")"+"\\s*$";tok("STAR");u[h.STAR]="(<|>)?=?\\s*\\*";for(var y=0;y<d;y++){i(y,u[y]);if(!l[y]){l[y]=new RegExp(u[y])}}r.parse=parse;function parse(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof SemVer){return t}if(typeof t!=="string"){return null}if(t.length>o){return null}var i=r.loose?l[h.LOOSE]:l[h.FULL];if(!i.test(t)){return null}try{return new SemVer(t,r)}catch(t){return null}}r.valid=valid;function valid(t,r){var i=parse(t,r);return i?i.version:null}r.clean=clean;function clean(t,r){var i=parse(t.trim().replace(/^[=v]+/,""),r);return i?i.version:null}r.SemVer=SemVer;function SemVer(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof SemVer){if(t.loose===r.loose){return t}else{t=t.version}}else if(typeof t!=="string"){throw new TypeError("Invalid Version: "+t)}if(t.length>o){throw new TypeError("version is longer than "+o+" characters")}if(!(this instanceof SemVer)){return new SemVer(t,r)}i("SemVer",t,r);this.options=r;this.loose=!!r.loose;var c=t.trim().match(r.loose?l[h.LOOSE]:l[h.FULL]);if(!c){throw new TypeError("Invalid Version: "+t)}this.raw=t;this.major=+c[1];this.minor=+c[2];this.patch=+c[3];if(this.major>a||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>a||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>a||this.patch<0){throw new TypeError("Invalid patch version")}if(!c[4]){this.prerelease=[]}else{this.prerelease=c[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var r=+t;if(r>=0&&r<a){return r}}return t}))}this.build=c[5]?c[5].split("."):[];this.format()}SemVer.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length){this.version+="-"+this.prerelease.join(".")}return this.version};SemVer.prototype.toString=function(){return this.version};SemVer.prototype.compare=function(t){i("SemVer.compare",this.version,this.options,t);if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}return this.compareMain(t)||this.comparePre(t)};SemVer.prototype.compareMain=function(t){if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}return compareIdentifiers(this.major,t.major)||compareIdentifiers(this.minor,t.minor)||compareIdentifiers(this.patch,t.patch)};SemVer.prototype.comparePre=function(t){if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}if(this.prerelease.length&&!t.prerelease.length){return-1}else if(!this.prerelease.length&&t.prerelease.length){return 1}else if(!this.prerelease.length&&!t.prerelease.length){return 0}var r=0;do{var o=this.prerelease[r];var a=t.prerelease[r];i("prerelease compare",r,o,a);if(o===undefined&&a===undefined){return 0}else if(a===undefined){return 1}else if(o===undefined){return-1}else if(o===a){continue}else{return compareIdentifiers(o,a)}}while(++r)};SemVer.prototype.compareBuild=function(t){if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}var r=0;do{var o=this.build[r];var a=t.build[r];i("prerelease compare",r,o,a);if(o===undefined&&a===undefined){return 0}else if(a===undefined){return 1}else if(o===undefined){return-1}else if(o===a){continue}else{return compareIdentifiers(o,a)}}while(++r)};SemVer.prototype.inc=function(t,r){switch(t){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0){this.inc("patch",r)}this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0){this.major++}this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0){this.minor++}this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0){this.patch++}this.prerelease=[];break;case"pre":if(this.prerelease.length===0){this.prerelease=[0]}else{var i=this.prerelease.length;while(--i>=0){if(typeof this.prerelease[i]==="number"){this.prerelease[i]++;i=-2}}if(i===-1){this.prerelease.push(0)}}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1])){this.prerelease=[r,0]}}else{this.prerelease=[r,0]}}break;default:throw new Error("invalid increment argument: "+t)}this.format();this.raw=this.version;return this};r.inc=inc;function inc(t,r,i,o){if(typeof i==="string"){o=i;i=undefined}try{return new SemVer(t,i).inc(r,o).version}catch(t){return null}}r.diff=diff;function diff(t,r){if(eq(t,r)){return null}else{var i=parse(t);var o=parse(r);var a="";if(i.prerelease.length||o.prerelease.length){a="pre";var c="prerelease"}for(var l in i){if(l==="major"||l==="minor"||l==="patch"){if(i[l]!==o[l]){return a+l}}}return c}}r.compareIdentifiers=compareIdentifiers;var b=/^[0-9]+$/;function compareIdentifiers(t,r){var i=b.test(t);var o=b.test(r);if(i&&o){t=+t;r=+r}return t===r?0:i&&!o?-1:o&&!i?1:t<r?-1:1}r.rcompareIdentifiers=rcompareIdentifiers;function rcompareIdentifiers(t,r){return compareIdentifiers(r,t)}r.major=major;function major(t,r){return new SemVer(t,r).major}r.minor=minor;function minor(t,r){return new SemVer(t,r).minor}r.patch=patch;function patch(t,r){return new SemVer(t,r).patch}r.compare=compare;function compare(t,r,i){return new SemVer(t,i).compare(new SemVer(r,i))}r.compareLoose=compareLoose;function compareLoose(t,r){return compare(t,r,true)}r.compareBuild=compareBuild;function compareBuild(t,r,i){var o=new SemVer(t,i);var a=new SemVer(r,i);return o.compare(a)||o.compareBuild(a)}r.rcompare=rcompare;function rcompare(t,r,i){return compare(r,t,i)}r.sort=sort;function sort(t,i){return t.sort((function(t,o){return r.compareBuild(t,o,i)}))}r.rsort=rsort;function rsort(t,i){return t.sort((function(t,o){return r.compareBuild(o,t,i)}))}r.gt=gt;function gt(t,r,i){return compare(t,r,i)>0}r.lt=lt;function lt(t,r,i){return compare(t,r,i)<0}r.eq=eq;function eq(t,r,i){return compare(t,r,i)===0}r.neq=neq;function neq(t,r,i){return compare(t,r,i)!==0}r.gte=gte;function gte(t,r,i){return compare(t,r,i)>=0}r.lte=lte;function lte(t,r,i){return compare(t,r,i)<=0}r.cmp=cmp;function cmp(t,r,i,o){switch(r){case"===":if(typeof t==="object")t=t.version;if(typeof i==="object")i=i.version;return t===i;case"!==":if(typeof t==="object")t=t.version;if(typeof i==="object")i=i.version;return t!==i;case"":case"=":case"==":return eq(t,i,o);case"!=":return neq(t,i,o);case">":return gt(t,i,o);case">=":return gte(t,i,o);case"<":return lt(t,i,o);case"<=":return lte(t,i,o);default:throw new TypeError("Invalid operator: "+r)}}r.Comparator=Comparator;function Comparator(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof Comparator){if(t.loose===!!r.loose){return t}else{t=t.value}}if(!(this instanceof Comparator)){return new Comparator(t,r)}i("comparator",t,r);this.options=r;this.loose=!!r.loose;this.parse(t);if(this.semver===v){this.value=""}else{this.value=this.operator+this.semver.version}i("comp",this)}var v={};Comparator.prototype.parse=function(t){var r=this.options.loose?l[h.COMPARATORLOOSE]:l[h.COMPARATOR];var i=t.match(r);if(!i){throw new TypeError("Invalid comparator: "+t)}this.operator=i[1]!==undefined?i[1]:"";if(this.operator==="="){this.operator=""}if(!i[2]){this.semver=v}else{this.semver=new SemVer(i[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(t){i("Comparator.test",t,this.options.loose);if(this.semver===v||t===v){return true}if(typeof t==="string"){try{t=new SemVer(t,this.options)}catch(t){return false}}return cmp(t,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(t,r){if(!(t instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}var i;if(this.operator===""){if(this.value===""){return true}i=new Range(t.value,r);return satisfies(this.value,i,r)}else if(t.operator===""){if(t.value===""){return true}i=new Range(this.value,r);return satisfies(t.semver,i,r)}var o=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">");var a=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<");var c=this.semver.version===t.semver.version;var l=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<=");var u=cmp(this.semver,"<",t.semver,r)&&((this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"));var h=cmp(this.semver,">",t.semver,r)&&((this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">"));return o||a||c&&l||u||h};r.Range=Range;function Range(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof Range){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{return new Range(t.raw,r)}}if(t instanceof Comparator){return new Range(t.value,r)}if(!(this instanceof Range)){return new Range(t,r)}this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;this.raw=t;this.set=t.split(/\s*\|\|\s*/).map((function(t){return this.parseRange(t.trim())}),this).filter((function(t){return t.length}));if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+t)}this.format()}Range.prototype.format=function(){this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(t){var r=this.options.loose;t=t.trim();var o=r?l[h.HYPHENRANGELOOSE]:l[h.HYPHENRANGE];t=t.replace(o,hyphenReplace);i("hyphen replace",t);t=t.replace(l[h.COMPARATORTRIM],g);i("comparator trim",t,l[h.COMPARATORTRIM]);t=t.replace(l[h.TILDETRIM],p);t=t.replace(l[h.CARETTRIM],m);t=t.split(/\s+/).join(" ");var a=r?l[h.COMPARATORLOOSE]:l[h.COMPARATOR];var c=t.split(" ").map((function(t){return parseComparator(t,this.options)}),this).join(" ").split(/\s+/);if(this.options.loose){c=c.filter((function(t){return!!t.match(a)}))}c=c.map((function(t){return new Comparator(t,this.options)}),this);return c};Range.prototype.intersects=function(t,r){if(!(t instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((function(i){return isSatisfiable(i,r)&&t.set.some((function(t){return isSatisfiable(t,r)&&i.every((function(i){return t.every((function(t){return i.intersects(t,r)}))}))}))}))};function isSatisfiable(t,r){var i=true;var o=t.slice();var a=o.pop();while(i&&o.length){i=o.every((function(t){return a.intersects(t,r)}));a=o.pop()}return i}r.toComparators=toComparators;function toComparators(t,r){return new Range(t,r).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))}function parseComparator(t,r){i("comp",t,r);t=replaceCarets(t,r);i("caret",t);t=replaceTildes(t,r);i("tildes",t);t=replaceXRanges(t,r);i("xrange",t);t=replaceStars(t,r);i("stars",t);return t}function isX(t){return!t||t.toLowerCase()==="x"||t==="*"}function replaceTildes(t,r){return t.trim().split(/\s+/).map((function(t){return replaceTilde(t,r)})).join(" ")}function replaceTilde(t,r){var o=r.loose?l[h.TILDELOOSE]:l[h.TILDE];return t.replace(o,(function(r,o,a,c,l){i("tilde",t,r,o,a,c,l);var u;if(isX(o)){u=""}else if(isX(a)){u=">="+o+".0.0 <"+(+o+1)+".0.0"}else if(isX(c)){u=">="+o+"."+a+".0 <"+o+"."+(+a+1)+".0"}else if(l){i("replaceTilde pr",l);u=">="+o+"."+a+"."+c+"-"+l+" <"+o+"."+(+a+1)+".0"}else{u=">="+o+"."+a+"."+c+" <"+o+"."+(+a+1)+".0"}i("tilde return",u);return u}))}function replaceCarets(t,r){return t.trim().split(/\s+/).map((function(t){return replaceCaret(t,r)})).join(" ")}function replaceCaret(t,r){i("caret",t,r);var o=r.loose?l[h.CARETLOOSE]:l[h.CARET];return t.replace(o,(function(r,o,a,c,l){i("caret",t,r,o,a,c,l);var u;if(isX(o)){u=""}else if(isX(a)){u=">="+o+".0.0 <"+(+o+1)+".0.0"}else if(isX(c)){if(o==="0"){u=">="+o+"."+a+".0 <"+o+"."+(+a+1)+".0"}else{u=">="+o+"."+a+".0 <"+(+o+1)+".0.0"}}else if(l){i("replaceCaret pr",l);if(o==="0"){if(a==="0"){u=">="+o+"."+a+"."+c+"-"+l+" <"+o+"."+a+"."+(+c+1)}else{u=">="+o+"."+a+"."+c+"-"+l+" <"+o+"."+(+a+1)+".0"}}else{u=">="+o+"."+a+"."+c+"-"+l+" <"+(+o+1)+".0.0"}}else{i("no pr");if(o==="0"){if(a==="0"){u=">="+o+"."+a+"."+c+" <"+o+"."+a+"."+(+c+1)}else{u=">="+o+"."+a+"."+c+" <"+o+"."+(+a+1)+".0"}}else{u=">="+o+"."+a+"."+c+" <"+(+o+1)+".0.0"}}i("caret return",u);return u}))}function replaceXRanges(t,r){i("replaceXRanges",t,r);return t.split(/\s+/).map((function(t){return replaceXRange(t,r)})).join(" ")}function replaceXRange(t,r){t=t.trim();var o=r.loose?l[h.XRANGELOOSE]:l[h.XRANGE];return t.replace(o,(function(o,a,c,l,u,h){i("xRange",t,o,a,c,l,u,h);var d=isX(c);var p=d||isX(l);var m=p||isX(u);var g=m;if(a==="="&&g){a=""}h=r.includePrerelease?"-0":"";if(d){if(a===">"||a==="<"){o="<0.0.0-0"}else{o="*"}}else if(a&&g){if(p){l=0}u=0;if(a===">"){a=">=";if(p){c=+c+1;l=0;u=0}else{l=+l+1;u=0}}else if(a==="<="){a="<";if(p){c=+c+1}else{l=+l+1}}o=a+c+"."+l+"."+u+h}else if(p){o=">="+c+".0.0"+h+" <"+(+c+1)+".0.0"+h}else if(m){o=">="+c+"."+l+".0"+h+" <"+c+"."+(+l+1)+".0"+h}i("xRange return",o);return o}))}function replaceStars(t,r){i("replaceStars",t,r);return t.trim().replace(l[h.STAR],"")}function hyphenReplace(t,r,i,o,a,c,l,u,h,d,p,m,g){if(isX(i)){r=""}else if(isX(o)){r=">="+i+".0.0"}else if(isX(a)){r=">="+i+"."+o+".0"}else{r=">="+r}if(isX(h)){u=""}else if(isX(d)){u="<"+(+h+1)+".0.0"}else if(isX(p)){u="<"+h+"."+(+d+1)+".0"}else if(m){u="<="+h+"."+d+"."+p+"-"+m}else{u="<="+u}return(r+" "+u).trim()}Range.prototype.test=function(t){if(!t){return false}if(typeof t==="string"){try{t=new SemVer(t,this.options)}catch(t){return false}}for(var r=0;r<this.set.length;r++){if(testSet(this.set[r],t,this.options)){return true}}return false};function testSet(t,r,o){for(var a=0;a<t.length;a++){if(!t[a].test(r)){return false}}if(r.prerelease.length&&!o.includePrerelease){for(a=0;a<t.length;a++){i(t[a].semver);if(t[a].semver===v){continue}if(t[a].semver.prerelease.length>0){var c=t[a].semver;if(c.major===r.major&&c.minor===r.minor&&c.patch===r.patch){return true}}}return false}return true}r.satisfies=satisfies;function satisfies(t,r,i){try{r=new Range(r,i)}catch(t){return false}return r.test(t)}r.maxSatisfying=maxSatisfying;function maxSatisfying(t,r,i){var o=null;var a=null;try{var c=new Range(r,i)}catch(t){return null}t.forEach((function(t){if(c.test(t)){if(!o||a.compare(t)===-1){o=t;a=new SemVer(o,i)}}}));return o}r.minSatisfying=minSatisfying;function minSatisfying(t,r,i){var o=null;var a=null;try{var c=new Range(r,i)}catch(t){return null}t.forEach((function(t){if(c.test(t)){if(!o||a.compare(t)===1){o=t;a=new SemVer(o,i)}}}));return o}r.minVersion=minVersion;function minVersion(t,r){t=new Range(t,r);var i=new SemVer("0.0.0");if(t.test(i)){return i}i=new SemVer("0.0.0-0");if(t.test(i)){return i}i=null;for(var o=0;o<t.set.length;++o){var a=t.set[o];a.forEach((function(t){var r=new SemVer(t.semver.version);switch(t.operator){case">":if(r.prerelease.length===0){r.patch++}else{r.prerelease.push(0)}r.raw=r.format();case"":case">=":if(!i||gt(i,r)){i=r}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}}))}if(i&&t.test(i)){return i}return null}r.validRange=validRange;function validRange(t,r){try{return new Range(t,r).range||"*"}catch(t){return null}}r.ltr=ltr;function ltr(t,r,i){return outside(t,r,"<",i)}r.gtr=gtr;function gtr(t,r,i){return outside(t,r,">",i)}r.outside=outside;function outside(t,r,i,o){t=new SemVer(t,o);r=new Range(r,o);var a,c,l,u,h;switch(i){case">":a=gt;c=lte;l=lt;u=">";h=">=";break;case"<":a=lt;c=gte;l=gt;u="<";h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(t,r,o)){return false}for(var d=0;d<r.set.length;++d){var p=r.set[d];var m=null;var g=null;p.forEach((function(t){if(t.semver===v){t=new Comparator(">=0.0.0")}m=m||t;g=g||t;if(a(t.semver,m.semver,o)){m=t}else if(l(t.semver,g.semver,o)){g=t}}));if(m.operator===u||m.operator===h){return false}if((!g.operator||g.operator===u)&&c(t,g.semver)){return false}else if(g.operator===h&&l(t,g.semver)){return false}}return true}r.prerelease=prerelease;function prerelease(t,r){var i=parse(t,r);return i&&i.prerelease.length?i.prerelease:null}r.intersects=intersects;function intersects(t,r,i){t=new Range(t,i);r=new Range(r,i);return t.intersects(r)}r.coerce=coerce;function coerce(t,r){if(t instanceof SemVer){return t}if(typeof t==="number"){t=String(t)}if(typeof t!=="string"){return null}r=r||{};var i=null;if(!r.rtl){i=t.match(l[h.COERCE])}else{var o;while((o=l[h.COERCERTL].exec(t))&&(!i||i.index+i[0].length!==t.length)){if(!i||o.index+o[0].length!==i.index+i[0].length){i=o}l[h.COERCERTL].lastIndex=o.index+o[1].length+o[2].length}l[h.COERCERTL].lastIndex=-1}if(i===null){return null}return parse(i[2]+"."+(i[3]||"0")+"."+(i[4]||"0"),r)}},7256:(t,r,i)=>{"use strict";const o=i(9609);t.exports=(t="")=>{const r=t.match(o);if(!r){return null}const[i,a]=r[0].replace(/#! ?/,"").split(" ");const c=i.split("/").pop();if(c==="env"){return a}return a?`${c} ${a}`:c}},9609:t=>{"use strict";t.exports=/^#!(.*)/},9270:t=>{"use strict";const r="";const i=`${r}[`;const o="";const a={to(t,r){if(!r)return`${i}${t+1}G`;return`${i}${r+1};${t+1}H`},move(t,r){let o="";if(t<0)o+=`${i}${-t}D`;else if(t>0)o+=`${i}${t}C`;if(r<0)o+=`${i}${-r}A`;else if(r>0)o+=`${i}${r}B`;return o},up:(t=1)=>`${i}${t}A`,down:(t=1)=>`${i}${t}B`,forward:(t=1)=>`${i}${t}C`,backward:(t=1)=>`${i}${t}D`,nextLine:(t=1)=>`${i}E`.repeat(t),prevLine:(t=1)=>`${i}F`.repeat(t),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${r}7`,restore:`${r}8`};const c={up:(t=1)=>`${i}S`.repeat(t),down:(t=1)=>`${i}T`.repeat(t)};const l={screen:`${i}2J`,up:(t=1)=>`${i}1J`.repeat(t),down:(t=1)=>`${i}J`.repeat(t),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(t){let r="";for(let i=0;i<t;i++)r+=this.line+(i<t-1?a.up():"");if(t)r+=a.left;return r}};t.exports={cursor:a,scroll:c,erase:l,beep:o}},2006:t=>{"use strict";var r=1;var i=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(t,r,i){return t.slice(r,i).replace(/\S/g," ")}t.exports=function(t,o){o=o||{};var a;var c;var l=false;var u=false;var h=0;var d="";var p=o.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var m=0;m<t.length;m++){a=t[m];c=t[m+1];if(!u&&a==='"'){var g=t[m-1]==="\\"&&t[m-2]!=="\\";if(!g){l=!l}}if(l){continue}if(!u&&a+c==="//"){d+=t.slice(h,m);h=m;u=r;m++}else if(u===r&&a+c==="\r\n"){m++;u=false;d+=p(t,h,m);h=m;continue}else if(u===r&&a==="\n"){u=false;d+=p(t,h,m);h=m}else if(!u&&a+c==="/*"){d+=t.slice(h,m);h=m;u=i;m++;continue}else if(u===i&&a+c==="*/"){m++;u=false;d+=p(t,h,m+1);h=m+1;continue}}return d+(u?p(t.substr(h)):t.substr(h))}},1470:(t,r,i)=>{"use strict";r.c=r.create=i(6828);r.r=r.replace=i(2834);r.t=r.list=i(2874);r.u=r.update=i(9764);r.x=r.extract=i(4682);r.Pack=i(2428);r.Unpack=i(925);r.Parse=i(5514);r.ReadEntry=i(927);r.WriteEntry=i(3717);r.Header=i(6261);r.Pax=i(2315);r.types=i(7312)},6828:(t,r,i)=>{"use strict";const o=i(813);const a=i(2428);const c=i(8829);const l=i(2874);const u=i(1017);t.exports=(t,r,i)=>{if(typeof r==="function")i=r;if(Array.isArray(t))r=t,t={};if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");r=Array.from(r);const a=o(t);if(a.sync&&typeof i==="function")throw new TypeError("callback not supported for sync tar functions");if(!a.file&&typeof i==="function")throw new TypeError("callback only supported with file option");return a.file&&a.sync?createFileSync(a,r):a.file?createFile(a,r,i):a.sync?createSync(a,r):create(a,r)};const createFileSync=(t,r)=>{const i=new a.Sync(t);const o=new c.WriteStreamSync(t.file,{mode:t.mode||438});i.pipe(o);addFilesSync(i,r)};const createFile=(t,r,i)=>{const o=new a(t);const l=new c.WriteStream(t.file,{mode:t.mode||438});o.pipe(l);const u=new Promise(((t,r)=>{l.on("error",r);l.on("close",t);o.on("error",r)}));addFilesAsync(o,r);return i?u.then(i,i):u};const addFilesSync=(t,r)=>{r.forEach((r=>{if(r.charAt(0)==="@"){l({file:u.resolve(t.cwd,r.substr(1)),sync:true,noResume:true,onentry:r=>t.add(r)})}else t.add(r)}));t.end()};const addFilesAsync=(t,r)=>{while(r.length){const i=r.shift();if(i.charAt(0)==="@"){return l({file:u.resolve(t.cwd,i.substr(1)),noResume:true,onentry:r=>t.add(r)}).then((i=>addFilesAsync(t,r)))}else t.add(i)}t.end()};const createSync=(t,r)=>{const i=new a.Sync(t);addFilesSync(i,r);return i};const create=(t,r)=>{const i=new a(t);addFilesAsync(i,r);return i}},4682:(t,r,i)=>{"use strict";const o=i(813);const a=i(925);const c=i(7147);const l=i(8829);const u=i(1017);const h=i(5919);t.exports=(t,r,i)=>{if(typeof t==="function")i=t,r=null,t={};else if(Array.isArray(t))r=t,t={};if(typeof r==="function")i=r,r=null;if(!r)r=[];else r=Array.from(r);const a=o(t);if(a.sync&&typeof i==="function")throw new TypeError("callback not supported for sync tar functions");if(!a.file&&typeof i==="function")throw new TypeError("callback only supported with file option");if(r.length)filesFilter(a,r);return a.file&&a.sync?extractFileSync(a):a.file?extractFile(a,i):a.sync?extractSync(a):extract(a)};const filesFilter=(t,r)=>{const i=new Map(r.map((t=>[h(t),true])));const o=t.filter;const mapHas=(t,r)=>{const o=r||u.parse(t).root||".";const a=t===o?false:i.has(t)?i.get(t):mapHas(u.dirname(t),o);i.set(t,a);return a};t.filter=o?(t,r)=>o(t,r)&&mapHas(h(t)):t=>mapHas(h(t))};const extractFileSync=t=>{const r=new a.Sync(t);const i=t.file;const o=c.statSync(i);const u=t.maxReadSize||16*1024*1024;const h=new l.ReadStreamSync(i,{readSize:u,size:o.size});h.pipe(r)};const extractFile=(t,r)=>{const i=new a(t);const o=t.maxReadSize||16*1024*1024;const u=t.file;const h=new Promise(((t,r)=>{i.on("error",r);i.on("close",t);c.stat(u,((t,a)=>{if(t)r(t);else{const t=new l.ReadStream(u,{readSize:o,size:a.size});t.on("error",r);t.pipe(i)}}))}));return r?h.then(r,r):h};const extractSync=t=>new a.Sync(t);const extract=t=>new a(t)},8166:(t,r,i)=>{const o=process.env.__FAKE_PLATFORM__||process.platform;const a=o==="win32";const c=global.__FAKE_TESTING_FS__||i(7147);const{O_CREAT:l,O_TRUNC:u,O_WRONLY:h,UV_FS_O_FILEMAP:d=0}=c.constants;const p=a&&!!d;const m=512*1024;const g=d|u|l|h;t.exports=!p?()=>"w":t=>t<m?g:"w"},6261:(t,r,i)=>{"use strict";const o=i(7312);const a=i(1017).posix;const c=i(1697);const l=Symbol("slurp");const u=Symbol("type");class Header{constructor(t,r,i,o){this.cksumValid=false;this.needPax=false;this.nullBlock=false;this.block=null;this.path=null;this.mode=null;this.uid=null;this.gid=null;this.size=null;this.mtime=null;this.cksum=null;this[u]="0";this.linkpath=null;this.uname=null;this.gname=null;this.devmaj=0;this.devmin=0;this.atime=null;this.ctime=null;if(Buffer.isBuffer(t))this.decode(t,r||0,i,o);else if(t)this.set(t)}decode(t,r,i,o){if(!r)r=0;if(!t||!(t.length>=r+512))throw new Error("need 512 bytes for header");this.path=decString(t,r,100);this.mode=decNumber(t,r+100,8);this.uid=decNumber(t,r+108,8);this.gid=decNumber(t,r+116,8);this.size=decNumber(t,r+124,12);this.mtime=decDate(t,r+136,12);this.cksum=decNumber(t,r+148,12);this[l](i);this[l](o,true);this[u]=decString(t,r+156,1);if(this[u]==="")this[u]="0";if(this[u]==="0"&&this.path.substr(-1)==="/")this[u]="5";if(this[u]==="5")this.size=0;this.linkpath=decString(t,r+157,100);if(t.slice(r+257,r+265).toString()==="ustar\x0000"){this.uname=decString(t,r+265,32);this.gname=decString(t,r+297,32);this.devmaj=decNumber(t,r+329,8);this.devmin=decNumber(t,r+337,8);if(t[r+475]!==0){const i=decString(t,r+345,155);this.path=i+"/"+this.path}else{const i=decString(t,r+345,130);if(i)this.path=i+"/"+this.path;this.atime=decDate(t,r+476,12);this.ctime=decDate(t,r+488,12)}}let a=8*32;for(let i=r;i<r+148;i++)a+=t[i];for(let i=r+156;i<r+512;i++)a+=t[i];this.cksumValid=a===this.cksum;if(this.cksum===null&&a===8*32)this.nullBlock=true}[l](t,r){for(const i in t){if(t[i]!==null&&t[i]!==undefined&&!(r&&i==="path"))this[i]=t[i]}}encode(t,r){if(!t){t=this.block=Buffer.alloc(512);r=0}if(!r)r=0;if(!(t.length>=r+512))throw new Error("need 512 bytes for header");const i=this.ctime||this.atime?130:155;const o=splitPrefix(this.path||"",i);const a=o[0];const c=o[1];this.needPax=o[2];this.needPax=encString(t,r,100,a)||this.needPax;this.needPax=encNumber(t,r+100,8,this.mode)||this.needPax;this.needPax=encNumber(t,r+108,8,this.uid)||this.needPax;this.needPax=encNumber(t,r+116,8,this.gid)||this.needPax;this.needPax=encNumber(t,r+124,12,this.size)||this.needPax;this.needPax=encDate(t,r+136,12,this.mtime)||this.needPax;t[r+156]=this[u].charCodeAt(0);this.needPax=encString(t,r+157,100,this.linkpath)||this.needPax;t.write("ustar\x0000",r+257,8);this.needPax=encString(t,r+265,32,this.uname)||this.needPax;this.needPax=encString(t,r+297,32,this.gname)||this.needPax;this.needPax=encNumber(t,r+329,8,this.devmaj)||this.needPax;this.needPax=encNumber(t,r+337,8,this.devmin)||this.needPax;this.needPax=encString(t,r+345,i,c)||this.needPax;if(t[r+475]!==0)this.needPax=encString(t,r+345,155,c)||this.needPax;else{this.needPax=encString(t,r+345,130,c)||this.needPax;this.needPax=encDate(t,r+476,12,this.atime)||this.needPax;this.needPax=encDate(t,r+488,12,this.ctime)||this.needPax}let l=8*32;for(let i=r;i<r+148;i++)l+=t[i];for(let i=r+156;i<r+512;i++)l+=t[i];this.cksum=l;encNumber(t,r+148,8,this.cksum);this.cksumValid=true;return this.needPax}set(t){for(const r in t){if(t[r]!==null&&t[r]!==undefined)this[r]=t[r]}}get type(){return o.name.get(this[u])||this[u]}get typeKey(){return this[u]}set type(t){if(o.code.has(t))this[u]=o.code.get(t);else this[u]=t}}const splitPrefix=(t,r)=>{const i=100;let o=t;let c="";let l;const u=a.parse(t).root||".";if(Buffer.byteLength(o)<i)l=[o,c,false];else{c=a.dirname(o);o=a.basename(o);do{if(Buffer.byteLength(o)<=i&&Buffer.byteLength(c)<=r)l=[o,c,false];else if(Buffer.byteLength(o)>i&&Buffer.byteLength(c)<=r)l=[o.substr(0,i-1),c,true];else{o=a.join(a.basename(c),o);c=a.dirname(c)}}while(c!==u&&!l);if(!l)l=[t.substr(0,i-1),"",true]}return l};const decString=(t,r,i)=>t.slice(r,r+i).toString("utf8").replace(/\0.*/,"");const decDate=(t,r,i)=>numToDate(decNumber(t,r,i));const numToDate=t=>t===null?null:new Date(t*1e3);const decNumber=(t,r,i)=>t[r]&128?c.parse(t.slice(r,r+i)):decSmallNumber(t,r,i);const nanNull=t=>isNaN(t)?null:t;const decSmallNumber=(t,r,i)=>nanNull(parseInt(t.slice(r,r+i).toString("utf8").replace(/\0.*$/,"").trim(),8));const h={12:8589934591,8:2097151};const encNumber=(t,r,i,o)=>o===null?false:o>h[i]||o<0?(c.encode(o,t.slice(r,r+i)),true):(encSmallNumber(t,r,i,o),false);const encSmallNumber=(t,r,i,o)=>t.write(octalString(o,i),r,i,"ascii");const octalString=(t,r)=>padOctal(Math.floor(t).toString(8),r);const padOctal=(t,r)=>(t.length===r-1?t:new Array(r-t.length-1).join("0")+t+" ")+"\0";const encDate=(t,r,i,o)=>o===null?false:encNumber(t,r,i,o.getTime()/1e3);const d=new Array(156).join("\0");const encString=(t,r,i,o)=>o===null?false:(t.write(o+d,r,i,"utf8"),o.length!==Buffer.byteLength(o)||o.length>i);t.exports=Header},813:t=>{"use strict";const r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);t.exports=t=>t?Object.keys(t).map((i=>[r.has(i)?r.get(i):i,t[i]])).reduce(((t,r)=>(t[r[0]]=r[1],t)),Object.create(null)):{}},1697:t=>{"use strict";const encode=(t,r)=>{if(!Number.isSafeInteger(t))throw Error("cannot encode number outside of javascript safe integer range");else if(t<0)encodeNegative(t,r);else encodePositive(t,r);return r};const encodePositive=(t,r)=>{r[0]=128;for(var i=r.length;i>1;i--){r[i-1]=t&255;t=Math.floor(t/256)}};const encodeNegative=(t,r)=>{r[0]=255;var i=false;t=t*-1;for(var o=r.length;o>1;o--){var a=t&255;t=Math.floor(t/256);if(i)r[o-1]=onesComp(a);else if(a===0)r[o-1]=0;else{i=true;r[o-1]=twosComp(a)}}};const parse=t=>{const r=t[0];const i=r===128?pos(t.slice(1,t.length)):r===255?twos(t):null;if(i===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i};const twos=t=>{var r=t.length;var i=0;var o=false;for(var a=r-1;a>-1;a--){var c=t[a];var l;if(o)l=onesComp(c);else if(c===0)l=c;else{o=true;l=twosComp(c)}if(l!==0)i-=l*Math.pow(256,r-a-1)}return i};const pos=t=>{var r=t.length;var i=0;for(var o=r-1;o>-1;o--){var a=t[o];if(a!==0)i+=a*Math.pow(256,r-o-1)}return i};const onesComp=t=>(255^t)&255;const twosComp=t=>(255^t)+1&255;t.exports={encode:encode,parse:parse}},2874:(t,r,i)=>{"use strict";const o=i(813);const a=i(5514);const c=i(7147);const l=i(8829);const u=i(1017);const h=i(5919);t.exports=(t,r,i)=>{if(typeof t==="function")i=t,r=null,t={};else if(Array.isArray(t))r=t,t={};if(typeof r==="function")i=r,r=null;if(!r)r=[];else r=Array.from(r);const a=o(t);if(a.sync&&typeof i==="function")throw new TypeError("callback not supported for sync tar functions");if(!a.file&&typeof i==="function")throw new TypeError("callback only supported with file option");if(r.length)filesFilter(a,r);if(!a.noResume)onentryFunction(a);return a.file&&a.sync?listFileSync(a):a.file?listFile(a,i):list(a)};const onentryFunction=t=>{const r=t.onentry;t.onentry=r?t=>{r(t);t.resume()}:t=>t.resume()};const filesFilter=(t,r)=>{const i=new Map(r.map((t=>[h(t),true])));const o=t.filter;const mapHas=(t,r)=>{const o=r||u.parse(t).root||".";const a=t===o?false:i.has(t)?i.get(t):mapHas(u.dirname(t),o);i.set(t,a);return a};t.filter=o?(t,r)=>o(t,r)&&mapHas(h(t)):t=>mapHas(h(t))};const listFileSync=t=>{const r=list(t);const i=t.file;let o=true;let a;try{const l=c.statSync(i);const u=t.maxReadSize||16*1024*1024;if(l.size<u)r.end(c.readFileSync(i));else{let t=0;const o=Buffer.allocUnsafe(u);a=c.openSync(i,"r");while(t<l.size){const i=c.readSync(a,o,0,u,t);t+=i;r.write(o.slice(0,i))}r.end()}o=false}finally{if(o&&a){try{c.closeSync(a)}catch(t){}}}};const listFile=(t,r)=>{const i=new a(t);const o=t.maxReadSize||16*1024*1024;const u=t.file;const h=new Promise(((t,r)=>{i.on("error",r);i.on("end",t);c.stat(u,((t,a)=>{if(t)r(t);else{const t=new l.ReadStream(u,{readSize:o,size:a.size});t.on("error",r);t.pipe(i)}}))}));return r?h.then(r,r):h};const list=t=>new a(t)},9077:(t,r,i)=>{"use strict";const o=i(9060);const a=i(7147);const c=i(1017);const l=i(1085);const u=i(307);class SymlinkError extends Error{constructor(t,r){super("Cannot extract through symbolic link");this.path=r;this.symlink=t}get name(){return"SylinkError"}}class CwdError extends Error{constructor(t,r){super(r+": Cannot cd into '"+t+"'");this.path=t;this.code=r}get name(){return"CwdError"}}const cGet=(t,r)=>t.get(u(r));const cSet=(t,r,i)=>t.set(u(r),i);const checkCwd=(t,r)=>{a.stat(t,((i,o)=>{if(i||!o.isDirectory())i=new CwdError(t,i&&i.code||"ENOTDIR");r(i)}))};t.exports=(t,r,i)=>{t=u(t);const h=r.umask;const d=r.mode|448;const p=(d&h)!==0;const m=r.uid;const g=r.gid;const y=typeof m==="number"&&typeof g==="number"&&(m!==r.processUid||g!==r.processGid);const b=r.preserve;const v=r.unlink;const _=r.cache;const w=u(r.cwd);const done=(r,o)=>{if(r)i(r);else{cSet(_,t,true);if(o&&y)l(o,m,g,(t=>done(t)));else if(p)a.chmod(t,d,i);else i()}};if(_&&cGet(_,t)===true)return done();if(t===w)return checkCwd(t,done);if(b)return o(t,{mode:d}).then((t=>done(null,t)),done);const E=u(c.relative(w,t));const S=E.split("/");mkdir_(w,S,d,_,v,w,null,done)};const mkdir_=(t,r,i,o,l,h,d,p)=>{if(!r.length)return p(null,d);const m=r.shift();const g=u(c.resolve(t+"/"+m));if(cGet(o,g))return mkdir_(g,r,i,o,l,h,d,p);a.mkdir(g,i,onmkdir(g,r,i,o,l,h,d,p))};const onmkdir=(t,r,i,o,c,l,h,d)=>p=>{if(p){a.lstat(t,((m,g)=>{if(m){m.path=m.path&&u(m.path);d(m)}else if(g.isDirectory())mkdir_(t,r,i,o,c,l,h,d);else if(c){a.unlink(t,(u=>{if(u)return d(u);a.mkdir(t,i,onmkdir(t,r,i,o,c,l,h,d))}))}else if(g.isSymbolicLink())return d(new SymlinkError(t,t+"/"+r.join("/")));else d(p)}))}else{h=h||t;mkdir_(t,r,i,o,c,l,h,d)}};const checkCwdSync=t=>{let r=false;let i="ENOTDIR";try{r=a.statSync(t).isDirectory()}catch(t){i=t.code}finally{if(!r)throw new CwdError(t,i)}};t.exports.sync=(t,r)=>{t=u(t);const i=r.umask;const h=r.mode|448;const d=(h&i)!==0;const p=r.uid;const m=r.gid;const g=typeof p==="number"&&typeof m==="number"&&(p!==r.processUid||m!==r.processGid);const y=r.preserve;const b=r.unlink;const v=r.cache;const _=u(r.cwd);const done=r=>{cSet(v,t,true);if(r&&g)l.sync(r,p,m);if(d)a.chmodSync(t,h)};if(v&&cGet(v,t)===true)return done();if(t===_){checkCwdSync(_);return done()}if(y)return done(o.sync(t,h));const w=u(c.relative(_,t));const E=w.split("/");let S=null;for(let t=E.shift(),r=_;t&&(r+="/"+t);t=E.shift()){r=u(c.resolve(r));if(cGet(v,r))continue;try{a.mkdirSync(r,h);S=S||r;cSet(v,r,true)}catch(t){const i=a.lstatSync(r);if(i.isDirectory()){cSet(v,r,true);continue}else if(b){a.unlinkSync(r);a.mkdirSync(r,h);S=S||r;cSet(v,r,true);continue}else if(i.isSymbolicLink())return new SymlinkError(r,r+"/"+E.join("/"))}}return done(S)}},3801:t=>{"use strict";t.exports=(t,r,i)=>{t&=4095;if(i)t=(t|384)&~18;if(r){if(t&256)t|=64;if(t&32)t|=8;if(t&4)t|=1}return t}},7984:t=>{const r=Object.create(null);const{hasOwnProperty:i}=Object.prototype;t.exports=t=>{if(!i.call(r,t))r[t]=t.normalize("NFKD");return r[t]}},307:t=>{const r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;t.exports=r!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")},2428:(t,r,i)=>{"use strict";class PackJob{constructor(t,r){this.path=t||"./";this.absolute=r;this.entry=null;this.stat=null;this.readdir=null;this.pending=false;this.ignore=false;this.piped=false}}const o=i(6150);const a=i(3954);const c=i(927);const l=i(3717);const u=l.Sync;const h=l.Tar;const d=i(605);const p=Buffer.alloc(1024);const m=Symbol("onStat");const g=Symbol("ended");const y=Symbol("queue");const b=Symbol("current");const v=Symbol("process");const _=Symbol("processing");const w=Symbol("processJob");const E=Symbol("jobs");const S=Symbol("jobDone");const O=Symbol("addFSEntry");const R=Symbol("addTarEntry");const x=Symbol("stat");const A=Symbol("readdir");const T=Symbol("onreaddir");const k=Symbol("pipe");const C=Symbol("entry");const P=Symbol("entryOpt");const I=Symbol("writeEntryClass");const L=Symbol("write");const N=Symbol("ondrain");const M=i(7147);const D=i(1017);const j=i(5160);const $=i(307);const H=j(class Pack extends o{constructor(t){super(t);t=t||Object.create(null);this.opt=t;this.file=t.file||"";this.cwd=t.cwd||process.cwd();this.maxReadSize=t.maxReadSize;this.preservePaths=!!t.preservePaths;this.strict=!!t.strict;this.noPax=!!t.noPax;this.prefix=$(t.prefix||"");this.linkCache=t.linkCache||new Map;this.statCache=t.statCache||new Map;this.readdirCache=t.readdirCache||new Map;this[I]=l;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);this.portable=!!t.portable;this.zip=null;if(t.gzip){if(typeof t.gzip!=="object")t.gzip={};if(this.portable)t.gzip.portable=true;this.zip=new a.Gzip(t.gzip);this.zip.on("data",(t=>super.write(t)));this.zip.on("end",(t=>super.end()));this.zip.on("drain",(t=>this[N]()));this.on("resume",(t=>this.zip.resume()))}else this.on("drain",this[N]);this.noDirRecurse=!!t.noDirRecurse;this.follow=!!t.follow;this.noMtime=!!t.noMtime;this.mtime=t.mtime||null;this.filter=typeof t.filter==="function"?t.filter:t=>true;this[y]=new d;this[E]=0;this.jobs=+t.jobs||4;this[_]=false;this[g]=false}[L](t){return super.write(t)}add(t){this.write(t);return this}end(t){if(t)this.write(t);this[g]=true;this[v]();return this}write(t){if(this[g])throw new Error("write after end");if(t instanceof c)this[R](t);else this[O](t);return this.flowing}[R](t){const r=$(D.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{const i=new PackJob(t.path,r,false);i.entry=new h(t,this[P](i));i.entry.on("end",(t=>this[S](i)));this[E]+=1;this[y].push(i)}this[v]()}[O](t){const r=$(D.resolve(this.cwd,t));this[y].push(new PackJob(t,r));this[v]()}[x](t){t.pending=true;this[E]+=1;const r=this.follow?"stat":"lstat";M[r](t.absolute,((r,i)=>{t.pending=false;this[E]-=1;if(r)this.emit("error",r);else this[m](t,i)}))}[m](t,r){this.statCache.set(t.absolute,r);t.stat=r;if(!this.filter(t.path,r))t.ignore=true;this[v]()}[A](t){t.pending=true;this[E]+=1;M.readdir(t.absolute,((r,i)=>{t.pending=false;this[E]-=1;if(r)return this.emit("error",r);this[T](t,i)}))}[T](t,r){this.readdirCache.set(t.absolute,r);t.readdir=r;this[v]()}[v](){if(this[_])return;this[_]=true;for(let t=this[y].head;t!==null&&this[E]<this.jobs;t=t.next){this[w](t.value);if(t.value.ignore){const r=t.next;this[y].removeNode(t);t.next=r}}this[_]=false;if(this[g]&&!this[y].length&&this[E]===0){if(this.zip)this.zip.end(p);else{super.write(p);super.end()}}}get[b](){return this[y]&&this[y].head&&this[y].head.value}[S](t){this[y].shift();this[E]-=1;this[v]()}[w](t){if(t.pending)return;if(t.entry){if(t===this[b]&&!t.piped)this[k](t);return}if(!t.stat){if(this.statCache.has(t.absolute))this[m](t,this.statCache.get(t.absolute));else this[x](t)}if(!t.stat)return;if(t.ignore)return;if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){if(this.readdirCache.has(t.absolute))this[T](t,this.readdirCache.get(t.absolute));else this[A](t);if(!t.readdir)return}t.entry=this[C](t);if(!t.entry){t.ignore=true;return}if(t===this[b]&&!t.piped)this[k](t)}[P](t){return{onwarn:(t,r,i)=>this.warn(t,r,i),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[C](t){this[E]+=1;try{return new this[I](t.path,this[P](t)).on("end",(()=>this[S](t))).on("error",(t=>this.emit("error",t)))}catch(t){this.emit("error",t)}}[N](){if(this[b]&&this[b].entry)this[b].entry.resume()}[k](t){t.piped=true;if(t.readdir){t.readdir.forEach((r=>{const i=t.path;const o=i==="./"?"":i.replace(/\/*$/,"/");this[O](o+r)}))}const r=t.entry;const i=this.zip;if(i){r.on("data",(t=>{if(!i.write(t))r.pause()}))}else{r.on("data",(t=>{if(!super.write(t))r.pause()}))}}pause(){if(this.zip)this.zip.pause();return super.pause()}});class PackSync extends H{constructor(t){super(t);this[I]=u}pause(){}resume(){}[x](t){const r=this.follow?"statSync":"lstatSync";this[m](t,M[r](t.absolute))}[A](t,r){this[T](t,M.readdirSync(t.absolute))}[k](t){const r=t.entry;const i=this.zip;if(t.readdir){t.readdir.forEach((r=>{const i=t.path;const o=i==="./"?"":i.replace(/\/*$/,"/");this[O](o+r)}))}if(i){r.on("data",(t=>{i.write(t)}))}else{r.on("data",(t=>{super[L](t)}))}}}H.Sync=PackSync;t.exports=H},5514:(t,r,i)=>{"use strict";const o=i(5160);const a=i(6261);const c=i(2361);const l=i(605);const u=1024*1024;const h=i(927);const d=i(2315);const p=i(3954);const m=Buffer.from([31,139]);const g=Symbol("state");const y=Symbol("writeEntry");const b=Symbol("readEntry");const v=Symbol("nextEntry");const _=Symbol("processEntry");const w=Symbol("extendedHeader");const E=Symbol("globalExtendedHeader");const S=Symbol("meta");const O=Symbol("emitMeta");const R=Symbol("buffer");const x=Symbol("queue");const A=Symbol("ended");const T=Symbol("emittedEnd");const k=Symbol("emit");const C=Symbol("unzip");const P=Symbol("consumeChunk");const I=Symbol("consumeChunkSub");const L=Symbol("consumeBody");const N=Symbol("consumeMeta");const M=Symbol("consumeHeader");const D=Symbol("consuming");const j=Symbol("bufferConcat");const $=Symbol("maybeEnd");const H=Symbol("writing");const B=Symbol("aborted");const U=Symbol("onDone");const q=Symbol("sawValidEntry");const G=Symbol("sawNullBlock");const V=Symbol("sawEOF");const noop=t=>true;t.exports=o(class Parser extends c{constructor(t){t=t||{};super(t);this.file=t.file||"";this[q]=null;this.on(U,(t=>{if(this[g]==="begin"||this[q]===false){this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}}));if(t.ondone)this.on(U,t.ondone);else{this.on(U,(t=>{this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}))}this.strict=!!t.strict;this.maxMetaEntrySize=t.maxMetaEntrySize||u;this.filter=typeof t.filter==="function"?t.filter:noop;this.writable=true;this.readable=false;this[x]=new l;this[R]=null;this[b]=null;this[y]=null;this[g]="begin";this[S]="";this[w]=null;this[E]=null;this[A]=false;this[C]=null;this[B]=false;this[G]=false;this[V]=false;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);if(typeof t.onentry==="function")this.on("entry",t.onentry)}[M](t,r){if(this[q]===null)this[q]=false;let i;try{i=new a(t,r,this[w],this[E])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(i.nullBlock){if(this[G]){this[V]=true;if(this[g]==="begin")this[g]="header";this[k]("eof")}else{this[G]=true;this[k]("nullBlock")}}else{this[G]=false;if(!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{const t=i.type;if(/^(Symbolic)?Link$/.test(t)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(t)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{const t=this[y]=new h(i,this[w],this[E]);if(!this[q]){if(t.remain){const onend=()=>{if(!t.invalid)this[q]=true};t.on("end",onend)}else this[q]=true}if(t.meta){if(t.size>this.maxMetaEntrySize){t.ignore=true;this[k]("ignoredEntry",t);this[g]="ignore";t.resume()}else if(t.size>0){this[S]="";t.on("data",(t=>this[S]+=t));this[g]="meta"}}else{this[w]=null;t.ignore=t.ignore||!this.filter(t.path,t);if(t.ignore){this[k]("ignoredEntry",t);this[g]=t.remain?"ignore":"header";t.resume()}else{if(t.remain)this[g]="body";else{this[g]="header";t.end()}if(!this[b]){this[x].push(t);this[v]()}else this[x].push(t)}}}}}}[_](t){let r=true;if(!t){this[b]=null;r=false}else if(Array.isArray(t))this.emit.apply(this,t);else{this[b]=t;this.emit("entry",t);if(!t.emittedEnd){t.on("end",(t=>this[v]()));r=false}}return r}[v](){do{}while(this[_](this[x].shift()));if(!this[x].length){const t=this[b];const r=!t||t.flowing||t.size===t.remain;if(r){if(!this[H])this.emit("drain")}else t.once("drain",(t=>this.emit("drain")))}}[L](t,r){const i=this[y];const o=i.blockRemain;const a=o>=t.length&&r===0?t:t.slice(r,r+o);i.write(a);if(!i.blockRemain){this[g]="header";this[y]=null;i.end()}return a.length}[N](t,r){const i=this[y];const o=this[L](t,r);if(!this[y])this[O](i);return o}[k](t,r,i){if(!this[x].length&&!this[b])this.emit(t,r,i);else this[x].push([t,r,i])}[O](t){this[k]("meta",this[S]);switch(t.type){case"ExtendedHeader":case"OldExtendedHeader":this[w]=d.parse(this[S],this[w],false);break;case"GlobalExtendedHeader":this[E]=d.parse(this[S],this[E],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[w]=this[w]||Object.create(null);this[w].path=this[S].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[w]=this[w]||Object.create(null);this[w].linkpath=this[S].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+t.type)}}abort(t){this[B]=true;this.emit("abort",t);this.warn("TAR_ABORT",t,{recoverable:false})}write(t){if(this[B])return;if(this[C]===null&&t){if(this[R]){t=Buffer.concat([this[R],t]);this[R]=null}if(t.length<m.length){this[R]=t;return true}for(let r=0;this[C]===null&&r<m.length;r++){if(t[r]!==m[r])this[C]=false}if(this[C]===null){const r=this[A];this[A]=false;this[C]=new p.Unzip;this[C].on("data",(t=>this[P](t)));this[C].on("error",(t=>this.abort(t)));this[C].on("end",(t=>{this[A]=true;this[P]()}));this[H]=true;const i=this[C][r?"end":"write"](t);this[H]=false;return i}}this[H]=true;if(this[C])this[C].write(t);else this[P](t);this[H]=false;const r=this[x].length?false:this[b]?this[b].flowing:true;if(!r&&!this[x].length)this[b].once("drain",(t=>this.emit("drain")));return r}[j](t){if(t&&!this[B])this[R]=this[R]?Buffer.concat([this[R],t]):t}[$](){if(this[A]&&!this[T]&&!this[B]&&!this[D]){this[T]=true;const t=this[y];if(t&&t.blockRemain){const r=this[R]?this[R].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${r} available)`,{entry:t});if(this[R])t.write(this[R]);t.end()}this[k](U)}}[P](t){if(this[D])this[j](t);else if(!t&&!this[R])this[$]();else{this[D]=true;if(this[R]){this[j](t);const r=this[R];this[R]=null;this[I](r)}else this[I](t);while(this[R]&&this[R].length>=512&&!this[B]&&!this[V]){const t=this[R];this[R]=null;this[I](t)}this[D]=false}if(!this[R]||this[A])this[$]()}[I](t){let r=0;const i=t.length;while(r+512<=i&&!this[B]&&!this[V]){switch(this[g]){case"begin":case"header":this[M](t,r);r+=512;break;case"ignore":case"body":r+=this[L](t,r);break;case"meta":r+=this[N](t,r);break;default:throw new Error("invalid state: "+this[g])}}if(r<i){if(this[R])this[R]=Buffer.concat([t.slice(r),this[R]]);else this[R]=t.slice(r)}}end(t){if(!this[B]){if(this[C])this[C].end(t);else{this[A]=true;this.write(t)}}}})},5871:(t,r,i)=>{const o=i(9491);const a=i(7984);const c=i(5919);const{join:l}=i(1017);const u=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const h=u==="win32";t.exports=()=>{const t=new Map;const r=new Map;const getDirs=t=>{const r=t.split("/").slice(0,-1).reduce(((t,r)=>{if(t.length)r=l(t[t.length-1],r);t.push(r||"/");return t}),[]);return r};const i=new Set;const getQueues=i=>{const o=r.get(i);if(!o)throw new Error("function does not have any path reservations");return{paths:o.paths.map((r=>t.get(r))),dirs:[...o.dirs].map((r=>t.get(r)))}};const check=t=>{const{paths:r,dirs:i}=getQueues(t);return r.every((r=>r[0]===t))&&i.every((r=>r[0]instanceof Set&&r[0].has(t)))};const run=t=>{if(i.has(t)||!check(t))return false;i.add(t);t((()=>clear(t)));return true};const clear=a=>{if(!i.has(a))return false;const{paths:c,dirs:l}=r.get(a);const u=new Set;c.forEach((r=>{const i=t.get(r);o.equal(i[0],a);if(i.length===1)t.delete(r);else{i.shift();if(typeof i[0]==="function")u.add(i[0]);else i[0].forEach((t=>u.add(t)))}}));l.forEach((r=>{const i=t.get(r);o(i[0]instanceof Set);if(i[0].size===1&&i.length===1)t.delete(r);else if(i[0].size===1){i.shift();u.add(i[0])}else i[0].delete(a)}));i.delete(a);u.forEach((t=>run(t)));return true};const reserve=(i,o)=>{i=h?["win32 parallelization disabled"]:i.map((t=>a(c(l(t))).toLowerCase()));const u=new Set(i.map((t=>getDirs(t))).reduce(((t,r)=>t.concat(r))));r.set(o,{dirs:u,paths:i});i.forEach((r=>{const i=t.get(r);if(!i)t.set(r,[o]);else i.push(o)}));u.forEach((r=>{const i=t.get(r);if(!i)t.set(r,[new Set([o])]);else if(i[i.length-1]instanceof Set)i[i.length-1].add(o);else i.push(new Set([o]))}));return run(o)};return{check:check,reserve:reserve}}},2315:(t,r,i)=>{"use strict";const o=i(6261);const a=i(1017);class Pax{constructor(t,r){this.atime=t.atime||null;this.charset=t.charset||null;this.comment=t.comment||null;this.ctime=t.ctime||null;this.gid=t.gid||null;this.gname=t.gname||null;this.linkpath=t.linkpath||null;this.mtime=t.mtime||null;this.path=t.path||null;this.size=t.size||null;this.uid=t.uid||null;this.uname=t.uname||null;this.dev=t.dev||null;this.ino=t.ino||null;this.nlink=t.nlink||null;this.global=r||false}encode(){const t=this.encodeBody();if(t==="")return null;const r=Buffer.byteLength(t);const i=512*Math.ceil(1+r/512);const c=Buffer.allocUnsafe(i);for(let t=0;t<512;t++)c[t]=0;new o({path:("PaxHeader/"+a.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(c);c.write(t,512,r,"utf8");for(let t=r+512;t<c.length;t++)c[t]=0;return c}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===null||this[t]===undefined)return"";const r=this[t]instanceof Date?this[t].getTime()/1e3:this[t];const i=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+r+"\n";const o=Buffer.byteLength(i);let a=Math.floor(Math.log(o)/Math.log(10))+1;if(o+a>=Math.pow(10,a))a+=1;const c=a+o;return c+i}}Pax.parse=(t,r,i)=>new Pax(merge(parseKV(t),r),i);const merge=(t,r)=>r?Object.keys(t).reduce(((r,i)=>(r[i]=t[i],r)),r):t;const parseKV=t=>t.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null));const parseKVLine=(t,r)=>{const i=parseInt(r,10);if(i!==Buffer.byteLength(r)+1)return t;r=r.substr((i+" ").length);const o=r.split("=");const a=o.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!a)return t;const c=o.join("=");t[a]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a)?new Date(c*1e3):/^[0-9]+$/.test(c)?+c:c;return t};t.exports=Pax},927:(t,r,i)=>{"use strict";const o=i(6150);const a=i(307);const c=Symbol("slurp");t.exports=class ReadEntry extends o{constructor(t,r,i){super();this.pause();this.extended=r;this.globalExtended=i;this.header=t;this.startBlockSize=512*Math.ceil(t.size/512);this.blockRemain=this.startBlockSize;this.remain=t.size;this.type=t.type;this.meta=false;this.ignore=false;switch(this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=true;break;default:this.ignore=true}this.path=a(t.path);this.mode=t.mode;if(this.mode)this.mode=this.mode&4095;this.uid=t.uid;this.gid=t.gid;this.uname=t.uname;this.gname=t.gname;this.size=t.size;this.mtime=t.mtime;this.atime=t.atime;this.ctime=t.ctime;this.linkpath=a(t.linkpath);this.uname=t.uname;this.gname=t.gname;if(r)this[c](r);if(i)this[c](i,true)}write(t){const r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");const i=this.remain;const o=this.blockRemain;this.remain=Math.max(0,i-r);this.blockRemain=Math.max(0,o-r);if(this.ignore)return true;if(i>=r)return super.write(t);return super.write(t.slice(0,i))}[c](t,r){for(const i in t){if(t[i]!==null&&t[i]!==undefined&&!(r&&i==="path"))this[i]=i==="path"||i==="linkpath"?a(t[i]):t[i]}}}},2834:(t,r,i)=>{"use strict";const o=i(813);const a=i(2428);const c=i(7147);const l=i(8829);const u=i(2874);const h=i(1017);const d=i(6261);t.exports=(t,r,i)=>{const a=o(t);if(!a.file)throw new TypeError("file is required");if(a.gzip)throw new TypeError("cannot append to compressed archives");if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");r=Array.from(r);return a.sync?replaceSync(a,r):replace(a,r,i)};const replaceSync=(t,r)=>{const i=new a.Sync(t);let o=true;let l;let u;try{try{l=c.openSync(t.file,"r+")}catch(r){if(r.code==="ENOENT")l=c.openSync(t.file,"w+");else throw r}const a=c.fstatSync(l);const h=Buffer.alloc(512);e:for(u=0;u<a.size;u+=512){for(let t=0,r=0;t<512;t+=r){r=c.readSync(l,h,t,h.length-t,u+t);if(u===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!r)break e}const r=new d(h);if(!r.cksumValid)break;const i=512*Math.ceil(r.size/512);if(u+i+512>a.size)break;u+=i;if(t.mtimeCache)t.mtimeCache.set(r.path,r.mtime)}o=false;streamSync(t,i,u,l,r)}finally{if(o){try{c.closeSync(l)}catch(t){}}}};const streamSync=(t,r,i,o,a)=>{const c=new l.WriteStreamSync(t.file,{fd:o,start:i});r.pipe(c);addFilesSync(r,a)};const replace=(t,r,i)=>{r=Array.from(r);const o=new a(t);const getPos=(r,i,o)=>{const cb=(t,i)=>{if(t)c.close(r,(r=>o(t)));else o(null,i)};let a=0;if(i===0)return cb(null,0);let l=0;const u=Buffer.alloc(512);const onread=(o,h)=>{if(o)return cb(o);l+=h;if(l<512&&h){return c.read(r,u,l,u.length-l,a+l,onread)}if(a===0&&u[0]===31&&u[1]===139)return cb(new Error("cannot append to compressed archives"));if(l<512)return cb(null,a);const p=new d(u);if(!p.cksumValid)return cb(null,a);const m=512*Math.ceil(p.size/512);if(a+m+512>i)return cb(null,a);a+=m+512;if(a>=i)return cb(null,a);if(t.mtimeCache)t.mtimeCache.set(p.path,p.mtime);l=0;c.read(r,u,0,512,a,onread)};c.read(r,u,0,512,a,onread)};const u=new Promise(((i,a)=>{o.on("error",a);let u="r+";const onopen=(h,d)=>{if(h&&h.code==="ENOENT"&&u==="r+"){u="w+";return c.open(t.file,u,onopen)}if(h)return a(h);c.fstat(d,((u,h)=>{if(u)return c.close(d,(()=>a(u)));getPos(d,h.size,((c,u)=>{if(c)return a(c);const h=new l.WriteStream(t.file,{fd:d,start:u});o.pipe(h);h.on("error",a);h.on("close",i);addFilesAsync(o,r)}))}))};c.open(t.file,u,onopen)}));return i?u.then(i,i):u};const addFilesSync=(t,r)=>{r.forEach((r=>{if(r.charAt(0)==="@"){u({file:h.resolve(t.cwd,r.substr(1)),sync:true,noResume:true,onentry:r=>t.add(r)})}else t.add(r)}));t.end()};const addFilesAsync=(t,r)=>{while(r.length){const i=r.shift();if(i.charAt(0)==="@"){return u({file:h.resolve(t.cwd,i.substr(1)),noResume:true,onentry:r=>t.add(r)}).then((i=>addFilesAsync(t,r)))}else t.add(i)}t.end()}},5691:(t,r,i)=>{const{isAbsolute:o,parse:a}=i(1017).win32;t.exports=t=>{let r="";let i=a(t);while(o(t)||i.root){const o=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":i.root;t=t.substr(o.length);r+=o;i=a(t)}return[r,t]}},5919:t=>{t.exports=t=>{let r=t.length-1;let i=-1;while(r>-1&&t.charAt(r)==="/"){i=r;r--}return i===-1?t:t.slice(0,i)}},7312:(t,r)=>{"use strict";r.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);r.code=new Map(Array.from(r.name).map((t=>[t[1],t[0]])))},925:(t,r,i)=>{"use strict";const o=i(9491);const a=i(5514);const c=i(7147);const l=i(8829);const u=i(1017);const h=i(9077);const d=i(462);const p=i(5871);const m=i(5691);const g=i(307);const y=i(5919);const b=i(7984);const v=Symbol("onEntry");const _=Symbol("checkFs");const w=Symbol("checkFs2");const E=Symbol("pruneCache");const S=Symbol("isReusable");const O=Symbol("makeFs");const R=Symbol("file");const x=Symbol("directory");const A=Symbol("link");const T=Symbol("symlink");const k=Symbol("hardlink");const C=Symbol("unsupported");const P=Symbol("checkPath");const I=Symbol("mkdir");const L=Symbol("onError");const N=Symbol("pending");const M=Symbol("pend");const D=Symbol("unpend");const j=Symbol("ended");const $=Symbol("maybeClose");const H=Symbol("skip");const B=Symbol("doChown");const U=Symbol("uid");const q=Symbol("gid");const G=Symbol("checkedCwd");const V=i(6113);const z=i(8166);const W=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const Y=W==="win32";const unlinkFile=(t,r)=>{if(!Y)return c.unlink(t,r);const i=t+".DELETE."+V.randomBytes(16).toString("hex");c.rename(t,i,(t=>{if(t)return r(t);c.unlink(i,r)}))};const unlinkFileSync=t=>{if(!Y)return c.unlinkSync(t);const r=t+".DELETE."+V.randomBytes(16).toString("hex");c.renameSync(t,r);c.unlinkSync(r)};const uint32=(t,r,i)=>t===t>>>0?t:r===r>>>0?r:i;const cacheKeyNormalize=t=>b(y(g(t))).toLowerCase();const pruneCache=(t,r)=>{r=cacheKeyNormalize(r);for(const i of t.keys()){const o=cacheKeyNormalize(i);if(o===r||o.indexOf(r+"/")===0)t.delete(i)}};const dropCache=t=>{for(const r of t.keys())t.delete(r)};class Unpack extends a{constructor(t){if(!t)t={};t.ondone=t=>{this[j]=true;this[$]()};super(t);this[G]=false;this.reservations=p();this.transform=typeof t.transform==="function"?t.transform:null;this.writable=true;this.readable=false;this[N]=0;this[j]=false;this.dirCache=t.dirCache||new Map;if(typeof t.uid==="number"||typeof t.gid==="number"){if(typeof t.uid!=="number"||typeof t.gid!=="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner){throw new TypeError("cannot preserve owner in archive and also set owner explicitly")}this.uid=t.uid;this.gid=t.gid;this.setOwner=true}else{this.uid=null;this.gid=null;this.setOwner=false}if(t.preserveOwner===undefined&&typeof t.uid!=="number")this.preserveOwner=process.getuid&&process.getuid()===0;else this.preserveOwner=!!t.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null;this.forceChown=t.forceChown===true;this.win32=!!t.win32||Y;this.newer=!!t.newer;this.keep=!!t.keep;this.noMtime=!!t.noMtime;this.preservePaths=!!t.preservePaths;this.unlink=!!t.unlink;this.cwd=g(u.resolve(t.cwd||process.cwd()));this.strip=+t.strip||0;this.processUmask=t.noChmod?0:process.umask();this.umask=typeof t.umask==="number"?t.umask:this.processUmask;this.dmode=t.dmode||511&~this.umask;this.fmode=t.fmode||438&~this.umask;this.on("entry",(t=>this[v](t)))}warn(t,r,i={}){if(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT")i.recoverable=false;return super.warn(t,r,i)}[$](){if(this[j]&&this[N]===0){this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}}[P](t){if(this.strip){const r=g(t.path).split("/");if(r.length<this.strip)return false;t.path=r.slice(this.strip).join("/");if(t.type==="Link"){const r=g(t.linkpath).split("/");if(r.length>=this.strip)t.linkpath=r.slice(this.strip).join("/");else return false}}if(!this.preservePaths){const r=g(t.path);const i=r.split("/");if(i.includes("..")||Y&&/^[a-z]:\.\.$/i.test(i[0])){this.warn("TAR_ENTRY_ERROR",`path contains '..'`,{entry:t,path:r});return false}const[o,a]=m(r);if(o){t.path=a;this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:t,path:r})}}if(u.isAbsolute(t.path))t.absolute=g(u.resolve(t.path));else t.absolute=g(u.resolve(this.cwd,t.path));if(!this.preservePaths&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd){this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:g(t.path),resolvedPath:t.absolute,cwd:this.cwd});return false}if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return false;if(this.win32){const{root:r}=u.win32.parse(t.absolute);t.absolute=r+d.encode(t.absolute.substr(r.length));const{root:i}=u.win32.parse(t.path);t.path=i+d.encode(t.path.substr(i.length))}return true}[v](t){if(!this[P](t))return t.resume();o.equal(typeof t.absolute,"string");switch(t.type){case"Directory":case"GNUDumpDir":if(t.mode)t.mode=t.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[_](t);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[C](t)}}[L](t,r){if(t.name==="CwdError")this.emit("error",t);else{this.warn("TAR_ENTRY_ERROR",t,{entry:r});this[D]();r.resume()}}[I](t,r,i){h(g(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r,noChmod:this.noChmod},i)}[B](t){return this.forceChown||this.preserveOwner&&(typeof t.uid==="number"&&t.uid!==this.processUid||typeof t.gid==="number"&&t.gid!==this.processGid)||(typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid)}[U](t){return uint32(this.uid,t.uid,this.processUid)}[q](t){return uint32(this.gid,t.gid,this.processGid)}[R](t,r){const i=t.mode&4095||this.fmode;const o=new l.WriteStream(t.absolute,{flags:z(t.size),mode:i,autoClose:false});o.on("error",(i=>{if(o.fd)c.close(o.fd,(()=>{}));o.write=()=>true;this[L](i,t);r()}));let a=1;const done=i=>{if(i){if(o.fd)c.close(o.fd,(()=>{}));this[L](i,t);r();return}if(--a===0){c.close(o.fd,(i=>{if(i)this[L](i,t);else this[D]();r()}))}};o.on("finish",(r=>{const i=t.absolute;const l=o.fd;if(t.mtime&&!this.noMtime){a++;const r=t.atime||new Date;const o=t.mtime;c.futimes(l,r,o,(t=>t?c.utimes(i,r,o,(r=>done(r&&t))):done()))}if(this[B](t)){a++;const r=this[U](t);const o=this[q](t);c.fchown(l,r,o,(t=>t?c.chown(i,r,o,(r=>done(r&&t))):done()))}done()}));const u=this.transform?this.transform(t)||t:t;if(u!==t){u.on("error",(i=>{this[L](i,t);r()}));t.pipe(u)}u.pipe(o)}[x](t,r){const i=t.mode&4095||this.dmode;this[I](t.absolute,i,(i=>{if(i){this[L](i,t);r();return}let o=1;const done=i=>{if(--o===0){r();this[D]();t.resume()}};if(t.mtime&&!this.noMtime){o++;c.utimes(t.absolute,t.atime||new Date,t.mtime,done)}if(this[B](t)){o++;c.chown(t.absolute,this[U](t),this[q](t),done)}done()}))}[C](t){t.unsupported=true;this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t});t.resume()}[T](t,r){this[A](t,t.linkpath,"symlink",r)}[k](t,r){const i=g(u.resolve(this.cwd,t.linkpath));this[A](t,i,"link",r)}[M](){this[N]++}[D](){this[N]--;this[$]()}[H](t){this[D]();t.resume()}[S](t,r){return t.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!Y}[_](t){this[M]();const r=[t.path];if(t.linkpath)r.push(t.linkpath);this.reservations.reserve(r,(r=>this[w](t,r)))}[E](t){if(t.type==="SymbolicLink")dropCache(this.dirCache);else if(t.type!=="Directory")pruneCache(this.dirCache,t.absolute)}[w](t,r){this[E](t);const done=i=>{this[E](t);r(i)};const checkCwd=()=>{this[I](this.cwd,this.dmode,(r=>{if(r){this[L](r,t);done();return}this[G]=true;start()}))};const start=()=>{if(t.absolute!==this.cwd){const r=g(u.dirname(t.absolute));if(r!==this.cwd){return this[I](r,this.dmode,(r=>{if(r){this[L](r,t);done();return}afterMakeParent()}))}}afterMakeParent()};const afterMakeParent=()=>{c.lstat(t.absolute,((r,i)=>{if(i&&(this.keep||this.newer&&i.mtime>t.mtime)){this[H](t);done();return}if(r||this[S](t,i))return this[O](null,t,done);if(i.isDirectory()){if(t.type==="Directory"){const r=!this.noChmod&&t.mode&&(i.mode&4095)!==t.mode;const afterChmod=r=>this[O](r,t,done);if(!r)return afterChmod();return c.chmod(t.absolute,t.mode,afterChmod)}if(t.absolute!==this.cwd){return c.rmdir(t.absolute,(r=>this[O](r,t,done)))}}if(t.absolute===this.cwd)return this[O](null,t,done);unlinkFile(t.absolute,(r=>this[O](r,t,done)))}))};if(this[G])start();else checkCwd()}[O](t,r,i){if(t){this[L](t,r);i();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[R](r,i);case"Link":return this[k](r,i);case"SymbolicLink":return this[T](r,i);case"Directory":case"GNUDumpDir":return this[x](r,i)}}[A](t,r,i,o){c[i](r,t.absolute,(r=>{if(r)this[L](r,t);else{this[D]();t.resume()}o()}))}}const callSync=t=>{try{return[null,t()]}catch(t){return[t,null]}};class UnpackSync extends Unpack{[O](t,r){return super[O](t,r,(()=>{}))}[_](t){this[E](t);if(!this[G]){const r=this[I](this.cwd,this.dmode);if(r)return this[L](r,t);this[G]=true}if(t.absolute!==this.cwd){const r=g(u.dirname(t.absolute));if(r!==this.cwd){const i=this[I](r,this.dmode);if(i)return this[L](i,t)}}const[r,i]=callSync((()=>c.lstatSync(t.absolute)));if(i&&(this.keep||this.newer&&i.mtime>t.mtime))return this[H](t);if(r||this[S](t,i))return this[O](null,t);if(i.isDirectory()){if(t.type==="Directory"){const r=!this.noChmod&&t.mode&&(i.mode&4095)!==t.mode;const[o]=r?callSync((()=>{c.chmodSync(t.absolute,t.mode)})):[];return this[O](o,t)}const[r]=callSync((()=>c.rmdirSync(t.absolute)));this[O](r,t)}const[o]=t.absolute===this.cwd?[]:callSync((()=>unlinkFileSync(t.absolute)));this[O](o,t)}[R](t,r){const i=t.mode&4095||this.fmode;const oner=i=>{let a;try{c.closeSync(o)}catch(t){a=t}if(i||a)this[L](i||a,t);r()};let o;try{o=c.openSync(t.absolute,z(t.size),i)}catch(t){return oner(t)}const a=this.transform?this.transform(t)||t:t;if(a!==t){a.on("error",(r=>this[L](r,t)));t.pipe(a)}a.on("data",(t=>{try{c.writeSync(o,t,0,t.length)}catch(t){oner(t)}}));a.on("end",(r=>{let i=null;if(t.mtime&&!this.noMtime){const r=t.atime||new Date;const a=t.mtime;try{c.futimesSync(o,r,a)}catch(o){try{c.utimesSync(t.absolute,r,a)}catch(t){i=o}}}if(this[B](t)){const r=this[U](t);const a=this[q](t);try{c.fchownSync(o,r,a)}catch(o){try{c.chownSync(t.absolute,r,a)}catch(t){i=i||o}}}oner(i)}))}[x](t,r){const i=t.mode&4095||this.dmode;const o=this[I](t.absolute,i);if(o){this[L](o,t);r();return}if(t.mtime&&!this.noMtime){try{c.utimesSync(t.absolute,t.atime||new Date,t.mtime)}catch(o){}}if(this[B](t)){try{c.chownSync(t.absolute,this[U](t),this[q](t))}catch(o){}}r();t.resume()}[I](t,r){try{return h.sync(g(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(t){return t}}[A](t,r,i,o){try{c[i+"Sync"](r,t.absolute);o();t.resume()}catch(r){return this[L](r,t)}}}Unpack.Sync=UnpackSync;t.exports=Unpack},9764:(t,r,i)=>{"use strict";const o=i(813);const a=i(2834);t.exports=(t,r,i)=>{const c=o(t);if(!c.file)throw new TypeError("file is required");if(c.gzip)throw new TypeError("cannot append to compressed archives");if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");r=Array.from(r);mtimeFilter(c);return a(c,r,i)};const mtimeFilter=t=>{const r=t.filter;if(!t.mtimeCache)t.mtimeCache=new Map;t.filter=r?(i,o)=>r(i,o)&&!(t.mtimeCache.get(i)>o.mtime):(r,i)=>!(t.mtimeCache.get(r)>i.mtime)}},5160:t=>{"use strict";t.exports=t=>class extends t{warn(t,r,i={}){if(this.file)i.file=this.file;if(this.cwd)i.cwd=this.cwd;i.code=r instanceof Error&&r.code||t;i.tarCode=t;if(!this.strict&&i.recoverable!==false){if(r instanceof Error){i=Object.assign(r,i);r=r.message}this.emit("warn",i.tarCode,r,i)}else if(r instanceof Error)this.emit("error",Object.assign(r,i));else this.emit("error",Object.assign(new Error(`${t}: ${r}`),i))}}},462:t=>{"use strict";const r=["|","<",">","?",":"];const i=r.map((t=>String.fromCharCode(61440+t.charCodeAt(0))));const o=new Map(r.map(((t,r)=>[t,i[r]])));const a=new Map(i.map(((t,i)=>[t,r[i]])));t.exports={encode:t=>r.reduce(((t,r)=>t.split(r).join(o.get(r))),t),decode:t=>i.reduce(((t,r)=>t.split(r).join(a.get(r))),t)}},3717:(t,r,i)=>{"use strict";const o=i(6150);const a=i(2315);const c=i(6261);const l=i(7147);const u=i(1017);const h=i(307);const d=i(5919);const prefixPath=(t,r)=>{if(!r)return h(t);t=h(t).replace(/^\.(\/|$)/,"");return d(r)+"/"+t};const p=16*1024*1024;const m=Symbol("process");const g=Symbol("file");const y=Symbol("directory");const b=Symbol("symlink");const v=Symbol("hardlink");const _=Symbol("header");const w=Symbol("read");const E=Symbol("lstat");const S=Symbol("onlstat");const O=Symbol("onread");const R=Symbol("onreadlink");const x=Symbol("openfile");const A=Symbol("onopenfile");const T=Symbol("close");const k=Symbol("mode");const C=Symbol("awaitDrain");const P=Symbol("ondrain");const I=Symbol("prefix");const L=Symbol("hadError");const N=i(5160);const M=i(462);const D=i(5691);const j=i(3801);const $=N(class WriteEntry extends o{constructor(t,r){r=r||{};super(r);if(typeof t!=="string")throw new TypeError("path is required");this.path=h(t);this.portable=!!r.portable;this.myuid=process.getuid&&process.getuid()||0;this.myuser=process.env.USER||"";this.maxReadSize=r.maxReadSize||p;this.linkCache=r.linkCache||new Map;this.statCache=r.statCache||new Map;this.preservePaths=!!r.preservePaths;this.cwd=h(r.cwd||process.cwd());this.strict=!!r.strict;this.noPax=!!r.noPax;this.noMtime=!!r.noMtime;this.mtime=r.mtime||null;this.prefix=r.prefix?h(r.prefix):null;this.fd=null;this.blockLen=null;this.blockRemain=null;this.buf=null;this.offset=null;this.length=null;this.pos=null;this.remain=null;if(typeof r.onwarn==="function")this.on("warn",r.onwarn);let i=false;if(!this.preservePaths){const[t,r]=D(this.path);if(t){this.path=r;i=t}}this.win32=!!r.win32||process.platform==="win32";if(this.win32){this.path=M.decode(this.path.replace(/\\/g,"/"));t=t.replace(/\\/g,"/")}this.absolute=h(r.absolute||u.resolve(this.cwd,t));if(this.path==="")this.path="./";if(i){this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path})}if(this.statCache.has(this.absolute))this[S](this.statCache.get(this.absolute));else this[E]()}emit(t,...r){if(t==="error")this[L]=true;return super.emit(t,...r)}[E](){l.lstat(this.absolute,((t,r)=>{if(t)return this.emit("error",t);this[S](r)}))}[S](t){this.statCache.set(this.absolute,t);this.stat=t;if(!t.isFile())t.size=0;this.type=getType(t);this.emit("stat",t);this[m]()}[m](){switch(this.type){case"File":return this[g]();case"Directory":return this[y]();case"SymbolicLink":return this[b]();default:return this.end()}}[k](t){return j(t,this.type==="Directory",this.portable)}[I](t){return prefixPath(t,this.prefix)}[_](){if(this.type==="Directory"&&this.portable)this.noMtime=true;this.header=new c({path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,mode:this[k](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime});if(this.header.encode()&&!this.noPax){super.write(new a({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode())}super.write(this.header.block)}[y](){if(this.path.substr(-1)!=="/")this.path+="/";this.stat.size=0;this[_]();this.end()}[b](){l.readlink(this.absolute,((t,r)=>{if(t)return this.emit("error",t);this[R](r)}))}[R](t){this.linkpath=h(t);this[_]();this.end()}[v](t){this.type="Link";this.linkpath=h(u.relative(this.cwd,t));this.stat.size=0;this[_]();this.end()}[g](){if(this.stat.nlink>1){const t=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(t)){const r=this.linkCache.get(t);if(r.indexOf(this.cwd)===0)return this[v](r)}this.linkCache.set(t,this.absolute)}this[_]();if(this.stat.size===0)return this.end();this[x]()}[x](){l.open(this.absolute,"r",((t,r)=>{if(t)return this.emit("error",t);this[A](r)}))}[A](t){this.fd=t;if(this[L])return this[T]();this.blockLen=512*Math.ceil(this.stat.size/512);this.blockRemain=this.blockLen;const r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r);this.offset=0;this.pos=0;this.remain=this.stat.size;this.length=this.buf.length;this[w]()}[w](){const{fd:t,buf:r,offset:i,length:o,pos:a}=this;l.read(t,r,i,o,a,((t,r)=>{if(t){return this[T]((()=>this.emit("error",t)))}this[O](r)}))}[T](t){l.close(this.fd,t)}[O](t){if(t<=0&&this.remain>0){const t=new Error("encountered unexpected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[T]((()=>this.emit("error",t)))}if(t>this.remain){const t=new Error("did not encounter expected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[T]((()=>this.emit("error",t)))}if(t===this.remain){for(let r=t;r<this.length&&t<this.blockRemain;r++){this.buf[r+this.offset]=0;t++;this.remain++}}const r=this.offset===0&&t===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+t);const i=this.write(r);if(!i)this[C]((()=>this[P]()));else this[P]()}[C](t){this.once("drain",t)}write(t){if(this.blockRemain<t.length){const t=new Error("writing more data than expected");t.path=this.absolute;return this.emit("error",t)}this.remain-=t.length;this.blockRemain-=t.length;this.pos+=t.length;this.offset+=t.length;return super.write(t)}[P](){if(!this.remain){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return this[T]((t=>t?this.emit("error",t):this.end()))}if(this.offset>=this.length){this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length));this.offset=0}this.length=this.buf.length-this.offset;this[w]()}});class WriteEntrySync extends ${[E](){this[S](l.lstatSync(this.absolute))}[b](){this[R](l.readlinkSync(this.absolute))}[x](){this[A](l.openSync(this.absolute,"r"))}[w](){let t=true;try{const{fd:r,buf:i,offset:o,length:a,pos:c}=this;const u=l.readSync(r,i,o,a,c);this[O](u);t=false}finally{if(t){try{this[T]((()=>{}))}catch(t){}}}}[C](t){t()}[T](t){l.closeSync(this.fd);t()}}const H=N(class WriteEntryTar extends o{constructor(t,r){r=r||{};super(r);this.preservePaths=!!r.preservePaths;this.portable=!!r.portable;this.strict=!!r.strict;this.noPax=!!r.noPax;this.noMtime=!!r.noMtime;this.readEntry=t;this.type=t.type;if(this.type==="Directory"&&this.portable)this.noMtime=true;this.prefix=r.prefix||null;this.path=h(t.path);this.mode=this[k](t.mode);this.uid=this.portable?null:t.uid;this.gid=this.portable?null:t.gid;this.uname=this.portable?null:t.uname;this.gname=this.portable?null:t.gname;this.size=t.size;this.mtime=this.noMtime?null:r.mtime||t.mtime;this.atime=this.portable?null:t.atime;this.ctime=this.portable?null:t.ctime;this.linkpath=h(t.linkpath);if(typeof r.onwarn==="function")this.on("warn",r.onwarn);let i=false;if(!this.preservePaths){const[t,r]=D(this.path);if(t){this.path=r;i=t}}this.remain=t.size;this.blockRemain=t.startBlockSize;this.header=new c({path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime});if(i){this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path})}if(this.header.encode()&&!this.noPax){super.write(new a({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode())}super.write(this.header.block);t.pipe(this)}[I](t){return prefixPath(t,this.prefix)}[k](t){return j(t,this.type==="Directory",this.portable)}write(t){const r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");this.blockRemain-=r;return super.write(t)}end(){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return super.end()}});$.Sync=WriteEntrySync;$.Tar=H;const getType=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";t.exports=$},211:(t,r,i)=>{"use strict";
|
|
117
|
+
var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){t.exports=o}else{copyProps(o,r);r.Buffer=SafeBuffer}function SafeBuffer(t,r,i){return a(t,r,i)}SafeBuffer.prototype=Object.create(a.prototype);copyProps(a,SafeBuffer);SafeBuffer.from=function(t,r,i){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return a(t,r,i)};SafeBuffer.alloc=function(t,r,i){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var o=a(t);if(r!==undefined){if(typeof i==="string"){o.fill(r,i)}else{o.fill(r)}}else{o.fill(0)}return o};SafeBuffer.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return a(t)};SafeBuffer.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return o.SlowBuffer(t)}},8985:(t,r)=>{r=t.exports=SemVer;var i;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){i=function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER");console.log.apply(console,t)}}else{i=function(){}}r.SEMVER_SPEC_VERSION="2.0.0";var o=256;var a=Number.MAX_SAFE_INTEGER||9007199254740991;var l=16;var c=r.re=[];var u=r.src=[];var h=r.tokens={};var d=0;function tok(t){h[t]=d++}tok("NUMERICIDENTIFIER");u[h.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");u[h.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");u[h.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");u[h.MAINVERSION]="("+u[h.NUMERICIDENTIFIER]+")\\."+"("+u[h.NUMERICIDENTIFIER]+")\\."+"("+u[h.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");u[h.MAINVERSIONLOOSE]="("+u[h.NUMERICIDENTIFIERLOOSE]+")\\."+"("+u[h.NUMERICIDENTIFIERLOOSE]+")\\."+"("+u[h.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");u[h.PRERELEASEIDENTIFIER]="(?:"+u[h.NUMERICIDENTIFIER]+"|"+u[h.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");u[h.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[h.NUMERICIDENTIFIERLOOSE]+"|"+u[h.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");u[h.PRERELEASE]="(?:-("+u[h.PRERELEASEIDENTIFIER]+"(?:\\."+u[h.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");u[h.PRERELEASELOOSE]="(?:-?("+u[h.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[h.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");u[h.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");u[h.BUILD]="(?:\\+("+u[h.BUILDIDENTIFIER]+"(?:\\."+u[h.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");u[h.FULLPLAIN]="v?"+u[h.MAINVERSION]+u[h.PRERELEASE]+"?"+u[h.BUILD]+"?";u[h.FULL]="^"+u[h.FULLPLAIN]+"$";tok("LOOSEPLAIN");u[h.LOOSEPLAIN]="[v=\\s]*"+u[h.MAINVERSIONLOOSE]+u[h.PRERELEASELOOSE]+"?"+u[h.BUILD]+"?";tok("LOOSE");u[h.LOOSE]="^"+u[h.LOOSEPLAIN]+"$";tok("GTLT");u[h.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");u[h.XRANGEIDENTIFIERLOOSE]=u[h.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");u[h.XRANGEIDENTIFIER]=u[h.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");u[h.XRANGEPLAIN]="[v=\\s]*("+u[h.XRANGEIDENTIFIER]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIER]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIER]+")"+"(?:"+u[h.PRERELEASE]+")?"+u[h.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");u[h.XRANGEPLAINLOOSE]="[v=\\s]*("+u[h.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+u[h.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+u[h.PRERELEASELOOSE]+")?"+u[h.BUILD]+"?"+")?)?";tok("XRANGE");u[h.XRANGE]="^"+u[h.GTLT]+"\\s*"+u[h.XRANGEPLAIN]+"$";tok("XRANGELOOSE");u[h.XRANGELOOSE]="^"+u[h.GTLT]+"\\s*"+u[h.XRANGEPLAINLOOSE]+"$";tok("COERCE");u[h.COERCE]="(^|[^\\d])"+"(\\d{1,"+l+"})"+"(?:\\.(\\d{1,"+l+"}))?"+"(?:\\.(\\d{1,"+l+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");c[h.COERCERTL]=new RegExp(u[h.COERCE],"g");tok("LONETILDE");u[h.LONETILDE]="(?:~>?)";tok("TILDETRIM");u[h.TILDETRIM]="(\\s*)"+u[h.LONETILDE]+"\\s+";c[h.TILDETRIM]=new RegExp(u[h.TILDETRIM],"g");var p="$1~";tok("TILDE");u[h.TILDE]="^"+u[h.LONETILDE]+u[h.XRANGEPLAIN]+"$";tok("TILDELOOSE");u[h.TILDELOOSE]="^"+u[h.LONETILDE]+u[h.XRANGEPLAINLOOSE]+"$";tok("LONECARET");u[h.LONECARET]="(?:\\^)";tok("CARETTRIM");u[h.CARETTRIM]="(\\s*)"+u[h.LONECARET]+"\\s+";c[h.CARETTRIM]=new RegExp(u[h.CARETTRIM],"g");var m="$1^";tok("CARET");u[h.CARET]="^"+u[h.LONECARET]+u[h.XRANGEPLAIN]+"$";tok("CARETLOOSE");u[h.CARETLOOSE]="^"+u[h.LONECARET]+u[h.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");u[h.COMPARATORLOOSE]="^"+u[h.GTLT]+"\\s*("+u[h.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");u[h.COMPARATOR]="^"+u[h.GTLT]+"\\s*("+u[h.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");u[h.COMPARATORTRIM]="(\\s*)"+u[h.GTLT]+"\\s*("+u[h.LOOSEPLAIN]+"|"+u[h.XRANGEPLAIN]+")";c[h.COMPARATORTRIM]=new RegExp(u[h.COMPARATORTRIM],"g");var y="$1$2$3";tok("HYPHENRANGE");u[h.HYPHENRANGE]="^\\s*("+u[h.XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+u[h.XRANGEPLAIN]+")"+"\\s*$";tok("HYPHENRANGELOOSE");u[h.HYPHENRANGELOOSE]="^\\s*("+u[h.XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+u[h.XRANGEPLAINLOOSE]+")"+"\\s*$";tok("STAR");u[h.STAR]="(<|>)?=?\\s*\\*";for(var g=0;g<d;g++){i(g,u[g]);if(!c[g]){c[g]=new RegExp(u[g])}}r.parse=parse;function parse(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof SemVer){return t}if(typeof t!=="string"){return null}if(t.length>o){return null}var i=r.loose?c[h.LOOSE]:c[h.FULL];if(!i.test(t)){return null}try{return new SemVer(t,r)}catch(t){return null}}r.valid=valid;function valid(t,r){var i=parse(t,r);return i?i.version:null}r.clean=clean;function clean(t,r){var i=parse(t.trim().replace(/^[=v]+/,""),r);return i?i.version:null}r.SemVer=SemVer;function SemVer(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof SemVer){if(t.loose===r.loose){return t}else{t=t.version}}else if(typeof t!=="string"){throw new TypeError("Invalid Version: "+t)}if(t.length>o){throw new TypeError("version is longer than "+o+" characters")}if(!(this instanceof SemVer)){return new SemVer(t,r)}i("SemVer",t,r);this.options=r;this.loose=!!r.loose;var l=t.trim().match(r.loose?c[h.LOOSE]:c[h.FULL]);if(!l){throw new TypeError("Invalid Version: "+t)}this.raw=t;this.major=+l[1];this.minor=+l[2];this.patch=+l[3];if(this.major>a||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>a||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>a||this.patch<0){throw new TypeError("Invalid patch version")}if(!l[4]){this.prerelease=[]}else{this.prerelease=l[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var r=+t;if(r>=0&&r<a){return r}}return t}))}this.build=l[5]?l[5].split("."):[];this.format()}SemVer.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length){this.version+="-"+this.prerelease.join(".")}return this.version};SemVer.prototype.toString=function(){return this.version};SemVer.prototype.compare=function(t){i("SemVer.compare",this.version,this.options,t);if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}return this.compareMain(t)||this.comparePre(t)};SemVer.prototype.compareMain=function(t){if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}return compareIdentifiers(this.major,t.major)||compareIdentifiers(this.minor,t.minor)||compareIdentifiers(this.patch,t.patch)};SemVer.prototype.comparePre=function(t){if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}if(this.prerelease.length&&!t.prerelease.length){return-1}else if(!this.prerelease.length&&t.prerelease.length){return 1}else if(!this.prerelease.length&&!t.prerelease.length){return 0}var r=0;do{var o=this.prerelease[r];var a=t.prerelease[r];i("prerelease compare",r,o,a);if(o===undefined&&a===undefined){return 0}else if(a===undefined){return 1}else if(o===undefined){return-1}else if(o===a){continue}else{return compareIdentifiers(o,a)}}while(++r)};SemVer.prototype.compareBuild=function(t){if(!(t instanceof SemVer)){t=new SemVer(t,this.options)}var r=0;do{var o=this.build[r];var a=t.build[r];i("prerelease compare",r,o,a);if(o===undefined&&a===undefined){return 0}else if(a===undefined){return 1}else if(o===undefined){return-1}else if(o===a){continue}else{return compareIdentifiers(o,a)}}while(++r)};SemVer.prototype.inc=function(t,r){switch(t){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0){this.inc("patch",r)}this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0){this.major++}this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0){this.minor++}this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0){this.patch++}this.prerelease=[];break;case"pre":if(this.prerelease.length===0){this.prerelease=[0]}else{var i=this.prerelease.length;while(--i>=0){if(typeof this.prerelease[i]==="number"){this.prerelease[i]++;i=-2}}if(i===-1){this.prerelease.push(0)}}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1])){this.prerelease=[r,0]}}else{this.prerelease=[r,0]}}break;default:throw new Error("invalid increment argument: "+t)}this.format();this.raw=this.version;return this};r.inc=inc;function inc(t,r,i,o){if(typeof i==="string"){o=i;i=undefined}try{return new SemVer(t,i).inc(r,o).version}catch(t){return null}}r.diff=diff;function diff(t,r){if(eq(t,r)){return null}else{var i=parse(t);var o=parse(r);var a="";if(i.prerelease.length||o.prerelease.length){a="pre";var l="prerelease"}for(var c in i){if(c==="major"||c==="minor"||c==="patch"){if(i[c]!==o[c]){return a+c}}}return l}}r.compareIdentifiers=compareIdentifiers;var b=/^[0-9]+$/;function compareIdentifiers(t,r){var i=b.test(t);var o=b.test(r);if(i&&o){t=+t;r=+r}return t===r?0:i&&!o?-1:o&&!i?1:t<r?-1:1}r.rcompareIdentifiers=rcompareIdentifiers;function rcompareIdentifiers(t,r){return compareIdentifiers(r,t)}r.major=major;function major(t,r){return new SemVer(t,r).major}r.minor=minor;function minor(t,r){return new SemVer(t,r).minor}r.patch=patch;function patch(t,r){return new SemVer(t,r).patch}r.compare=compare;function compare(t,r,i){return new SemVer(t,i).compare(new SemVer(r,i))}r.compareLoose=compareLoose;function compareLoose(t,r){return compare(t,r,true)}r.compareBuild=compareBuild;function compareBuild(t,r,i){var o=new SemVer(t,i);var a=new SemVer(r,i);return o.compare(a)||o.compareBuild(a)}r.rcompare=rcompare;function rcompare(t,r,i){return compare(r,t,i)}r.sort=sort;function sort(t,i){return t.sort((function(t,o){return r.compareBuild(t,o,i)}))}r.rsort=rsort;function rsort(t,i){return t.sort((function(t,o){return r.compareBuild(o,t,i)}))}r.gt=gt;function gt(t,r,i){return compare(t,r,i)>0}r.lt=lt;function lt(t,r,i){return compare(t,r,i)<0}r.eq=eq;function eq(t,r,i){return compare(t,r,i)===0}r.neq=neq;function neq(t,r,i){return compare(t,r,i)!==0}r.gte=gte;function gte(t,r,i){return compare(t,r,i)>=0}r.lte=lte;function lte(t,r,i){return compare(t,r,i)<=0}r.cmp=cmp;function cmp(t,r,i,o){switch(r){case"===":if(typeof t==="object")t=t.version;if(typeof i==="object")i=i.version;return t===i;case"!==":if(typeof t==="object")t=t.version;if(typeof i==="object")i=i.version;return t!==i;case"":case"=":case"==":return eq(t,i,o);case"!=":return neq(t,i,o);case">":return gt(t,i,o);case">=":return gte(t,i,o);case"<":return lt(t,i,o);case"<=":return lte(t,i,o);default:throw new TypeError("Invalid operator: "+r)}}r.Comparator=Comparator;function Comparator(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof Comparator){if(t.loose===!!r.loose){return t}else{t=t.value}}if(!(this instanceof Comparator)){return new Comparator(t,r)}i("comparator",t,r);this.options=r;this.loose=!!r.loose;this.parse(t);if(this.semver===v){this.value=""}else{this.value=this.operator+this.semver.version}i("comp",this)}var v={};Comparator.prototype.parse=function(t){var r=this.options.loose?c[h.COMPARATORLOOSE]:c[h.COMPARATOR];var i=t.match(r);if(!i){throw new TypeError("Invalid comparator: "+t)}this.operator=i[1]!==undefined?i[1]:"";if(this.operator==="="){this.operator=""}if(!i[2]){this.semver=v}else{this.semver=new SemVer(i[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(t){i("Comparator.test",t,this.options.loose);if(this.semver===v||t===v){return true}if(typeof t==="string"){try{t=new SemVer(t,this.options)}catch(t){return false}}return cmp(t,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(t,r){if(!(t instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}var i;if(this.operator===""){if(this.value===""){return true}i=new Range(t.value,r);return satisfies(this.value,i,r)}else if(t.operator===""){if(t.value===""){return true}i=new Range(this.value,r);return satisfies(t.semver,i,r)}var o=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">");var a=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<");var l=this.semver.version===t.semver.version;var c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<=");var u=cmp(this.semver,"<",t.semver,r)&&((this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"));var h=cmp(this.semver,">",t.semver,r)&&((this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">"));return o||a||l&&c||u||h};r.Range=Range;function Range(t,r){if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(t instanceof Range){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{return new Range(t.raw,r)}}if(t instanceof Comparator){return new Range(t.value,r)}if(!(this instanceof Range)){return new Range(t,r)}this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;this.raw=t;this.set=t.split(/\s*\|\|\s*/).map((function(t){return this.parseRange(t.trim())}),this).filter((function(t){return t.length}));if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+t)}this.format()}Range.prototype.format=function(){this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(t){var r=this.options.loose;t=t.trim();var o=r?c[h.HYPHENRANGELOOSE]:c[h.HYPHENRANGE];t=t.replace(o,hyphenReplace);i("hyphen replace",t);t=t.replace(c[h.COMPARATORTRIM],y);i("comparator trim",t,c[h.COMPARATORTRIM]);t=t.replace(c[h.TILDETRIM],p);t=t.replace(c[h.CARETTRIM],m);t=t.split(/\s+/).join(" ");var a=r?c[h.COMPARATORLOOSE]:c[h.COMPARATOR];var l=t.split(" ").map((function(t){return parseComparator(t,this.options)}),this).join(" ").split(/\s+/);if(this.options.loose){l=l.filter((function(t){return!!t.match(a)}))}l=l.map((function(t){return new Comparator(t,this.options)}),this);return l};Range.prototype.intersects=function(t,r){if(!(t instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((function(i){return isSatisfiable(i,r)&&t.set.some((function(t){return isSatisfiable(t,r)&&i.every((function(i){return t.every((function(t){return i.intersects(t,r)}))}))}))}))};function isSatisfiable(t,r){var i=true;var o=t.slice();var a=o.pop();while(i&&o.length){i=o.every((function(t){return a.intersects(t,r)}));a=o.pop()}return i}r.toComparators=toComparators;function toComparators(t,r){return new Range(t,r).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))}function parseComparator(t,r){i("comp",t,r);t=replaceCarets(t,r);i("caret",t);t=replaceTildes(t,r);i("tildes",t);t=replaceXRanges(t,r);i("xrange",t);t=replaceStars(t,r);i("stars",t);return t}function isX(t){return!t||t.toLowerCase()==="x"||t==="*"}function replaceTildes(t,r){return t.trim().split(/\s+/).map((function(t){return replaceTilde(t,r)})).join(" ")}function replaceTilde(t,r){var o=r.loose?c[h.TILDELOOSE]:c[h.TILDE];return t.replace(o,(function(r,o,a,l,c){i("tilde",t,r,o,a,l,c);var u;if(isX(o)){u=""}else if(isX(a)){u=">="+o+".0.0 <"+(+o+1)+".0.0"}else if(isX(l)){u=">="+o+"."+a+".0 <"+o+"."+(+a+1)+".0"}else if(c){i("replaceTilde pr",c);u=">="+o+"."+a+"."+l+"-"+c+" <"+o+"."+(+a+1)+".0"}else{u=">="+o+"."+a+"."+l+" <"+o+"."+(+a+1)+".0"}i("tilde return",u);return u}))}function replaceCarets(t,r){return t.trim().split(/\s+/).map((function(t){return replaceCaret(t,r)})).join(" ")}function replaceCaret(t,r){i("caret",t,r);var o=r.loose?c[h.CARETLOOSE]:c[h.CARET];return t.replace(o,(function(r,o,a,l,c){i("caret",t,r,o,a,l,c);var u;if(isX(o)){u=""}else if(isX(a)){u=">="+o+".0.0 <"+(+o+1)+".0.0"}else if(isX(l)){if(o==="0"){u=">="+o+"."+a+".0 <"+o+"."+(+a+1)+".0"}else{u=">="+o+"."+a+".0 <"+(+o+1)+".0.0"}}else if(c){i("replaceCaret pr",c);if(o==="0"){if(a==="0"){u=">="+o+"."+a+"."+l+"-"+c+" <"+o+"."+a+"."+(+l+1)}else{u=">="+o+"."+a+"."+l+"-"+c+" <"+o+"."+(+a+1)+".0"}}else{u=">="+o+"."+a+"."+l+"-"+c+" <"+(+o+1)+".0.0"}}else{i("no pr");if(o==="0"){if(a==="0"){u=">="+o+"."+a+"."+l+" <"+o+"."+a+"."+(+l+1)}else{u=">="+o+"."+a+"."+l+" <"+o+"."+(+a+1)+".0"}}else{u=">="+o+"."+a+"."+l+" <"+(+o+1)+".0.0"}}i("caret return",u);return u}))}function replaceXRanges(t,r){i("replaceXRanges",t,r);return t.split(/\s+/).map((function(t){return replaceXRange(t,r)})).join(" ")}function replaceXRange(t,r){t=t.trim();var o=r.loose?c[h.XRANGELOOSE]:c[h.XRANGE];return t.replace(o,(function(o,a,l,c,u,h){i("xRange",t,o,a,l,c,u,h);var d=isX(l);var p=d||isX(c);var m=p||isX(u);var y=m;if(a==="="&&y){a=""}h=r.includePrerelease?"-0":"";if(d){if(a===">"||a==="<"){o="<0.0.0-0"}else{o="*"}}else if(a&&y){if(p){c=0}u=0;if(a===">"){a=">=";if(p){l=+l+1;c=0;u=0}else{c=+c+1;u=0}}else if(a==="<="){a="<";if(p){l=+l+1}else{c=+c+1}}o=a+l+"."+c+"."+u+h}else if(p){o=">="+l+".0.0"+h+" <"+(+l+1)+".0.0"+h}else if(m){o=">="+l+"."+c+".0"+h+" <"+l+"."+(+c+1)+".0"+h}i("xRange return",o);return o}))}function replaceStars(t,r){i("replaceStars",t,r);return t.trim().replace(c[h.STAR],"")}function hyphenReplace(t,r,i,o,a,l,c,u,h,d,p,m,y){if(isX(i)){r=""}else if(isX(o)){r=">="+i+".0.0"}else if(isX(a)){r=">="+i+"."+o+".0"}else{r=">="+r}if(isX(h)){u=""}else if(isX(d)){u="<"+(+h+1)+".0.0"}else if(isX(p)){u="<"+h+"."+(+d+1)+".0"}else if(m){u="<="+h+"."+d+"."+p+"-"+m}else{u="<="+u}return(r+" "+u).trim()}Range.prototype.test=function(t){if(!t){return false}if(typeof t==="string"){try{t=new SemVer(t,this.options)}catch(t){return false}}for(var r=0;r<this.set.length;r++){if(testSet(this.set[r],t,this.options)){return true}}return false};function testSet(t,r,o){for(var a=0;a<t.length;a++){if(!t[a].test(r)){return false}}if(r.prerelease.length&&!o.includePrerelease){for(a=0;a<t.length;a++){i(t[a].semver);if(t[a].semver===v){continue}if(t[a].semver.prerelease.length>0){var l=t[a].semver;if(l.major===r.major&&l.minor===r.minor&&l.patch===r.patch){return true}}}return false}return true}r.satisfies=satisfies;function satisfies(t,r,i){try{r=new Range(r,i)}catch(t){return false}return r.test(t)}r.maxSatisfying=maxSatisfying;function maxSatisfying(t,r,i){var o=null;var a=null;try{var l=new Range(r,i)}catch(t){return null}t.forEach((function(t){if(l.test(t)){if(!o||a.compare(t)===-1){o=t;a=new SemVer(o,i)}}}));return o}r.minSatisfying=minSatisfying;function minSatisfying(t,r,i){var o=null;var a=null;try{var l=new Range(r,i)}catch(t){return null}t.forEach((function(t){if(l.test(t)){if(!o||a.compare(t)===1){o=t;a=new SemVer(o,i)}}}));return o}r.minVersion=minVersion;function minVersion(t,r){t=new Range(t,r);var i=new SemVer("0.0.0");if(t.test(i)){return i}i=new SemVer("0.0.0-0");if(t.test(i)){return i}i=null;for(var o=0;o<t.set.length;++o){var a=t.set[o];a.forEach((function(t){var r=new SemVer(t.semver.version);switch(t.operator){case">":if(r.prerelease.length===0){r.patch++}else{r.prerelease.push(0)}r.raw=r.format();case"":case">=":if(!i||gt(i,r)){i=r}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}}))}if(i&&t.test(i)){return i}return null}r.validRange=validRange;function validRange(t,r){try{return new Range(t,r).range||"*"}catch(t){return null}}r.ltr=ltr;function ltr(t,r,i){return outside(t,r,"<",i)}r.gtr=gtr;function gtr(t,r,i){return outside(t,r,">",i)}r.outside=outside;function outside(t,r,i,o){t=new SemVer(t,o);r=new Range(r,o);var a,l,c,u,h;switch(i){case">":a=gt;l=lte;c=lt;u=">";h=">=";break;case"<":a=lt;l=gte;c=gt;u="<";h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(t,r,o)){return false}for(var d=0;d<r.set.length;++d){var p=r.set[d];var m=null;var y=null;p.forEach((function(t){if(t.semver===v){t=new Comparator(">=0.0.0")}m=m||t;y=y||t;if(a(t.semver,m.semver,o)){m=t}else if(c(t.semver,y.semver,o)){y=t}}));if(m.operator===u||m.operator===h){return false}if((!y.operator||y.operator===u)&&l(t,y.semver)){return false}else if(y.operator===h&&c(t,y.semver)){return false}}return true}r.prerelease=prerelease;function prerelease(t,r){var i=parse(t,r);return i&&i.prerelease.length?i.prerelease:null}r.intersects=intersects;function intersects(t,r,i){t=new Range(t,i);r=new Range(r,i);return t.intersects(r)}r.coerce=coerce;function coerce(t,r){if(t instanceof SemVer){return t}if(typeof t==="number"){t=String(t)}if(typeof t!=="string"){return null}r=r||{};var i=null;if(!r.rtl){i=t.match(c[h.COERCE])}else{var o;while((o=c[h.COERCERTL].exec(t))&&(!i||i.index+i[0].length!==t.length)){if(!i||o.index+o[0].length!==i.index+i[0].length){i=o}c[h.COERCERTL].lastIndex=o.index+o[1].length+o[2].length}c[h.COERCERTL].lastIndex=-1}if(i===null){return null}return parse(i[2]+"."+(i[3]||"0")+"."+(i[4]||"0"),r)}},6464:(t,r,i)=>{"use strict";const o=i(8646);t.exports=(t="")=>{const r=t.match(o);if(!r){return null}const[i,a]=r[0].replace(/#! ?/,"").split(" ");const l=i.split("/").pop();if(l==="env"){return a}return a?`${l} ${a}`:l}},8646:t=>{"use strict";t.exports=/^#!(.*)/},3797:t=>{"use strict";const r="";const i=`${r}[`;const o="";const a={to(t,r){if(!r)return`${i}${t+1}G`;return`${i}${r+1};${t+1}H`},move(t,r){let o="";if(t<0)o+=`${i}${-t}D`;else if(t>0)o+=`${i}${t}C`;if(r<0)o+=`${i}${-r}A`;else if(r>0)o+=`${i}${r}B`;return o},up:(t=1)=>`${i}${t}A`,down:(t=1)=>`${i}${t}B`,forward:(t=1)=>`${i}${t}C`,backward:(t=1)=>`${i}${t}D`,nextLine:(t=1)=>`${i}E`.repeat(t),prevLine:(t=1)=>`${i}F`.repeat(t),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${r}7`,restore:`${r}8`};const l={up:(t=1)=>`${i}S`.repeat(t),down:(t=1)=>`${i}T`.repeat(t)};const c={screen:`${i}2J`,up:(t=1)=>`${i}1J`.repeat(t),down:(t=1)=>`${i}J`.repeat(t),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(t){let r="";for(let i=0;i<t;i++)r+=this.line+(i<t-1?a.up():"");if(t)r+=a.left;return r}};t.exports={cursor:a,scroll:l,erase:c,beep:o}},467:(t,r,i)=>{"use strict";var o=i(7455).Buffer;var a=o.isEncoding||function(t){t=""+t;switch(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 true;default:return false}};function _normalizeEncoding(t){if(!t)return"utf8";var r;while(true){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(r)return;t=(""+t).toLowerCase();r=true}}}function normalizeEncoding(t){var r=_normalizeEncoding(t);if(typeof r!=="string"&&(o.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return r||t}r.s=StringDecoder;function StringDecoder(t){this.encoding=normalizeEncoding(t);var r;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;r=4;break;case"utf8":this.fillLast=utf8FillLast;r=4;break;case"base64":this.text=base64Text;this.end=base64End;r=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=o.allocUnsafe(r)}StringDecoder.prototype.write=function(t){if(t.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(t);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i<t.length)return r?r+this.text(t,i):this.text(t,i);return r||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};function utf8CheckByte(t){if(t<=127)return 0;else if(t>>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function utf8CheckIncomplete(t,r,i){var o=r.length-1;if(o<i)return 0;var a=utf8CheckByte(r[o]);if(a>=0){if(a>0)t.lastNeed=a-1;return a}if(--o<i||a===-2)return 0;a=utf8CheckByte(r[o]);if(a>=0){if(a>0)t.lastNeed=a-2;return a}if(--o<i||a===-2)return 0;a=utf8CheckByte(r[o]);if(a>=0){if(a>0){if(a===2)a=0;else t.lastNeed=a-3}return a}return 0}function utf8CheckExtraBytes(t,r,i){if((r[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&r.length>1){if((r[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&r.length>2){if((r[2]&192)!==128){t.lastNeed=2;return"�"}}}}function utf8FillLast(t){var r=this.lastTotal-this.lastNeed;var i=utf8CheckExtraBytes(this,t,r);if(i!==undefined)return i;if(this.lastNeed<=t.length){t.copy(this.lastChar,r,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,r,0,t.length);this.lastNeed-=t.length}function utf8Text(t,r){var i=utf8CheckIncomplete(this,t,r);if(!this.lastNeed)return t.toString("utf8",r);this.lastTotal=i;var o=t.length-(i-this.lastNeed);t.copy(this.lastChar,0,o);return t.toString("utf8",r,o)}function utf8End(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed)return r+"�";return r}function utf16Text(t,r){if((t.length-r)%2===0){var i=t.toString("utf16le",r);if(i){var o=i.charCodeAt(i.length-1);if(o>=55296&&o<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return i.slice(0,-1)}}return i}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",r,t.length-1)}function utf16End(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,i)}return r}function base64Text(t,r){var i=(t.length-r)%3;if(i===0)return t.toString("base64",r);this.lastNeed=3-i;this.lastTotal=3;if(i===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",r,t.length-i)}function base64End(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}},1862:(t,r,i)=>{"use strict";var o=i(1420).Buffer;var a=o.isEncoding||function(t){t=""+t;switch(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 true;default:return false}};function _normalizeEncoding(t){if(!t)return"utf8";var r;while(true){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(r)return;t=(""+t).toLowerCase();r=true}}}function normalizeEncoding(t){var r=_normalizeEncoding(t);if(typeof r!=="string"&&(o.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return r||t}r.s=StringDecoder;function StringDecoder(t){this.encoding=normalizeEncoding(t);var r;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;r=4;break;case"utf8":this.fillLast=utf8FillLast;r=4;break;case"base64":this.text=base64Text;this.end=base64End;r=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=o.allocUnsafe(r)}StringDecoder.prototype.write=function(t){if(t.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(t);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i<t.length)return r?r+this.text(t,i):this.text(t,i);return r||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};function utf8CheckByte(t){if(t<=127)return 0;else if(t>>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function utf8CheckIncomplete(t,r,i){var o=r.length-1;if(o<i)return 0;var a=utf8CheckByte(r[o]);if(a>=0){if(a>0)t.lastNeed=a-1;return a}if(--o<i||a===-2)return 0;a=utf8CheckByte(r[o]);if(a>=0){if(a>0)t.lastNeed=a-2;return a}if(--o<i||a===-2)return 0;a=utf8CheckByte(r[o]);if(a>=0){if(a>0){if(a===2)a=0;else t.lastNeed=a-3}return a}return 0}function utf8CheckExtraBytes(t,r,i){if((r[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&r.length>1){if((r[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&r.length>2){if((r[2]&192)!==128){t.lastNeed=2;return"�"}}}}function utf8FillLast(t){var r=this.lastTotal-this.lastNeed;var i=utf8CheckExtraBytes(this,t,r);if(i!==undefined)return i;if(this.lastNeed<=t.length){t.copy(this.lastChar,r,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,r,0,t.length);this.lastNeed-=t.length}function utf8Text(t,r){var i=utf8CheckIncomplete(this,t,r);if(!this.lastNeed)return t.toString("utf8",r);this.lastTotal=i;var o=t.length-(i-this.lastNeed);t.copy(this.lastChar,0,o);return t.toString("utf8",r,o)}function utf8End(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed)return r+"�";return r}function utf16Text(t,r){if((t.length-r)%2===0){var i=t.toString("utf16le",r);if(i){var o=i.charCodeAt(i.length-1);if(o>=55296&&o<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return i.slice(0,-1)}}return i}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",r,t.length-1)}function utf16End(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,i)}return r}function base64Text(t,r){var i=(t.length-r)%3;if(i===0)return t.toString("base64",r);this.lastNeed=3-i;this.lastTotal=3;if(i===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",r,t.length-i)}function base64End(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}},2524:t=>{"use strict";var r=1;var i=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(t,r,i){return t.slice(r,i).replace(/\S/g," ")}t.exports=function(t,o){o=o||{};var a;var l;var c=false;var u=false;var h=0;var d="";var p=o.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var m=0;m<t.length;m++){a=t[m];l=t[m+1];if(!u&&a==='"'){var y=t[m-1]==="\\"&&t[m-2]!=="\\";if(!y){c=!c}}if(c){continue}if(!u&&a+l==="//"){d+=t.slice(h,m);h=m;u=r;m++}else if(u===r&&a+l==="\r\n"){m++;u=false;d+=p(t,h,m);h=m;continue}else if(u===r&&a==="\n"){u=false;d+=p(t,h,m);h=m}else if(!u&&a+l==="/*"){d+=t.slice(h,m);h=m;u=i;m++;continue}else if(u===i&&a+l==="*/"){m++;u=false;d+=p(t,h,m+1);h=m+1;continue}}return d+(u?p(t.substr(h)):t.substr(h))}},5438:(t,r,i)=>{var o=i(3837);var a=i(6539);var l=i(5825);var c=i(4381).Writable;var u=i(4381).PassThrough;var noop=function(){};var overflow=function(t){t&=511;return t&&512-t};var emptyStream=function(t,r){var i=new Source(t,r);i.end();return i};var mixinPax=function(t,r){if(r.path)t.name=r.path;if(r.linkpath)t.linkname=r.linkpath;if(r.size)t.size=parseInt(r.size,10);t.pax=r;return t};var Source=function(t,r){this._parent=t;this.offset=r;u.call(this,{autoDestroy:false})};o.inherits(Source,u);Source.prototype.destroy=function(t){this._parent.destroy(t)};var Extract=function(t){if(!(this instanceof Extract))return new Extract(t);c.call(this,t);t=t||{};this._offset=0;this._buffer=a();this._missing=0;this._partial=false;this._onparse=noop;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var r=this;var i=r._buffer;var oncontinue=function(){r._continue()};var onunlock=function(t){r._locked=false;if(t)return r.destroy(t);if(!r._stream)oncontinue()};var onstreamend=function(){r._stream=null;var t=overflow(r._header.size);if(t)r._parse(t,ondrain);else r._parse(512,onheader);if(!r._locked)oncontinue()};var ondrain=function(){r._buffer.consume(overflow(r._header.size));r._parse(512,onheader);oncontinue()};var onpaxglobalheader=function(){var t=r._header.size;r._paxGlobal=l.decodePax(i.slice(0,t));i.consume(t);onstreamend()};var onpaxheader=function(){var t=r._header.size;r._pax=l.decodePax(i.slice(0,t));if(r._paxGlobal)r._pax=Object.assign({},r._paxGlobal,r._pax);i.consume(t);onstreamend()};var ongnulongpath=function(){var o=r._header.size;this._gnuLongPath=l.decodeLongPath(i.slice(0,o),t.filenameEncoding);i.consume(o);onstreamend()};var ongnulonglinkpath=function(){var o=r._header.size;this._gnuLongLinkPath=l.decodeLongPath(i.slice(0,o),t.filenameEncoding);i.consume(o);onstreamend()};var onheader=function(){var o=r._offset;var a;try{a=r._header=l.decode(i.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(t){r.emit("error",t)}i.consume(512);if(!a){r._parse(512,onheader);oncontinue();return}if(a.type==="gnu-long-path"){r._parse(a.size,ongnulongpath);oncontinue();return}if(a.type==="gnu-long-link-path"){r._parse(a.size,ongnulonglinkpath);oncontinue();return}if(a.type==="pax-global-header"){r._parse(a.size,onpaxglobalheader);oncontinue();return}if(a.type==="pax-header"){r._parse(a.size,onpaxheader);oncontinue();return}if(r._gnuLongPath){a.name=r._gnuLongPath;r._gnuLongPath=null}if(r._gnuLongLinkPath){a.linkname=r._gnuLongLinkPath;r._gnuLongLinkPath=null}if(r._pax){r._header=a=mixinPax(a,r._pax);r._pax=null}r._locked=true;if(!a.size||a.type==="directory"){r._parse(512,onheader);r.emit("entry",a,emptyStream(r,o),onunlock);return}r._stream=new Source(r,o);r.emit("entry",a,r._stream,onunlock);r._parse(a.size,onstreamend);oncontinue()};this._onheader=onheader;this._parse(512,onheader)};o.inherits(Extract,c);Extract.prototype.destroy=function(t){if(this._destroyed)return;this._destroyed=true;if(t)this.emit("error",t);this.emit("close");if(this._stream)this._stream.emit("close")};Extract.prototype._parse=function(t,r){if(this._destroyed)return;this._offset+=t;this._missing=t;if(r===this._onheader)this._partial=false;this._onparse=r};Extract.prototype._continue=function(){if(this._destroyed)return;var t=this._cb;this._cb=noop;if(this._overflow)this._write(this._overflow,undefined,t);else t()};Extract.prototype._write=function(t,r,i){if(this._destroyed)return;var o=this._stream;var a=this._buffer;var l=this._missing;if(t.length)this._partial=true;if(t.length<l){this._missing-=t.length;this._overflow=null;if(o)return o.write(t,i);a.append(t);return i()}this._cb=i;this._missing=0;var c=null;if(t.length>l){c=t.slice(l);t=t.slice(0,l)}if(o)o.end(t);else a.append(t);this._overflow=c;this._onparse()};Extract.prototype._final=function(t){if(this._partial)return this.destroy(new Error("Unexpected end of data"));t()};t.exports=Extract},5825:(t,r)=>{var i=Buffer.alloc;var o="0000000000000000000";var a="7777777777777777777";var l="0".charCodeAt(0);var c=Buffer.from("ustar\0","binary");var u=Buffer.from("00","binary");var h=Buffer.from("ustar ","binary");var d=Buffer.from(" \0","binary");var p=parseInt("7777",8);var m=257;var y=263;var clamp=function(t,r,i){if(typeof t!=="number")return i;t=~~t;if(t>=r)return r;if(t>=0)return t;t+=r;if(t>=0)return t;return 0};var toType=function(t){switch(t){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null};var toTypeflag=function(t){switch(t){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0};var indexOf=function(t,r,i,o){for(;i<o;i++){if(t[i]===r)return i}return o};var cksum=function(t){var r=8*32;for(var i=0;i<148;i++)r+=t[i];for(var o=156;o<512;o++)r+=t[o];return r};var encodeOct=function(t,r){t=t.toString(8);if(t.length>r)return a.slice(0,r)+" ";else return o.slice(0,r-t.length)+t+" "};function parse256(t){var r;if(t[0]===128)r=true;else if(t[0]===255)r=false;else return null;var i=[];for(var o=t.length-1;o>0;o--){var a=t[o];if(r)i.push(a);else i.push(255-a)}var l=0;var c=i.length;for(o=0;o<c;o++){l+=i[o]*Math.pow(256,o)}return r?l:-1*l}var decodeOct=function(t,r,i){t=t.slice(r,r+i);r=0;if(t[r]&128){return parse256(t)}else{while(r<t.length&&t[r]===32)r++;var o=clamp(indexOf(t,32,r,t.length),t.length,t.length);while(r<o&&t[r]===0)r++;if(o===r)return 0;return parseInt(t.slice(r,o).toString(),8)}};var decodeStr=function(t,r,i,o){return t.slice(r,indexOf(t,0,r,r+i)).toString(o)};var addLength=function(t){var r=Buffer.byteLength(t);var i=Math.floor(Math.log(r)/Math.log(10))+1;if(r+i>=Math.pow(10,i))i++;return r+i+t};r.decodeLongPath=function(t,r){return decodeStr(t,0,t.length,r)};r.encodePax=function(t){var r="";if(t.name)r+=addLength(" path="+t.name+"\n");if(t.linkname)r+=addLength(" linkpath="+t.linkname+"\n");var i=t.pax;if(i){for(var o in i){r+=addLength(" "+o+"="+i[o]+"\n")}}return Buffer.from(r)};r.decodePax=function(t){var r={};while(t.length){var i=0;while(i<t.length&&t[i]!==32)i++;var o=parseInt(t.slice(0,i).toString(),10);if(!o)return r;var a=t.slice(i+1,o-1).toString();var l=a.indexOf("=");if(l===-1)return r;r[a.slice(0,l)]=a.slice(l+1);t=t.slice(o)}return r};r.encode=function(t){var r=i(512);var o=t.name;var a="";if(t.typeflag===5&&o[o.length-1]!=="/")o+="/";if(Buffer.byteLength(o)!==o.length)return null;while(Buffer.byteLength(o)>100){var h=o.indexOf("/");if(h===-1)return null;a+=a?"/"+o.slice(0,h):o.slice(0,h);o=o.slice(h+1)}if(Buffer.byteLength(o)>100||Buffer.byteLength(a)>155)return null;if(t.linkname&&Buffer.byteLength(t.linkname)>100)return null;r.write(o);r.write(encodeOct(t.mode&p,6),100);r.write(encodeOct(t.uid,6),108);r.write(encodeOct(t.gid,6),116);r.write(encodeOct(t.size,11),124);r.write(encodeOct(t.mtime.getTime()/1e3|0,11),136);r[156]=l+toTypeflag(t.type);if(t.linkname)r.write(t.linkname,157);c.copy(r,m);u.copy(r,y);if(t.uname)r.write(t.uname,265);if(t.gname)r.write(t.gname,297);r.write(encodeOct(t.devmajor||0,6),329);r.write(encodeOct(t.devminor||0,6),337);if(a)r.write(a,345);r.write(encodeOct(cksum(r),6),148);return r};r.decode=function(t,r,i){var o=t[156]===0?0:t[156]-l;var a=decodeStr(t,0,100,r);var u=decodeOct(t,100,8);var p=decodeOct(t,108,8);var g=decodeOct(t,116,8);var b=decodeOct(t,124,12);var v=decodeOct(t,136,12);var _=toType(o);var w=t[157]===0?null:decodeStr(t,157,100,r);var E=decodeStr(t,265,32);var S=decodeStr(t,297,32);var R=decodeOct(t,329,8);var O=decodeOct(t,337,8);var x=cksum(t);if(x===8*32)return null;if(x!==decodeOct(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(c.compare(t,m,m+6)===0){if(t[345])a=decodeStr(t,345,155,r)+"/"+a}else if(h.compare(t,m,m+6)===0&&d.compare(t,y,y+2)===0){}else{if(!i){throw new Error("Invalid tar header: unknown format.")}}if(o===0&&a&&a[a.length-1]==="/")o=5;return{name:a,mode:u,uid:p,gid:g,size:b,mtime:new Date(1e3*v),type:_,linkname:w,uname:E,gname:S,devmajor:R,devminor:O}}},5464:(t,r,i)=>{r.extract=i(5438);r.pack=i(874)},874:(t,r,i)=>{var o=i(6086);var a=i(1545);var l=i(3193);var c=Buffer.alloc;var u=i(4381).Readable;var h=i(4381).Writable;var d=i(1576).StringDecoder;var p=i(5825);var m=parseInt("755",8);var y=parseInt("644",8);var g=c(1024);var noop=function(){};var overflow=function(t,r){r&=511;if(r)t.push(g.slice(0,512-r))};function modeToType(t){switch(t&o.S_IFMT){case o.S_IFBLK:return"block-device";case o.S_IFCHR:return"character-device";case o.S_IFDIR:return"directory";case o.S_IFIFO:return"fifo";case o.S_IFLNK:return"symlink"}return"file"}var Sink=function(t){h.call(this);this.written=0;this._to=t;this._destroyed=false};l(Sink,h);Sink.prototype._write=function(t,r,i){this.written+=t.length;if(this._to.push(t))return i();this._to._drain=i};Sink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var LinkSink=function(){h.call(this);this.linkname="";this._decoder=new d("utf-8");this._destroyed=false};l(LinkSink,h);LinkSink.prototype._write=function(t,r,i){this.linkname+=this._decoder.write(t);i()};LinkSink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Void=function(){h.call(this);this._destroyed=false};l(Void,h);Void.prototype._write=function(t,r,i){i(new Error("No body allowed for this entry"))};Void.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Pack=function(t){if(!(this instanceof Pack))return new Pack(t);u.call(this,t);this._drain=noop;this._finalized=false;this._finalizing=false;this._destroyed=false;this._stream=null};l(Pack,u);Pack.prototype.entry=function(t,r,i){if(this._stream)throw new Error("already piping an entry");if(this._finalized||this._destroyed)return;if(typeof r==="function"){i=r;r=null}if(!i)i=noop;var o=this;if(!t.size||t.type==="symlink")t.size=0;if(!t.type)t.type=modeToType(t.mode);if(!t.mode)t.mode=t.type==="directory"?m:y;if(!t.uid)t.uid=0;if(!t.gid)t.gid=0;if(!t.mtime)t.mtime=new Date;if(typeof r==="string")r=Buffer.from(r);if(Buffer.isBuffer(r)){t.size=r.length;this._encode(t);var l=this.push(r);overflow(o,t.size);if(l)process.nextTick(i);else this._drain=i;return new Void}if(t.type==="symlink"&&!t.linkname){var c=new LinkSink;a(c,(function(r){if(r){o.destroy();return i(r)}t.linkname=c.linkname;o._encode(t);i()}));return c}this._encode(t);if(t.type!=="file"&&t.type!=="contiguous-file"){process.nextTick(i);return new Void}var u=new Sink(this);this._stream=u;a(u,(function(r){o._stream=null;if(r){o.destroy();return i(r)}if(u.written!==t.size){o.destroy();return i(new Error("size mismatch"))}overflow(o,t.size);if(o._finalizing)o.finalize();i()}));return u};Pack.prototype.finalize=function(){if(this._stream){this._finalizing=true;return}if(this._finalized)return;this._finalized=true;this.push(g);this.push(null)};Pack.prototype.destroy=function(t){if(this._destroyed)return;this._destroyed=true;if(t)this.emit("error",t);this.emit("close");if(this._stream&&this._stream.destroy)this._stream.destroy()};Pack.prototype._encode=function(t){if(!t.pax){var r=p.encode(t);if(r){this.push(r);return}}this._encodePax(t)};Pack.prototype._encodePax=function(t){var r=p.encodePax({name:t.name,linkname:t.linkname,pax:t.pax});var i={name:"PaxHeader",mode:t.mode,uid:t.uid,gid:t.gid,size:r.length,mtime:t.mtime,type:"pax-header",linkname:t.linkname&&"PaxHeader",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};this.push(p.encode(i));this.push(r);overflow(this,r.length);i.size=t.size;i.type=t.type;this.push(p.encode(i))};Pack.prototype._read=function(t){var r=this._drain;this._drain=noop;r()};t.exports=Pack},2263:(t,r,i)=>{"use strict";r.c=r.create=i(3651);r.r=r.replace=i(4735);r.t=r.list=i(6667);r.u=r.update=i(4527);r.x=r.extract=i(7814);r.Pack=i(8113);r.Unpack=i(570);r.Parse=i(7445);r.ReadEntry=i(7625);r.WriteEntry=i(9979);r.Header=i(2911);r.Pax=i(7504);r.types=i(8007)},3651:(t,r,i)=>{"use strict";const o=i(4189);const a=i(8113);const l=i(6855);const c=i(6667);const u=i(1017);t.exports=(t,r,i)=>{if(typeof r==="function")i=r;if(Array.isArray(t))r=t,t={};if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");r=Array.from(r);const a=o(t);if(a.sync&&typeof i==="function")throw new TypeError("callback not supported for sync tar functions");if(!a.file&&typeof i==="function")throw new TypeError("callback only supported with file option");return a.file&&a.sync?createFileSync(a,r):a.file?createFile(a,r,i):a.sync?createSync(a,r):create(a,r)};const createFileSync=(t,r)=>{const i=new a.Sync(t);const o=new l.WriteStreamSync(t.file,{mode:t.mode||438});i.pipe(o);addFilesSync(i,r)};const createFile=(t,r,i)=>{const o=new a(t);const c=new l.WriteStream(t.file,{mode:t.mode||438});o.pipe(c);const u=new Promise(((t,r)=>{c.on("error",r);c.on("close",t);o.on("error",r)}));addFilesAsync(o,r);return i?u.then(i,i):u};const addFilesSync=(t,r)=>{r.forEach((r=>{if(r.charAt(0)==="@"){c({file:u.resolve(t.cwd,r.substr(1)),sync:true,noResume:true,onentry:r=>t.add(r)})}else t.add(r)}));t.end()};const addFilesAsync=(t,r)=>{while(r.length){const i=r.shift();if(i.charAt(0)==="@"){return c({file:u.resolve(t.cwd,i.substr(1)),noResume:true,onentry:r=>t.add(r)}).then((i=>addFilesAsync(t,r)))}else t.add(i)}t.end()};const createSync=(t,r)=>{const i=new a.Sync(t);addFilesSync(i,r);return i};const create=(t,r)=>{const i=new a(t);addFilesAsync(i,r);return i}},7814:(t,r,i)=>{"use strict";const o=i(4189);const a=i(570);const l=i(7147);const c=i(6855);const u=i(1017);const h=i(5159);t.exports=(t,r,i)=>{if(typeof t==="function")i=t,r=null,t={};else if(Array.isArray(t))r=t,t={};if(typeof r==="function")i=r,r=null;if(!r)r=[];else r=Array.from(r);const a=o(t);if(a.sync&&typeof i==="function")throw new TypeError("callback not supported for sync tar functions");if(!a.file&&typeof i==="function")throw new TypeError("callback only supported with file option");if(r.length)filesFilter(a,r);return a.file&&a.sync?extractFileSync(a):a.file?extractFile(a,i):a.sync?extractSync(a):extract(a)};const filesFilter=(t,r)=>{const i=new Map(r.map((t=>[h(t),true])));const o=t.filter;const mapHas=(t,r)=>{const o=r||u.parse(t).root||".";const a=t===o?false:i.has(t)?i.get(t):mapHas(u.dirname(t),o);i.set(t,a);return a};t.filter=o?(t,r)=>o(t,r)&&mapHas(h(t)):t=>mapHas(h(t))};const extractFileSync=t=>{const r=new a.Sync(t);const i=t.file;const o=l.statSync(i);const u=t.maxReadSize||16*1024*1024;const h=new c.ReadStreamSync(i,{readSize:u,size:o.size});h.pipe(r)};const extractFile=(t,r)=>{const i=new a(t);const o=t.maxReadSize||16*1024*1024;const u=t.file;const h=new Promise(((t,r)=>{i.on("error",r);i.on("close",t);l.stat(u,((t,a)=>{if(t)r(t);else{const t=new c.ReadStream(u,{readSize:o,size:a.size});t.on("error",r);t.pipe(i)}}))}));return r?h.then(r,r):h};const extractSync=t=>new a.Sync(t);const extract=t=>new a(t)},505:(t,r,i)=>{const o=process.env.__FAKE_PLATFORM__||process.platform;const a=o==="win32";const l=global.__FAKE_TESTING_FS__||i(7147);const{O_CREAT:c,O_TRUNC:u,O_WRONLY:h,UV_FS_O_FILEMAP:d=0}=l.constants;const p=a&&!!d;const m=512*1024;const y=d|u|c|h;t.exports=!p?()=>"w":t=>t<m?y:"w"},2911:(t,r,i)=>{"use strict";const o=i(8007);const a=i(1017).posix;const l=i(8648);const c=Symbol("slurp");const u=Symbol("type");class Header{constructor(t,r,i,o){this.cksumValid=false;this.needPax=false;this.nullBlock=false;this.block=null;this.path=null;this.mode=null;this.uid=null;this.gid=null;this.size=null;this.mtime=null;this.cksum=null;this[u]="0";this.linkpath=null;this.uname=null;this.gname=null;this.devmaj=0;this.devmin=0;this.atime=null;this.ctime=null;if(Buffer.isBuffer(t))this.decode(t,r||0,i,o);else if(t)this.set(t)}decode(t,r,i,o){if(!r)r=0;if(!t||!(t.length>=r+512))throw new Error("need 512 bytes for header");this.path=decString(t,r,100);this.mode=decNumber(t,r+100,8);this.uid=decNumber(t,r+108,8);this.gid=decNumber(t,r+116,8);this.size=decNumber(t,r+124,12);this.mtime=decDate(t,r+136,12);this.cksum=decNumber(t,r+148,12);this[c](i);this[c](o,true);this[u]=decString(t,r+156,1);if(this[u]==="")this[u]="0";if(this[u]==="0"&&this.path.substr(-1)==="/")this[u]="5";if(this[u]==="5")this.size=0;this.linkpath=decString(t,r+157,100);if(t.slice(r+257,r+265).toString()==="ustar\x0000"){this.uname=decString(t,r+265,32);this.gname=decString(t,r+297,32);this.devmaj=decNumber(t,r+329,8);this.devmin=decNumber(t,r+337,8);if(t[r+475]!==0){const i=decString(t,r+345,155);this.path=i+"/"+this.path}else{const i=decString(t,r+345,130);if(i)this.path=i+"/"+this.path;this.atime=decDate(t,r+476,12);this.ctime=decDate(t,r+488,12)}}let a=8*32;for(let i=r;i<r+148;i++)a+=t[i];for(let i=r+156;i<r+512;i++)a+=t[i];this.cksumValid=a===this.cksum;if(this.cksum===null&&a===8*32)this.nullBlock=true}[c](t,r){for(const i in t){if(t[i]!==null&&t[i]!==undefined&&!(r&&i==="path"))this[i]=t[i]}}encode(t,r){if(!t){t=this.block=Buffer.alloc(512);r=0}if(!r)r=0;if(!(t.length>=r+512))throw new Error("need 512 bytes for header");const i=this.ctime||this.atime?130:155;const o=splitPrefix(this.path||"",i);const a=o[0];const l=o[1];this.needPax=o[2];this.needPax=encString(t,r,100,a)||this.needPax;this.needPax=encNumber(t,r+100,8,this.mode)||this.needPax;this.needPax=encNumber(t,r+108,8,this.uid)||this.needPax;this.needPax=encNumber(t,r+116,8,this.gid)||this.needPax;this.needPax=encNumber(t,r+124,12,this.size)||this.needPax;this.needPax=encDate(t,r+136,12,this.mtime)||this.needPax;t[r+156]=this[u].charCodeAt(0);this.needPax=encString(t,r+157,100,this.linkpath)||this.needPax;t.write("ustar\x0000",r+257,8);this.needPax=encString(t,r+265,32,this.uname)||this.needPax;this.needPax=encString(t,r+297,32,this.gname)||this.needPax;this.needPax=encNumber(t,r+329,8,this.devmaj)||this.needPax;this.needPax=encNumber(t,r+337,8,this.devmin)||this.needPax;this.needPax=encString(t,r+345,i,l)||this.needPax;if(t[r+475]!==0)this.needPax=encString(t,r+345,155,l)||this.needPax;else{this.needPax=encString(t,r+345,130,l)||this.needPax;this.needPax=encDate(t,r+476,12,this.atime)||this.needPax;this.needPax=encDate(t,r+488,12,this.ctime)||this.needPax}let c=8*32;for(let i=r;i<r+148;i++)c+=t[i];for(let i=r+156;i<r+512;i++)c+=t[i];this.cksum=c;encNumber(t,r+148,8,this.cksum);this.cksumValid=true;return this.needPax}set(t){for(const r in t){if(t[r]!==null&&t[r]!==undefined)this[r]=t[r]}}get type(){return o.name.get(this[u])||this[u]}get typeKey(){return this[u]}set type(t){if(o.code.has(t))this[u]=o.code.get(t);else this[u]=t}}const splitPrefix=(t,r)=>{const i=100;let o=t;let l="";let c;const u=a.parse(t).root||".";if(Buffer.byteLength(o)<i)c=[o,l,false];else{l=a.dirname(o);o=a.basename(o);do{if(Buffer.byteLength(o)<=i&&Buffer.byteLength(l)<=r)c=[o,l,false];else if(Buffer.byteLength(o)>i&&Buffer.byteLength(l)<=r)c=[o.substr(0,i-1),l,true];else{o=a.join(a.basename(l),o);l=a.dirname(l)}}while(l!==u&&!c);if(!c)c=[t.substr(0,i-1),"",true]}return c};const decString=(t,r,i)=>t.slice(r,r+i).toString("utf8").replace(/\0.*/,"");const decDate=(t,r,i)=>numToDate(decNumber(t,r,i));const numToDate=t=>t===null?null:new Date(t*1e3);const decNumber=(t,r,i)=>t[r]&128?l.parse(t.slice(r,r+i)):decSmallNumber(t,r,i);const nanNull=t=>isNaN(t)?null:t;const decSmallNumber=(t,r,i)=>nanNull(parseInt(t.slice(r,r+i).toString("utf8").replace(/\0.*$/,"").trim(),8));const h={12:8589934591,8:2097151};const encNumber=(t,r,i,o)=>o===null?false:o>h[i]||o<0?(l.encode(o,t.slice(r,r+i)),true):(encSmallNumber(t,r,i,o),false);const encSmallNumber=(t,r,i,o)=>t.write(octalString(o,i),r,i,"ascii");const octalString=(t,r)=>padOctal(Math.floor(t).toString(8),r);const padOctal=(t,r)=>(t.length===r-1?t:new Array(r-t.length-1).join("0")+t+" ")+"\0";const encDate=(t,r,i,o)=>o===null?false:encNumber(t,r,i,o.getTime()/1e3);const d=new Array(156).join("\0");const encString=(t,r,i,o)=>o===null?false:(t.write(o+d,r,i,"utf8"),o.length!==Buffer.byteLength(o)||o.length>i);t.exports=Header},4189:t=>{"use strict";const r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);t.exports=t=>t?Object.keys(t).map((i=>[r.has(i)?r.get(i):i,t[i]])).reduce(((t,r)=>(t[r[0]]=r[1],t)),Object.create(null)):{}},8648:t=>{"use strict";const encode=(t,r)=>{if(!Number.isSafeInteger(t))throw Error("cannot encode number outside of javascript safe integer range");else if(t<0)encodeNegative(t,r);else encodePositive(t,r);return r};const encodePositive=(t,r)=>{r[0]=128;for(var i=r.length;i>1;i--){r[i-1]=t&255;t=Math.floor(t/256)}};const encodeNegative=(t,r)=>{r[0]=255;var i=false;t=t*-1;for(var o=r.length;o>1;o--){var a=t&255;t=Math.floor(t/256);if(i)r[o-1]=onesComp(a);else if(a===0)r[o-1]=0;else{i=true;r[o-1]=twosComp(a)}}};const parse=t=>{const r=t[0];const i=r===128?pos(t.slice(1,t.length)):r===255?twos(t):null;if(i===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i};const twos=t=>{var r=t.length;var i=0;var o=false;for(var a=r-1;a>-1;a--){var l=t[a];var c;if(o)c=onesComp(l);else if(l===0)c=l;else{o=true;c=twosComp(l)}if(c!==0)i-=c*Math.pow(256,r-a-1)}return i};const pos=t=>{var r=t.length;var i=0;for(var o=r-1;o>-1;o--){var a=t[o];if(a!==0)i+=a*Math.pow(256,r-o-1)}return i};const onesComp=t=>(255^t)&255;const twosComp=t=>(255^t)+1&255;t.exports={encode:encode,parse:parse}},6667:(t,r,i)=>{"use strict";const o=i(4189);const a=i(7445);const l=i(7147);const c=i(6855);const u=i(1017);const h=i(5159);t.exports=(t,r,i)=>{if(typeof t==="function")i=t,r=null,t={};else if(Array.isArray(t))r=t,t={};if(typeof r==="function")i=r,r=null;if(!r)r=[];else r=Array.from(r);const a=o(t);if(a.sync&&typeof i==="function")throw new TypeError("callback not supported for sync tar functions");if(!a.file&&typeof i==="function")throw new TypeError("callback only supported with file option");if(r.length)filesFilter(a,r);if(!a.noResume)onentryFunction(a);return a.file&&a.sync?listFileSync(a):a.file?listFile(a,i):list(a)};const onentryFunction=t=>{const r=t.onentry;t.onentry=r?t=>{r(t);t.resume()}:t=>t.resume()};const filesFilter=(t,r)=>{const i=new Map(r.map((t=>[h(t),true])));const o=t.filter;const mapHas=(t,r)=>{const o=r||u.parse(t).root||".";const a=t===o?false:i.has(t)?i.get(t):mapHas(u.dirname(t),o);i.set(t,a);return a};t.filter=o?(t,r)=>o(t,r)&&mapHas(h(t)):t=>mapHas(h(t))};const listFileSync=t=>{const r=list(t);const i=t.file;let o=true;let a;try{const c=l.statSync(i);const u=t.maxReadSize||16*1024*1024;if(c.size<u)r.end(l.readFileSync(i));else{let t=0;const o=Buffer.allocUnsafe(u);a=l.openSync(i,"r");while(t<c.size){const i=l.readSync(a,o,0,u,t);t+=i;r.write(o.slice(0,i))}r.end()}o=false}finally{if(o&&a){try{l.closeSync(a)}catch(t){}}}};const listFile=(t,r)=>{const i=new a(t);const o=t.maxReadSize||16*1024*1024;const u=t.file;const h=new Promise(((t,r)=>{i.on("error",r);i.on("end",t);l.stat(u,((t,a)=>{if(t)r(t);else{const t=new c.ReadStream(u,{readSize:o,size:a.size});t.on("error",r);t.pipe(i)}}))}));return r?h.then(r,r):h};const list=t=>new a(t)},9570:(t,r,i)=>{"use strict";const o=i(6340);const a=i(7147);const l=i(1017);const c=i(9409);const u=i(980);class SymlinkError extends Error{constructor(t,r){super("Cannot extract through symbolic link");this.path=r;this.symlink=t}get name(){return"SylinkError"}}class CwdError extends Error{constructor(t,r){super(r+": Cannot cd into '"+t+"'");this.path=t;this.code=r}get name(){return"CwdError"}}const cGet=(t,r)=>t.get(u(r));const cSet=(t,r,i)=>t.set(u(r),i);const checkCwd=(t,r)=>{a.stat(t,((i,o)=>{if(i||!o.isDirectory())i=new CwdError(t,i&&i.code||"ENOTDIR");r(i)}))};t.exports=(t,r,i)=>{t=u(t);const h=r.umask;const d=r.mode|448;const p=(d&h)!==0;const m=r.uid;const y=r.gid;const g=typeof m==="number"&&typeof y==="number"&&(m!==r.processUid||y!==r.processGid);const b=r.preserve;const v=r.unlink;const _=r.cache;const w=u(r.cwd);const done=(r,o)=>{if(r)i(r);else{cSet(_,t,true);if(o&&g)c(o,m,y,(t=>done(t)));else if(p)a.chmod(t,d,i);else i()}};if(_&&cGet(_,t)===true)return done();if(t===w)return checkCwd(t,done);if(b)return o(t,{mode:d}).then((t=>done(null,t)),done);const E=u(l.relative(w,t));const S=E.split("/");mkdir_(w,S,d,_,v,w,null,done)};const mkdir_=(t,r,i,o,c,h,d,p)=>{if(!r.length)return p(null,d);const m=r.shift();const y=u(l.resolve(t+"/"+m));if(cGet(o,y))return mkdir_(y,r,i,o,c,h,d,p);a.mkdir(y,i,onmkdir(y,r,i,o,c,h,d,p))};const onmkdir=(t,r,i,o,l,c,h,d)=>p=>{if(p){a.lstat(t,((m,y)=>{if(m){m.path=m.path&&u(m.path);d(m)}else if(y.isDirectory())mkdir_(t,r,i,o,l,c,h,d);else if(l){a.unlink(t,(u=>{if(u)return d(u);a.mkdir(t,i,onmkdir(t,r,i,o,l,c,h,d))}))}else if(y.isSymbolicLink())return d(new SymlinkError(t,t+"/"+r.join("/")));else d(p)}))}else{h=h||t;mkdir_(t,r,i,o,l,c,h,d)}};const checkCwdSync=t=>{let r=false;let i="ENOTDIR";try{r=a.statSync(t).isDirectory()}catch(t){i=t.code}finally{if(!r)throw new CwdError(t,i)}};t.exports.sync=(t,r)=>{t=u(t);const i=r.umask;const h=r.mode|448;const d=(h&i)!==0;const p=r.uid;const m=r.gid;const y=typeof p==="number"&&typeof m==="number"&&(p!==r.processUid||m!==r.processGid);const g=r.preserve;const b=r.unlink;const v=r.cache;const _=u(r.cwd);const done=r=>{cSet(v,t,true);if(r&&y)c.sync(r,p,m);if(d)a.chmodSync(t,h)};if(v&&cGet(v,t)===true)return done();if(t===_){checkCwdSync(_);return done()}if(g)return done(o.sync(t,h));const w=u(l.relative(_,t));const E=w.split("/");let S=null;for(let t=E.shift(),r=_;t&&(r+="/"+t);t=E.shift()){r=u(l.resolve(r));if(cGet(v,r))continue;try{a.mkdirSync(r,h);S=S||r;cSet(v,r,true)}catch(t){const i=a.lstatSync(r);if(i.isDirectory()){cSet(v,r,true);continue}else if(b){a.unlinkSync(r);a.mkdirSync(r,h);S=S||r;cSet(v,r,true);continue}else if(i.isSymbolicLink())return new SymlinkError(r,r+"/"+E.join("/"))}}return done(S)}},3283:t=>{"use strict";t.exports=(t,r,i)=>{t&=4095;if(i)t=(t|384)&~18;if(r){if(t&256)t|=64;if(t&32)t|=8;if(t&4)t|=1}return t}},7705:t=>{const r=Object.create(null);const{hasOwnProperty:i}=Object.prototype;t.exports=t=>{if(!i.call(r,t))r[t]=t.normalize("NFKD");return r[t]}},980:t=>{const r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;t.exports=r!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")},8113:(t,r,i)=>{"use strict";class PackJob{constructor(t,r){this.path=t||"./";this.absolute=r;this.entry=null;this.stat=null;this.readdir=null;this.pending=false;this.ignore=false;this.piped=false}}const o=i(2103);const a=i(2762);const l=i(7625);const c=i(9979);const u=c.Sync;const h=c.Tar;const d=i(1064);const p=Buffer.alloc(1024);const m=Symbol("onStat");const y=Symbol("ended");const g=Symbol("queue");const b=Symbol("current");const v=Symbol("process");const _=Symbol("processing");const w=Symbol("processJob");const E=Symbol("jobs");const S=Symbol("jobDone");const R=Symbol("addFSEntry");const O=Symbol("addTarEntry");const x=Symbol("stat");const T=Symbol("readdir");const k=Symbol("onreaddir");const A=Symbol("pipe");const C=Symbol("entry");const P=Symbol("entryOpt");const I=Symbol("writeEntryClass");const L=Symbol("write");const D=Symbol("ondrain");const M=i(7147);const N=i(1017);const j=i(6998);const B=i(980);const $=j(class Pack extends o{constructor(t){super(t);t=t||Object.create(null);this.opt=t;this.file=t.file||"";this.cwd=t.cwd||process.cwd();this.maxReadSize=t.maxReadSize;this.preservePaths=!!t.preservePaths;this.strict=!!t.strict;this.noPax=!!t.noPax;this.prefix=B(t.prefix||"");this.linkCache=t.linkCache||new Map;this.statCache=t.statCache||new Map;this.readdirCache=t.readdirCache||new Map;this[I]=c;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);this.portable=!!t.portable;this.zip=null;if(t.gzip){if(typeof t.gzip!=="object")t.gzip={};if(this.portable)t.gzip.portable=true;this.zip=new a.Gzip(t.gzip);this.zip.on("data",(t=>super.write(t)));this.zip.on("end",(t=>super.end()));this.zip.on("drain",(t=>this[D]()));this.on("resume",(t=>this.zip.resume()))}else this.on("drain",this[D]);this.noDirRecurse=!!t.noDirRecurse;this.follow=!!t.follow;this.noMtime=!!t.noMtime;this.mtime=t.mtime||null;this.filter=typeof t.filter==="function"?t.filter:t=>true;this[g]=new d;this[E]=0;this.jobs=+t.jobs||4;this[_]=false;this[y]=false}[L](t){return super.write(t)}add(t){this.write(t);return this}end(t){if(t)this.write(t);this[y]=true;this[v]();return this}write(t){if(this[y])throw new Error("write after end");if(t instanceof l)this[O](t);else this[R](t);return this.flowing}[O](t){const r=B(N.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{const i=new PackJob(t.path,r,false);i.entry=new h(t,this[P](i));i.entry.on("end",(t=>this[S](i)));this[E]+=1;this[g].push(i)}this[v]()}[R](t){const r=B(N.resolve(this.cwd,t));this[g].push(new PackJob(t,r));this[v]()}[x](t){t.pending=true;this[E]+=1;const r=this.follow?"stat":"lstat";M[r](t.absolute,((r,i)=>{t.pending=false;this[E]-=1;if(r)this.emit("error",r);else this[m](t,i)}))}[m](t,r){this.statCache.set(t.absolute,r);t.stat=r;if(!this.filter(t.path,r))t.ignore=true;this[v]()}[T](t){t.pending=true;this[E]+=1;M.readdir(t.absolute,((r,i)=>{t.pending=false;this[E]-=1;if(r)return this.emit("error",r);this[k](t,i)}))}[k](t,r){this.readdirCache.set(t.absolute,r);t.readdir=r;this[v]()}[v](){if(this[_])return;this[_]=true;for(let t=this[g].head;t!==null&&this[E]<this.jobs;t=t.next){this[w](t.value);if(t.value.ignore){const r=t.next;this[g].removeNode(t);t.next=r}}this[_]=false;if(this[y]&&!this[g].length&&this[E]===0){if(this.zip)this.zip.end(p);else{super.write(p);super.end()}}}get[b](){return this[g]&&this[g].head&&this[g].head.value}[S](t){this[g].shift();this[E]-=1;this[v]()}[w](t){if(t.pending)return;if(t.entry){if(t===this[b]&&!t.piped)this[A](t);return}if(!t.stat){if(this.statCache.has(t.absolute))this[m](t,this.statCache.get(t.absolute));else this[x](t)}if(!t.stat)return;if(t.ignore)return;if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){if(this.readdirCache.has(t.absolute))this[k](t,this.readdirCache.get(t.absolute));else this[T](t);if(!t.readdir)return}t.entry=this[C](t);if(!t.entry){t.ignore=true;return}if(t===this[b]&&!t.piped)this[A](t)}[P](t){return{onwarn:(t,r,i)=>this.warn(t,r,i),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[C](t){this[E]+=1;try{return new this[I](t.path,this[P](t)).on("end",(()=>this[S](t))).on("error",(t=>this.emit("error",t)))}catch(t){this.emit("error",t)}}[D](){if(this[b]&&this[b].entry)this[b].entry.resume()}[A](t){t.piped=true;if(t.readdir){t.readdir.forEach((r=>{const i=t.path;const o=i==="./"?"":i.replace(/\/*$/,"/");this[R](o+r)}))}const r=t.entry;const i=this.zip;if(i){r.on("data",(t=>{if(!i.write(t))r.pause()}))}else{r.on("data",(t=>{if(!super.write(t))r.pause()}))}}pause(){if(this.zip)this.zip.pause();return super.pause()}});class PackSync extends ${constructor(t){super(t);this[I]=u}pause(){}resume(){}[x](t){const r=this.follow?"statSync":"lstatSync";this[m](t,M[r](t.absolute))}[T](t,r){this[k](t,M.readdirSync(t.absolute))}[A](t){const r=t.entry;const i=this.zip;if(t.readdir){t.readdir.forEach((r=>{const i=t.path;const o=i==="./"?"":i.replace(/\/*$/,"/");this[R](o+r)}))}if(i){r.on("data",(t=>{i.write(t)}))}else{r.on("data",(t=>{super[L](t)}))}}}$.Sync=PackSync;t.exports=$},7445:(t,r,i)=>{"use strict";const o=i(6998);const a=i(2911);const l=i(2361);const c=i(1064);const u=1024*1024;const h=i(7625);const d=i(7504);const p=i(2762);const m=Buffer.from([31,139]);const y=Symbol("state");const g=Symbol("writeEntry");const b=Symbol("readEntry");const v=Symbol("nextEntry");const _=Symbol("processEntry");const w=Symbol("extendedHeader");const E=Symbol("globalExtendedHeader");const S=Symbol("meta");const R=Symbol("emitMeta");const O=Symbol("buffer");const x=Symbol("queue");const T=Symbol("ended");const k=Symbol("emittedEnd");const A=Symbol("emit");const C=Symbol("unzip");const P=Symbol("consumeChunk");const I=Symbol("consumeChunkSub");const L=Symbol("consumeBody");const D=Symbol("consumeMeta");const M=Symbol("consumeHeader");const N=Symbol("consuming");const j=Symbol("bufferConcat");const B=Symbol("maybeEnd");const $=Symbol("writing");const H=Symbol("aborted");const U=Symbol("onDone");const q=Symbol("sawValidEntry");const z=Symbol("sawNullBlock");const G=Symbol("sawEOF");const noop=t=>true;t.exports=o(class Parser extends l{constructor(t){t=t||{};super(t);this.file=t.file||"";this[q]=null;this.on(U,(t=>{if(this[y]==="begin"||this[q]===false){this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}}));if(t.ondone)this.on(U,t.ondone);else{this.on(U,(t=>{this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}))}this.strict=!!t.strict;this.maxMetaEntrySize=t.maxMetaEntrySize||u;this.filter=typeof t.filter==="function"?t.filter:noop;this.writable=true;this.readable=false;this[x]=new c;this[O]=null;this[b]=null;this[g]=null;this[y]="begin";this[S]="";this[w]=null;this[E]=null;this[T]=false;this[C]=null;this[H]=false;this[z]=false;this[G]=false;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);if(typeof t.onentry==="function")this.on("entry",t.onentry)}[M](t,r){if(this[q]===null)this[q]=false;let i;try{i=new a(t,r,this[w],this[E])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(i.nullBlock){if(this[z]){this[G]=true;if(this[y]==="begin")this[y]="header";this[A]("eof")}else{this[z]=true;this[A]("nullBlock")}}else{this[z]=false;if(!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{const t=i.type;if(/^(Symbolic)?Link$/.test(t)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(t)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{const t=this[g]=new h(i,this[w],this[E]);if(!this[q]){if(t.remain){const onend=()=>{if(!t.invalid)this[q]=true};t.on("end",onend)}else this[q]=true}if(t.meta){if(t.size>this.maxMetaEntrySize){t.ignore=true;this[A]("ignoredEntry",t);this[y]="ignore";t.resume()}else if(t.size>0){this[S]="";t.on("data",(t=>this[S]+=t));this[y]="meta"}}else{this[w]=null;t.ignore=t.ignore||!this.filter(t.path,t);if(t.ignore){this[A]("ignoredEntry",t);this[y]=t.remain?"ignore":"header";t.resume()}else{if(t.remain)this[y]="body";else{this[y]="header";t.end()}if(!this[b]){this[x].push(t);this[v]()}else this[x].push(t)}}}}}}[_](t){let r=true;if(!t){this[b]=null;r=false}else if(Array.isArray(t))this.emit.apply(this,t);else{this[b]=t;this.emit("entry",t);if(!t.emittedEnd){t.on("end",(t=>this[v]()));r=false}}return r}[v](){do{}while(this[_](this[x].shift()));if(!this[x].length){const t=this[b];const r=!t||t.flowing||t.size===t.remain;if(r){if(!this[$])this.emit("drain")}else t.once("drain",(t=>this.emit("drain")))}}[L](t,r){const i=this[g];const o=i.blockRemain;const a=o>=t.length&&r===0?t:t.slice(r,r+o);i.write(a);if(!i.blockRemain){this[y]="header";this[g]=null;i.end()}return a.length}[D](t,r){const i=this[g];const o=this[L](t,r);if(!this[g])this[R](i);return o}[A](t,r,i){if(!this[x].length&&!this[b])this.emit(t,r,i);else this[x].push([t,r,i])}[R](t){this[A]("meta",this[S]);switch(t.type){case"ExtendedHeader":case"OldExtendedHeader":this[w]=d.parse(this[S],this[w],false);break;case"GlobalExtendedHeader":this[E]=d.parse(this[S],this[E],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[w]=this[w]||Object.create(null);this[w].path=this[S].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[w]=this[w]||Object.create(null);this[w].linkpath=this[S].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+t.type)}}abort(t){this[H]=true;this.emit("abort",t);this.warn("TAR_ABORT",t,{recoverable:false})}write(t){if(this[H])return;if(this[C]===null&&t){if(this[O]){t=Buffer.concat([this[O],t]);this[O]=null}if(t.length<m.length){this[O]=t;return true}for(let r=0;this[C]===null&&r<m.length;r++){if(t[r]!==m[r])this[C]=false}if(this[C]===null){const r=this[T];this[T]=false;this[C]=new p.Unzip;this[C].on("data",(t=>this[P](t)));this[C].on("error",(t=>this.abort(t)));this[C].on("end",(t=>{this[T]=true;this[P]()}));this[$]=true;const i=this[C][r?"end":"write"](t);this[$]=false;return i}}this[$]=true;if(this[C])this[C].write(t);else this[P](t);this[$]=false;const r=this[x].length?false:this[b]?this[b].flowing:true;if(!r&&!this[x].length)this[b].once("drain",(t=>this.emit("drain")));return r}[j](t){if(t&&!this[H])this[O]=this[O]?Buffer.concat([this[O],t]):t}[B](){if(this[T]&&!this[k]&&!this[H]&&!this[N]){this[k]=true;const t=this[g];if(t&&t.blockRemain){const r=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${r} available)`,{entry:t});if(this[O])t.write(this[O]);t.end()}this[A](U)}}[P](t){if(this[N])this[j](t);else if(!t&&!this[O])this[B]();else{this[N]=true;if(this[O]){this[j](t);const r=this[O];this[O]=null;this[I](r)}else this[I](t);while(this[O]&&this[O].length>=512&&!this[H]&&!this[G]){const t=this[O];this[O]=null;this[I](t)}this[N]=false}if(!this[O]||this[T])this[B]()}[I](t){let r=0;const i=t.length;while(r+512<=i&&!this[H]&&!this[G]){switch(this[y]){case"begin":case"header":this[M](t,r);r+=512;break;case"ignore":case"body":r+=this[L](t,r);break;case"meta":r+=this[D](t,r);break;default:throw new Error("invalid state: "+this[y])}}if(r<i){if(this[O])this[O]=Buffer.concat([t.slice(r),this[O]]);else this[O]=t.slice(r)}}end(t){if(!this[H]){if(this[C])this[C].end(t);else{this[T]=true;this.write(t)}}}})},7443:(t,r,i)=>{const o=i(9491);const a=i(7705);const l=i(5159);const{join:c}=i(1017);const u=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const h=u==="win32";t.exports=()=>{const t=new Map;const r=new Map;const getDirs=t=>{const r=t.split("/").slice(0,-1).reduce(((t,r)=>{if(t.length)r=c(t[t.length-1],r);t.push(r||"/");return t}),[]);return r};const i=new Set;const getQueues=i=>{const o=r.get(i);if(!o)throw new Error("function does not have any path reservations");return{paths:o.paths.map((r=>t.get(r))),dirs:[...o.dirs].map((r=>t.get(r)))}};const check=t=>{const{paths:r,dirs:i}=getQueues(t);return r.every((r=>r[0]===t))&&i.every((r=>r[0]instanceof Set&&r[0].has(t)))};const run=t=>{if(i.has(t)||!check(t))return false;i.add(t);t((()=>clear(t)));return true};const clear=a=>{if(!i.has(a))return false;const{paths:l,dirs:c}=r.get(a);const u=new Set;l.forEach((r=>{const i=t.get(r);o.equal(i[0],a);if(i.length===1)t.delete(r);else{i.shift();if(typeof i[0]==="function")u.add(i[0]);else i[0].forEach((t=>u.add(t)))}}));c.forEach((r=>{const i=t.get(r);o(i[0]instanceof Set);if(i[0].size===1&&i.length===1)t.delete(r);else if(i[0].size===1){i.shift();u.add(i[0])}else i[0].delete(a)}));i.delete(a);u.forEach((t=>run(t)));return true};const reserve=(i,o)=>{i=h?["win32 parallelization disabled"]:i.map((t=>a(l(c(t))).toLowerCase()));const u=new Set(i.map((t=>getDirs(t))).reduce(((t,r)=>t.concat(r))));r.set(o,{dirs:u,paths:i});i.forEach((r=>{const i=t.get(r);if(!i)t.set(r,[o]);else i.push(o)}));u.forEach((r=>{const i=t.get(r);if(!i)t.set(r,[new Set([o])]);else if(i[i.length-1]instanceof Set)i[i.length-1].add(o);else i.push(new Set([o]))}));return run(o)};return{check:check,reserve:reserve}}},7504:(t,r,i)=>{"use strict";const o=i(2911);const a=i(1017);class Pax{constructor(t,r){this.atime=t.atime||null;this.charset=t.charset||null;this.comment=t.comment||null;this.ctime=t.ctime||null;this.gid=t.gid||null;this.gname=t.gname||null;this.linkpath=t.linkpath||null;this.mtime=t.mtime||null;this.path=t.path||null;this.size=t.size||null;this.uid=t.uid||null;this.uname=t.uname||null;this.dev=t.dev||null;this.ino=t.ino||null;this.nlink=t.nlink||null;this.global=r||false}encode(){const t=this.encodeBody();if(t==="")return null;const r=Buffer.byteLength(t);const i=512*Math.ceil(1+r/512);const l=Buffer.allocUnsafe(i);for(let t=0;t<512;t++)l[t]=0;new o({path:("PaxHeader/"+a.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(l);l.write(t,512,r,"utf8");for(let t=r+512;t<l.length;t++)l[t]=0;return l}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===null||this[t]===undefined)return"";const r=this[t]instanceof Date?this[t].getTime()/1e3:this[t];const i=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+r+"\n";const o=Buffer.byteLength(i);let a=Math.floor(Math.log(o)/Math.log(10))+1;if(o+a>=Math.pow(10,a))a+=1;const l=a+o;return l+i}}Pax.parse=(t,r,i)=>new Pax(merge(parseKV(t),r),i);const merge=(t,r)=>r?Object.keys(t).reduce(((r,i)=>(r[i]=t[i],r)),r):t;const parseKV=t=>t.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null));const parseKVLine=(t,r)=>{const i=parseInt(r,10);if(i!==Buffer.byteLength(r)+1)return t;r=r.substr((i+" ").length);const o=r.split("=");const a=o.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!a)return t;const l=o.join("=");t[a]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a)?new Date(l*1e3):/^[0-9]+$/.test(l)?+l:l;return t};t.exports=Pax},7625:(t,r,i)=>{"use strict";const o=i(2103);const a=i(980);const l=Symbol("slurp");t.exports=class ReadEntry extends o{constructor(t,r,i){super();this.pause();this.extended=r;this.globalExtended=i;this.header=t;this.startBlockSize=512*Math.ceil(t.size/512);this.blockRemain=this.startBlockSize;this.remain=t.size;this.type=t.type;this.meta=false;this.ignore=false;switch(this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=true;break;default:this.ignore=true}this.path=a(t.path);this.mode=t.mode;if(this.mode)this.mode=this.mode&4095;this.uid=t.uid;this.gid=t.gid;this.uname=t.uname;this.gname=t.gname;this.size=t.size;this.mtime=t.mtime;this.atime=t.atime;this.ctime=t.ctime;this.linkpath=a(t.linkpath);this.uname=t.uname;this.gname=t.gname;if(r)this[l](r);if(i)this[l](i,true)}write(t){const r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");const i=this.remain;const o=this.blockRemain;this.remain=Math.max(0,i-r);this.blockRemain=Math.max(0,o-r);if(this.ignore)return true;if(i>=r)return super.write(t);return super.write(t.slice(0,i))}[l](t,r){for(const i in t){if(t[i]!==null&&t[i]!==undefined&&!(r&&i==="path"))this[i]=i==="path"||i==="linkpath"?a(t[i]):t[i]}}}},4735:(t,r,i)=>{"use strict";const o=i(4189);const a=i(8113);const l=i(7147);const c=i(6855);const u=i(6667);const h=i(1017);const d=i(2911);t.exports=(t,r,i)=>{const a=o(t);if(!a.file)throw new TypeError("file is required");if(a.gzip)throw new TypeError("cannot append to compressed archives");if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");r=Array.from(r);return a.sync?replaceSync(a,r):replace(a,r,i)};const replaceSync=(t,r)=>{const i=new a.Sync(t);let o=true;let c;let u;try{try{c=l.openSync(t.file,"r+")}catch(r){if(r.code==="ENOENT")c=l.openSync(t.file,"w+");else throw r}const a=l.fstatSync(c);const h=Buffer.alloc(512);e:for(u=0;u<a.size;u+=512){for(let t=0,r=0;t<512;t+=r){r=l.readSync(c,h,t,h.length-t,u+t);if(u===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!r)break e}const r=new d(h);if(!r.cksumValid)break;const i=512*Math.ceil(r.size/512);if(u+i+512>a.size)break;u+=i;if(t.mtimeCache)t.mtimeCache.set(r.path,r.mtime)}o=false;streamSync(t,i,u,c,r)}finally{if(o){try{l.closeSync(c)}catch(t){}}}};const streamSync=(t,r,i,o,a)=>{const l=new c.WriteStreamSync(t.file,{fd:o,start:i});r.pipe(l);addFilesSync(r,a)};const replace=(t,r,i)=>{r=Array.from(r);const o=new a(t);const getPos=(r,i,o)=>{const cb=(t,i)=>{if(t)l.close(r,(r=>o(t)));else o(null,i)};let a=0;if(i===0)return cb(null,0);let c=0;const u=Buffer.alloc(512);const onread=(o,h)=>{if(o)return cb(o);c+=h;if(c<512&&h){return l.read(r,u,c,u.length-c,a+c,onread)}if(a===0&&u[0]===31&&u[1]===139)return cb(new Error("cannot append to compressed archives"));if(c<512)return cb(null,a);const p=new d(u);if(!p.cksumValid)return cb(null,a);const m=512*Math.ceil(p.size/512);if(a+m+512>i)return cb(null,a);a+=m+512;if(a>=i)return cb(null,a);if(t.mtimeCache)t.mtimeCache.set(p.path,p.mtime);c=0;l.read(r,u,0,512,a,onread)};l.read(r,u,0,512,a,onread)};const u=new Promise(((i,a)=>{o.on("error",a);let u="r+";const onopen=(h,d)=>{if(h&&h.code==="ENOENT"&&u==="r+"){u="w+";return l.open(t.file,u,onopen)}if(h)return a(h);l.fstat(d,((u,h)=>{if(u)return l.close(d,(()=>a(u)));getPos(d,h.size,((l,u)=>{if(l)return a(l);const h=new c.WriteStream(t.file,{fd:d,start:u});o.pipe(h);h.on("error",a);h.on("close",i);addFilesAsync(o,r)}))}))};l.open(t.file,u,onopen)}));return i?u.then(i,i):u};const addFilesSync=(t,r)=>{r.forEach((r=>{if(r.charAt(0)==="@"){u({file:h.resolve(t.cwd,r.substr(1)),sync:true,noResume:true,onentry:r=>t.add(r)})}else t.add(r)}));t.end()};const addFilesAsync=(t,r)=>{while(r.length){const i=r.shift();if(i.charAt(0)==="@"){return u({file:h.resolve(t.cwd,i.substr(1)),noResume:true,onentry:r=>t.add(r)}).then((i=>addFilesAsync(t,r)))}else t.add(i)}t.end()}},8494:(t,r,i)=>{const{isAbsolute:o,parse:a}=i(1017).win32;t.exports=t=>{let r="";let i=a(t);while(o(t)||i.root){const o=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":i.root;t=t.substr(o.length);r+=o;i=a(t)}return[r,t]}},5159:t=>{t.exports=t=>{let r=t.length-1;let i=-1;while(r>-1&&t.charAt(r)==="/"){i=r;r--}return i===-1?t:t.slice(0,i)}},8007:(t,r)=>{"use strict";r.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);r.code=new Map(Array.from(r.name).map((t=>[t[1],t[0]])))},570:(t,r,i)=>{"use strict";const o=i(9491);const a=i(7445);const l=i(7147);const c=i(6855);const u=i(1017);const h=i(9570);const d=i(5365);const p=i(7443);const m=i(8494);const y=i(980);const g=i(5159);const b=i(7705);const v=Symbol("onEntry");const _=Symbol("checkFs");const w=Symbol("checkFs2");const E=Symbol("pruneCache");const S=Symbol("isReusable");const R=Symbol("makeFs");const O=Symbol("file");const x=Symbol("directory");const T=Symbol("link");const k=Symbol("symlink");const A=Symbol("hardlink");const C=Symbol("unsupported");const P=Symbol("checkPath");const I=Symbol("mkdir");const L=Symbol("onError");const D=Symbol("pending");const M=Symbol("pend");const N=Symbol("unpend");const j=Symbol("ended");const B=Symbol("maybeClose");const $=Symbol("skip");const H=Symbol("doChown");const U=Symbol("uid");const q=Symbol("gid");const z=Symbol("checkedCwd");const G=i(6113);const W=i(505);const V=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const Y=V==="win32";const unlinkFile=(t,r)=>{if(!Y)return l.unlink(t,r);const i=t+".DELETE."+G.randomBytes(16).toString("hex");l.rename(t,i,(t=>{if(t)return r(t);l.unlink(i,r)}))};const unlinkFileSync=t=>{if(!Y)return l.unlinkSync(t);const r=t+".DELETE."+G.randomBytes(16).toString("hex");l.renameSync(t,r);l.unlinkSync(r)};const uint32=(t,r,i)=>t===t>>>0?t:r===r>>>0?r:i;const cacheKeyNormalize=t=>b(g(y(t))).toLowerCase();const pruneCache=(t,r)=>{r=cacheKeyNormalize(r);for(const i of t.keys()){const o=cacheKeyNormalize(i);if(o===r||o.indexOf(r+"/")===0)t.delete(i)}};const dropCache=t=>{for(const r of t.keys())t.delete(r)};class Unpack extends a{constructor(t){if(!t)t={};t.ondone=t=>{this[j]=true;this[B]()};super(t);this[z]=false;this.reservations=p();this.transform=typeof t.transform==="function"?t.transform:null;this.writable=true;this.readable=false;this[D]=0;this[j]=false;this.dirCache=t.dirCache||new Map;if(typeof t.uid==="number"||typeof t.gid==="number"){if(typeof t.uid!=="number"||typeof t.gid!=="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner){throw new TypeError("cannot preserve owner in archive and also set owner explicitly")}this.uid=t.uid;this.gid=t.gid;this.setOwner=true}else{this.uid=null;this.gid=null;this.setOwner=false}if(t.preserveOwner===undefined&&typeof t.uid!=="number")this.preserveOwner=process.getuid&&process.getuid()===0;else this.preserveOwner=!!t.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null;this.forceChown=t.forceChown===true;this.win32=!!t.win32||Y;this.newer=!!t.newer;this.keep=!!t.keep;this.noMtime=!!t.noMtime;this.preservePaths=!!t.preservePaths;this.unlink=!!t.unlink;this.cwd=y(u.resolve(t.cwd||process.cwd()));this.strip=+t.strip||0;this.processUmask=t.noChmod?0:process.umask();this.umask=typeof t.umask==="number"?t.umask:this.processUmask;this.dmode=t.dmode||511&~this.umask;this.fmode=t.fmode||438&~this.umask;this.on("entry",(t=>this[v](t)))}warn(t,r,i={}){if(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT")i.recoverable=false;return super.warn(t,r,i)}[B](){if(this[j]&&this[D]===0){this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}}[P](t){if(this.strip){const r=y(t.path).split("/");if(r.length<this.strip)return false;t.path=r.slice(this.strip).join("/");if(t.type==="Link"){const r=y(t.linkpath).split("/");if(r.length>=this.strip)t.linkpath=r.slice(this.strip).join("/");else return false}}if(!this.preservePaths){const r=y(t.path);const i=r.split("/");if(i.includes("..")||Y&&/^[a-z]:\.\.$/i.test(i[0])){this.warn("TAR_ENTRY_ERROR",`path contains '..'`,{entry:t,path:r});return false}const[o,a]=m(r);if(o){t.path=a;this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:t,path:r})}}if(u.isAbsolute(t.path))t.absolute=y(u.resolve(t.path));else t.absolute=y(u.resolve(this.cwd,t.path));if(!this.preservePaths&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd){this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:y(t.path),resolvedPath:t.absolute,cwd:this.cwd});return false}if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return false;if(this.win32){const{root:r}=u.win32.parse(t.absolute);t.absolute=r+d.encode(t.absolute.substr(r.length));const{root:i}=u.win32.parse(t.path);t.path=i+d.encode(t.path.substr(i.length))}return true}[v](t){if(!this[P](t))return t.resume();o.equal(typeof t.absolute,"string");switch(t.type){case"Directory":case"GNUDumpDir":if(t.mode)t.mode=t.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[_](t);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[C](t)}}[L](t,r){if(t.name==="CwdError")this.emit("error",t);else{this.warn("TAR_ENTRY_ERROR",t,{entry:r});this[N]();r.resume()}}[I](t,r,i){h(y(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r,noChmod:this.noChmod},i)}[H](t){return this.forceChown||this.preserveOwner&&(typeof t.uid==="number"&&t.uid!==this.processUid||typeof t.gid==="number"&&t.gid!==this.processGid)||(typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid)}[U](t){return uint32(this.uid,t.uid,this.processUid)}[q](t){return uint32(this.gid,t.gid,this.processGid)}[O](t,r){const i=t.mode&4095||this.fmode;const o=new c.WriteStream(t.absolute,{flags:W(t.size),mode:i,autoClose:false});o.on("error",(i=>{if(o.fd)l.close(o.fd,(()=>{}));o.write=()=>true;this[L](i,t);r()}));let a=1;const done=i=>{if(i){if(o.fd)l.close(o.fd,(()=>{}));this[L](i,t);r();return}if(--a===0){l.close(o.fd,(i=>{if(i)this[L](i,t);else this[N]();r()}))}};o.on("finish",(r=>{const i=t.absolute;const c=o.fd;if(t.mtime&&!this.noMtime){a++;const r=t.atime||new Date;const o=t.mtime;l.futimes(c,r,o,(t=>t?l.utimes(i,r,o,(r=>done(r&&t))):done()))}if(this[H](t)){a++;const r=this[U](t);const o=this[q](t);l.fchown(c,r,o,(t=>t?l.chown(i,r,o,(r=>done(r&&t))):done()))}done()}));const u=this.transform?this.transform(t)||t:t;if(u!==t){u.on("error",(i=>{this[L](i,t);r()}));t.pipe(u)}u.pipe(o)}[x](t,r){const i=t.mode&4095||this.dmode;this[I](t.absolute,i,(i=>{if(i){this[L](i,t);r();return}let o=1;const done=i=>{if(--o===0){r();this[N]();t.resume()}};if(t.mtime&&!this.noMtime){o++;l.utimes(t.absolute,t.atime||new Date,t.mtime,done)}if(this[H](t)){o++;l.chown(t.absolute,this[U](t),this[q](t),done)}done()}))}[C](t){t.unsupported=true;this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t});t.resume()}[k](t,r){this[T](t,t.linkpath,"symlink",r)}[A](t,r){const i=y(u.resolve(this.cwd,t.linkpath));this[T](t,i,"link",r)}[M](){this[D]++}[N](){this[D]--;this[B]()}[$](t){this[N]();t.resume()}[S](t,r){return t.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!Y}[_](t){this[M]();const r=[t.path];if(t.linkpath)r.push(t.linkpath);this.reservations.reserve(r,(r=>this[w](t,r)))}[E](t){if(t.type==="SymbolicLink")dropCache(this.dirCache);else if(t.type!=="Directory")pruneCache(this.dirCache,t.absolute)}[w](t,r){this[E](t);const done=i=>{this[E](t);r(i)};const checkCwd=()=>{this[I](this.cwd,this.dmode,(r=>{if(r){this[L](r,t);done();return}this[z]=true;start()}))};const start=()=>{if(t.absolute!==this.cwd){const r=y(u.dirname(t.absolute));if(r!==this.cwd){return this[I](r,this.dmode,(r=>{if(r){this[L](r,t);done();return}afterMakeParent()}))}}afterMakeParent()};const afterMakeParent=()=>{l.lstat(t.absolute,((r,i)=>{if(i&&(this.keep||this.newer&&i.mtime>t.mtime)){this[$](t);done();return}if(r||this[S](t,i))return this[R](null,t,done);if(i.isDirectory()){if(t.type==="Directory"){const r=!this.noChmod&&t.mode&&(i.mode&4095)!==t.mode;const afterChmod=r=>this[R](r,t,done);if(!r)return afterChmod();return l.chmod(t.absolute,t.mode,afterChmod)}if(t.absolute!==this.cwd){return l.rmdir(t.absolute,(r=>this[R](r,t,done)))}}if(t.absolute===this.cwd)return this[R](null,t,done);unlinkFile(t.absolute,(r=>this[R](r,t,done)))}))};if(this[z])start();else checkCwd()}[R](t,r,i){if(t){this[L](t,r);i();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[O](r,i);case"Link":return this[A](r,i);case"SymbolicLink":return this[k](r,i);case"Directory":case"GNUDumpDir":return this[x](r,i)}}[T](t,r,i,o){l[i](r,t.absolute,(r=>{if(r)this[L](r,t);else{this[N]();t.resume()}o()}))}}const callSync=t=>{try{return[null,t()]}catch(t){return[t,null]}};class UnpackSync extends Unpack{[R](t,r){return super[R](t,r,(()=>{}))}[_](t){this[E](t);if(!this[z]){const r=this[I](this.cwd,this.dmode);if(r)return this[L](r,t);this[z]=true}if(t.absolute!==this.cwd){const r=y(u.dirname(t.absolute));if(r!==this.cwd){const i=this[I](r,this.dmode);if(i)return this[L](i,t)}}const[r,i]=callSync((()=>l.lstatSync(t.absolute)));if(i&&(this.keep||this.newer&&i.mtime>t.mtime))return this[$](t);if(r||this[S](t,i))return this[R](null,t);if(i.isDirectory()){if(t.type==="Directory"){const r=!this.noChmod&&t.mode&&(i.mode&4095)!==t.mode;const[o]=r?callSync((()=>{l.chmodSync(t.absolute,t.mode)})):[];return this[R](o,t)}const[r]=callSync((()=>l.rmdirSync(t.absolute)));this[R](r,t)}const[o]=t.absolute===this.cwd?[]:callSync((()=>unlinkFileSync(t.absolute)));this[R](o,t)}[O](t,r){const i=t.mode&4095||this.fmode;const oner=i=>{let a;try{l.closeSync(o)}catch(t){a=t}if(i||a)this[L](i||a,t);r()};let o;try{o=l.openSync(t.absolute,W(t.size),i)}catch(t){return oner(t)}const a=this.transform?this.transform(t)||t:t;if(a!==t){a.on("error",(r=>this[L](r,t)));t.pipe(a)}a.on("data",(t=>{try{l.writeSync(o,t,0,t.length)}catch(t){oner(t)}}));a.on("end",(r=>{let i=null;if(t.mtime&&!this.noMtime){const r=t.atime||new Date;const a=t.mtime;try{l.futimesSync(o,r,a)}catch(o){try{l.utimesSync(t.absolute,r,a)}catch(t){i=o}}}if(this[H](t)){const r=this[U](t);const a=this[q](t);try{l.fchownSync(o,r,a)}catch(o){try{l.chownSync(t.absolute,r,a)}catch(t){i=i||o}}}oner(i)}))}[x](t,r){const i=t.mode&4095||this.dmode;const o=this[I](t.absolute,i);if(o){this[L](o,t);r();return}if(t.mtime&&!this.noMtime){try{l.utimesSync(t.absolute,t.atime||new Date,t.mtime)}catch(o){}}if(this[H](t)){try{l.chownSync(t.absolute,this[U](t),this[q](t))}catch(o){}}r();t.resume()}[I](t,r){try{return h.sync(y(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(t){return t}}[T](t,r,i,o){try{l[i+"Sync"](r,t.absolute);o();t.resume()}catch(r){return this[L](r,t)}}}Unpack.Sync=UnpackSync;t.exports=Unpack},4527:(t,r,i)=>{"use strict";const o=i(4189);const a=i(4735);t.exports=(t,r,i)=>{const l=o(t);if(!l.file)throw new TypeError("file is required");if(l.gzip)throw new TypeError("cannot append to compressed archives");if(!r||!Array.isArray(r)||!r.length)throw new TypeError("no files or directories specified");r=Array.from(r);mtimeFilter(l);return a(l,r,i)};const mtimeFilter=t=>{const r=t.filter;if(!t.mtimeCache)t.mtimeCache=new Map;t.filter=r?(i,o)=>r(i,o)&&!(t.mtimeCache.get(i)>o.mtime):(r,i)=>!(t.mtimeCache.get(r)>i.mtime)}},6998:t=>{"use strict";t.exports=t=>class extends t{warn(t,r,i={}){if(this.file)i.file=this.file;if(this.cwd)i.cwd=this.cwd;i.code=r instanceof Error&&r.code||t;i.tarCode=t;if(!this.strict&&i.recoverable!==false){if(r instanceof Error){i=Object.assign(r,i);r=r.message}this.emit("warn",i.tarCode,r,i)}else if(r instanceof Error)this.emit("error",Object.assign(r,i));else this.emit("error",Object.assign(new Error(`${t}: ${r}`),i))}}},5365:t=>{"use strict";const r=["|","<",">","?",":"];const i=r.map((t=>String.fromCharCode(61440+t.charCodeAt(0))));const o=new Map(r.map(((t,r)=>[t,i[r]])));const a=new Map(i.map(((t,i)=>[t,r[i]])));t.exports={encode:t=>r.reduce(((t,r)=>t.split(r).join(o.get(r))),t),decode:t=>i.reduce(((t,r)=>t.split(r).join(a.get(r))),t)}},9979:(t,r,i)=>{"use strict";const o=i(2103);const a=i(7504);const l=i(2911);const c=i(7147);const u=i(1017);const h=i(980);const d=i(5159);const prefixPath=(t,r)=>{if(!r)return h(t);t=h(t).replace(/^\.(\/|$)/,"");return d(r)+"/"+t};const p=16*1024*1024;const m=Symbol("process");const y=Symbol("file");const g=Symbol("directory");const b=Symbol("symlink");const v=Symbol("hardlink");const _=Symbol("header");const w=Symbol("read");const E=Symbol("lstat");const S=Symbol("onlstat");const R=Symbol("onread");const O=Symbol("onreadlink");const x=Symbol("openfile");const T=Symbol("onopenfile");const k=Symbol("close");const A=Symbol("mode");const C=Symbol("awaitDrain");const P=Symbol("ondrain");const I=Symbol("prefix");const L=Symbol("hadError");const D=i(6998);const M=i(5365);const N=i(8494);const j=i(3283);const B=D(class WriteEntry extends o{constructor(t,r){r=r||{};super(r);if(typeof t!=="string")throw new TypeError("path is required");this.path=h(t);this.portable=!!r.portable;this.myuid=process.getuid&&process.getuid()||0;this.myuser=process.env.USER||"";this.maxReadSize=r.maxReadSize||p;this.linkCache=r.linkCache||new Map;this.statCache=r.statCache||new Map;this.preservePaths=!!r.preservePaths;this.cwd=h(r.cwd||process.cwd());this.strict=!!r.strict;this.noPax=!!r.noPax;this.noMtime=!!r.noMtime;this.mtime=r.mtime||null;this.prefix=r.prefix?h(r.prefix):null;this.fd=null;this.blockLen=null;this.blockRemain=null;this.buf=null;this.offset=null;this.length=null;this.pos=null;this.remain=null;if(typeof r.onwarn==="function")this.on("warn",r.onwarn);let i=false;if(!this.preservePaths){const[t,r]=N(this.path);if(t){this.path=r;i=t}}this.win32=!!r.win32||process.platform==="win32";if(this.win32){this.path=M.decode(this.path.replace(/\\/g,"/"));t=t.replace(/\\/g,"/")}this.absolute=h(r.absolute||u.resolve(this.cwd,t));if(this.path==="")this.path="./";if(i){this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path})}if(this.statCache.has(this.absolute))this[S](this.statCache.get(this.absolute));else this[E]()}emit(t,...r){if(t==="error")this[L]=true;return super.emit(t,...r)}[E](){c.lstat(this.absolute,((t,r)=>{if(t)return this.emit("error",t);this[S](r)}))}[S](t){this.statCache.set(this.absolute,t);this.stat=t;if(!t.isFile())t.size=0;this.type=getType(t);this.emit("stat",t);this[m]()}[m](){switch(this.type){case"File":return this[y]();case"Directory":return this[g]();case"SymbolicLink":return this[b]();default:return this.end()}}[A](t){return j(t,this.type==="Directory",this.portable)}[I](t){return prefixPath(t,this.prefix)}[_](){if(this.type==="Directory"&&this.portable)this.noMtime=true;this.header=new l({path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,mode:this[A](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime});if(this.header.encode()&&!this.noPax){super.write(new a({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode())}super.write(this.header.block)}[g](){if(this.path.substr(-1)!=="/")this.path+="/";this.stat.size=0;this[_]();this.end()}[b](){c.readlink(this.absolute,((t,r)=>{if(t)return this.emit("error",t);this[O](r)}))}[O](t){this.linkpath=h(t);this[_]();this.end()}[v](t){this.type="Link";this.linkpath=h(u.relative(this.cwd,t));this.stat.size=0;this[_]();this.end()}[y](){if(this.stat.nlink>1){const t=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(t)){const r=this.linkCache.get(t);if(r.indexOf(this.cwd)===0)return this[v](r)}this.linkCache.set(t,this.absolute)}this[_]();if(this.stat.size===0)return this.end();this[x]()}[x](){c.open(this.absolute,"r",((t,r)=>{if(t)return this.emit("error",t);this[T](r)}))}[T](t){this.fd=t;if(this[L])return this[k]();this.blockLen=512*Math.ceil(this.stat.size/512);this.blockRemain=this.blockLen;const r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r);this.offset=0;this.pos=0;this.remain=this.stat.size;this.length=this.buf.length;this[w]()}[w](){const{fd:t,buf:r,offset:i,length:o,pos:a}=this;c.read(t,r,i,o,a,((t,r)=>{if(t){return this[k]((()=>this.emit("error",t)))}this[R](r)}))}[k](t){c.close(this.fd,t)}[R](t){if(t<=0&&this.remain>0){const t=new Error("encountered unexpected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[k]((()=>this.emit("error",t)))}if(t>this.remain){const t=new Error("did not encounter expected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";return this[k]((()=>this.emit("error",t)))}if(t===this.remain){for(let r=t;r<this.length&&t<this.blockRemain;r++){this.buf[r+this.offset]=0;t++;this.remain++}}const r=this.offset===0&&t===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+t);const i=this.write(r);if(!i)this[C]((()=>this[P]()));else this[P]()}[C](t){this.once("drain",t)}write(t){if(this.blockRemain<t.length){const t=new Error("writing more data than expected");t.path=this.absolute;return this.emit("error",t)}this.remain-=t.length;this.blockRemain-=t.length;this.pos+=t.length;this.offset+=t.length;return super.write(t)}[P](){if(!this.remain){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return this[k]((t=>t?this.emit("error",t):this.end()))}if(this.offset>=this.length){this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length));this.offset=0}this.length=this.buf.length-this.offset;this[w]()}});class WriteEntrySync extends B{[E](){this[S](c.lstatSync(this.absolute))}[b](){this[O](c.readlinkSync(this.absolute))}[x](){this[T](c.openSync(this.absolute,"r"))}[w](){let t=true;try{const{fd:r,buf:i,offset:o,length:a,pos:l}=this;const u=c.readSync(r,i,o,a,l);this[R](u);t=false}finally{if(t){try{this[k]((()=>{}))}catch(t){}}}}[C](t){t()}[k](t){c.closeSync(this.fd);t()}}const $=D(class WriteEntryTar extends o{constructor(t,r){r=r||{};super(r);this.preservePaths=!!r.preservePaths;this.portable=!!r.portable;this.strict=!!r.strict;this.noPax=!!r.noPax;this.noMtime=!!r.noMtime;this.readEntry=t;this.type=t.type;if(this.type==="Directory"&&this.portable)this.noMtime=true;this.prefix=r.prefix||null;this.path=h(t.path);this.mode=this[A](t.mode);this.uid=this.portable?null:t.uid;this.gid=this.portable?null:t.gid;this.uname=this.portable?null:t.uname;this.gname=this.portable?null:t.gname;this.size=t.size;this.mtime=this.noMtime?null:r.mtime||t.mtime;this.atime=this.portable?null:t.atime;this.ctime=this.portable?null:t.ctime;this.linkpath=h(t.linkpath);if(typeof r.onwarn==="function")this.on("warn",r.onwarn);let i=false;if(!this.preservePaths){const[t,r]=N(this.path);if(t){this.path=r;i=t}}this.remain=t.size;this.blockRemain=t.startBlockSize;this.header=new l({path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime});if(i){this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path})}if(this.header.encode()&&!this.noPax){super.write(new a({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[I](this.path),linkpath:this.type==="Link"?this[I](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode())}super.write(this.header.block);t.pipe(this)}[I](t){return prefixPath(t,this.prefix)}[A](t){return j(t,this.type==="Directory",this.portable)}write(t){const r=t.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");this.blockRemain-=r;return super.write(t)}end(){if(this.blockRemain)super.write(Buffer.alloc(this.blockRemain));return super.end()}});B.Sync=WriteEntrySync;B.Tar=$;const getType=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";t.exports=B},8368:(t,r,i)=>{"use strict";
|
|
61
118
|
/*!
|
|
62
119
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
63
120
|
*
|
|
64
121
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
65
122
|
* Released under the MIT License.
|
|
66
|
-
*/const o=i(8387);const toRegexRange=(t,r,i)=>{if(o(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(r===void 0||t===r){return String(t)}if(o(r)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let a={relaxZeros:true,...i};if(typeof a.strictZeros==="boolean"){a.relaxZeros=a.strictZeros===false}let c=String(a.relaxZeros);let l=String(a.shorthand);let u=String(a.capture);let h=String(a.wrap);let d=t+":"+r+"="+c+l+u+h;if(toRegexRange.cache.hasOwnProperty(d)){return toRegexRange.cache[d].result}let p=Math.min(t,r);let m=Math.max(t,r);if(Math.abs(p-m)===1){let i=t+"|"+r;if(a.capture){return`(${i})`}if(a.wrap===false){return i}return`(?:${i})`}let g=hasPadding(t)||hasPadding(r);let y={min:t,max:r,a:p,b:m};let b=[];let v=[];if(g){y.isPadded=g;y.maxLen=String(y.max).length}if(p<0){let t=m<0?Math.abs(m):1;v=splitToPatterns(t,Math.abs(p),y,a);p=y.a=0}if(m>=0){b=splitToPatterns(p,m,y,a)}y.negatives=v;y.positives=b;y.result=collatePatterns(v,b,a);if(a.capture===true){y.result=`(${y.result})`}else if(a.wrap!==false&&b.length+v.length>1){y.result=`(?:${y.result})`}toRegexRange.cache[d]=y;return y.result};function collatePatterns(t,r,i){let o=filterPatterns(t,r,"-",false,i)||[];let a=filterPatterns(r,t,"",false,i)||[];let c=filterPatterns(t,r,"-?",true,i)||[];let l=o.concat(c).concat(a);return l.join("|")}function splitToRanges(t,r){let i=1;let o=1;let a=countNines(t,i);let c=new Set([r]);while(t<=a&&a<=r){c.add(a);i+=1;a=countNines(t,i)}a=countZeros(r+1,o)-1;while(t<a&&a<=r){c.add(a);o+=1;a=countZeros(r+1,o)-1}c=[...c];c.sort(compare);return c}function rangeToPattern(t,r,i){if(t===r){return{pattern:t,count:[],digits:0}}let o=zip(t,r);let a=o.length;let c="";let l=0;for(let t=0;t<a;t++){let[r,a]=o[t];if(r===a){c+=r}else if(r!=="0"||a!=="9"){c+=toCharacterClass(r,a,i)}else{l++}}if(l){c+=i.shorthand===true?"\\d":"[0-9]"}return{pattern:c,count:[l],digits:a}}function splitToPatterns(t,r,i,o){let a=splitToRanges(t,r);let c=[];let l=t;let u;for(let t=0;t<a.length;t++){let r=a[t];let h=rangeToPattern(String(l),String(r),o);let d="";if(!i.isPadded&&u&&u.pattern===h.pattern){if(u.count.length>1){u.count.pop()}u.count.push(h.count[0]);u.string=u.pattern+toQuantifier(u.count);l=r+1;continue}if(i.isPadded){d=padZeros(r,i,o)}h.string=d+h.pattern+toQuantifier(h.count);c.push(h);l=r+1;u=h}return c}function filterPatterns(t,r,i,o,a){let c=[];for(let a of t){let{string:t}=a;if(!o&&!contains(r,"string",t)){c.push(i+t)}if(o&&contains(r,"string",t)){c.push(i+t)}}return c}function zip(t,r){let i=[];for(let o=0;o<t.length;o++)i.push([t[o],r[o]]);return i}function compare(t,r){return t>r?1:r>t?-1:0}function contains(t,r,i){return t.some((t=>t[r]===i))}function countNines(t,r){return Number(String(t).slice(0,-r)+"9".repeat(r))}function countZeros(t,r){return t-t%Math.pow(10,r)}function toQuantifier(t){let[r=0,i=""]=t;if(i||r>1){return`{${r+(i?","+i:"")}}`}return""}function toCharacterClass(t,r,i){return`[${t}${r-t===1?"":"-"}${r}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,r,i){if(!r.isPadded){return t}let o=Math.abs(r.maxLen-String(t).length);let a=i.relaxZeros!==false;switch(o){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:{return a?`0{0,${o}}`:`0{${o}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},2817:(t,r,i)=>{const{URL:o}=i(7310);const{join:a}=i(1017);const c=i(7147);const{promisify:l}=i(3837);const{tmpdir:u}=i(2037);const h=i(2404);const d=l(c.writeFile);const p=l(c.mkdir);const m=l(c.readFile);const compareVersions=(t,r)=>t.localeCompare(r,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,r)=>{const i=u();const o=a(i,"update-check");if(!c.existsSync(o)){await p(o)}let l=`${t.name}-${r}.json`;if(t.scope){l=`${t.scope}-${l}`}return a(o,l)};const evaluateCache=async(t,r,i)=>{if(c.existsSync(t)){const o=await m(t,"utf8");const{lastUpdate:a,latest:c}=JSON.parse(o);const l=a+i;if(l>r){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,r,i)=>{const o=JSON.stringify({latest:r,lastUpdate:i});await d(t,o,"utf8")};const loadPackage=(t,r)=>new Promise(((o,a)=>{const c={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(r){c.headers.authorization=`${r.type} ${r.token}`}const{get:l}=i(t.protocol==="https:"?5687:3685);l(c,(t=>{const{statusCode:r}=t;if(r!==200){const i=new Error(`Request failed with code ${r}`);i.code=r;a(i);t.resume();return}let i="";t.setEncoding("utf8");t.on("data",(t=>{i+=t}));t.on("end",(()=>{try{const t=JSON.parse(i);o(t)}catch(t){a(t)}}))})).on("error",a).on("timeout",a)}));const getMostRecent=async({full:t,scope:r},a)=>{const c=h(r);const l=new o(t,c);let u=null;try{u=await loadPackage(l)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=i(6377);const r=t(c,{recursive:true});u=await loadPackage(l,r)}else{throw t}}const d=u["dist-tags"][a];if(!d){throw new Error(`Distribution tag ${a} is not available`)}return d};const g={interval:36e5,distTag:"latest"};const getDetails=t=>{const r={full:encode(t)};if(t.includes("/")){const i=t.split("/");r.scope=i[0];r.name=i[1]}else{r.scope=null;r.name=t}return r};t.exports=async(t,r)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const i=getDetails(t.name);const o=Date.now();const{distTag:a,interval:c}=Object.assign({},g,r);const l=await getFile(i,a);let u=null;let h=true;({shouldCheck:h,latest:u}=await evaluateCache(l,o,c));if(h){u=await getMostRecent(i,a);await updateCache(l,u,o)}const d=compareVersions(t.version,u);if(d===-1){return{latest:u,fromCache:!h}}return null}},8085:(t,r,i)=>{const o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const a=i(1017);const c=o?";":":";const l=i(2212);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,r)=>{const i=r.colon||c;const a=t.match(/\//)||o&&t.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(i)];const l=o?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const u=o?l.split(i):[""];if(o){if(t.indexOf(".")!==-1&&u[0]!=="")u.unshift("")}return{pathEnv:a,pathExt:u,pathExtExe:l}};const which=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}if(!r)r={};const{pathEnv:o,pathExt:c,pathExtExe:u}=getPathInfo(t,r);const h=[];const step=i=>new Promise(((c,l)=>{if(i===o.length)return r.all&&h.length?c(h):l(getNotFoundError(t));const u=o[i];const d=/^".*"$/.test(u)?u.slice(1,-1):u;const p=a.join(d,t);const m=!d&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(subStep(m,i,0))}));const subStep=(t,i,o)=>new Promise(((a,d)=>{if(o===c.length)return a(step(i+1));const p=c[o];l(t+p,{pathExt:u},((c,l)=>{if(!c&&l){if(r.all)h.push(t+p);else return a(t+p)}return a(subStep(t,i,o+1))}))}));return i?step(0).then((t=>i(null,t)),i):step(0)};const whichSync=(t,r)=>{r=r||{};const{pathEnv:i,pathExt:o,pathExtExe:c}=getPathInfo(t,r);const u=[];for(let h=0;h<i.length;h++){const d=i[h];const p=/^".*"$/.test(d)?d.slice(1,-1):d;const m=a.join(p,t);const g=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;for(let t=0;t<o.length;t++){const i=g+o[t];try{const t=l.sync(i,{pathExt:c});if(t){if(r.all)u.push(i);else return i}}catch(t){}}}if(r.all&&u.length)return u;if(r.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},2928:t=>{t.exports=wrappy;function wrappy(t,r){if(t&&r)return wrappy(t)(r);if(typeof t!=="function")throw new TypeError("need wrapper function");Object.keys(t).forEach((function(r){wrapper[r]=t[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var i=0;i<r.length;i++){r[i]=arguments[i]}var o=t.apply(this,r);var a=r[r.length-1];if(typeof o==="function"&&o!==a){Object.keys(a).forEach((function(t){o[t]=a[t]}))}return o}}},6077:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},605:(t,r,i)=>{"use strict";t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var r=this;if(!(r instanceof Yallist)){r=new Yallist}r.tail=null;r.head=null;r.length=0;if(t&&typeof t.forEach==="function"){t.forEach((function(t){r.push(t)}))}else if(arguments.length>0){for(var i=0,o=arguments.length;i<o;i++){r.push(arguments[i])}}return r}Yallist.prototype.removeNode=function(t){if(t.list!==this){throw new Error("removing node which does not belong to this list")}var r=t.next;var i=t.prev;if(r){r.prev=i}if(i){i.next=r}if(t===this.head){this.head=r}if(t===this.tail){this.tail=i}t.list.length--;t.next=null;t.prev=null;t.list=null;return r};Yallist.prototype.unshiftNode=function(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}var r=this.head;t.list=this;t.next=r;if(r){r.prev=t}this.head=t;if(!this.tail){this.tail=t}this.length++};Yallist.prototype.pushNode=function(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}var r=this.tail;t.list=this;t.prev=r;if(r){r.next=t}this.tail=t;if(!this.head){this.head=t}this.length++};Yallist.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++){push(this,arguments[t])}return this.length};Yallist.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++){unshift(this,arguments[t])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var t=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return t};Yallist.prototype.shift=function(){if(!this.head){return undefined}var t=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return t};Yallist.prototype.forEach=function(t,r){r=r||this;for(var i=this.head,o=0;i!==null;o++){t.call(r,i.value,o,this);i=i.next}};Yallist.prototype.forEachReverse=function(t,r){r=r||this;for(var i=this.tail,o=this.length-1;i!==null;o--){t.call(r,i.value,o,this);i=i.prev}};Yallist.prototype.get=function(t){for(var r=0,i=this.head;i!==null&&r<t;r++){i=i.next}if(r===t&&i!==null){return i.value}};Yallist.prototype.getReverse=function(t){for(var r=0,i=this.tail;i!==null&&r<t;r++){i=i.prev}if(r===t&&i!==null){return i.value}};Yallist.prototype.map=function(t,r){r=r||this;var i=new Yallist;for(var o=this.head;o!==null;){i.push(t.call(r,o.value,this));o=o.next}return i};Yallist.prototype.mapReverse=function(t,r){r=r||this;var i=new Yallist;for(var o=this.tail;o!==null;){i.push(t.call(r,o.value,this));o=o.prev}return i};Yallist.prototype.reduce=function(t,r){var i;var o=this.head;if(arguments.length>1){i=r}else if(this.head){o=this.head.next;i=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=0;o!==null;a++){i=t(i,o.value,a);o=o.next}return i};Yallist.prototype.reduceReverse=function(t,r){var i;var o=this.tail;if(arguments.length>1){i=r}else if(this.tail){o=this.tail.prev;i=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=this.length-1;o!==null;a--){i=t(i,o.value,a);o=o.prev}return i};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var r=0,i=this.head;i!==null;r++){t[r]=i.value;i=i.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var r=0,i=this.tail;i!==null;r++){t[r]=i.value;i=i.prev}return t};Yallist.prototype.slice=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}for(;a!==null&&o<r;o++,a=a.next){i.push(a.value)}return i};Yallist.prototype.sliceReverse=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=this.length,a=this.tail;a!==null&&o>r;o--){a=a.prev}for(;a!==null&&o>t;o--,a=a.prev){i.push(a.value)}return i};Yallist.prototype.splice=function(t,r,...i){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}var c=[];for(var o=0;a&&o<r;o++){c.push(a.value);a=this.removeNode(a)}if(a===null){a=this.tail}if(a!==this.head&&a!==this.tail){a=a.prev}for(var o=0;o<i.length;o++){a=insert(this,a,i[o])}return c};Yallist.prototype.reverse=function(){var t=this.head;var r=this.tail;for(var i=t;i!==null;i=i.prev){var o=i.prev;i.prev=i.next;i.next=o}this.head=r;this.tail=t;return this};function insert(t,r,i){var o=r===t.head?new Node(i,null,r,t):new Node(i,r,r.next,t);if(o.next===null){t.tail=o}if(o.prev===null){t.head=o}t.length++;return o}function push(t,r){t.tail=new Node(r,t.tail,null,t);if(!t.head){t.head=t.tail}t.length++}function unshift(t,r){t.head=new Node(r,null,t.head,t);if(!t.tail){t.tail=t.head}t.length++}function Node(t,r,i,o){if(!(this instanceof Node)){return new Node(t,r,i,o)}this.list=o;this.value=t;if(r){r.next=this;this.prev=r}else{this.prev=null}if(i){i.prev=this;this.next=i}else{this.next=null}}try{i(6077)(Yallist)}catch(t){}},3288:(t,r,i)=>{"use strict";i.r(r);const o=10;const wrapAnsi16=(t=0)=>r=>`[${r+t}m`;const wrapAnsi256=(t=0)=>r=>`[${38+t};5;${r}m`;const wrapAnsi16m=(t=0)=>(r,i,o)=>`[${38+t};2;${r};${i};${o}m`;function assembleStyles(){const t=new Map;const r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright;r.bgColor.bgGray=r.bgColor.bgBlackBright;r.color.grey=r.color.blackBright;r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(const[i,o]of Object.entries(r)){for(const[i,a]of Object.entries(o)){r[i]={open:`[${a[0]}m`,close:`[${a[1]}m`};o[i]=r[i];t.set(a[0],a[1])}Object.defineProperty(r,i,{value:o,enumerable:false})}Object.defineProperty(r,"codes",{value:t,enumerable:false});r.color.close="[39m";r.bgColor.close="[49m";r.color.ansi=wrapAnsi16();r.color.ansi256=wrapAnsi256();r.color.ansi16m=wrapAnsi16m();r.bgColor.ansi=wrapAnsi16(o);r.bgColor.ansi256=wrapAnsi256(o);r.bgColor.ansi16m=wrapAnsi16m(o);Object.defineProperties(r,{rgbToAnsi256:{value:(t,r,i)=>{if(t===r&&r===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value:t=>{const r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r){return[0,0,0]}let{colorString:i}=r.groups;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,o&255]},enumerable:false},hexToAnsi256:{value:t=>r.rgbToAnsi256(...r.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value:t=>{if(t<8){return 30+t}if(t<16){return 90+(t-8)}let r;let i;let o;if(t>=232){r=((t-232)*10+8)/255;i=r;o=r}else{t-=16;const a=t%36;r=Math.floor(t/36)/5;i=Math.floor(a/6)/5;o=a%6/5}const a=Math.max(r,i,o)*2;if(a===0){return 30}let c=30+(Math.round(o)<<2|Math.round(i)<<1|Math.round(r));if(a===2){c+=60}return c},enumerable:false},rgbToAnsi:{value:(t,i,o)=>r.ansi256ToAnsi(r.rgbToAnsi256(t,i,o)),enumerable:false},hexToAnsi:{value:t=>r.ansi256ToAnsi(r.hexToAnsi256(t)),enumerable:false}});return r}const a=assembleStyles();const c=a;const l=require("node:process");const u=require("node:os");const h=require("node:tty");function hasFlag(t,r=l.argv){const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1||o<a)}const{env:d}=l;let p;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){p=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){p=1}function envForceColor(){if("FORCE_COLOR"in d){if(d.FORCE_COLOR==="true"){return 1}if(d.FORCE_COLOR==="false"){return 0}return d.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(d.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:r,sniffFlags:i=true}={}){const o=envForceColor();if(o!==undefined){p=o}const a=i?p:o;if(a===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if(t&&!r&&a===undefined){return 0}const c=a||0;if(d.TERM==="dumb"){return c}if(l.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in d){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in d))||d.CI_NAME==="codeship"){return 1}return c}if("TEAMCITY_VERSION"in d){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0}if("TF_BUILD"in d&&"AGENT_NAME"in d){return 1}if(d.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in d){const t=Number.parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)){return 1}if("COLORTERM"in d){return 1}return c}function createSupportsColor(t,r={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...r});return translateLevel(i)}const m={stdout:createSupportsColor({isTTY:h.isatty(1)}),stderr:createSupportsColor({isTTY:h.isatty(2)})};const g=m;function stringReplaceAll(t,r,i){let o=t.indexOf(r);if(o===-1){return t}const a=r.length;let c=0;let l="";do{l+=t.substr(c,o-c)+r+i;c=o+a;o=t.indexOf(r,c)}while(o!==-1);l+=t.slice(c);return l}function stringEncaseCRLFWithFirstIndex(t,r,i,o){let a=0;let c="";do{const l=t[o-1]==="\r";c+=t.substr(a,(l?o-1:o)-a)+r+(l?"\r\n":"\n")+i;a=o+1;o=t.indexOf("\n",a)}while(o!==-1);c+=t.slice(a);return c}const{stdout:y,stderr:b}=g;const v=Symbol("GENERATOR");const _=Symbol("STYLER");const w=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const S=Object.create(null);const applyOptions=(t,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=y?y.level:0;t.level=r.level===undefined?i:r.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,r]of Object.entries(c)){S[t]={get(){const i=createBuilder(this,createStyler(r.open,r.close,this[_]),this[w]);Object.defineProperty(this,t,{value:i});return i}}}S.visible={get(){const t=createBuilder(this,this[_],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,r,i,...o)=>{if(t==="rgb"){if(r==="ansi16m"){return c[i].ansi16m(...o)}if(r==="ansi256"){return c[i].ansi256(c.rgbToAnsi256(...o))}return c[i].ansi(c.rgbToAnsi(...o))}if(t==="hex"){return getModelAnsi("rgb",r,i,...c.hexToRgb(...o))}return c[i][t](...o)};const O=["rgb","hex","ansi256"];for(const t of O){S[t]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"color",...i),c.color.close,this[_]);return createBuilder(this,o,this[w])}}};const r="bg"+t[0].toUpperCase()+t.slice(1);S[r]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"bgColor",...i),c.bgColor.close,this[_]);return createBuilder(this,o,this[w])}}}}const R=Object.defineProperties((()=>{}),{...S,level:{enumerable:true,get(){return this[v].level},set(t){this[v].level=t}}});const createStyler=(t,r,i)=>{let o;let a;if(i===undefined){o=t;a=r}else{o=i.openAll+t;a=r+i.closeAll}return{open:t,close:r,openAll:o,closeAll:a,parent:i}};const createBuilder=(t,r,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,R);builder[v]=t;builder[_]=r;builder[w]=i;return builder};const applyStyle=(t,r)=>{if(t.level<=0||!r){return t[w]?"":r}let i=t[_];if(i===undefined){return r}const{openAll:o,closeAll:a}=i;if(r.includes("")){while(i!==undefined){r=stringReplaceAll(r,i.close,i.open);i=i.parent}}const c=r.indexOf("\n");if(c!==-1){r=stringEncaseCRLFWithFirstIndex(r,a,o,c)}return o+r+a};Object.defineProperties(createChalk.prototype,S);const x=createChalk();const A=createChalk({level:b?b.level:0});const T=x;var k=i(621);const{program:C,createCommand:P,createArgument:I,createOption:L,CommanderError:N,InvalidArgumentError:M,Command:D,Argument:j,Option:$,Help:H}=k;var B=i(2817);var U=i.n(B);var q=i(7328);var G=i.n(q);var V=i(1017);var z=i.n(V);var W=i(7147);var Y=i.n(W);function isSetup(){try{const t=Y().statSync(z().join(process.cwd(),".hyperbook"));if(!t.isDirectory()){throw Error()}}catch(t){console.log(T.red("Could not find .hyperbook folder. Be sure to run `hyperbook setup`."));return false}try{Y().statSync(z().join(process.cwd(),".hyperbook","node_modules",".bin","next"))}catch(t){console.log(T.red("Could not find next binary in the .hyperbook folder. Be sure to run `hyperbook setup`."));return false}return true}async function readHyperbook(){return new Promise(((t,r)=>{Y().readFile(z().join(process.cwd(),"hyperbook.json"),((i,o)=>{if(i){console.log(T.red("Could not find 'hyperbook.json'. Make sure you are in the right directory."));r()}else{const r=JSON.parse(o.toString());t(r)}}))}))}async function runBuild(){const t=isSetup();if(!t){return}const r=await readHyperbook();Y().writeFileSync(z().join(process.cwd(),".hyperbook","next.config.js"),`\nmodule.exports = {\n ${(r===null||r===void 0?void 0:r.basePath)?`basePath: '${r.basePath}',`:""}\n typescript: {\n ignoreBuildErrors: true,\n }\n}\n `);return new Promise(((t,r)=>{const i="npm";const o=["run","build"];const a=G()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}async function runDev(){const t=isSetup();if(!t){return}return new Promise(((t,r)=>{const i="npm";const o=["run","dev"];const a=G()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}var K=i(2081);function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,K.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,K.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}var X=i(2037);var Z=i.n(X);const Q=require("node:events");const J=require("node:path");function indentString(t,r=1,i={}){const{indent:o=" ",includeEmptyLines:a=false}=i;if(typeof t!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(r<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``)}if(typeof o!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof o}\``)}if(r===0){return t}const c=a?/^/gm:/^(?!\s*$)/gm;return t.replace(c,o.repeat(r))}function escapeStringRegexp(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ee=/\s+at.*[(\s](.*)\)?/;const te=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;const re=typeof X.homedir==="undefined"?"":X.homedir().replace(/\\/g,"/");function cleanStack(t,{pretty:r=false,basePath:i}={}){const o=i&&new RegExp(`(at | \\()${escapeStringRegexp(i.replace(/\\/g,"/"))}`,"g");if(typeof t!=="string"){return undefined}return t.replace(/\\/g,"/").split("\n").filter((t=>{const r=t.match(ee);if(r===null||!r[1]){return true}const i=r[1];if(i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")){return false}return!te.test(i)})).filter((t=>t.trim()!=="")).map((t=>{if(o){t=t.replace(o,"$1")}if(r){t=t.replace(ee,((t,r)=>t.replace(r,r.replace(re,"~"))))}return t})).join("\n")}const cleanInternalStack=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t)){throw new TypeError(`Expected input to be an Array, got ${typeof t}`)}t=t.map((t=>{if(t instanceof Error){return t}if(t!==null&&typeof t==="object"){return Object.assign(new Error(t.message),t)}return new Error(t)}));let r=t.map((t=>typeof t.stack==="string"?cleanInternalStack(cleanStack(t.stack)):String(t))).join("\n");r="\n"+indentString(r,4);super(r);this.#e=t}get errors(){return this.#e.slice()}}async function pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true}={}){return new Promise(((a,c)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const l=[];const u=[];const h=new Map;let d=false;let p=false;let m=false;let g=0;let y=0;const b=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{d=true;p=true;c(t)};const next=async()=>{if(p){return}const t=await b.next();const i=y;y++;if(t.done){m=true;if(g===0&&!p){if(!o&&u.length>0){reject(new AggregateError(u));return}p=true;if(!h.size){a(l);return}const t=[];for(const[r,i]of l.entries()){if(h.get(r)===se){continue}t.push(i)}a(t)}return}g++;(async()=>{try{const o=await t.value;if(p){return}const a=await r(o,i);if(a===se){h.set(i,a)}l[i]=a;g--;await next()}catch(t){if(o){reject(t)}else{u.push(t);g--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(m||d){break}}})()}))}const se=Symbol("skip");function arrify(t){if(t===null||t===undefined){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]}var ie=i(654);async function pFilter(t,r,i){const o=await pMap(t,((t,i)=>Promise.all([r(t,i),t])),i);return o.filter((t=>Boolean(t[0]))).map((t=>t[1]))}const ne=require("node:fs");var oe=i(1382);var ae=i(3924);var ce=i(5352);var le=i(6302);function slash(t){const r=/^\\\\\?\\/.test(t);const i=/[^\u0000-\u0080]+/.test(t);if(r||i){return t}return t.replace(/\\/g,"/")}const ue=require("node:url");const he=require("node:stream");const toPath=t=>t instanceof URL?(0,ue.fileURLToPath)(t):t;class FilterStream extends he.Transform{constructor(t){super({objectMode:true,transform(r,i,o){o(undefined,t(r)?r:undefined)}})}}const isNegativePattern=t=>t[0]==="!";const fe={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:true,dot:true};const de="**/.gitignore";const applyBaseToPattern=(t,r)=>isNegativePattern(t)?"!"+J.posix.join(r,t.slice(1)):J.posix.join(r,t);const parseIgnoreFile=(t,r)=>{const i=slash(J.relative(r,J.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,i)))};const toRelativePath=(t,r)=>{r=slash(r);if(J.isAbsolute(t)){if(slash(t).startsWith(r)){return J.relative(r,t)}throw new Error(`Path ${t} is not in cwd ${r}`)}return t};const getIsIgnoredPredicate=(t,r)=>{const i=t.flatMap((t=>parseIgnoreFile(t,r)));const o=le().add(i);return t=>{t=toPath(t);t=toRelativePath(t,r);return o.ignores(slash(t))}};const normalizeOptions=(t={})=>({cwd:toPath(t.cwd)||l.cwd()});const isIgnoredByIgnoreFiles=async(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=await ae(t,{cwd:i,...fe});const a=await Promise.all(o.map((async t=>({filePath:t,content:await ne.promises.readFile(t,"utf8")}))));return getIsIgnoredPredicate(a,i)};const isIgnoredByIgnoreFilesSync=(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=ae.sync(t,{cwd:i,...fe});const a=o.map((t=>({filePath:t,content:ne.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(a,i)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(de,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(de,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t.cwd){return}let r;try{r=ne.statSync(t.cwd)}catch{return}if(!r.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={ignore:[],expandDirectories:true,...t,cwd:toPath(t.cwd)};checkCwdOption(t);return t};const normalizeArguments=t=>async(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const normalizeArgumentsSync=t=>(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:r,gitignore:i}=t;const o=r?toPatternsArray(r):[];if(i){o.push(de)}return o};const getFilter=async t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&await isIgnoredByIgnoreFiles(r,{cwd:t.cwd}))};const getFilterSync=t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&isIgnoredByIgnoreFilesSync(r,{cwd:t.cwd}))};const createFilterFunction=t=>{const r=new Set;return i=>{const o=i.path||i;const a=J.normalize(o);const c=r.has(a)||t&&t(o);r.add(a);return!c}};const unionFastGlobResults=(t,r)=>t.flat().filter((t=>r(t)));const unionFastGlobStreams=(t,r)=>oe(t).pipe(new FilterStream((t=>r(t))));const convertNegativePatterns=(t,r)=>{const i=[];while(t.length>0){const o=t.findIndex((t=>isNegativePattern(t)));if(o===-1){i.push({patterns:t,options:r});break}const a=t[o].slice(1);for(const t of i){t.options.ignore.push(a)}if(o!==0){i.push({patterns:t.slice(0,o),options:{...r,ignore:[...r.ignore,a]}})}t=t.slice(o+1)}return i};const getDirGlobOptions=(t,r)=>({...r?{cwd:r}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const c=getDirGlobOptions(a,o);const l=o?{cwd:o}:undefined;return Promise.all(i.map((async t=>{let{patterns:r,options:i}=t;[r,i.ignore]=await Promise.all([ce(r,c),ce(i.ignore,l)]);return{patterns:r,options:i}})))};const generateTasksSync=(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const c=getDirGlobOptions(a,o);const l=o?{cwd:o}:undefined;return i.map((t=>{let{patterns:r,options:i}=t;r=ce.sync(r,c);i.ignore=ce.sync(i.ignore,l);return{patterns:r,options:i}}))};const pe=normalizeArguments((async(t,r)=>{const[i,o]=await Promise.all([generateTasks(t,r),getFilter(r)]);const a=await Promise.all(i.map((t=>ae(t.patterns,t.options))));return unionFastGlobResults(a,o)}));const me=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>ae.sync(t.patterns,t.options)));return unionFastGlobResults(a,o)}));const ge=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>ae.stream(t.patterns,t.options)));return unionFastGlobStreams(a,o)}));const ye=normalizeArgumentsSync(((t,r)=>t.some((t=>ae.isDynamicPattern(t,r)))));const be=normalizeArguments(generateTasks);const ve=normalizeArgumentsSync(generateTasksSync);var _e=i(1224);var we=i(5842);class CpyError extends we{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpyError"}}const Ee=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"];const Se=new RegExp(Ee.join("|"));function isJunk(t){return Se.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,r,i){this.path=t;this.originalPath=t;this.destination=r;this.options=i;this.isDirectory=false;if(!ye(t)&&ne.existsSync(t)&&ne.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return J.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const r=t.findIndex((t=>t?ye(t):false));const i=t.slice(0,r).join("/");if(i){return J.isAbsolute(i)?i:J.join(this.options.cwd,i)}return this.destination}hasMagic(){return ye(this.options.flat?this.path:this.originalPath)}getMatches(){let t=me(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(J.basename(t))))}return t}}const Oe=(u.cpus().length||1)*2;const Re={ignoreJunk:true,flat:false,cwd:l.cwd()};class Entry{constructor(t,r,i){this.path=t.split("/").join(J.sep);this.relativePath=r.split("/").join(J.sep);this.pattern=i;Object.freeze(this)}get name(){return J.basename(this.path)}get nameWithoutExtension(){return J.basename(this.path,J.extname(this.path))}get extension(){return J.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>_e.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:r,options:i})=>{if(t.pattern.hasMagic()){if(i.flat){if(J.isAbsolute(r)){return J.join(r,t.name)}return J.join(i.cwd,r,t.name)}return J.join(r,J.relative(t.pattern.normalizedPath,t.path))}if(J.isAbsolute(r)){return J.join(r,t.name)}if(t.pattern.isDirectory&&J.relative(i.cwd,t.path).startsWith("..")){return J.join(i.cwd,r,J.basename(t.pattern.originalPath),J.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return J.join(i.cwd,r,J.basename(t.pattern.originalPath),J.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&i.flat){return J.join(i.cwd,r,J.basename(t.pattern.originalPath))}return J.join(i.cwd,r,J.relative(i.cwd,t.path))};const renameFile=(t,r)=>{const i=J.basename(t,J.extname(t));const o=J.extname(t);const a=J.dirname(t);if(typeof r==="string"){return J.join(a,r)}if(typeof r==="function"){return J.join(a,`${r(i)}${o}`)}return t};function cpy(t,r,{concurrency:i=Oe,...o}={}){const a=new Map;const c=new Q;o={...Re,...o};const l=(async()=>{let l=[];let u=0;let h=0;let d=expandPatternsWithBraceExpansion(arrify(t)).map((t=>t.replace(/\\/g,"/")));const p=d.filter((t=>!t.startsWith("!")));const m=d.filter((t=>t.startsWith("!")));if(p.length===0||!r){throw new CpyError("`source` and `destination` required")}d=d.map((t=>new GlobPattern(t,r,{...o,ignore:m})));for(const t of d){let r=[];try{r=t.getMatches()}catch(r){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${r.message}`,r)}if(r.length===0&&!ye(t.originalPath)&&!ye(m)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}l=[...l,...r.map((r=>new Entry(r,J.relative(o.cwd,r),t)))]}if(o.filter!==undefined){l=await pFilter(l,o.filter,{concurrency:1024})}if(l.length===0){c.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const r=a.get(t.sourcePath)||{writtenBytes:0,percent:0};if(r.writtenBytes!==t.writtenBytes||r.percent!==t.percent){h-=r.writtenBytes;h+=t.writtenBytes;if(t.percent===1&&r.percent!==1){u++}a.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});c.emit("progress",{totalFiles:l.length,percent:u/l.length,completedFiles:u,completedSize:h})}};return pMap(l,(async t=>{const i=renameFile(preprocessDestinationPath({entry:t,destination:r,options:o}),o.rename);try{await ie(t.path,i,o).on("progress",fileProgressHandler)}catch(r){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${i}\`: ${r.message}`,r)}return i}),{concurrency:i})})();l.on=(...t)=>{c.on(...t);return l};return l}var xe=i(6718);var Ae=i.n(xe);function isFolderEmpty(t,r){const i=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const o=Y().readdirSync(t).filter((t=>!i.includes(t))).filter((t=>!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${T.green(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=Y().lstatSync(z().join(t,r));if(i.isDirectory()){console.log(` ${T.blue(r)}/`)}else{console.log(` ${r}`)}}catch{console.log(` ${r}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await Y().promises.access(t,(Y().constants||Y()).W_OK);return true}catch(t){return false}}async function makeDir(t,r={recursive:true}){await Y().promises.mkdir(t,r)}var Te=i(2625);var ke=i.n(Te);function isInGitRepository(){try{(0,K.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,K.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,K.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,K.execSync)("git init",{stdio:"ignore"});r=true;(0,K.execSync)("git checkout -b main",{stdio:"ignore"});(0,K.execSync)("git add -A",{stdio:"ignore"});(0,K.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(i){if(r){try{ke().sync(z().join(t,".git"))}catch(t){}}return false}}var Ce=i(8950);class CancelError extends Error{constructor(t){super(t||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(t){return(...r)=>new PCancelable(((i,o,a)=>{r.push(a);t(...r).then(i,o)}))}constructor(t){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((r,i)=>{this._reject=i;const onResolve=t=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;r(t)}};const onReject=t=>{this._isPending=false;i(t)};const onCancel=t=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(t)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}});t(onResolve,onReject,onCancel)}))}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const t of this._cancelHandlers){t()}}catch(t){this._reject(t);return}}if(this._rejectOnCancel){this._reject(new CancelError(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(t){return Ce.object(t)&&"_onResponse"in t}class RequestError extends Error{constructor(t,r,i){super(t);Object.defineProperty(this,"input",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"stack",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=r.code??"ERR_GOT_REQUEST_ERROR";this.input=r.input;if(isRequest(i)){Object.defineProperty(this,"request",{enumerable:false,value:i});Object.defineProperty(this,"response",{enumerable:false,value:i.response});this.options=i.options}else{this.options=i}this.timings=this.request?.timings;if(Ce.string(r.stack)&&Ce.string(this.stack)){const t=this.stack.indexOf(this.message)+this.message.length;const i=this.stack.slice(t).split("\n").reverse();const o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split("\n").reverse();while(o.length>0&&o[0]===i[0]){i.shift()}this.stack=`${this.stack.slice(0,t)}${i.reverse().join("\n")}${o.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t);this.name="MaxRedirectsError";this.code="ERR_TOO_MANY_REDIRECTS"}}class HTTPError extends RequestError{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request);this.name="HTTPError";this.code="ERR_NON_2XX_3XX_RESPONSE"}}class CacheError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="CacheError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}}class UploadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="UploadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}class TimeoutError extends RequestError{constructor(t,r,i){super(t.message,t,i);Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.event=t.event;this.timings=r}}class ReadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="ReadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class RetryError extends RequestError{constructor(t){super("Retrying",{},t);this.name="RetryError";this.code="ERR_RETRYING"}}const Pe=require("node:buffer");const Ie=require("node:http");var Le=i(2361);var Ne=i(3837);var Me=i(2966);const timer=t=>{if(t.timings){return t.timings}const r={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};t.timings=r;const handleError=t=>{t.once(Le.errorMonitor,(()=>{r.error=Date.now();r.phases.total=r.error-r.start}))};handleError(t);const onAbort=()=>{r.abort=Date.now();r.phases.total=r.abort-r.start};t.prependOnceListener("abort",onAbort);const onSocket=t=>{r.socket=Date.now();r.phases.wait=r.socket-r.start;if(Ne.types.isProxy(t)){return}const lookupListener=()=>{r.lookup=Date.now();r.phases.dns=r.lookup-r.socket};t.prependOnceListener("lookup",lookupListener);Me(t,{connect:()=>{r.connect=Date.now();if(r.lookup===undefined){t.removeListener("lookup",lookupListener);r.lookup=r.connect;r.phases.dns=r.lookup-r.socket}r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now();r.phases.tls=r.secureConnect-r.connect}})};if(t.socket){onSocket(t.socket)}else{t.prependOnceListener("socket",onSocket)}const onUpload=()=>{r.upload=Date.now();r.phases.request=r.upload-(r.secureConnect??r.connect)};if(t.writableFinished){onUpload()}else{t.prependOnceListener("finish",onUpload)}t.prependOnceListener("response",(i=>{r.response=Date.now();r.phases.firstByte=r.response-r.upload;i.timings=r;handleError(i);i.prependOnceListener("end",(()=>{t.off("abort",onAbort);i.off("aborted",onAbort);if(r.phases.total){return}r.end=Date.now();r.phases.download=r.end-r.response;r.phases.total=r.end-r.start}));i.prependOnceListener("aborted",onAbort)}));return r};const De=timer;var je=i(3846);var $e=i(1599);var Fe=i(7981);const He="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let t=16;let r="";while(t--){r+=He[Math.random()*He.length<<0]}return r}const Be=createBoundary;const getType=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function isPlainObject(t){if(getType(t)!=="object"){return false}const r=Object.getPrototypeOf(t);if(r===null||r===undefined){return true}const i=r.constructor&&r.constructor.toString();return i===Object.toString()}const Ue=isPlainObject;const normalizeValue=t=>String(t).replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n");const qe=normalizeValue;const escapeName=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");const Ge=escapeName;const isFunction=t=>typeof t==="function";const Ve=isFunction;const isFileLike=t=>Boolean(t&&typeof t==="object"&&Ve(t.constructor)&&t[Symbol.toStringTag]==="File"&&Ve(t.stream)&&t.name!=null&&t.size!=null&&t.lastModified!=null);const isFormData=t=>Boolean(t&&Ve(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&Ve(t.append)&&Ve(t.getAll)&&Ve(t.entries)&&Ve(t[Symbol.iterator]));const ze=isFormData;var We=undefined&&undefined.__classPrivateFieldSet||function(t,r,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,i):a?a.value=i:r.set(t,i),i};var Ye=undefined&&undefined.__classPrivateFieldGet||function(t,r,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!o:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:r.get(t)};var Ke,Xe,Ze,Qe,Je,et,tt,rt,st,it;const nt={enableAdditionalHeaders:false};class FormDataEncoder{constructor(t,r,i){Ke.add(this);Xe.set(this,"\r\n");Ze.set(this,void 0);Qe.set(this,void 0);Je.set(this,"-".repeat(2));et.set(this,new TextEncoder);tt.set(this,void 0);rt.set(this,void 0);st.set(this,void 0);if(!isFormData(t)){throw new TypeError("Expected first argument to be a FormData instance.")}let o;if(Ue(r)){i=r}else{o=r}if(!o){o=Be()}if(typeof o!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(i&&!Ue(i)){throw new TypeError("Expected options argument to be an object.")}We(this,rt,t,"f");We(this,st,{...nt,...i},"f");We(this,Ze,Ye(this,et,"f").encode(Ye(this,Xe,"f")),"f");We(this,Qe,Ye(this,Ze,"f").byteLength,"f");this.boundary=`form-data-boundary-${o}`;this.contentType=`multipart/form-data; boundary=${this.boundary}`;We(this,tt,Ye(this,et,"f").encode(`${Ye(this,Je,"f")}${this.boundary}${Ye(this,Je,"f")}${Ye(this,Xe,"f").repeat(2)}`),"f");this.contentLength=String(this.getContentLength());this.headers=Object.freeze({"Content-Type":this.contentType,"Content-Length":this.contentLength});Object.defineProperties(this,{boundary:{writable:false,configurable:false},contentType:{writable:false,configurable:false},contentLength:{writable:false,configurable:false},headers:{writable:false,configurable:false}})}getContentLength(){let t=0;for(const[r,i]of Ye(this,rt,"f")){const o=isFileLike(i)?i:Ye(this,et,"f").encode(qe(i));t+=Ye(this,Ke,"m",it).call(this,r,o).byteLength;t+=isFileLike(o)?o.size:o.byteLength;t+=Ye(this,Qe,"f")}return t+Ye(this,tt,"f").byteLength}*values(){for(const[t,r]of Ye(this,rt,"f").entries()){const i=isFileLike(r)?r:Ye(this,et,"f").encode(qe(r));yield Ye(this,Ke,"m",it).call(this,t,i);yield i;yield Ye(this,Ze,"f")}yield Ye(this,tt,"f")}async*encode(){for(const t of this.values()){if(isFileLike(t)){yield*t.stream()}else{yield t}}}[(Xe=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,Je=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,st=new WeakMap,Ke=new WeakSet,it=function _FormDataEncoder_getFieldHeader(t,r){let i="";i+=`${Ye(this,Je,"f")}${this.boundary}${Ye(this,Xe,"f")}`;i+=`Content-Disposition: form-data; name="${Ge(t)}"`;if(isFileLike(r)){i+=`; filename="${Ge(r.name)}"${Ye(this,Xe,"f")}`;i+=`Content-Type: ${r.type||"application/octet-stream"}`}if(Ye(this,st,"f").enableAdditionalHeaders===true){i+=`${Ye(this,Xe,"f")}Content-Length: ${isFileLike(r)?r.size:r.byteLength}`}return Ye(this,et,"f").encode(`${i}${Ye(this,Xe,"f").repeat(2)}`)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}}const ot=null&&FormDataEncoder;const at=require("node:util");function is_form_data_isFormData(t){return Ce.nodeStream(t)&&Ce.function_(t.getBoundary)}async function getBodySize(t,r){if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(Ce.string(t)){return Pe.Buffer.byteLength(t)}if(Ce.buffer(t)){return t.length}if(is_form_data_isFormData(t)){return(0,at.promisify)(t.getLength.bind(t))()}return undefined}function proxyEvents(t,r,i){const o={};for(const a of i){const eventFunction=(...t)=>{r.emit(a,...t)};o[a]=eventFunction;t.on(a,eventFunction)}return()=>{for(const[r,i]of Object.entries(o)){t.off(r,i)}}}const ct=require("node:net");function unhandle(){const t=[];return{once(r,i,o){r.once(i,o);t.push({origin:r,event:i,fn:o})},unhandleAll(){for(const r of t){const{origin:t,event:i,fn:o}=r;t.removeListener(i,o)}t.length=0}}}const ut=Symbol("reentry");const noop=()=>{};class timed_out_TimeoutError extends Error{constructor(t,r){super(`Timeout awaiting '${r}' for ${t}ms`);Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:r});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.code="ETIMEDOUT"}}function timedOut(t,r,i){if(ut in t){return noop}t[ut]=true;const o=[];const{once:a,unhandleAll:c}=unhandle();const addTimeout=(t,r,i)=>{const a=setTimeout(r,t,t,i);a.unref?.();const cancel=()=>{clearTimeout(a)};o.push(cancel);return cancel};const{host:l,hostname:u}=i;const timeoutHandler=(r,i)=>{t.destroy(new timed_out_TimeoutError(r,i))};const cancelTimeouts=()=>{for(const t of o){t()}c()};t.once("error",(r=>{cancelTimeouts();if(t.listenerCount("error")===0){throw r}}));if(typeof r.request!=="undefined"){const i=addTimeout(r.request,timeoutHandler,"request");a(t,"response",(t=>{a(t,"end",i)}))}if(typeof r.socket!=="undefined"){const{socket:i}=r;const socketTimeoutHandler=()=>{timeoutHandler(i,"socket")};t.setTimeout(i,socketTimeoutHandler);o.push((()=>{t.removeListener("timeout",socketTimeoutHandler)}))}const h=typeof r.lookup!=="undefined";const d=typeof r.connect!=="undefined";const p=typeof r.secureConnect!=="undefined";const m=typeof r.send!=="undefined";if(h||d||p||m){a(t,"socket",(o=>{const{socketPath:c}=t;if(o.connecting){const t=Boolean(c??ct.isIP(u??l??"")!==0);if(h&&!t&&typeof o.address().address==="undefined"){const t=addTimeout(r.lookup,timeoutHandler,"lookup");a(o,"lookup",t)}if(d){const timeConnect=()=>addTimeout(r.connect,timeoutHandler,"connect");if(t){a(o,"connect",timeConnect())}else{a(o,"lookup",(t=>{if(t===null){a(o,"connect",timeConnect())}}))}}if(p&&i.protocol==="https:"){a(o,"connect",(()=>{const t=addTimeout(r.secureConnect,timeoutHandler,"secureConnect");a(o,"secureConnect",t)}))}}if(m){const timeRequest=()=>addTimeout(r.send,timeoutHandler,"send");if(o.connecting){a(o,"connect",(()=>{a(t,"upload-complete",timeRequest())}))}else{a(t,"upload-complete",timeRequest())}}}))}if(typeof r.response!=="undefined"){a(t,"upload-complete",(()=>{const i=addTimeout(r.response,timeoutHandler,"response");a(t,"response",i)}))}if(typeof r.read!=="undefined"){a(t,"response",(t=>{const i=addTimeout(r.read,timeoutHandler,"read");a(t,"end",i)}))}return cancelTimeouts}function urlToOptions(t){t=t;const r={protocol:t.protocol,hostname:Ce.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};if(Ce.string(t.port)&&t.port.length>0){r.port=Number(t.port)}if(t.username||t.password){r.auth=`${t.username||""}:${t.password||""}`}return r}class WeakableMap{constructor(){Object.defineProperty(this,"weakMap",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"map",{enumerable:true,configurable:true,writable:true,value:void 0});this.weakMap=new WeakMap;this.map=new Map}set(t,r){if(typeof t==="object"){this.weakMap.set(t,r)}else{this.map.set(t,r)}}get(t){if(typeof t==="object"){return this.weakMap.get(t)}return this.map.get(t)}has(t){if(typeof t==="object"){return this.weakMap.has(t)}return this.map.has(t)}}const calculateRetryDelay=({attemptCount:t,retryOptions:r,error:i,retryAfter:o,computedValue:a})=>{if(i.name==="RetryError"){return 1}if(t>r.limit){return 0}const c=r.methods.includes(i.options.method);const l=r.errorCodes.includes(i.code);const u=i.response&&r.statusCodes.includes(i.response.statusCode);if(!c||!l&&!u){return 0}if(i.response){if(o){if(o>a){return 0}return o}if(i.response.statusCode===413){return 0}}const h=Math.random()*r.noise;return Math.min(2**(t-1)*1e3,r.backoffLimit)+h};const ht=calculateRetryDelay;const ft=require("node:tls");const dt=require("node:https");function lowercaseKeys(t){return Object.fromEntries(Object.entries(t).map((([t,r])=>[t.toLowerCase(),r])))}var pt=i(9201);var mt=i(7331);function parseLinkHeader(t){const r=[];const i=t.split(",");for(const o of i){const[i,...a]=o.split(";");const c=i.trim();if(c[0]!=="<"||c[c.length-1]!==">"){throw new Error(`Invalid format of the Link header reference: ${c}`)}const l=c.slice(1,-1);const u={};if(a.length===0){throw new Error(`Unexpected end of Link header parameters: ${a.join(";")}`)}for(const r of a){const i=r.trim();const o=i.indexOf("=");if(o===-1){throw new Error(`Failed to parse Link header: ${t}`)}const a=i.slice(0,o).trim();const c=i.slice(o+1).trim();u[a]=c}r.push({reference:l,parameters:u})}return r}const[yt,bt]=l.versions.node.split(".").map((t=>Number(t)));function validateSearchParameters(t){for(const r in t){const i=t[r];Ce.assert.any([Ce.string,Ce.number,Ce.boolean,Ce.null_,Ce.undefined],i)}}const vt=new Map;let _t;const getGlobalDnsCache=()=>{if(_t){return _t}_t=new pt;return _t};const wt={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(t){if(t.request.options.responseType==="json"){return t.body}return JSON.parse(t.body)},paginate({response:t}){const r=t.headers.link;if(typeof r!=="string"||r.trim()===""){return false}const i=parseLinkHeader(r);const o=i.find((t=>t.parameters.rel==="next"||t.parameters.rel==='"next"'));if(o){return{url:new ue.URL(o.reference,t.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined};const cloneInternals=t=>{const{hooks:r,retry:i}=t;const o={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...i,errorCodes:[...i.errorCodes],methods:[...i.methods],statusCodes:[...i.statusCodes]},timeout:{...t.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:t.searchParams?new ue.URLSearchParams(t.searchParams):undefined,pagination:{...t.pagination}};if(o.url!==undefined){o.prefixUrl=""}return o};const cloneRaw=t=>{const{hooks:r,retry:i}=t;const o={...t};if(Ce.object(t.context)){o.context={...t.context}}if(Ce.object(t.cacheOptions)){o.cacheOptions={...t.cacheOptions}}if(Ce.object(t.https)){o.https={...t.https}}if(Ce.object(t.cacheOptions)){o.cacheOptions={...o.cacheOptions}}if(Ce.object(t.agent)){o.agent={...t.agent}}if(Ce.object(t.headers)){o.headers={...t.headers}}if(Ce.object(i)){o.retry={...i};if(Ce.array(i.errorCodes)){o.retry.errorCodes=[...i.errorCodes]}if(Ce.array(i.methods)){o.retry.methods=[...i.methods]}if(Ce.array(i.statusCodes)){o.retry.statusCodes=[...i.statusCodes]}}if(Ce.object(t.timeout)){o.timeout={...t.timeout}}if(Ce.object(r)){o.hooks={...r};if(Ce.array(r.init)){o.hooks.init=[...r.init]}if(Ce.array(r.beforeRequest)){o.hooks.beforeRequest=[...r.beforeRequest]}if(Ce.array(r.beforeError)){o.hooks.beforeError=[...r.beforeError]}if(Ce.array(r.beforeRedirect)){o.hooks.beforeRedirect=[...r.beforeRedirect]}if(Ce.array(r.beforeRetry)){o.hooks.beforeRetry=[...r.beforeRetry]}if(Ce.array(r.afterResponse)){o.hooks.afterResponse=[...r.afterResponse]}}if(Ce.object(t.pagination)){o.pagination={...t.pagination}}return o};const getHttp2TimeoutOption=t=>{const r=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter((t=>typeof t==="number"));if(r.length>0){return Math.min(...r)}return undefined};const init=(t,r,i)=>{const o=t.hooks?.init;if(o){for(const t of o){t(r,i)}}};class Options{constructor(t,r,i){Object.defineProperty(this,"_unixOptions",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_internals",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_merging",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_init",{enumerable:true,configurable:true,writable:true,value:void 0});Ce.assert.any([Ce.string,Ce.urlInstance,Ce.object,Ce.undefined],t);Ce.assert.any([Ce.object,Ce.undefined],r);Ce.assert.any([Ce.object,Ce.undefined],i);if(t instanceof Options||r instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(i?._internals??i??wt);this._init=[...i?._init??[]];this._merging=false;this._unixOptions=undefined;try{if(Ce.plainObject(t)){try{this.merge(t);this.merge(r)}finally{this.url=t.url}}else{try{this.merge(r)}finally{if(r?.url!==undefined){if(t===undefined){this.url=r.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(t!==undefined){this.url=t}}}}catch(t){t.options=this;throw t}}merge(t){if(!t){return}if(t instanceof Options){for(const r of t._init){this.merge(r)}return}t=cloneRaw(t);init(this,t,this);init(t,t,this);this._merging=true;if("isStream"in t){this.isStream=t.isStream}try{let r=false;for(const i in t){if(i==="mutableDefaults"||i==="handlers"){continue}if(i==="url"){continue}if(!(i in this)){throw new Error(`Unexpected option: ${i}`)}this[i]=t[i];r=true}if(r){this._init.push(t)}}finally{this._merging=false}}get request(){return this._internals.request}set request(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.request=t}get agent(){return this._internals.agent}set agent(t){Ce.assert.plainObject(t);for(const r in t){if(!(r in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${r}`)}Ce.assert.any([Ce.object,Ce.undefined],t[r])}if(this._merging){Object.assign(this._internals.agent,t)}else{this._internals.agent={...t}}}get h2session(){return this._internals.h2session}set h2session(t){this._internals.h2session=t}get decompress(){return this._internals.decompress}set decompress(t){Ce.assert.boolean(t);this._internals.decompress=t}get timeout(){return this._internals.timeout}set timeout(t){Ce.assert.plainObject(t);for(const r in t){if(!(r in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${r}`)}Ce.assert.any([Ce.number,Ce.undefined],t[r])}if(this._merging){Object.assign(this._internals.timeout,t)}else{this._internals.timeout={...t}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(t){Ce.assert.any([Ce.string,Ce.urlInstance],t);if(t===""){this._internals.prefixUrl="";return}t=t.toString();if(!t.endsWith("/")){t+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:r}=this._internals.url;this._internals.url.href=t+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=t}get body(){return this._internals.body}set body(t){Ce.assert.any([Ce.string,Ce.buffer,Ce.nodeStream,Ce.generator,Ce.asyncGenerator,ze,Ce.undefined],t);if(Ce.nodeStream(t)){Ce.assert.truthy(t.readable)}if(t!==undefined){Ce.assert.undefined(this._internals.form);Ce.assert.undefined(this._internals.json)}this._internals.body=t}get form(){return this._internals.form}set form(t){Ce.assert.any([Ce.plainObject,Ce.undefined],t);if(t!==undefined){Ce.assert.undefined(this._internals.body);Ce.assert.undefined(this._internals.json)}this._internals.form=t}get json(){return this._internals.json}set json(t){Ce.assert.any([Ce.object,Ce.undefined],t);if(t!==undefined){Ce.assert.undefined(this._internals.body);Ce.assert.undefined(this._internals.form)}this._internals.json=t}get url(){return this._internals.url}set url(t){Ce.assert.any([Ce.string,Ce.urlInstance,Ce.undefined],t);if(t===undefined){this._internals.url=undefined;return}if(Ce.string(t)&&t.startsWith("/")){throw new Error("`url` must not start with a slash")}const r=`${this.prefixUrl}${t.toString()}`;const i=new ue.URL(r);this._internals.url=i;decodeURI(r);if(i.protocol==="unix:"){i.href=`http://unix${i.pathname}${i.search}`}if(i.protocol!=="http:"&&i.protocol!=="https:"){const t=new Error(`Unsupported protocol: ${i.protocol}`);t.code="ERR_UNSUPPORTED_PROTOCOL";throw t}if(this._internals.username){i.username=this._internals.username;this._internals.username=""}if(this._internals.password){i.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){i.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(i.hostname==="unix"){const t=/(?<socketPath>.+?):(?<path>.+)/.exec(`${i.pathname}${i.search}`);if(t?.groups){const{socketPath:r,path:i}=t.groups;this._unixOptions={socketPath:r,path:i,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(t){Ce.assert.any([Ce.object,Ce.undefined],t);if(t===undefined){this._internals.cookieJar=undefined;return}let{setCookie:r,getCookieString:i}=t;Ce.assert.function_(r);Ce.assert.function_(i);if(r.length===4&&i.length===0){r=(0,at.promisify)(r.bind(t));i=(0,at.promisify)(i.bind(t));this._internals.cookieJar={setCookie:r,getCookieString:i}}else{this._internals.cookieJar=t}}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(t){Ce.assert.boolean(t);this._internals.ignoreInvalidCookies=t}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new ue.URLSearchParams}return this._internals.searchParams}set searchParams(t){Ce.assert.any([Ce.string,Ce.object,Ce.undefined],t);const r=this._internals.url;if(t===undefined){this._internals.searchParams=undefined;if(r){r.search=""}return}const i=this.searchParams;let o;if(Ce.string(t)){o=new ue.URLSearchParams(t)}else if(t instanceof ue.URLSearchParams){o=t}else{validateSearchParameters(t);o=new ue.URLSearchParams;for(const r in t){const a=t[r];if(a===null){o.append(r,"")}else if(a===undefined){i.delete(r)}else{o.append(r,a)}}}if(this._merging){for(const t of o.keys()){i.delete(t)}for(const[t,r]of o){i.append(t,r)}}else if(r){r.search=i.toString()}else{this._internals.searchParams=i}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(t){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.dnsLookup=t}get dnsCache(){return this._internals.dnsCache}set dnsCache(t){Ce.assert.any([Ce.object,Ce.boolean,Ce.undefined],t);if(t===true){this._internals.dnsCache=getGlobalDnsCache()}else if(t===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=t}}get context(){return this._internals.context}set context(t){Ce.assert.object(t);if(this._merging){Object.assign(this._internals.context,t)}else{this._internals.context={...t}}}get hooks(){return this._internals.hooks}set hooks(t){Ce.assert.object(t);for(const r in t){if(!(r in this._internals.hooks)){throw new Error(`Unexpected hook event: ${r}`)}const i=r;const o=t;const a=o[i];Ce.assert.any([Ce.array,Ce.undefined],a);if(a){for(const t of a){Ce.assert.function_(t)}}if(this._merging){if(a){this._internals.hooks[i].push(...a)}}else{if(!a){throw new Error(`Missing hook event: ${r}`)}this._internals.hooks[r]=[...a]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(t){Ce.assert.boolean(t);this._internals.followRedirect=t}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(t){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(t){Ce.assert.number(t);this._internals.maxRedirects=t}get cache(){return this._internals.cache}set cache(t){Ce.assert.any([Ce.object,Ce.string,Ce.boolean,Ce.undefined],t);if(t===true){this._internals.cache=vt}else if(t===false){this._internals.cache=undefined}else{this._internals.cache=t}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(t){Ce.assert.boolean(t);this._internals.throwHttpErrors=t}get username(){const t=this._internals.url;const r=t?t.username:this._internals.username;return decodeURIComponent(r)}set username(t){Ce.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.username=i}else{this._internals.username=i}}get password(){const t=this._internals.url;const r=t?t.password:this._internals.password;return decodeURIComponent(r)}set password(t){Ce.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.password=i}else{this._internals.password=i}}get http2(){return this._internals.http2}set http2(t){Ce.assert.boolean(t);this._internals.http2=t}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(t){Ce.assert.boolean(t);this._internals.allowGetBody=t}get headers(){return this._internals.headers}set headers(t){Ce.assert.plainObject(t);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(t))}else{this._internals.headers=lowercaseKeys(t)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(t){Ce.assert.boolean(t);this._internals.methodRewriting=t}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(t){if(t!==undefined&&t!==4&&t!==6){throw new TypeError(`Invalid DNS lookup IP version: ${t}`)}this._internals.dnsLookupIpVersion=t}get parseJson(){return this._internals.parseJson}set parseJson(t){Ce.assert.function_(t);this._internals.parseJson=t}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(t){Ce.assert.function_(t);this._internals.stringifyJson=t}get retry(){return this._internals.retry}set retry(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.function_,Ce.undefined],t.calculateDelay);Ce.assert.any([Ce.number,Ce.undefined],t.maxRetryAfter);Ce.assert.any([Ce.number,Ce.undefined],t.limit);Ce.assert.any([Ce.array,Ce.undefined],t.methods);Ce.assert.any([Ce.array,Ce.undefined],t.statusCodes);Ce.assert.any([Ce.array,Ce.undefined],t.errorCodes);Ce.assert.any([Ce.number,Ce.undefined],t.noise);if(t.noise&&Math.abs(t.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${t.noise}`)}for(const r in t){if(!(r in this._internals.retry)){throw new Error(`Unexpected retry option: ${r}`)}}if(this._merging){Object.assign(this._internals.retry,t)}else{this._internals.retry={...t}}const{retry:r}=this._internals;r.methods=[...new Set(r.methods.map((t=>t.toUpperCase())))];r.statusCodes=[...new Set(r.statusCodes)];r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(t){Ce.assert.any([Ce.string,Ce.undefined],t);this._internals.localAddress=t}get method(){return this._internals.method}set method(t){Ce.assert.string(t);this._internals.method=t.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(t){Ce.assert.any([Ce.function_,Ce.undefined],t);this._internals.createConnection=t}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.boolean,Ce.undefined],t.shared);Ce.assert.any([Ce.number,Ce.undefined],t.cacheHeuristic);Ce.assert.any([Ce.number,Ce.undefined],t.immutableMinTimeToLive);Ce.assert.any([Ce.boolean,Ce.undefined],t.ignoreCargoCult);for(const r in t){if(!(r in this._internals.cacheOptions)){throw new Error(`Cache option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,t)}else{this._internals.cacheOptions={...t}}}get https(){return this._internals.https}set https(t){Ce.assert.plainObject(t);Ce.assert.any([Ce.boolean,Ce.undefined],t.rejectUnauthorized);Ce.assert.any([Ce.function_,Ce.undefined],t.checkServerIdentity);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.certificateAuthority);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.key);Ce.assert.any([Ce.string,Ce.object,Ce.array,Ce.undefined],t.certificate);Ce.assert.any([Ce.string,Ce.undefined],t.passphrase);Ce.assert.any([Ce.string,Ce.buffer,Ce.array,Ce.undefined],t.pfx);Ce.assert.any([Ce.array,Ce.undefined],t.alpnProtocols);Ce.assert.any([Ce.string,Ce.undefined],t.ciphers);Ce.assert.any([Ce.string,Ce.buffer,Ce.undefined],t.dhparam);Ce.assert.any([Ce.string,Ce.undefined],t.signatureAlgorithms);Ce.assert.any([Ce.string,Ce.undefined],t.minVersion);Ce.assert.any([Ce.string,Ce.undefined],t.maxVersion);Ce.assert.any([Ce.boolean,Ce.undefined],t.honorCipherOrder);Ce.assert.any([Ce.number,Ce.undefined],t.tlsSessionLifetime);Ce.assert.any([Ce.string,Ce.undefined],t.ecdhCurve);Ce.assert.any([Ce.string,Ce.buffer,Ce.array,Ce.undefined],t.certificateRevocationLists);for(const r in t){if(!(r in this._internals.https)){throw new Error(`HTTPS option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,t)}else{this._internals.https={...t}}}get encoding(){return this._internals.encoding}set encoding(t){if(t===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}Ce.assert.any([Ce.string,Ce.undefined],t);this._internals.encoding=t}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(t){Ce.assert.boolean(t);this._internals.resolveBodyOnly=t}get isStream(){return this._internals.isStream}set isStream(t){Ce.assert.boolean(t);this._internals.isStream=t}get responseType(){return this._internals.responseType}set responseType(t){if(t===undefined){this._internals.responseType="text";return}if(t!=="text"&&t!=="buffer"&&t!=="json"){throw new Error(`Invalid \`responseType\` option: ${t}`)}this._internals.responseType=t}get pagination(){return this._internals.pagination}set pagination(t){Ce.assert.object(t);if(this._merging){Object.assign(this._internals.pagination,t)}else{this._internals.pagination=t}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(t){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(t){Ce.assert.boolean(t);this._internals.setHost=t}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(t){Ce.assert.any([Ce.number,Ce.undefined],t);this._internals.maxHeaderSize=t}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](t,r){return(0,at.inspect)(this._internals,r)}createNativeRequestOptions(){const t=this._internals;const r=t.url;let i;if(r.protocol==="https:"){i=t.http2?t.agent:t.agent.https}else{i=t.agent.http}const{https:o}=t;let{pfx:a}=o;if(Ce.array(a)&&Ce.plainObject(a[0])){a=a.map((t=>({buf:t.buffer,passphrase:t.passphrase})))}return{...t.cacheOptions,...this._unixOptions,ALPNProtocols:o.alpnProtocols,ca:o.certificateAuthority,cert:o.certificate,key:o.key,passphrase:o.passphrase,pfx:o.pfx,rejectUnauthorized:o.rejectUnauthorized,checkServerIdentity:o.checkServerIdentity??ft.checkServerIdentity,ciphers:o.ciphers,honorCipherOrder:o.honorCipherOrder,minVersion:o.minVersion,maxVersion:o.maxVersion,sigalgs:o.signatureAlgorithms,sessionTimeout:o.tlsSessionLifetime,dhparam:o.dhparam,ecdhCurve:o.ecdhCurve,crl:o.certificateRevocationLists,lookup:t.dnsLookup??t.dnsCache?.lookup,family:t.dnsLookupIpVersion,agent:i,setHost:t.setHost,method:t.method,maxHeaderSize:t.maxHeaderSize,localAddress:t.localAddress,headers:t.headers,createConnection:t.createConnection,timeout:t.http2?getHttp2TimeoutOption(t):undefined,h2session:t.h2session}}getRequestFunction(){const t=this._internals.url;const{request:r}=this._internals;if(!r&&t){return this.getFallbackRequestFunction()}return r}getFallbackRequestFunction(){const t=this._internals.url;if(!t){return}if(t.protocol==="https:"){if(this._internals.http2){if(yt<15||yt===15&&bt<10){const t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");t.code="EUNSUPPORTED";throw t}return mt.auto}return dt.request}return Ie.request}freeze(){const t=this._internals;Object.freeze(t);Object.freeze(t.hooks);Object.freeze(t.hooks.afterResponse);Object.freeze(t.hooks.beforeError);Object.freeze(t.hooks.beforeRedirect);Object.freeze(t.hooks.beforeRequest);Object.freeze(t.hooks.beforeRetry);Object.freeze(t.hooks.init);Object.freeze(t.https);Object.freeze(t.cacheOptions);Object.freeze(t.agent);Object.freeze(t.headers);Object.freeze(t.timeout);Object.freeze(t.retry);Object.freeze(t.retry.errorCodes);Object.freeze(t.retry.methods);Object.freeze(t.retry.statusCodes);Object.freeze(t.context)}}const isResponseOk=t=>{const{statusCode:r}=t;const i=t.request.options.followRedirect?299:399;return r>=200&&r<=i||r===304};class ParseError extends RequestError{constructor(t,r){const{options:i}=r.request;super(`${t.message} in "${i.url.toString()}"`,t,r.request);this.name="ParseError";this.code="ERR_BODY_PARSE_FAILURE"}}const parseBody=(t,r,i,o)=>{const{rawBody:a}=t;try{if(r==="text"){return a.toString(o)}if(r==="json"){return a.length===0?"":i(a.toString(o))}if(r==="buffer"){return a}}catch(r){throw new ParseError(r,t)}throw new ParseError({message:`Unknown body type '${r}'`,name:"Error"},t)};function isClientRequest(t){return t.writable&&!t.writableEnded}const Et=isClientRequest;const St=Ce.string(l.versions.brotli);const Ot=new Set(["GET","HEAD"]);const Rt=new WeakableMap;const xt=new Set([300,301,302,303,304,307,308]);const At=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends he.Duplex{constructor(t,r,i){super({autoDestroy:false,highWaterMark:0});Object.defineProperty(this,"constructor",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_noPipe",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"requestUrl",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"redirectUrls",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"retryCount",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopRetry",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_downloadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_uploadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopReading",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_pipedServerResponses",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_responseSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_bodySize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_unproxyEvents",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_isFromCache",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cannotHaveBody",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_triggerRead",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cancelTimeouts",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_nativeResponse",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_flushed",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_aborted",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_requestInitialized",{enumerable:true,configurable:true,writable:true,value:void 0});this._downloadedSize=0;this._uploadedSize=0;this._stopReading=false;this._pipedServerResponses=new Set;this._cannotHaveBody=false;this._unproxyEvents=core_noop;this._triggerRead=false;this._cancelTimeouts=core_noop;this._jobs=[];this._flushed=false;this._requestInitialized=false;this._aborted=false;this.redirectUrls=[];this.retryCount=0;this._stopRetry=core_noop;const unlockWrite=()=>{this._unlockWrite()};const lockWrite=()=>{this._lockWrite()};this.on("pipe",(t=>{t.prependListener("data",unlockWrite);t.on("data",lockWrite);t.prependListener("end",unlockWrite);t.on("end",lockWrite)}));this.on("unpipe",(t=>{t.off("data",unlockWrite);t.off("data",lockWrite);t.off("end",unlockWrite);t.off("end",lockWrite)}));this.on("pipe",(t=>{if(t.headers){Object.assign(this.options.headers,t.headers)}}));this.on("newListener",(t=>{if(t==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(t,r,i);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url}catch(t){const{options:r}=t;if(r){this.options=r}this.flush=async()=>{this.flush=async()=>{};this.destroy(t)};return}const{json:o,body:a,form:c}=this.options;if(o||a||c){this._lockWrite()}if(Ce.nodeStream(a)){a.once("error",(t=>{if(this._flushed){this._beforeError(new UploadError(t,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(t,this))}}}))}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const t of this._jobs){t()}this._jobs.length=0;this._requestInitialized=true}catch(t){this._beforeError(t)}}_beforeError(t){if(this._stopReading){return}const{response:r,options:i}=this;const o=this.retryCount+(t.name==="RetryError"?0:1);this._stopReading=true;if(!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}const a=t;void(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed){r.setEncoding(this.readableEncoding);const t=await this._setRawBody(r);if(t){r.body=r.rawBody.toString()}}if(this.listenerCount("retry")!==0){let c;try{let t;if(r&&"retry-after"in r.headers){t=Number(r.headers["retry-after"]);if(Number.isNaN(t)){t=Date.parse(r.headers["retry-after"])-Date.now();if(t<=0){t=1}}else{t*=1e3}}const l=i.retry;c=await l.calculateDelay({attemptCount:o,retryOptions:l,error:a,retryAfter:t,computedValue:ht({attemptCount:o,retryOptions:l,error:a,retryAfter:t,computedValue:l.maxRetryAfter??i.timeout.request??Number.POSITIVE_INFINITY})})}catch(t){void this._error(new RequestError(t.message,t,this));return}if(c){await new Promise((t=>{const r=setTimeout(t,c);this._stopRetry=()=>{clearTimeout(r);t()}}));if(this.destroyed){return}try{for(const t of this.options.hooks.beforeRetry){await t(a,this.retryCount+1)}}catch(r){void this._error(new RequestError(r.message,t,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",this.retryCount+1,t,(t=>{const r=new Request(i.url,t,i);r.retryCount=this.retryCount+1;l.nextTick((()=>{void r.flush()}));return r}));return}}void this._error(a)})()}_read(){this._triggerRead=true;const{response:t}=this;if(t&&!this._stopReading){if(t.readableLength){this._triggerRead=false}let r;while((r=t.read())!==null){this._downloadedSize+=r.length;const t=this.downloadProgress;if(t.percent<1){this.emit("downloadProgress",t)}this.push(r)}}}_write(t,r,i){const write=()=>{this._writeRequest(t,r,i)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(t){const endRequest=()=>{if(!this._request||this._request.destroyed){t();return}this._request.end((r=>{if(this._request._writableState?.errored){return}if(!r){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request.emit("upload-complete")}t(r)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(t,r){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();if(this.options){const{body:t}=this.options;if(Ce.nodeStream(t)){t.destroy()}}if(this._request){this._request.destroy()}if(t!==null&&!Ce.undefined(t)&&!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}r(t)}pipe(t,r){if(t instanceof Ie.ServerResponse){this._pipedServerResponses.add(t)}return super.pipe(t,r)}unpipe(t){if(t instanceof Ie.ServerResponse){this._pipedServerResponses.delete(t)}super.unpipe(t);return this}_lockWrite(){const onLockedWrite=()=>{throw new TypeError("The payload has been already provided")};this.write=onLockedWrite;this.end=onLockedWrite}_unlockWrite(){this.write=super.write;this.end=super.end}async _finalizeBody(){const{options:t}=this;const{headers:r}=t;const i=!Ce.undefined(t.form);const o=!Ce.undefined(t.json);const a=!Ce.undefined(t.body);const c=Ot.has(t.method)&&!(t.method==="GET"&&t.allowGetBody);this._cannotHaveBody=c;if(i||o||a){if(c){throw new TypeError(`The \`${t.method}\` method cannot be used with a body`)}const o=!Ce.string(r["content-type"]);if(a){if(ze(t.body)){const i=new FormDataEncoder(t.body);if(o){r["content-type"]=i.headers["Content-Type"]}r["content-length"]=i.headers["Content-Length"];t.body=i.encode()}if(is_form_data_isFormData(t.body)&&o){r["content-type"]=`multipart/form-data; boundary=${t.body.getBoundary()}`}}else if(i){if(o){r["content-type"]="application/x-www-form-urlencoded"}const{form:i}=t;t.form=undefined;t.body=new ue.URLSearchParams(i).toString()}else{if(o){r["content-type"]="application/json"}const{json:i}=t;t.json=undefined;t.body=t.stringifyJson(i)}const l=await getBodySize(t.body,t.headers);if(Ce.undefined(r["content-length"])&&Ce.undefined(r["transfer-encoding"])&&!c&&!Ce.undefined(l)){r["content-length"]=String(l)}}else if(c){this._lockWrite()}else{this._unlockWrite()}if(t.responseType==="json"&&!("accept"in t.headers)){t.headers.accept="application/json"}this._bodySize=Number(r["content-length"])||undefined}async _onResponseBase(t){if(this.isAborted){return}const{options:r}=this;const{url:i}=r;this._nativeResponse=t;if(r.decompress){t=$e(t)}const o=t.statusCode;const a=t;a.statusMessage=a.statusMessage?a.statusMessage:Ie.STATUS_CODES[o];a.url=r.url.toString();a.requestUrl=this.requestUrl;a.redirectUrls=this.redirectUrls;a.request=this;a.isFromCache=this._nativeResponse.fromCache??false;a.ip=this.ip;a.retryCount=this.retryCount;this._isFromCache=a.isFromCache;this._responseSize=Number(t.headers["content-length"])||undefined;this.response=a;t.once("end",(()=>{this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress)}));t.once("error",(r=>{this._aborted=true;t.destroy();this._beforeError(new ReadError(r,this))}));t.once("aborted",(()=>{this._aborted=true;this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}));this.emit("downloadProgress",this.downloadProgress);const c=t.headers["set-cookie"];if(Ce.object(r.cookieJar)&&c){let t=c.map((async t=>r.cookieJar.setCookie(t,i.toString())));if(r.ignoreInvalidCookies){t=t.map((async t=>{try{await t}catch{}}))}try{await Promise.all(t)}catch(t){this._beforeError(t);return}}if(this.isAborted){return}if(r.followRedirect&&t.headers.location&&xt.has(o)){t.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=r.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;const c=new Options(undefined,undefined,this.options);const l=o===303&&c.method!=="GET"&&c.method!=="HEAD";if(l||c.methodRewriting){c.method="GET";c.body=undefined;c.json=undefined;c.form=undefined;delete c.headers["content-length"]}try{const r=Pe.Buffer.from(t.headers.location,"binary").toString();const o=new ue.URL(r,i);if(o.hostname!==i.hostname||o.port!==i.port){if("host"in c.headers){delete c.headers.host}if("cookie"in c.headers){delete c.headers.cookie}if("authorization"in c.headers){delete c.headers.authorization}if(c.username||c.password){c.username="";c.password=""}}else{o.username=c.username;o.password=c.password}this.redirectUrls.push(o);c.prefixUrl="";c.url=o;for(const t of c.hooks.beforeRedirect){await t(c,a)}this.emit("redirect",c,a);this.options=c;await this._makeRequest()}catch(t){this._beforeError(t);return}return}if(r.isStream&&r.throwHttpErrors&&!isResponseOk(a)){this._beforeError(new HTTPError(a));return}t.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{t.resume()}));this.on("pause",(()=>{t.pause()}));t.once("end",(()=>{this.push(null)}));if(this._noPipe){const r=await this._setRawBody();if(r){this.emit("response",t)}return}this.emit("response",t);for(const i of this._pipedServerResponses){if(i.headersSent){continue}for(const o in t.headers){const a=r.decompress?o!=="content-encoding":true;const c=t.headers[o];if(a){i.setHeader(o,c)}}i.statusCode=o}}async _setRawBody(t=this){if(t.readableEnded){return false}try{const r=await(0,Fe.buffer)(t);if(!this.isAborted){this.response.rawBody=r;return true}}catch{}return false}async _onResponse(t){try{await this._onResponseBase(t)}catch(t){this._beforeError(t)}}_onRequest(t){const{options:r}=this;const{timeout:i,url:o}=r;De(t);if(this.options.http2){t.setTimeout(0)}this._cancelTimeouts=timedOut(t,i,o);const a=r.cache?"cacheableResponse":"response";t.once(a,(t=>{void this._onResponse(t)}));t.once("error",(r=>{this._aborted=true;t.destroy();r=r instanceof timed_out_TimeoutError?new TimeoutError(r,this.timings,this):new RequestError(r.message,r,this);this._beforeError(r)}));this._unproxyEvents=proxyEvents(t,this,At);this._request=t;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",t)}async _asyncWrite(t){return new Promise(((r,i)=>{super.write(t,(t=>{if(t){i(t);return}r()}))}))}_sendBody(){const{body:t}=this.options;const r=this.redirectUrls.length===0?this:this._request??this;if(Ce.nodeStream(t)){t.pipe(r)}else if(Ce.generator(t)||Ce.asyncGenerator(t)){(async()=>{try{for await(const r of t){await this._asyncWrite(r)}super.end()}catch(t){this._beforeError(t)}})()}else{this._unlockWrite();if(!Ce.undefined(t)){this._writeRequest(t,undefined,(()=>{}));r.end();this._lockWrite()}else if(this._cannotHaveBody||this._noPipe){r.end();this._lockWrite()}}}_prepareCache(t){if(!Rt.has(t)){Rt.set(t,new je(((t,r)=>{const i=t._request(t,r);if(Ce.promise(i)){i.once=(t,r)=>{if(t==="error"){(async()=>{try{await i}catch(t){r(t)}})()}else if(t==="abort"){(async()=>{try{const t=await i;t.once("abort",r)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${t}`)}return i}}return i}),t))}}async _createCacheableRequest(t,r){return new Promise(((i,o)=>{Object.assign(r,urlToOptions(t));let a;const c=Rt.get(r.cache)(r,(async t=>{t._readableState.autoDestroy=false;if(a){const fix=()=>{if(t.req){t.complete=t.req.res.complete}};t.prependOnceListener("end",fix);fix();(await a).emit("cacheableResponse",t)}i(t)}));c.once("error",o);c.once("request",(async t=>{a=t;i(a)}))}))}async _makeRequest(){const{options:t}=this;const{headers:r,username:i,password:o}=t;const a=t.cookieJar;for(const t in r){if(Ce.undefined(r[t])){delete r[t]}else if(Ce.null_(r[t])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(t.decompress&&Ce.undefined(r["accept-encoding"])){r["accept-encoding"]=St?"gzip, deflate, br":"gzip, deflate"}if(i||o){const t=Pe.Buffer.from(`${i}:${o}`).toString("base64");r.authorization=`Basic ${t}`}if(a){const i=await a.getCookieString(t.url.toString());if(Ce.nonEmptyString(i)){r.cookie=i}}t.prefixUrl="";let c;for(const r of t.hooks.beforeRequest){const i=await r(t);if(!Ce.undefined(i)){c=()=>i;break}}if(!c){c=t.getRequestFunction()}const l=t.url;this._requestOptions=t.createNativeRequestOptions();if(t.cache){this._requestOptions._request=c;this._requestOptions.cache=t.cache;this._prepareCache(t.cache)}const u=t.cache?this._createCacheableRequest:c;try{let r=u(l,this._requestOptions);if(Ce.promise(r)){r=await r}if(Ce.undefined(r)){r=t.getFallbackRequestFunction()(l,this._requestOptions);if(Ce.promise(r)){r=await r}}if(Et(r)){this._onRequest(r)}else if(this.writable){this.once("finish",(()=>{void this._onResponse(r)}));this._sendBody()}else{void this._onResponse(r)}}catch(t){if(t instanceof je.CacheError){throw new CacheError(t,this)}throw t}}async _error(t){try{for(const r of this.options.hooks.beforeError){t=await r(t)}}catch(r){t=new RequestError(r.message,r,this)}this.destroy(t)}_writeRequest(t,r,i){if(!this._request||this._request.destroyed){return}this._request.write(t,r,(o=>{if(!o){this._uploadedSize+=Pe.Buffer.byteLength(t,r);const i=this.uploadProgress;if(i.percent<1){this.emit("uploadProgress",i)}}i(o)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let t;if(this._responseSize){t=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){t=1}else{t=0}return{percent:t,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let t;if(this._bodySize){t=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){t=1}else{t=0}return{percent:t,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}}class types_CancelError extends RequestError{constructor(t){super("Promise was canceled",{},t);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const Tt=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(t){let r;let i;let o;const a=new Q.EventEmitter;const c=new PCancelable(((l,u,h)=>{h((()=>{r.destroy()}));h.shouldReject=false;h((()=>{u(new types_CancelError(r))}));const makeRequest=d=>{h((()=>{}));const p=t??new Request(undefined,undefined,o);p.retryCount=d;p._noPipe=true;r=p;p.once("response",(async t=>{const r=(t.headers["content-encoding"]??"").toLowerCase();const o=r==="gzip"||r==="deflate"||r==="br";const{options:a}=p;if(o&&!a.decompress){t.body=t.rawBody}else{try{t.body=parseBody(t,a.responseType,a.parseJson,a.encoding)}catch(r){t.body=t.rawBody.toString();if(isResponseOk(t)){p._beforeError(r);return}}}try{const r=a.hooks.afterResponse;for(const[i,o]of r.entries()){t=await o(t,(async t=>{a.merge(t);a.prefixUrl="";if(t.url){a.url=t.url}a.hooks.afterResponse=a.hooks.afterResponse.slice(0,i);throw new RetryError(p)}));if(!(Ce.object(t)&&Ce.number(t.statusCode)&&!Ce.nullOrUndefined(t.body))){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(t){p._beforeError(t);return}i=t;if(!isResponseOk(t)){p._beforeError(new HTTPError(t));return}p.destroy();l(p.options.resolveBodyOnly?t.body:t)}));const onError=t=>{if(c.isCanceled){return}const{options:r}=p;if(t instanceof HTTPError&&!r.throwHttpErrors){const{response:r}=t;p.destroy();l(p.options.resolveBodyOnly?r.body:r);return}u(t)};p.once("error",onError);const m=p.options?.body;p.once("retry",((r,i)=>{t=undefined;const a=p.options.body;if(m===a&&Ce.nodeStream(a)){i.message="Cannot retry with consumed body stream";onError(i);return}o=p.options;makeRequest(r)}));proxyEvents(p,a,Tt);if(Ce.undefined(t)){void p.flush()}};makeRequest(0)}));c.on=(t,r)=>{a.on(t,r);return c};const shortcut=t=>{const r=(async()=>{await c;const{options:r}=i.request;return parseBody(i,t,r.parseJson,r.encoding)})();Object.defineProperties(r,Object.getOwnPropertyDescriptors(c));return r};c.json=()=>{if(r.options){const{headers:t}=r.options;if(!r.writableFinished&&!("accept"in t)){t.accept="application/json"}}return shortcut("json")};c.buffer=()=>shortcut("buffer");c.text=()=>shortcut("text");return c}const delay=async t=>new Promise((r=>{setTimeout(r,t)}));const isGotInstance=t=>Ce.function_(t);const kt=["get","post","put","patch","head","delete"];const create=t=>{t={options:new Options(undefined,undefined,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults};Object.defineProperty(t,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(r,i,o=t.options)=>{const a=new Request(r,i,o);let c;const lastHandler=t=>{a.options=t;a._noPipe=!t.isStream;void a.flush();if(t.isStream){return a}if(!c){c=asPromise(a)}return c};let l=0;const iterateHandlers=r=>{const i=t.handlers[l++]??lastHandler;const o=i(r,iterateHandlers);if(Ce.promise(o)&&!a.options.isStream){if(!c){c=asPromise(a)}if(o!==c){const t=Object.getOwnPropertyDescriptors(c);for(const r in t){if(r in o){delete t[r]}}Object.defineProperties(o,t);o.cancel=c.cancel}}return o};return iterateHandlers(a.options)};got.extend=(...r)=>{const i=new Options(undefined,undefined,t.options);const o=[...t.handlers];let a;for(const t of r){if(isGotInstance(t)){i.merge(t.defaults.options);o.push(...t.defaults.handlers);a=t.defaults.mutableDefaults}else{i.merge(t);if(t.handlers){o.push(...t.handlers)}a=t.mutableDefaults}}return create({options:i,handlers:o,mutableDefaults:Boolean(a)})};const paginateEach=async function*(r,i){let o=new Options(r,i,t.options);o.resolveBodyOnly=false;const{pagination:a}=o;Ce.assert.function_(a.transform);Ce.assert.function_(a.shouldContinue);Ce.assert.function_(a.filter);Ce.assert.function_(a.paginate);Ce.assert.number(a.countLimit);Ce.assert.number(a.requestLimit);Ce.assert.number(a.backoff);const c=[];let{countLimit:l}=a;let u=0;while(u<a.requestLimit){if(u!==0){await delay(a.backoff)}const t=await got(undefined,undefined,o);const r=await a.transform(t);const i=[];Ce.assert.array(r);for(const t of r){if(a.filter({item:t,currentItems:i,allItems:c})){if(!a.shouldContinue({item:t,currentItems:i,allItems:c})){return}yield t;if(a.stackAllItems){c.push(t)}i.push(t);if(--l<=0){return}}}const h=a.paginate({response:t,currentItems:i,allItems:c});if(h===false){return}if(h===t.request.options){o=t.request.options}else{o.merge(h);Ce.assert.any([Ce.urlInstance,Ce.undefined],h.url);if(h.url!==undefined){o.prefixUrl="";o.url=h.url}}u++}};got.paginate=paginateEach;got.paginate.all=async(t,r)=>{const i=[];for await(const o of paginateEach(t,r)){i.push(o)}return i};got.paginate.each=paginateEach;got.stream=(t,r)=>got(t,{...r,isStream:true});for(const t of kt){got[t]=(r,i)=>got(r,{...i,method:t});got.stream[t]=(r,i)=>got(r,{...i,method:t,isStream:true})}if(!t.mutableDefaults){Object.freeze(t.handlers);t.options.freeze()}Object.defineProperty(got,"defaults",{value:t,writable:false,configurable:false,enumerable:true});return got};const Ct=create;const Pt={options:new Options,handlers:[],mutableDefaults:false};const It=Ct(Pt);const Lt=It;var Nt=i(1470);var Mt=i(2781);const Dt=(0,Ne.promisify)(Mt.Stream.pipeline);async function isUrlOk(t){const r=await Lt.head(t).catch((t=>t));return r.statusCode===200}async function getRepoInfo(t,r){const[,i,o,a,c,...l]=t.pathname.split("/");const u=r?r.replace(/^\//,""):l.join("/");if(a===undefined){const t=await Lt(`https://api.github.com/repos/${i}/${o}`).catch((t=>t));if(t.statusCode!==200){return}const r=JSON.parse(t.body);return{username:i,name:o,branch:r["default_branch"],filePath:u}}const h=r?`${c}/${l.join("/")}`.replace(new RegExp(`/${u}|/$`),""):c;if(i&&o&&h&&a==="tree"){return{username:i,name:o,branch:h,filePath:u}}}function hasRepo({username:t,name:r,branch:i,filePath:o}){const a=`https://api.github.com/repos/${t}/${r}/contents`;const c=`${o?`/${o}`:""}/package.json`;return isUrlOk(a+c+`?ref=${i}`)}function hasTemplate(t){return isUrlOk(`https://api.github.com/repos/openpatch/hyperbook/contents/templates/${encodeURIComponent(t)}/package.json`)}function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){return Dt(Lt.stream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),Nt.extract({cwd:t,strip:a?a.split("/").length+1:1},[`${i}-${o}${a?`/${a}`:""}`]))}async function getTemplateInfo(t){let r;if(t){let i;try{i=new URL(t)}catch(t){if(t.code!=="ERR_INVALID_URL"){console.error(t);process.exit(1)}}if(i){if(i.origin!=="https://github.com"){console.error(`Invalid URL: ${T.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}r=await getRepoInfo(i);if(!r){console.error(`Found invalid GitHub URL: ${T.red(`"${t}"`)}. Please fix the URL and try again.`);process.exit(1)}const o=await hasRepo(r);if(!o){console.error(`Could not locate the repository for ${T.red(`"${t}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(t!=="__internal-testing-retry"){const r=await hasTemplate(t);if(!r){console.error(`Could not locate an template named ${T.red(`"${t}"`)}. It could be due to the following:\n`,`1. Your spelling of template ${T.red(`"${t}"`)} might be incorrect.\n`,`2. You might not be connected to the internet.`);process.exit(1)}}}return r}var jt=i(1176);var $t=i.n(jt);function install(t,r,{packageManager:i,isOnline:o,devDependencies:a}){const c=[];const l=[];return new Promise(((u,h)=>{let d;let p=i;const m=i==="yarn";if(r&&r.length){if(m){d=["add","--exact"];if(!o)d.push("--offline");d.push("--cwd",t);if(a)d.push("--dev");d.push(...r)}else{d=["install","--save-exact"];d.push(a?"--save-dev":"--save");d.push(...r)}}else{d=["install"];if(!o){console.log(T.yellow("You appear to be offline."));if(m){console.log(T.yellow("Falling back to the local Yarn cache."));console.log();d.push("--offline")}else{console.log()}}}if(m){d.push(...l)}else{d.push(...c)}const g=G()(p,d,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});g.on("close",(t=>{if(t!==0){h({command:`${p} ${d.join(" ")}`});return}u()}))}))}var Ft=i(9523);var Ht=i.n(Ft);var Bt=i(7310);var Ut=i.n(Bt);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,K.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}function getOnline(){return new Promise((t=>{Ht().lookup("registry.yarnpkg.com",(r=>{if(!r){return t(true)}const i=getProxy();if(!i){return t(false)}const{hostname:o}=Ut().parse(i);if(!o){return t(false)}Ht().lookup(o,(r=>{t(r==null)}))}))}))}async function makeSymlink(t,r){return new Promise(((i,o)=>{Y().symlink(t,r,(t=>{if(t){o()}else{i()}}))}))}class DownloadError extends Error{}async function runSetup(t,r,i){if(!i){i=process.cwd()}if(!t){const r=await readHyperbook();t=r.template}if(!t){t="https://github.com/openpatch/hyperbook/tree/main/templates/simple"}if(!r){r=await getTemplateInfo(t)}const o=z().join(i,".hyperbook");console.log("Removing old template");ke().sync(o);await makeDir(o);const a=await getOnline();try{if(r){const i=r;console.log(`Downloading files from repo ${T.cyan(t)}. This might take a moment.`);console.log();await $t()((()=>downloadAndExtractRepo(o,i)),{retries:3})}}catch(t){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(t)?t.message:t+"")}console.log("Installing packages. This might take a couple of minutes.");console.log();await install(o,null,{packageManager:"npm",isOnline:a});console.log();ke().sync(z().join(o,"book"));ke().sync(z().join(o,"public"));ke().sync(z().join(o,"glossary"));ke().sync(z().join(o,"hyperbook.json"));await makeSymlink(z().join(i,"book"),z().join(o,"book"));await makeSymlink(z().join(i,"public"),z().join(o,"public"));await makeSymlink(z().join(i,"glossary"),z().join(o,"glossary"));await makeSymlink(z().join(i,"hyperbook.json"),z().join(o,"hyperbook.json"))}async function runNew({programName:t,bookPath:r,template:o}){if(typeof r==="string"){r=r.trim()}if(!r){const t=await Ae()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){r=t.path.trim()}}if(!r){console.log();console.log("Please specify the book directory:");console.log(` ${T.cyan(t)} ${T.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${T.cyan(t)} ${T.green("my-new-book")}`);console.log();console.log(`Run ${T.cyan(`${t} --help`)} to see all options.`);process.exit(1)}let a=await getTemplateInfo(o);const c=z().resolve(r);if(!await isWriteable(z().dirname(c))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const l=z().basename(c);await makeDir(c);if(!isFolderEmpty(c,l)){process.exit(1)}const u=process.cwd();console.log(`Creating a new hyperbook in ${T.green(c)}.`);console.log();process.chdir(c);const{description:h}=await Ae()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:d}=await Ae()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:p}=await Ae()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:m}=await Ae()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(m==="custom"){const t=await Ae()({type:"text",name:"license",message:"Which custom license you want to use?"});m=t.license}const{language:g}=await Ae()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const y={name:l,version:"0.0.0",description:h,license:m,author:{name:d,url:p},language:g};Y().writeFileSync(z().join(c,"hyperbook.json"),JSON.stringify(y,null,2)+Z().EOL);console.log();const b=i.ab+"templates";await cpy("default/**",c,{cwd:i.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});await runSetup(o,a,c);if(tryGitInit(c)){console.log("Initialized a git repository.");console.log()}let v;if(z().join(u,l)===r){v=l}else{v=r}console.log(`${T.green("Success!")} Created ${l} at ${r}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(T.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(T.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(T.cyan(" cd"),v);console.log(` ${T.cyan(`hyperbook dev`)}`);console.log()}const qt=JSON.parse('{"name":"hyperbook","version":"0.4.3","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"},"devDependencies":{"@types/async-retry":"1.4.3","@types/cross-spawn":"6.0.2","@types/prompts":"2.0.14","@types/rimraf":"3.0.2","@types/tar":"6.1.1","@vercel/ncc":"0.33.3","async-retry":"1.3.3","chalk":"5.0.1","commander":"9.1.0","cpy":"9.0.1","cross-spawn":"7.0.3","got":"12.0.2","prompts":"2.4.2","rimraf":"3.0.2","tar":"6.1.11","update-check":"1.5.4"}}');const Gt=new D;Gt.name(qt.name).version(qt.version).hook("preAction",(async()=>{await notifyUpdate()}));Gt.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${T.green("<book-directory>")} [options]`).option("-t, --template [name]|[github-url]",`\n A template for your hyperbook. You can use an template name\n from the official hyperbook repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).action((async(t,r)=>{const i=typeof r.template==="string"&&r.template.trim();await runNew({programName:Gt.name(),bookPath:t,template:i}).catch((()=>process.exit(1)))}));Gt.command("dev").description("start the development server for a hyperbook").action((async()=>{await runDev().catch((()=>process.exit(1)))}));Gt.command("setup").description("downloads the latest version of the template of a hyperbook").action((async()=>{await runSetup().catch((()=>process.exit(1)))}));Gt.command("build").description("build a hyperbook").action((async()=>{await runBuild().catch((()=>process.exit(1)))}));Gt.parseAsync(process.argv);const Vt=U()(qt).catch((()=>null));async function notifyUpdate(){try{const t=await Vt;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(T.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+T.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}},9491:t=>{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2057:t=>{"use strict";t.exports=require("constants")},6113:t=>{"use strict";t.exports=require("crypto")},9523:t=>{"use strict";t.exports=require("dns")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5158:t=>{"use strict";t.exports=require("http2")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},6821:t=>{"use strict";t.exports=require("tls")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},621:(t,r,i)=>{const{Argument:o}=i(9787);const{Command:a}=i(5117);const{CommanderError:c,InvalidArgumentError:l}=i(2383);const{Help:u}=i(199);const{Option:h}=i(6362);r=t.exports=new a;r.program=r;r.Argument=o;r.Command=a;r.CommanderError=c;r.Help=u;r.InvalidArgumentError=l;r.InvalidOptionArgumentError=l;r.Option=h},9787:(t,r,i)=>{const{InvalidArgumentError:o}=i(2383);class Argument{constructor(t,r){this.description=r||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const r=t.name()+(t.variadic===true?"...":"");return t.required?"<"+r+">":"["+r+"]"}r.Argument=Argument;r.humanReadableArgName=humanReadableArgName},5117:(t,r,i)=>{const o=i(2361).EventEmitter;const a=i(2081);const c=i(1017);const l=i(7147);const u=i(7282);const{Argument:h,humanReadableArgName:d}=i(9787);const{CommanderError:p}=i(2383);const{Help:m}=i(199);const{Option:g,splitOptionFlags:y}=i(6362);const{suggestSimilar:b}=i(6639);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>u.stdout.write(t),writeErr:t=>u.stderr.write(t),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:undefined,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:undefined,outputError:(t,r)=>r(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,r,i){let o=r;let a=i;if(typeof o==="object"&&o!==null){a=o;o=null}a=a||{};const[,c,l]=t.match(/([^ ]+) *(.*)/);const u=this.createCommand(c);if(o){u.description(o);u._executableHandler=true}if(a.isDefault)this._defaultCommandName=u._name;u._hidden=!!(a.noHelp||a.hidden);u._executableFile=a.executableFile||null;if(l)u.arguments(l);this.commands.push(u);u.parent=this;u.copyInheritedSettings(this);if(o)return this;return u}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new m,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,r){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}r=r||{};if(r.isDefault)this._defaultCommandName=t._name;if(r.noHelp||r.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,r){return new h(t,r)}argument(t,r,i,o){const a=this.createArgument(t,r);if(typeof i==="function"){a.default(o).argParser(i)}else{a.default(i)}this.addArgument(a);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this._args.slice(-1)[0];if(r&&r.variadic){throw new Error(`only the last argument can be variadic '${r.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,r){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=r||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,r){const i=["preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(r)}else{this._lifeCycleHooks[t]=[r]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,r,i){if(this._exitCallback){this._exitCallback(new p(t,r,i))}u.exit(t)}action(t){const listener=r=>{const i=this._args.length;const o=r.slice(0,i);if(this._storeOptionsAsProperties){o[i]=this}else{o[i]=this.opts()}o.push(this);return t.apply(this,o)};this._actionHandler=listener;return this}createOption(t,r){return new g(t,r)}addOption(t){const r=t.name();const i=t.attributeName();if(t.negate){const r=t.long.replace(/^--no-/,"--");if(!this._findOption(r)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const c=this.getOptionValue(i);if(r!==null&&t.parseArg){try{r=t.parseArg(r,c)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}else if(r!==null&&t.variadic){r=t._concatValue(r,c)}if(r==null){if(t.negate){r=false}else if(t.isBoolean()||t.optional){r=true}else{r=""}}this.setOptionValueWithSource(i,r,a)};this.on("option:"+r,(r=>{const i=`error: option '${t.flags}' argument '${r}' is invalid.`;handleOptionValue(r,i,"cli")}));if(t.envVar){this.on("optionEnv:"+r,(r=>{const i=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;handleOptionValue(r,i,"env")}))}return this}_optionEx(t,r,i,o,a){if(typeof r==="object"&&r instanceof g){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const c=this.createOption(r,i);c.makeOptionMandatory(!!t.mandatory);if(typeof o==="function"){c.default(a).argParser(o)}else if(o instanceof RegExp){const t=o;o=(r,i)=>{const o=t.exec(r);return o?o[0]:i};c.default(a).argParser(o)}else{c.default(o)}return this.addOption(c)}option(t,r,i,o){return this._optionEx({},t,r,i,o)}requiredOption(t,r,i,o){return this._optionEx({mandatory:true},t,r,i,o)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}return this}setOptionValueWithSource(t,r,i){this.setOptionValue(t,r);this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}r=r||{};if(t===undefined){t=u.argv;if(u.versions&&u.versions.electron){r.from="electron"}}this.rawArgs=t.slice();let i;switch(r.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(u.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,r){const i=this._prepareUserArgs(t,r);this._parseCommand([],i);return this}async parseAsync(t,r){const i=this._prepareUserArgs(t,r);await this._parseCommand([],i);return this}_executeSubCommand(t,r){r=r.slice();let i=false;const o=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,r){const i=c.resolve(t,r);if(l.existsSync(i))return i;if(o.includes(c.extname(r)))return undefined;const a=o.find((t=>l.existsSync(`${i}${t}`)));if(a)return`${i}${a}`;return undefined}this._checkForMissingMandatoryOptions();let h=t._executableFile||`${this._name}-${t._name}`;let d=this._executableDir||"";if(this._scriptPath){let t;try{t=l.realpathSync(this._scriptPath)}catch(r){t=this._scriptPath}d=c.resolve(c.dirname(t),d)}if(d){let r=findFile(d,h);if(!r&&!t._executableFile&&this._scriptPath){const i=c.basename(this._scriptPath,c.extname(this._scriptPath));if(i!==this._name){r=findFile(d,`${i}-${t._name}`)}}h=r||h}i=o.includes(c.extname(h));let m;if(u.platform!=="win32"){if(i){r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.argv[0],r,{stdio:"inherit"})}else{m=a.spawn(h,r,{stdio:"inherit"})}}else{r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.execPath,r,{stdio:"inherit"})}if(!m.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{u.on(t,(()=>{if(m.killed===false&&m.exitCode===null){m.kill(t)}}))}))}const g=this._exitCallback;if(!g){m.on("close",u.exit.bind(u))}else{m.on("close",(()=>{g(new p(u.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}m.on("error",(r=>{if(r.code==="ENOENT"){const r=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${h}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${r}`;throw new Error(i)}else if(r.code==="EACCES"){throw new Error(`'${h}' not executable`)}if(!g){u.exit(1)}else{const t=new p(1,"commander.executeSubCommandAsync","(error)");t.nestedError=r;g(t)}}));this.runningCommand=m}_dispatchSubcommand(t,r,i){const o=this._findCommand(t);if(!o)this.help({error:true});if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}_checkNumberOfArguments(){this._args.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){try{o=t.parseArg(r,i)}catch(i){if(i.code==="commander.invalidArgument"){const o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}return o};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(i<this.args.length){o=this.args.slice(i);if(r.parseArg){o=o.reduce(((t,i)=>myParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(i<this.args.length){o=this.args[i];if(r.parseArg){o=myParseArg(r,o,r.defaultValue)}}t[i]=o}));this.processedArgs=t}_chainOrCall(t,r){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>r()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[r]!==undefined)).forEach((t=>{t._lifeCycleHooks[r].forEach((r=>{o.push({hookedCommand:t,callback:r})}))}));if(r==="postAction"){o.reverse()}o.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();t=t.concat(i.operands);r=i.unknown;this.args=t.concat(r);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),r)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const o=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(o,t,r)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(o)){checkForUnknownOptions();this._processArguments();this.parent.emit(o,t,r)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,r)}if(this.listenerCount("command:*")){this.emit("command:*",t,r)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((r=>r._name===t||r._aliases.includes(t)))}_findOption(t){return this.options.find((r=>r.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((r=>{if(r.mandatory&&t.getOptionValue(r.attributeName())===undefined){t.missingMandatoryOptionValue(r)}}))}}_checkForConflictingOptions(){const t=this.options.filter((t=>{const r=t.attributeName();if(this.getOptionValue(r)===undefined){return false}return this.getOptionValueSource(r)!=="default"}));const r=t.filter((t=>t.conflictsWith.length>0));r.forEach((r=>{const i=t.find((t=>r.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(r,i)}}))}parseOptions(t){const r=[];const i=[];let o=r;const a=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let c=null;while(a.length){const t=a.shift();if(t==="--"){if(o===i)o.push(t);o.push(...a);break}if(c&&!maybeOption(t)){this.emit(`option:${c.name()}`,t);continue}c=null;if(maybeOption(t)){const r=this._findOption(t);if(r){if(r.required){const t=a.shift();if(t===undefined)this.optionMissingArgument(r);this.emit(`option:${r.name()}`,t)}else if(r.optional){let t=null;if(a.length>0&&!maybeOption(a[0])){t=a.shift()}this.emit(`option:${r.name()}`,t)}else{this.emit(`option:${r.name()}`)}c=r.variadic?r:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const r=this._findOption(`-${t[1]}`);if(r){if(r.required||r.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${r.name()}`,t.slice(2))}else{this.emit(`option:${r.name()}`);a.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const r=t.indexOf("=");const i=this._findOption(t.slice(0,r));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(r+1));continue}}if(maybeOption(t)){o=i}if((this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(t)){r.push(t);if(a.length>0)i.push(...a);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(t);if(a.length>0)r.push(...a);break}else if(this._defaultCommandName){i.push(t);if(a.length>0)i.push(...a);break}}if(this._passThroughOptions){o.push(t);if(a.length>0)o.push(...a);break}o.push(t)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const r=this.options.length;for(let i=0;i<r;i++){const r=this.options[i].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,r)=>Object.assign(t,r.opts())),{})}error(t,r){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=r||{};const o=i.exitCode||1;const a=i.code||"commander.error";this._exit(o,a,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in u.env){const r=t.attributeName();if(this.getOptionValue(r)===undefined||["default","config","env"].includes(this.getOptionValueSource(r))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,u.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}missingArgument(t){const r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){const r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){const findBestOptionFromValue=t=>{const r=t.attributeName();const i=this.getOptionValue(r);const o=this.options.find((t=>t.negate&&r===t.attributeName()));const a=this.options.find((t=>!t.negate&&r===t.attributeName()));if(o&&(o.presetArg===undefined&&i===false||o.presetArg!==undefined&&i===o.presetArg)){return o}return a||t};const getErrorMessage=t=>{const r=findBestOptionFromValue(t);const i=r.attributeName();const o=this.getOptionValueSource(i);if(o==="env"){return`environment variable '${r.envVar}'`}return`option '${r.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let o=this;do{const t=o.createHelp().visibleOptions(o).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);o=o.parent}while(o&&!o._enablePositionalOptions);r=b(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this._args.length;const i=r===1?"":"s";const o=this.parent?` for '${this.name()}'`:"";const a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let r="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));r=b(t,i)}const i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===undefined)return this._version;this._version=t;r=r||"-V, --version";i=i||"output the version number";const o=this.createOption(r,i);this._versionOptionName=o.attributeName();this.options.push(o);this.on("option:"+o.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,r){if(t===undefined&&r===undefined)return this._description;this._description=t;if(r){this._argsDescription=r}return this}alias(t){if(t===undefined)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){r=this.commands[this.commands.length-1]}if(t===r._name)throw new Error("Command alias can't be the same as its name");r._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>d(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=c.basename(t,c.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const r=this.createHelp();if(r.helpWidth===undefined){r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return r.formatHelp(this,r)}_getHelpContext(t){t=t||{};const r={error:!!t.error};let i;if(r.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}r.write=t.write||i;r.command=this;return r}outputHelp(t){let r;if(typeof t==="function"){r=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let o=this.helpInformation(i);if(r){o=r(o);if(typeof o!=="string"&&!Buffer.isBuffer(o)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(o);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=r||this._helpDescription;const i=y(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let r=u.exitCode||0;if(r===0&&t&&typeof t!=="function"&&t.error){r=1}this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const o=`${t}Help`;this.on(o,(t=>{let i;if(typeof r==="function"){i=r({error:t.error,command:t.command})}else{i=r}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,r){const i=t._hasHelpOption&&r.find((r=>r===t._helpLongFlag||r===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let r;let i="127.0.0.1";let o="9229";let a;if((a=t.match(/^(--inspect(-brk)?)$/))!==null){r=a[1]}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){r=a[1];if(/^\d+$/.test(a[3])){o=a[3]}else{i=a[3]}}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){r=a[1];i=a[3];o=a[4]}if(r&&o!=="0"){return`${r}=${i}:${parseInt(o)+1}`}return t}))}function getCommandAndParents(t){const r=[];for(let i=t;i;i=i.parent){r.push(i)}return r}r.Command=Command},2383:(t,r)=>{class CommanderError extends Error{constructor(t,r,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=r;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}r.CommanderError=CommanderError;r.InvalidArgumentError=InvalidArgumentError},199:(t,r,i)=>{const{humanReadableArgName:o}=i(9787);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,o]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const a=t.createCommand(i).helpOption(false);a.description(t._helpCommandDescription);if(o)a.arguments(o);r.push(a)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const o=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||o){let a;if(!i){a=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!o){a=t.createOption(t._helpShortFlag,t._helpDescription)}else{a=t.createOption(t._helpFlags,t._helpDescription)}r.push(a)}if(this.sortOptions){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");r.sort(((t,r)=>getSortKey(t).localeCompare(getSortKey(r))))}return r}visibleArguments(t){if(t._argsDescription){t._args.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const r=t._args.map((t=>o(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce(((t,i)=>Math.max(t,r.subcommandTerm(i).length)),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce(((t,i)=>Math.max(t,r.optionTerm(i).length)),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce(((t,i)=>Math.max(t,r.argumentTerm(i).length)),0)}commandUsage(t){let r=t._name;if(t._aliases[0]){r=r+"|"+t._aliases[0]}let i="";for(let r=t.parent;r;r=r.parent){i=r.name()+" "+i}return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.description()}optionDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){r.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){r.push(`env: ${t.envVar}`)}if(r.length>0){return`${t.description} (${r.join(", ")})`}return t.description}argumentDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(r.length>0){const i=`(${r.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,r){const i=r.padWidth(t,r);const o=r.helpWidth||80;const a=2;const c=2;function formatItem(t,l){if(l){const u=`${t.padEnd(i+c)}${l}`;return r.wrap(u,o-a,i+c)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(a))}let l=[`Usage: ${r.commandUsage(t)}`,""];const u=r.commandDescription(t);if(u.length>0){l=l.concat([u,""])}const h=r.visibleArguments(t).map((t=>formatItem(r.argumentTerm(t),r.argumentDescription(t))));if(h.length>0){l=l.concat(["Arguments:",formatList(h),""])}const d=r.visibleOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(d.length>0){l=l.concat(["Options:",formatList(d),""])}const p=r.visibleCommands(t).map((t=>formatItem(r.subcommandTerm(t),r.subcommandDescription(t))));if(p.length>0){l=l.concat(["Commands:",formatList(p),""])}return l.join("\n")}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){if(t.match(/[\n]\s+/))return t;const a=r-i;if(a<o)return t;const c=t.substr(0,i);const l=t.substr(i);const u=" ".repeat(i);const h=new RegExp(".{1,"+(a-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g");const d=l.match(h)||[];return c+d.map(((t,r)=>{if(t.slice(-1)==="\n"){t=t.slice(0,t.length-1)}return(r>0?u:"")+t.trimRight()})).join("\n")}}r.Help=Help},6362:(t,r,i)=>{const{InvalidArgumentError:o}=i(2383);class Option{constructor(t,r){this.flags=t;this.description=r||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[]}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}function camelcase(t){return t.split("-").reduce(((t,r)=>t+r[0].toUpperCase()+r.slice(1)))}function splitOptionFlags(t){let r;let i;const o=t.split(/[ |,]+/);if(o.length>1&&!/^[[<]/.test(o[1]))r=o.shift();i=o.shift();if(!r&&/^-[^-]$/.test(i)){r=i;i=undefined}return{shortFlag:r,longFlag:i}}r.Option=Option;r.splitOptionFlags=splitOptionFlags},6639:(t,r)=>{const i=3;function editDistance(t,r){if(Math.abs(t.length-r.length)>i)return Math.max(t.length,r.length);const o=[];for(let r=0;r<=t.length;r++){o[r]=[r]}for(let t=0;t<=r.length;t++){o[0][t]=t}for(let i=1;i<=r.length;i++){for(let a=1;a<=t.length;a++){let c=1;if(t[a-1]===r[i-1]){c=0}else{c=1}o[a][i]=Math.min(o[a-1][i]+1,o[a][i-1]+1,o[a-1][i-1]+c);if(a>1&&i>1&&t[a-1]===r[i-2]&&t[a-2]===r[i-1]){o[a][i]=Math.min(o[a][i],o[a-2][i-2]+1)}}}return o[t.length][r.length]}function suggestSimilar(t,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const o=t.startsWith("--");if(o){t=t.slice(2);r=r.map((t=>t.slice(2)))}let a=[];let c=i;const l=.4;r.forEach((r=>{if(r.length<=1)return;const i=editDistance(t,r);const o=Math.max(t.length,r.length);const u=(o-i)/o;if(u>l){if(i<c){c=i;a=[r]}else if(i===c){a.push(r)}}}));a.sort(((t,r)=>t.localeCompare(r)));if(o){a=a.map((t=>`--${t}`))}if(a.length>1){return`\n(Did you mean one of ${a.join(", ")}?)`}if(a.length===1){return`\n(Did you mean ${a[0]}?)`}return""}r.suggestSimilar=suggestSimilar}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var c=true;try{t[i](a,a.exports,__nccwpck_require__);c=false}finally{if(c)delete r[i]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(3288);module.exports=i})();
|
|
123
|
+
*/const o=i(2773);const toRegexRange=(t,r,i)=>{if(o(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(r===void 0||t===r){return String(t)}if(o(r)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let a={relaxZeros:true,...i};if(typeof a.strictZeros==="boolean"){a.relaxZeros=a.strictZeros===false}let l=String(a.relaxZeros);let c=String(a.shorthand);let u=String(a.capture);let h=String(a.wrap);let d=t+":"+r+"="+l+c+u+h;if(toRegexRange.cache.hasOwnProperty(d)){return toRegexRange.cache[d].result}let p=Math.min(t,r);let m=Math.max(t,r);if(Math.abs(p-m)===1){let i=t+"|"+r;if(a.capture){return`(${i})`}if(a.wrap===false){return i}return`(?:${i})`}let y=hasPadding(t)||hasPadding(r);let g={min:t,max:r,a:p,b:m};let b=[];let v=[];if(y){g.isPadded=y;g.maxLen=String(g.max).length}if(p<0){let t=m<0?Math.abs(m):1;v=splitToPatterns(t,Math.abs(p),g,a);p=g.a=0}if(m>=0){b=splitToPatterns(p,m,g,a)}g.negatives=v;g.positives=b;g.result=collatePatterns(v,b,a);if(a.capture===true){g.result=`(${g.result})`}else if(a.wrap!==false&&b.length+v.length>1){g.result=`(?:${g.result})`}toRegexRange.cache[d]=g;return g.result};function collatePatterns(t,r,i){let o=filterPatterns(t,r,"-",false,i)||[];let a=filterPatterns(r,t,"",false,i)||[];let l=filterPatterns(t,r,"-?",true,i)||[];let c=o.concat(l).concat(a);return c.join("|")}function splitToRanges(t,r){let i=1;let o=1;let a=countNines(t,i);let l=new Set([r]);while(t<=a&&a<=r){l.add(a);i+=1;a=countNines(t,i)}a=countZeros(r+1,o)-1;while(t<a&&a<=r){l.add(a);o+=1;a=countZeros(r+1,o)-1}l=[...l];l.sort(compare);return l}function rangeToPattern(t,r,i){if(t===r){return{pattern:t,count:[],digits:0}}let o=zip(t,r);let a=o.length;let l="";let c=0;for(let t=0;t<a;t++){let[r,a]=o[t];if(r===a){l+=r}else if(r!=="0"||a!=="9"){l+=toCharacterClass(r,a,i)}else{c++}}if(c){l+=i.shorthand===true?"\\d":"[0-9]"}return{pattern:l,count:[c],digits:a}}function splitToPatterns(t,r,i,o){let a=splitToRanges(t,r);let l=[];let c=t;let u;for(let t=0;t<a.length;t++){let r=a[t];let h=rangeToPattern(String(c),String(r),o);let d="";if(!i.isPadded&&u&&u.pattern===h.pattern){if(u.count.length>1){u.count.pop()}u.count.push(h.count[0]);u.string=u.pattern+toQuantifier(u.count);c=r+1;continue}if(i.isPadded){d=padZeros(r,i,o)}h.string=d+h.pattern+toQuantifier(h.count);l.push(h);c=r+1;u=h}return l}function filterPatterns(t,r,i,o,a){let l=[];for(let a of t){let{string:t}=a;if(!o&&!contains(r,"string",t)){l.push(i+t)}if(o&&contains(r,"string",t)){l.push(i+t)}}return l}function zip(t,r){let i=[];for(let o=0;o<t.length;o++)i.push([t[o],r[o]]);return i}function compare(t,r){return t>r?1:r>t?-1:0}function contains(t,r,i){return t.some((t=>t[r]===i))}function countNines(t,r){return Number(String(t).slice(0,-r)+"9".repeat(r))}function countZeros(t,r){return t-t%Math.pow(10,r)}function toQuantifier(t){let[r=0,i=""]=t;if(i||r>1){return`{${r+(i?","+i:"")}}`}return""}function toCharacterClass(t,r,i){return`[${t}${r-t===1?"":"-"}${r}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,r,i){if(!r.isPadded){return t}let o=Math.abs(r.maxLen-String(t).length);let a=i.relaxZeros!==false;switch(o){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:{return a?`0{0,${o}}`:`0{${o}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},8290:(t,r,i)=>{const{URL:o}=i(7310);const{join:a}=i(1017);const l=i(7147);const{promisify:c}=i(3837);const{tmpdir:u}=i(2037);const h=i(3389);const d=c(l.writeFile);const p=c(l.mkdir);const m=c(l.readFile);const compareVersions=(t,r)=>t.localeCompare(r,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,r)=>{const i=u();const o=a(i,"update-check");if(!l.existsSync(o)){await p(o)}let c=`${t.name}-${r}.json`;if(t.scope){c=`${t.scope}-${c}`}return a(o,c)};const evaluateCache=async(t,r,i)=>{if(l.existsSync(t)){const o=await m(t,"utf8");const{lastUpdate:a,latest:l}=JSON.parse(o);const c=a+i;if(c>r){return{shouldCheck:false,latest:l}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,r,i)=>{const o=JSON.stringify({latest:r,lastUpdate:i});await d(t,o,"utf8")};const loadPackage=(t,r)=>new Promise(((o,a)=>{const l={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(r){l.headers.authorization=`${r.type} ${r.token}`}const{get:c}=i(t.protocol==="https:"?5687:3685);c(l,(t=>{const{statusCode:r}=t;if(r!==200){const i=new Error(`Request failed with code ${r}`);i.code=r;a(i);t.resume();return}let i="";t.setEncoding("utf8");t.on("data",(t=>{i+=t}));t.on("end",(()=>{try{const t=JSON.parse(i);o(t)}catch(t){a(t)}}))})).on("error",a).on("timeout",a)}));const getMostRecent=async({full:t,scope:r},a)=>{const l=h(r);const c=new o(t,l);let u=null;try{u=await loadPackage(c)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=i(6705);const r=t(l,{recursive:true});u=await loadPackage(c,r)}else{throw t}}const d=u["dist-tags"][a];if(!d){throw new Error(`Distribution tag ${a} is not available`)}return d};const y={interval:36e5,distTag:"latest"};const getDetails=t=>{const r={full:encode(t)};if(t.includes("/")){const i=t.split("/");r.scope=i[0];r.name=i[1]}else{r.scope=null;r.name=t}return r};t.exports=async(t,r)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const i=getDetails(t.name);const o=Date.now();const{distTag:a,interval:l}=Object.assign({},y,r);const c=await getFile(i,a);let u=null;let h=true;({shouldCheck:h,latest:u}=await evaluateCache(c,o,l));if(h){u=await getMostRecent(i,a);await updateCache(c,u,o)}const d=compareVersions(t.version,u);if(d===-1){return{latest:u,fromCache:!h}}return null}},343:(t,r,i)=>{t.exports=i(3837).deprecate},7183:(t,r,i)=>{const o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const a=i(1017);const l=o?";":":";const c=i(9774);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,r)=>{const i=r.colon||l;const a=t.match(/\//)||o&&t.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(i)];const c=o?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const u=o?c.split(i):[""];if(o){if(t.indexOf(".")!==-1&&u[0]!=="")u.unshift("")}return{pathEnv:a,pathExt:u,pathExtExe:c}};const which=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}if(!r)r={};const{pathEnv:o,pathExt:l,pathExtExe:u}=getPathInfo(t,r);const h=[];const step=i=>new Promise(((l,c)=>{if(i===o.length)return r.all&&h.length?l(h):c(getNotFoundError(t));const u=o[i];const d=/^".*"$/.test(u)?u.slice(1,-1):u;const p=a.join(d,t);const m=!d&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;l(subStep(m,i,0))}));const subStep=(t,i,o)=>new Promise(((a,d)=>{if(o===l.length)return a(step(i+1));const p=l[o];c(t+p,{pathExt:u},((l,c)=>{if(!l&&c){if(r.all)h.push(t+p);else return a(t+p)}return a(subStep(t,i,o+1))}))}));return i?step(0).then((t=>i(null,t)),i):step(0)};const whichSync=(t,r)=>{r=r||{};const{pathEnv:i,pathExt:o,pathExtExe:l}=getPathInfo(t,r);const u=[];for(let h=0;h<i.length;h++){const d=i[h];const p=/^".*"$/.test(d)?d.slice(1,-1):d;const m=a.join(p,t);const y=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;for(let t=0;t<o.length;t++){const i=y+o[t];try{const t=c.sync(i,{pathExt:l});if(t){if(r.all)u.push(i);else return i}}catch(t){}}}if(r.all&&u.length)return u;if(r.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},7564:t=>{t.exports=wrappy;function wrappy(t,r){if(t&&r)return wrappy(t)(r);if(typeof t!=="function")throw new TypeError("need wrapper function");Object.keys(t).forEach((function(r){wrapper[r]=t[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var i=0;i<r.length;i++){r[i]=arguments[i]}var o=t.apply(this,r);var a=r[r.length-1];if(typeof o==="function"&&o!==a){Object.keys(a).forEach((function(t){o[t]=a[t]}))}return o}}},1833:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},1064:(t,r,i)=>{"use strict";t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var r=this;if(!(r instanceof Yallist)){r=new Yallist}r.tail=null;r.head=null;r.length=0;if(t&&typeof t.forEach==="function"){t.forEach((function(t){r.push(t)}))}else if(arguments.length>0){for(var i=0,o=arguments.length;i<o;i++){r.push(arguments[i])}}return r}Yallist.prototype.removeNode=function(t){if(t.list!==this){throw new Error("removing node which does not belong to this list")}var r=t.next;var i=t.prev;if(r){r.prev=i}if(i){i.next=r}if(t===this.head){this.head=r}if(t===this.tail){this.tail=i}t.list.length--;t.next=null;t.prev=null;t.list=null;return r};Yallist.prototype.unshiftNode=function(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}var r=this.head;t.list=this;t.next=r;if(r){r.prev=t}this.head=t;if(!this.tail){this.tail=t}this.length++};Yallist.prototype.pushNode=function(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}var r=this.tail;t.list=this;t.prev=r;if(r){r.next=t}this.tail=t;if(!this.head){this.head=t}this.length++};Yallist.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++){push(this,arguments[t])}return this.length};Yallist.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++){unshift(this,arguments[t])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var t=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return t};Yallist.prototype.shift=function(){if(!this.head){return undefined}var t=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return t};Yallist.prototype.forEach=function(t,r){r=r||this;for(var i=this.head,o=0;i!==null;o++){t.call(r,i.value,o,this);i=i.next}};Yallist.prototype.forEachReverse=function(t,r){r=r||this;for(var i=this.tail,o=this.length-1;i!==null;o--){t.call(r,i.value,o,this);i=i.prev}};Yallist.prototype.get=function(t){for(var r=0,i=this.head;i!==null&&r<t;r++){i=i.next}if(r===t&&i!==null){return i.value}};Yallist.prototype.getReverse=function(t){for(var r=0,i=this.tail;i!==null&&r<t;r++){i=i.prev}if(r===t&&i!==null){return i.value}};Yallist.prototype.map=function(t,r){r=r||this;var i=new Yallist;for(var o=this.head;o!==null;){i.push(t.call(r,o.value,this));o=o.next}return i};Yallist.prototype.mapReverse=function(t,r){r=r||this;var i=new Yallist;for(var o=this.tail;o!==null;){i.push(t.call(r,o.value,this));o=o.prev}return i};Yallist.prototype.reduce=function(t,r){var i;var o=this.head;if(arguments.length>1){i=r}else if(this.head){o=this.head.next;i=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=0;o!==null;a++){i=t(i,o.value,a);o=o.next}return i};Yallist.prototype.reduceReverse=function(t,r){var i;var o=this.tail;if(arguments.length>1){i=r}else if(this.tail){o=this.tail.prev;i=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var a=this.length-1;o!==null;a--){i=t(i,o.value,a);o=o.prev}return i};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var r=0,i=this.head;i!==null;r++){t[r]=i.value;i=i.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var r=0,i=this.tail;i!==null;r++){t[r]=i.value;i=i.prev}return t};Yallist.prototype.slice=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}for(;a!==null&&o<r;o++,a=a.next){i.push(a.value)}return i};Yallist.prototype.sliceReverse=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(r<t||r<0){return i}if(t<0){t=0}if(r>this.length){r=this.length}for(var o=this.length,a=this.tail;a!==null&&o>r;o--){a=a.prev}for(;a!==null&&o>t;o--,a=a.prev){i.push(a.value)}return i};Yallist.prototype.splice=function(t,r,...i){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var o=0,a=this.head;a!==null&&o<t;o++){a=a.next}var l=[];for(var o=0;a&&o<r;o++){l.push(a.value);a=this.removeNode(a)}if(a===null){a=this.tail}if(a!==this.head&&a!==this.tail){a=a.prev}for(var o=0;o<i.length;o++){a=insert(this,a,i[o])}return l};Yallist.prototype.reverse=function(){var t=this.head;var r=this.tail;for(var i=t;i!==null;i=i.prev){var o=i.prev;i.prev=i.next;i.next=o}this.head=r;this.tail=t;return this};function insert(t,r,i){var o=r===t.head?new Node(i,null,r,t):new Node(i,r,r.next,t);if(o.next===null){t.tail=o}if(o.prev===null){t.head=o}t.length++;return o}function push(t,r){t.tail=new Node(r,t.tail,null,t);if(!t.head){t.head=t.tail}t.length++}function unshift(t,r){t.head=new Node(r,null,t.head,t);if(!t.tail){t.tail=t.head}t.length++}function Node(t,r,i,o){if(!(this instanceof Node)){return new Node(t,r,i,o)}this.list=o;this.value=t;if(r){r.next=this;this.prev=r}else{this.prev=null}if(i){i.prev=this;this.next=i}else{this.next=null}}try{i(1833)(Yallist)}catch(t){}},4127:(t,r,i)=>{
|
|
124
|
+
/**
|
|
125
|
+
* ZipStream
|
|
126
|
+
*
|
|
127
|
+
* @ignore
|
|
128
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
|
|
129
|
+
* @copyright (c) 2014 Chris Talkington, contributors.
|
|
130
|
+
*/
|
|
131
|
+
var o=i(3837).inherits;var a=i(7449).ZipArchiveOutputStream;var l=i(7449).ZipArchiveEntry;var c=i(1267);var u=t.exports=function(t){if(!(this instanceof u)){return new u(t)}t=this.options=t||{};t.zlib=t.zlib||{};a.call(this,t);if(typeof t.level==="number"&&t.level>=0){t.zlib.level=t.level;delete t.level}if(!t.forceZip64&&typeof t.zlib.level==="number"&&t.zlib.level===0){t.store=true}t.namePrependSlash=t.namePrependSlash||false;if(t.comment&&t.comment.length>0){this.setComment(t.comment)}};o(u,a);u.prototype._normalizeFileData=function(t){t=c.defaults(t,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var r=t.type==="directory";var i=t.type==="symlink";if(t.name){t.name=c.sanitizePath(t.name);if(!i&&t.name.slice(-1)==="/"){r=true;t.type="directory"}else if(r){t.name+="/"}}if(r||i){t.store=true}t.date=c.dateify(t.date);return t};u.prototype.entry=function(t,r,i){if(typeof i!=="function"){i=this._emitErrorCallback.bind(this)}r=this._normalizeFileData(r);if(r.type!=="file"&&r.type!=="directory"&&r.type!=="symlink"){i(new Error(r.type+" entries not currently supported"));return}if(typeof r.name!=="string"||r.name.length===0){i(new Error("entry name must be a non-empty string value"));return}if(r.type==="symlink"&&typeof r.linkname!=="string"){i(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var o=new l(r.name);o.setTime(r.date,this.options.forceLocalTime);if(r.namePrependSlash){o.setName(r.name,true)}if(r.store){o.setMethod(0)}if(r.comment.length>0){o.setComment(r.comment)}if(r.type==="symlink"&&typeof r.mode!=="number"){r.mode=40960}if(typeof r.mode==="number"){if(r.type==="symlink"){r.mode|=40960}o.setUnixMode(r.mode)}if(r.type==="symlink"&&typeof r.linkname==="string"){t=Buffer.from(r.linkname)}return a.prototype.entry.call(this,o,t,i)};u.prototype.finalize=function(){this.finish()}},1663:(t,r,i)=>{"use strict";i.r(r);const o=10;const wrapAnsi16=(t=0)=>r=>`[${r+t}m`;const wrapAnsi256=(t=0)=>r=>`[${38+t};5;${r}m`;const wrapAnsi16m=(t=0)=>(r,i,o)=>`[${38+t};2;${r};${i};${o}m`;function assembleStyles(){const t=new Map;const r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright;r.bgColor.bgGray=r.bgColor.bgBlackBright;r.color.grey=r.color.blackBright;r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(const[i,o]of Object.entries(r)){for(const[i,a]of Object.entries(o)){r[i]={open:`[${a[0]}m`,close:`[${a[1]}m`};o[i]=r[i];t.set(a[0],a[1])}Object.defineProperty(r,i,{value:o,enumerable:false})}Object.defineProperty(r,"codes",{value:t,enumerable:false});r.color.close="[39m";r.bgColor.close="[49m";r.color.ansi=wrapAnsi16();r.color.ansi256=wrapAnsi256();r.color.ansi16m=wrapAnsi16m();r.bgColor.ansi=wrapAnsi16(o);r.bgColor.ansi256=wrapAnsi256(o);r.bgColor.ansi16m=wrapAnsi16m(o);Object.defineProperties(r,{rgbToAnsi256:{value:(t,r,i)=>{if(t===r&&r===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value:t=>{const r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r){return[0,0,0]}let{colorString:i}=r.groups;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,o&255]},enumerable:false},hexToAnsi256:{value:t=>r.rgbToAnsi256(...r.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value:t=>{if(t<8){return 30+t}if(t<16){return 90+(t-8)}let r;let i;let o;if(t>=232){r=((t-232)*10+8)/255;i=r;o=r}else{t-=16;const a=t%36;r=Math.floor(t/36)/5;i=Math.floor(a/6)/5;o=a%6/5}const a=Math.max(r,i,o)*2;if(a===0){return 30}let l=30+(Math.round(o)<<2|Math.round(i)<<1|Math.round(r));if(a===2){l+=60}return l},enumerable:false},rgbToAnsi:{value:(t,i,o)=>r.ansi256ToAnsi(r.rgbToAnsi256(t,i,o)),enumerable:false},hexToAnsi:{value:t=>r.ansi256ToAnsi(r.hexToAnsi256(t)),enumerable:false}});return r}const a=assembleStyles();const l=a;const c=require("node:process");const u=require("node:os");const h=require("node:tty");function hasFlag(t,r=c.argv){const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1||o<a)}const{env:d}=c;let p;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){p=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){p=1}function envForceColor(){if("FORCE_COLOR"in d){if(d.FORCE_COLOR==="true"){return 1}if(d.FORCE_COLOR==="false"){return 0}return d.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(d.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:r,sniffFlags:i=true}={}){const o=envForceColor();if(o!==undefined){p=o}const a=i?p:o;if(a===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if(t&&!r&&a===undefined){return 0}const l=a||0;if(d.TERM==="dumb"){return l}if(c.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in d){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in d))||d.CI_NAME==="codeship"){return 1}return l}if("TEAMCITY_VERSION"in d){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0}if("TF_BUILD"in d&&"AGENT_NAME"in d){return 1}if(d.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in d){const t=Number.parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)){return 1}if("COLORTERM"in d){return 1}return l}function createSupportsColor(t,r={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...r});return translateLevel(i)}const m={stdout:createSupportsColor({isTTY:h.isatty(1)}),stderr:createSupportsColor({isTTY:h.isatty(2)})};const y=m;function stringReplaceAll(t,r,i){let o=t.indexOf(r);if(o===-1){return t}const a=r.length;let l=0;let c="";do{c+=t.substr(l,o-l)+r+i;l=o+a;o=t.indexOf(r,l)}while(o!==-1);c+=t.slice(l);return c}function stringEncaseCRLFWithFirstIndex(t,r,i,o){let a=0;let l="";do{const c=t[o-1]==="\r";l+=t.substr(a,(c?o-1:o)-a)+r+(c?"\r\n":"\n")+i;a=o+1;o=t.indexOf("\n",a)}while(o!==-1);l+=t.slice(a);return l}const{stdout:g,stderr:b}=y;const v=Symbol("GENERATOR");const _=Symbol("STYLER");const w=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const S=Object.create(null);const applyOptions=(t,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=g?g.level:0;t.level=r.level===undefined?i:r.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,r]of Object.entries(l)){S[t]={get(){const i=createBuilder(this,createStyler(r.open,r.close,this[_]),this[w]);Object.defineProperty(this,t,{value:i});return i}}}S.visible={get(){const t=createBuilder(this,this[_],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,r,i,...o)=>{if(t==="rgb"){if(r==="ansi16m"){return l[i].ansi16m(...o)}if(r==="ansi256"){return l[i].ansi256(l.rgbToAnsi256(...o))}return l[i].ansi(l.rgbToAnsi(...o))}if(t==="hex"){return getModelAnsi("rgb",r,i,...l.hexToRgb(...o))}return l[i][t](...o)};const R=["rgb","hex","ansi256"];for(const t of R){S[t]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"color",...i),l.color.close,this[_]);return createBuilder(this,o,this[w])}}};const r="bg"+t[0].toUpperCase()+t.slice(1);S[r]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"bgColor",...i),l.bgColor.close,this[_]);return createBuilder(this,o,this[w])}}}}const O=Object.defineProperties((()=>{}),{...S,level:{enumerable:true,get(){return this[v].level},set(t){this[v].level=t}}});const createStyler=(t,r,i)=>{let o;let a;if(i===undefined){o=t;a=r}else{o=i.openAll+t;a=r+i.closeAll}return{open:t,close:r,openAll:o,closeAll:a,parent:i}};const createBuilder=(t,r,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,O);builder[v]=t;builder[_]=r;builder[w]=i;return builder};const applyStyle=(t,r)=>{if(t.level<=0||!r){return t[w]?"":r}let i=t[_];if(i===undefined){return r}const{openAll:o,closeAll:a}=i;if(r.includes("")){while(i!==undefined){r=stringReplaceAll(r,i.close,i.open);i=i.parent}}const l=r.indexOf("\n");if(l!==-1){r=stringEncaseCRLFWithFirstIndex(r,a,o,l)}return o+r+a};Object.defineProperties(createChalk.prototype,S);const x=createChalk();const T=createChalk({level:b?b.level:0});const k=x;var A=i(2535);const{program:C,createCommand:P,createArgument:I,createOption:L,CommanderError:D,InvalidArgumentError:M,Command:N,Argument:j,Option:B,Help:$}=A;var H=i(8290);var U=i.n(H);var q=i(1017);var z=i.n(q);var G=i(7147);var W=i.n(G);function isSetup(){try{const t=W().statSync(z().join(process.cwd(),".hyperbook"));if(!t.isDirectory()){throw Error()}}catch(t){console.log(k.red("Could not find .hyperbook folder. Be sure to run `hyperbook setup`."));return false}try{W().statSync(z().join(process.cwd(),".hyperbook","node_modules",".bin","next"))}catch(t){console.log(k.red("Could not find next binary in the .hyperbook folder. Be sure to run `hyperbook setup`."));return false}return true}var V=i(8906);var Y=i.n(V);var Z=i(7282);var K=i.n(Z);async function archiveFolder(t){return new Promise(((r,i)=>{const o=z().join(K().cwd(),"public","archives");if(!W().existsSync(o)){W().mkdirSync(o,{recursive:true})}const a=z().join(o,t+".zip");const l=W().createWriteStream(a);const c=Y()("zip",{zlib:{level:9}});c.on("finish",(()=>{console.log(k.green("Archive zipped: ")+t);r()}));c.on("error",(()=>{i()}));c.pipe(l);c.directory(z().join(K().cwd(),"archives",t),false);c.finalize()}))}async function runArchive(){const t=isSetup();if(!t){return}return new Promise(((t,r)=>{const i=W().readdirSync(z().join(K().cwd(),"archives"),{withFileTypes:true}).filter((t=>t.isDirectory()));Promise.all(i.map((t=>archiveFolder(t.name)))).then((()=>{t()})).catch((()=>{r()}))}))}var Q=i(9579);var X=i.n(Q);async function readHyperbook(){return new Promise(((t,r)=>{W().readFile(z().join(process.cwd(),"hyperbook.json"),((i,o)=>{if(i){console.log(k.red("Could not find 'hyperbook.json'. Make sure you are in the right directory."));r()}else{const r=JSON.parse(o.toString());t(r)}}))}))}async function runBuild(){const t=isSetup();if(!t){return}const r=await readHyperbook();W().writeFileSync(z().join(process.cwd(),".hyperbook","next.config.js"),`\nmodule.exports = {\n ${(r===null||r===void 0?void 0:r.basePath)?`basePath: '${r.basePath}',`:""}\n typescript: {\n ignoreBuildErrors: true,\n }\n}\n `);return new Promise(((t,r)=>{const i="npm";const o=["run","build"];const a=X()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}async function runDev(){const t=isSetup();if(!t){return}return new Promise(((t,r)=>{const i="npm";const o=["run","dev"];const a=X()(i,o,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}var J=i(2081);function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,J.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,J.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}var ee=i(2037);var te=i.n(ee);const re=require("node:events");const ie=require("node:path");function indentString(t,r=1,i={}){const{indent:o=" ",includeEmptyLines:a=false}=i;if(typeof t!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(r<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``)}if(typeof o!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof o}\``)}if(r===0){return t}const l=a?/^/gm:/^(?!\s*$)/gm;return t.replace(l,o.repeat(r))}function escapeStringRegexp(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const se=/\s+at.*[(\s](.*)\)?/;const ne=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;const oe=typeof ee.homedir==="undefined"?"":ee.homedir().replace(/\\/g,"/");function cleanStack(t,{pretty:r=false,basePath:i}={}){const o=i&&new RegExp(`(at | \\()${escapeStringRegexp(i.replace(/\\/g,"/"))}`,"g");if(typeof t!=="string"){return undefined}return t.replace(/\\/g,"/").split("\n").filter((t=>{const r=t.match(se);if(r===null||!r[1]){return true}const i=r[1];if(i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")){return false}return!ne.test(i)})).filter((t=>t.trim()!=="")).map((t=>{if(o){t=t.replace(o,"$1")}if(r){t=t.replace(se,((t,r)=>t.replace(r,r.replace(oe,"~"))))}return t})).join("\n")}const cleanInternalStack=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t)){throw new TypeError(`Expected input to be an Array, got ${typeof t}`)}t=t.map((t=>{if(t instanceof Error){return t}if(t!==null&&typeof t==="object"){return Object.assign(new Error(t.message),t)}return new Error(t)}));let r=t.map((t=>typeof t.stack==="string"?cleanInternalStack(cleanStack(t.stack)):String(t))).join("\n");r="\n"+indentString(r,4);super(r);this.#e=t}get errors(){return this.#e.slice()}}async function pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true}={}){return new Promise(((a,l)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const c=[];const u=[];const h=new Map;let d=false;let p=false;let m=false;let y=0;let g=0;const b=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{d=true;p=true;l(t)};const next=async()=>{if(p){return}const t=await b.next();const i=g;g++;if(t.done){m=true;if(y===0&&!p){if(!o&&u.length>0){reject(new AggregateError(u));return}p=true;if(!h.size){a(c);return}const t=[];for(const[r,i]of c.entries()){if(h.get(r)===ae){continue}t.push(i)}a(t)}return}y++;(async()=>{try{const o=await t.value;if(p){return}const a=await r(o,i);if(a===ae){h.set(i,a)}c[i]=a;y--;await next()}catch(t){if(o){reject(t)}else{u.push(t);y--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(m||d){break}}})()}))}const ae=Symbol("skip");function arrify(t){if(t===null||t===undefined){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]}var le=i(2797);async function pFilter(t,r,i){const o=await pMap(t,((t,i)=>Promise.all([r(t,i),t])),i);return o.filter((t=>Boolean(t[0]))).map((t=>t[1]))}const ce=require("node:fs");var ue=i(5628);var he=i(2682);var fe=i(5753);var de=i(2058);function slash(t){const r=/^\\\\\?\\/.test(t);const i=/[^\u0000-\u0080]+/.test(t);if(r||i){return t}return t.replace(/\\/g,"/")}const pe=require("node:url");const me=require("node:stream");const toPath=t=>t instanceof URL?(0,pe.fileURLToPath)(t):t;class FilterStream extends me.Transform{constructor(t){super({objectMode:true,transform(r,i,o){o(undefined,t(r)?r:undefined)}})}}const isNegativePattern=t=>t[0]==="!";const ye={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:true,dot:true};const ge="**/.gitignore";const applyBaseToPattern=(t,r)=>isNegativePattern(t)?"!"+ie.posix.join(r,t.slice(1)):ie.posix.join(r,t);const parseIgnoreFile=(t,r)=>{const i=slash(ie.relative(r,ie.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,i)))};const toRelativePath=(t,r)=>{r=slash(r);if(ie.isAbsolute(t)){if(slash(t).startsWith(r)){return ie.relative(r,t)}throw new Error(`Path ${t} is not in cwd ${r}`)}return t};const getIsIgnoredPredicate=(t,r)=>{const i=t.flatMap((t=>parseIgnoreFile(t,r)));const o=de().add(i);return t=>{t=toPath(t);t=toRelativePath(t,r);return o.ignores(slash(t))}};const normalizeOptions=(t={})=>({cwd:toPath(t.cwd)||c.cwd()});const isIgnoredByIgnoreFiles=async(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=await he(t,{cwd:i,...ye});const a=await Promise.all(o.map((async t=>({filePath:t,content:await ce.promises.readFile(t,"utf8")}))));return getIsIgnoredPredicate(a,i)};const isIgnoredByIgnoreFilesSync=(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=he.sync(t,{cwd:i,...ye});const a=o.map((t=>({filePath:t,content:ce.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(a,i)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(ge,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(ge,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t.cwd){return}let r;try{r=ce.statSync(t.cwd)}catch{return}if(!r.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={ignore:[],expandDirectories:true,...t,cwd:toPath(t.cwd)};checkCwdOption(t);return t};const normalizeArguments=t=>async(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const normalizeArgumentsSync=t=>(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:r,gitignore:i}=t;const o=r?toPatternsArray(r):[];if(i){o.push(ge)}return o};const getFilter=async t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&await isIgnoredByIgnoreFiles(r,{cwd:t.cwd}))};const getFilterSync=t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&isIgnoredByIgnoreFilesSync(r,{cwd:t.cwd}))};const createFilterFunction=t=>{const r=new Set;return i=>{const o=i.path||i;const a=ie.normalize(o);const l=r.has(a)||t&&t(o);r.add(a);return!l}};const unionFastGlobResults=(t,r)=>t.flat().filter((t=>r(t)));const unionFastGlobStreams=(t,r)=>ue(t).pipe(new FilterStream((t=>r(t))));const convertNegativePatterns=(t,r)=>{const i=[];while(t.length>0){const o=t.findIndex((t=>isNegativePattern(t)));if(o===-1){i.push({patterns:t,options:r});break}const a=t[o].slice(1);for(const t of i){t.options.ignore.push(a)}if(o!==0){i.push({patterns:t.slice(0,o),options:{...r,ignore:[...r.ignore,a]}})}t=t.slice(o+1)}return i};const getDirGlobOptions=(t,r)=>({...r?{cwd:r}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const l=getDirGlobOptions(a,o);const c=o?{cwd:o}:undefined;return Promise.all(i.map((async t=>{let{patterns:r,options:i}=t;[r,i.ignore]=await Promise.all([fe(r,l),fe(i.ignore,c)]);return{patterns:r,options:i}})))};const generateTasksSync=(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const l=getDirGlobOptions(a,o);const c=o?{cwd:o}:undefined;return i.map((t=>{let{patterns:r,options:i}=t;r=fe.sync(r,l);i.ignore=fe.sync(i.ignore,c);return{patterns:r,options:i}}))};const be=normalizeArguments((async(t,r)=>{const[i,o]=await Promise.all([generateTasks(t,r),getFilter(r)]);const a=await Promise.all(i.map((t=>he(t.patterns,t.options))));return unionFastGlobResults(a,o)}));const ve=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>he.sync(t.patterns,t.options)));return unionFastGlobResults(a,o)}));const _e=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>he.stream(t.patterns,t.options)));return unionFastGlobStreams(a,o)}));const we=normalizeArgumentsSync(((t,r)=>t.some((t=>he.isDynamicPattern(t,r)))));const Ee=normalizeArguments(generateTasks);const Se=normalizeArgumentsSync(generateTasksSync);var Re=i(1888);var Oe=i(5800);class CpyError extends Oe{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpyError"}}const xe=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"];const Te=new RegExp(xe.join("|"));function isJunk(t){return Te.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,r,i){this.path=t;this.originalPath=t;this.destination=r;this.options=i;this.isDirectory=false;if(!we(t)&&ce.existsSync(t)&&ce.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return ie.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const r=t.findIndex((t=>t?we(t):false));const i=t.slice(0,r).join("/");if(i){return ie.isAbsolute(i)?i:ie.join(this.options.cwd,i)}return this.destination}hasMagic(){return we(this.options.flat?this.path:this.originalPath)}getMatches(){let t=ve(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(ie.basename(t))))}return t}}const ke=(u.cpus().length||1)*2;const Ae={ignoreJunk:true,flat:false,cwd:c.cwd()};class Entry{constructor(t,r,i){this.path=t.split("/").join(ie.sep);this.relativePath=r.split("/").join(ie.sep);this.pattern=i;Object.freeze(this)}get name(){return ie.basename(this.path)}get nameWithoutExtension(){return ie.basename(this.path,ie.extname(this.path))}get extension(){return ie.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>Re.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:r,options:i})=>{if(t.pattern.hasMagic()){if(i.flat){if(ie.isAbsolute(r)){return ie.join(r,t.name)}return ie.join(i.cwd,r,t.name)}return ie.join(r,ie.relative(t.pattern.normalizedPath,t.path))}if(ie.isAbsolute(r)){return ie.join(r,t.name)}if(t.pattern.isDirectory&&ie.relative(i.cwd,t.path).startsWith("..")){return ie.join(i.cwd,r,ie.basename(t.pattern.originalPath),ie.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return ie.join(i.cwd,r,ie.basename(t.pattern.originalPath),ie.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&i.flat){return ie.join(i.cwd,r,ie.basename(t.pattern.originalPath))}return ie.join(i.cwd,r,ie.relative(i.cwd,t.path))};const renameFile=(t,r)=>{const i=ie.basename(t,ie.extname(t));const o=ie.extname(t);const a=ie.dirname(t);if(typeof r==="string"){return ie.join(a,r)}if(typeof r==="function"){return ie.join(a,`${r(i)}${o}`)}return t};function cpy(t,r,{concurrency:i=ke,...o}={}){const a=new Map;const l=new re;o={...Ae,...o};const c=(async()=>{let c=[];let u=0;let h=0;let d=expandPatternsWithBraceExpansion(arrify(t)).map((t=>t.replace(/\\/g,"/")));const p=d.filter((t=>!t.startsWith("!")));const m=d.filter((t=>t.startsWith("!")));if(p.length===0||!r){throw new CpyError("`source` and `destination` required")}d=d.map((t=>new GlobPattern(t,r,{...o,ignore:m})));for(const t of d){let r=[];try{r=t.getMatches()}catch(r){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${r.message}`,r)}if(r.length===0&&!we(t.originalPath)&&!we(m)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}c=[...c,...r.map((r=>new Entry(r,ie.relative(o.cwd,r),t)))]}if(o.filter!==undefined){c=await pFilter(c,o.filter,{concurrency:1024})}if(c.length===0){l.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const r=a.get(t.sourcePath)||{writtenBytes:0,percent:0};if(r.writtenBytes!==t.writtenBytes||r.percent!==t.percent){h-=r.writtenBytes;h+=t.writtenBytes;if(t.percent===1&&r.percent!==1){u++}a.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});l.emit("progress",{totalFiles:c.length,percent:u/c.length,completedFiles:u,completedSize:h})}};return pMap(c,(async t=>{const i=renameFile(preprocessDestinationPath({entry:t,destination:r,options:o}),o.rename);try{await le(t.path,i,o).on("progress",fileProgressHandler)}catch(r){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${i}\`: ${r.message}`,r)}return i}),{concurrency:i})})();c.on=(...t)=>{l.on(...t);return c};return c}var Ce=i(2279);var Pe=i.n(Ce);function isFolderEmpty(t,r){const i=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const o=W().readdirSync(t).filter((t=>!i.includes(t))).filter((t=>!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${k.green(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=W().lstatSync(z().join(t,r));if(i.isDirectory()){console.log(` ${k.blue(r)}/`)}else{console.log(` ${r}`)}}catch{console.log(` ${r}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await W().promises.access(t,(W().constants||W()).W_OK);return true}catch(t){return false}}async function makeDir(t,r={recursive:true}){await W().promises.mkdir(t,r)}var Ie=i(93);var Le=i.n(Ie);function isInGitRepository(){try{(0,J.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,J.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,J.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,J.execSync)("git init",{stdio:"ignore"});r=true;(0,J.execSync)("git checkout -b main",{stdio:"ignore"});(0,J.execSync)("git add -A",{stdio:"ignore"});(0,J.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(i){if(r){try{Le().sync(z().join(t,".git"))}catch(t){}}return false}}var De=i(9845);class CancelError extends Error{constructor(t){super(t||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(t){return(...r)=>new PCancelable(((i,o,a)=>{r.push(a);t(...r).then(i,o)}))}constructor(t){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((r,i)=>{this._reject=i;const onResolve=t=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;r(t)}};const onReject=t=>{this._isPending=false;i(t)};const onCancel=t=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(t)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}});t(onResolve,onReject,onCancel)}))}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const t of this._cancelHandlers){t()}}catch(t){this._reject(t);return}}if(this._rejectOnCancel){this._reject(new CancelError(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(t){return De.object(t)&&"_onResponse"in t}class RequestError extends Error{constructor(t,r,i){super(t);Object.defineProperty(this,"input",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"stack",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=r.code??"ERR_GOT_REQUEST_ERROR";this.input=r.input;if(isRequest(i)){Object.defineProperty(this,"request",{enumerable:false,value:i});Object.defineProperty(this,"response",{enumerable:false,value:i.response});this.options=i.options}else{this.options=i}this.timings=this.request?.timings;if(De.string(r.stack)&&De.string(this.stack)){const t=this.stack.indexOf(this.message)+this.message.length;const i=this.stack.slice(t).split("\n").reverse();const o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split("\n").reverse();while(o.length>0&&o[0]===i[0]){i.shift()}this.stack=`${this.stack.slice(0,t)}${i.reverse().join("\n")}${o.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t);this.name="MaxRedirectsError";this.code="ERR_TOO_MANY_REDIRECTS"}}class HTTPError extends RequestError{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request);this.name="HTTPError";this.code="ERR_NON_2XX_3XX_RESPONSE"}}class CacheError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="CacheError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}}class UploadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="UploadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}class TimeoutError extends RequestError{constructor(t,r,i){super(t.message,t,i);Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.event=t.event;this.timings=r}}class ReadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="ReadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class RetryError extends RequestError{constructor(t){super("Retrying",{},t);this.name="RetryError";this.code="ERR_RETRYING"}}const Me=require("node:buffer");const Ne=require("node:http");var je=i(2361);var Fe=i(3837);var Be=i(7233);const timer=t=>{if(t.timings){return t.timings}const r={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};t.timings=r;const handleError=t=>{t.once(je.errorMonitor,(()=>{r.error=Date.now();r.phases.total=r.error-r.start}))};handleError(t);const onAbort=()=>{r.abort=Date.now();r.phases.total=r.abort-r.start};t.prependOnceListener("abort",onAbort);const onSocket=t=>{r.socket=Date.now();r.phases.wait=r.socket-r.start;if(Fe.types.isProxy(t)){return}const lookupListener=()=>{r.lookup=Date.now();r.phases.dns=r.lookup-r.socket};t.prependOnceListener("lookup",lookupListener);Be(t,{connect:()=>{r.connect=Date.now();if(r.lookup===undefined){t.removeListener("lookup",lookupListener);r.lookup=r.connect;r.phases.dns=r.lookup-r.socket}r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now();r.phases.tls=r.secureConnect-r.connect}})};if(t.socket){onSocket(t.socket)}else{t.prependOnceListener("socket",onSocket)}const onUpload=()=>{r.upload=Date.now();r.phases.request=r.upload-(r.secureConnect??r.connect)};if(t.writableFinished){onUpload()}else{t.prependOnceListener("finish",onUpload)}t.prependOnceListener("response",(i=>{r.response=Date.now();r.phases.firstByte=r.response-r.upload;i.timings=r;handleError(i);i.prependOnceListener("end",(()=>{t.off("abort",onAbort);i.off("aborted",onAbort);if(r.phases.total){return}r.end=Date.now();r.phases.download=r.end-r.response;r.phases.total=r.end-r.start}));i.prependOnceListener("aborted",onAbort)}));return r};const $e=timer;var He=i(8622);var Ue=i(1614);var qe=i(7567);const ze="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let t=16;let r="";while(t--){r+=ze[Math.random()*ze.length<<0]}return r}const Ge=createBoundary;const getType=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function isPlainObject(t){if(getType(t)!=="object"){return false}const r=Object.getPrototypeOf(t);if(r===null||r===undefined){return true}const i=r.constructor&&r.constructor.toString();return i===Object.toString()}const We=isPlainObject;const normalizeValue=t=>String(t).replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n");const Ve=normalizeValue;const escapeName=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");const Ye=escapeName;const isFunction=t=>typeof t==="function";const Ze=isFunction;const isFileLike=t=>Boolean(t&&typeof t==="object"&&Ze(t.constructor)&&t[Symbol.toStringTag]==="File"&&Ze(t.stream)&&t.name!=null&&t.size!=null&&t.lastModified!=null);const isFormData=t=>Boolean(t&&Ze(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&Ze(t.append)&&Ze(t.getAll)&&Ze(t.entries)&&Ze(t[Symbol.iterator]));const Ke=isFormData;var Qe=undefined&&undefined.__classPrivateFieldSet||function(t,r,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,i):a?a.value=i:r.set(t,i),i};var Xe=undefined&&undefined.__classPrivateFieldGet||function(t,r,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!o:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:r.get(t)};var Je,et,tt,rt,it,st,nt,ot,at,ct;const ut={enableAdditionalHeaders:false};class FormDataEncoder{constructor(t,r,i){Je.add(this);et.set(this,"\r\n");tt.set(this,void 0);rt.set(this,void 0);it.set(this,"-".repeat(2));st.set(this,new TextEncoder);nt.set(this,void 0);ot.set(this,void 0);at.set(this,void 0);if(!isFormData(t)){throw new TypeError("Expected first argument to be a FormData instance.")}let o;if(We(r)){i=r}else{o=r}if(!o){o=Ge()}if(typeof o!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(i&&!We(i)){throw new TypeError("Expected options argument to be an object.")}Qe(this,ot,t,"f");Qe(this,at,{...ut,...i},"f");Qe(this,tt,Xe(this,st,"f").encode(Xe(this,et,"f")),"f");Qe(this,rt,Xe(this,tt,"f").byteLength,"f");this.boundary=`form-data-boundary-${o}`;this.contentType=`multipart/form-data; boundary=${this.boundary}`;Qe(this,nt,Xe(this,st,"f").encode(`${Xe(this,it,"f")}${this.boundary}${Xe(this,it,"f")}${Xe(this,et,"f").repeat(2)}`),"f");this.contentLength=String(this.getContentLength());this.headers=Object.freeze({"Content-Type":this.contentType,"Content-Length":this.contentLength});Object.defineProperties(this,{boundary:{writable:false,configurable:false},contentType:{writable:false,configurable:false},contentLength:{writable:false,configurable:false},headers:{writable:false,configurable:false}})}getContentLength(){let t=0;for(const[r,i]of Xe(this,ot,"f")){const o=isFileLike(i)?i:Xe(this,st,"f").encode(Ve(i));t+=Xe(this,Je,"m",ct).call(this,r,o).byteLength;t+=isFileLike(o)?o.size:o.byteLength;t+=Xe(this,rt,"f")}return t+Xe(this,nt,"f").byteLength}*values(){for(const[t,r]of Xe(this,ot,"f").entries()){const i=isFileLike(r)?r:Xe(this,st,"f").encode(Ve(r));yield Xe(this,Je,"m",ct).call(this,t,i);yield i;yield Xe(this,tt,"f")}yield Xe(this,nt,"f")}async*encode(){for(const t of this.values()){if(isFileLike(t)){yield*t.stream()}else{yield t}}}[(et=new WeakMap,tt=new WeakMap,rt=new WeakMap,it=new WeakMap,st=new WeakMap,nt=new WeakMap,ot=new WeakMap,at=new WeakMap,Je=new WeakSet,ct=function _FormDataEncoder_getFieldHeader(t,r){let i="";i+=`${Xe(this,it,"f")}${this.boundary}${Xe(this,et,"f")}`;i+=`Content-Disposition: form-data; name="${Ye(t)}"`;if(isFileLike(r)){i+=`; filename="${Ye(r.name)}"${Xe(this,et,"f")}`;i+=`Content-Type: ${r.type||"application/octet-stream"}`}if(Xe(this,at,"f").enableAdditionalHeaders===true){i+=`${Xe(this,et,"f")}Content-Length: ${isFileLike(r)?r.size:r.byteLength}`}return Xe(this,st,"f").encode(`${i}${Xe(this,et,"f").repeat(2)}`)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}}const ht=null&&FormDataEncoder;const ft=require("node:util");function is_form_data_isFormData(t){return De.nodeStream(t)&&De.function_(t.getBoundary)}async function getBodySize(t,r){if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(De.string(t)){return Me.Buffer.byteLength(t)}if(De.buffer(t)){return t.length}if(is_form_data_isFormData(t)){return(0,ft.promisify)(t.getLength.bind(t))()}return undefined}function proxyEvents(t,r,i){const o={};for(const a of i){const eventFunction=(...t)=>{r.emit(a,...t)};o[a]=eventFunction;t.on(a,eventFunction)}return()=>{for(const[r,i]of Object.entries(o)){t.off(r,i)}}}const dt=require("node:net");function unhandle(){const t=[];return{once(r,i,o){r.once(i,o);t.push({origin:r,event:i,fn:o})},unhandleAll(){for(const r of t){const{origin:t,event:i,fn:o}=r;t.removeListener(i,o)}t.length=0}}}const pt=Symbol("reentry");const noop=()=>{};class timed_out_TimeoutError extends Error{constructor(t,r){super(`Timeout awaiting '${r}' for ${t}ms`);Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:r});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.code="ETIMEDOUT"}}function timedOut(t,r,i){if(pt in t){return noop}t[pt]=true;const o=[];const{once:a,unhandleAll:l}=unhandle();const addTimeout=(t,r,i)=>{const a=setTimeout(r,t,t,i);a.unref?.();const cancel=()=>{clearTimeout(a)};o.push(cancel);return cancel};const{host:c,hostname:u}=i;const timeoutHandler=(r,i)=>{t.destroy(new timed_out_TimeoutError(r,i))};const cancelTimeouts=()=>{for(const t of o){t()}l()};t.once("error",(r=>{cancelTimeouts();if(t.listenerCount("error")===0){throw r}}));if(typeof r.request!=="undefined"){const i=addTimeout(r.request,timeoutHandler,"request");a(t,"response",(t=>{a(t,"end",i)}))}if(typeof r.socket!=="undefined"){const{socket:i}=r;const socketTimeoutHandler=()=>{timeoutHandler(i,"socket")};t.setTimeout(i,socketTimeoutHandler);o.push((()=>{t.removeListener("timeout",socketTimeoutHandler)}))}const h=typeof r.lookup!=="undefined";const d=typeof r.connect!=="undefined";const p=typeof r.secureConnect!=="undefined";const m=typeof r.send!=="undefined";if(h||d||p||m){a(t,"socket",(o=>{const{socketPath:l}=t;if(o.connecting){const t=Boolean(l??dt.isIP(u??c??"")!==0);if(h&&!t&&typeof o.address().address==="undefined"){const t=addTimeout(r.lookup,timeoutHandler,"lookup");a(o,"lookup",t)}if(d){const timeConnect=()=>addTimeout(r.connect,timeoutHandler,"connect");if(t){a(o,"connect",timeConnect())}else{a(o,"lookup",(t=>{if(t===null){a(o,"connect",timeConnect())}}))}}if(p&&i.protocol==="https:"){a(o,"connect",(()=>{const t=addTimeout(r.secureConnect,timeoutHandler,"secureConnect");a(o,"secureConnect",t)}))}}if(m){const timeRequest=()=>addTimeout(r.send,timeoutHandler,"send");if(o.connecting){a(o,"connect",(()=>{a(t,"upload-complete",timeRequest())}))}else{a(t,"upload-complete",timeRequest())}}}))}if(typeof r.response!=="undefined"){a(t,"upload-complete",(()=>{const i=addTimeout(r.response,timeoutHandler,"response");a(t,"response",i)}))}if(typeof r.read!=="undefined"){a(t,"response",(t=>{const i=addTimeout(r.read,timeoutHandler,"read");a(t,"end",i)}))}return cancelTimeouts}function urlToOptions(t){t=t;const r={protocol:t.protocol,hostname:De.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};if(De.string(t.port)&&t.port.length>0){r.port=Number(t.port)}if(t.username||t.password){r.auth=`${t.username||""}:${t.password||""}`}return r}class WeakableMap{constructor(){Object.defineProperty(this,"weakMap",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"map",{enumerable:true,configurable:true,writable:true,value:void 0});this.weakMap=new WeakMap;this.map=new Map}set(t,r){if(typeof t==="object"){this.weakMap.set(t,r)}else{this.map.set(t,r)}}get(t){if(typeof t==="object"){return this.weakMap.get(t)}return this.map.get(t)}has(t){if(typeof t==="object"){return this.weakMap.has(t)}return this.map.has(t)}}const calculateRetryDelay=({attemptCount:t,retryOptions:r,error:i,retryAfter:o,computedValue:a})=>{if(i.name==="RetryError"){return 1}if(t>r.limit){return 0}const l=r.methods.includes(i.options.method);const c=r.errorCodes.includes(i.code);const u=i.response&&r.statusCodes.includes(i.response.statusCode);if(!l||!c&&!u){return 0}if(i.response){if(o){if(o>a){return 0}return o}if(i.response.statusCode===413){return 0}}const h=Math.random()*r.noise;return Math.min(2**(t-1)*1e3,r.backoffLimit)+h};const mt=calculateRetryDelay;const yt=require("node:tls");const bt=require("node:https");function lowercaseKeys(t){return Object.fromEntries(Object.entries(t).map((([t,r])=>[t.toLowerCase(),r])))}var vt=i(8897);var _t=i(8115);function parseLinkHeader(t){const r=[];const i=t.split(",");for(const o of i){const[i,...a]=o.split(";");const l=i.trim();if(l[0]!=="<"||l[l.length-1]!==">"){throw new Error(`Invalid format of the Link header reference: ${l}`)}const c=l.slice(1,-1);const u={};if(a.length===0){throw new Error(`Unexpected end of Link header parameters: ${a.join(";")}`)}for(const r of a){const i=r.trim();const o=i.indexOf("=");if(o===-1){throw new Error(`Failed to parse Link header: ${t}`)}const a=i.slice(0,o).trim();const l=i.slice(o+1).trim();u[a]=l}r.push({reference:c,parameters:u})}return r}const[wt,Et]=c.versions.node.split(".").map((t=>Number(t)));function validateSearchParameters(t){for(const r in t){const i=t[r];De.assert.any([De.string,De.number,De.boolean,De.null_,De.undefined],i)}}const St=new Map;let Rt;const getGlobalDnsCache=()=>{if(Rt){return Rt}Rt=new vt;return Rt};const Ot={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(t){if(t.request.options.responseType==="json"){return t.body}return JSON.parse(t.body)},paginate({response:t}){const r=t.headers.link;if(typeof r!=="string"||r.trim()===""){return false}const i=parseLinkHeader(r);const o=i.find((t=>t.parameters.rel==="next"||t.parameters.rel==='"next"'));if(o){return{url:new pe.URL(o.reference,t.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined};const cloneInternals=t=>{const{hooks:r,retry:i}=t;const o={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...i,errorCodes:[...i.errorCodes],methods:[...i.methods],statusCodes:[...i.statusCodes]},timeout:{...t.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:t.searchParams?new pe.URLSearchParams(t.searchParams):undefined,pagination:{...t.pagination}};if(o.url!==undefined){o.prefixUrl=""}return o};const cloneRaw=t=>{const{hooks:r,retry:i}=t;const o={...t};if(De.object(t.context)){o.context={...t.context}}if(De.object(t.cacheOptions)){o.cacheOptions={...t.cacheOptions}}if(De.object(t.https)){o.https={...t.https}}if(De.object(t.cacheOptions)){o.cacheOptions={...o.cacheOptions}}if(De.object(t.agent)){o.agent={...t.agent}}if(De.object(t.headers)){o.headers={...t.headers}}if(De.object(i)){o.retry={...i};if(De.array(i.errorCodes)){o.retry.errorCodes=[...i.errorCodes]}if(De.array(i.methods)){o.retry.methods=[...i.methods]}if(De.array(i.statusCodes)){o.retry.statusCodes=[...i.statusCodes]}}if(De.object(t.timeout)){o.timeout={...t.timeout}}if(De.object(r)){o.hooks={...r};if(De.array(r.init)){o.hooks.init=[...r.init]}if(De.array(r.beforeRequest)){o.hooks.beforeRequest=[...r.beforeRequest]}if(De.array(r.beforeError)){o.hooks.beforeError=[...r.beforeError]}if(De.array(r.beforeRedirect)){o.hooks.beforeRedirect=[...r.beforeRedirect]}if(De.array(r.beforeRetry)){o.hooks.beforeRetry=[...r.beforeRetry]}if(De.array(r.afterResponse)){o.hooks.afterResponse=[...r.afterResponse]}}if(De.object(t.pagination)){o.pagination={...t.pagination}}return o};const getHttp2TimeoutOption=t=>{const r=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter((t=>typeof t==="number"));if(r.length>0){return Math.min(...r)}return undefined};const init=(t,r,i)=>{const o=t.hooks?.init;if(o){for(const t of o){t(r,i)}}};class Options{constructor(t,r,i){Object.defineProperty(this,"_unixOptions",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_internals",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_merging",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_init",{enumerable:true,configurable:true,writable:true,value:void 0});De.assert.any([De.string,De.urlInstance,De.object,De.undefined],t);De.assert.any([De.object,De.undefined],r);De.assert.any([De.object,De.undefined],i);if(t instanceof Options||r instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(i?._internals??i??Ot);this._init=[...i?._init??[]];this._merging=false;this._unixOptions=undefined;try{if(De.plainObject(t)){try{this.merge(t);this.merge(r)}finally{this.url=t.url}}else{try{this.merge(r)}finally{if(r?.url!==undefined){if(t===undefined){this.url=r.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(t!==undefined){this.url=t}}}}catch(t){t.options=this;throw t}}merge(t){if(!t){return}if(t instanceof Options){for(const r of t._init){this.merge(r)}return}t=cloneRaw(t);init(this,t,this);init(t,t,this);this._merging=true;if("isStream"in t){this.isStream=t.isStream}try{let r=false;for(const i in t){if(i==="mutableDefaults"||i==="handlers"){continue}if(i==="url"){continue}if(!(i in this)){throw new Error(`Unexpected option: ${i}`)}this[i]=t[i];r=true}if(r){this._init.push(t)}}finally{this._merging=false}}get request(){return this._internals.request}set request(t){De.assert.any([De.function_,De.undefined],t);this._internals.request=t}get agent(){return this._internals.agent}set agent(t){De.assert.plainObject(t);for(const r in t){if(!(r in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${r}`)}De.assert.any([De.object,De.undefined],t[r])}if(this._merging){Object.assign(this._internals.agent,t)}else{this._internals.agent={...t}}}get h2session(){return this._internals.h2session}set h2session(t){this._internals.h2session=t}get decompress(){return this._internals.decompress}set decompress(t){De.assert.boolean(t);this._internals.decompress=t}get timeout(){return this._internals.timeout}set timeout(t){De.assert.plainObject(t);for(const r in t){if(!(r in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${r}`)}De.assert.any([De.number,De.undefined],t[r])}if(this._merging){Object.assign(this._internals.timeout,t)}else{this._internals.timeout={...t}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(t){De.assert.any([De.string,De.urlInstance],t);if(t===""){this._internals.prefixUrl="";return}t=t.toString();if(!t.endsWith("/")){t+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:r}=this._internals.url;this._internals.url.href=t+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=t}get body(){return this._internals.body}set body(t){De.assert.any([De.string,De.buffer,De.nodeStream,De.generator,De.asyncGenerator,Ke,De.undefined],t);if(De.nodeStream(t)){De.assert.truthy(t.readable)}if(t!==undefined){De.assert.undefined(this._internals.form);De.assert.undefined(this._internals.json)}this._internals.body=t}get form(){return this._internals.form}set form(t){De.assert.any([De.plainObject,De.undefined],t);if(t!==undefined){De.assert.undefined(this._internals.body);De.assert.undefined(this._internals.json)}this._internals.form=t}get json(){return this._internals.json}set json(t){if(t!==undefined){De.assert.undefined(this._internals.body);De.assert.undefined(this._internals.form)}this._internals.json=t}get url(){return this._internals.url}set url(t){De.assert.any([De.string,De.urlInstance,De.undefined],t);if(t===undefined){this._internals.url=undefined;return}if(De.string(t)&&t.startsWith("/")){throw new Error("`url` must not start with a slash")}const r=`${this.prefixUrl}${t.toString()}`;const i=new pe.URL(r);this._internals.url=i;decodeURI(r);if(i.protocol==="unix:"){i.href=`http://unix${i.pathname}${i.search}`}if(i.protocol!=="http:"&&i.protocol!=="https:"){const t=new Error(`Unsupported protocol: ${i.protocol}`);t.code="ERR_UNSUPPORTED_PROTOCOL";throw t}if(this._internals.username){i.username=this._internals.username;this._internals.username=""}if(this._internals.password){i.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){i.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(i.hostname==="unix"){const t=/(?<socketPath>.+?):(?<path>.+)/.exec(`${i.pathname}${i.search}`);if(t?.groups){const{socketPath:r,path:i}=t.groups;this._unixOptions={socketPath:r,path:i,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(t){De.assert.any([De.object,De.undefined],t);if(t===undefined){this._internals.cookieJar=undefined;return}let{setCookie:r,getCookieString:i}=t;De.assert.function_(r);De.assert.function_(i);if(r.length===4&&i.length===0){r=(0,ft.promisify)(r.bind(t));i=(0,ft.promisify)(i.bind(t));this._internals.cookieJar={setCookie:r,getCookieString:i}}else{this._internals.cookieJar=t}}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(t){De.assert.boolean(t);this._internals.ignoreInvalidCookies=t}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new pe.URLSearchParams}return this._internals.searchParams}set searchParams(t){De.assert.any([De.string,De.object,De.undefined],t);const r=this._internals.url;if(t===undefined){this._internals.searchParams=undefined;if(r){r.search=""}return}const i=this.searchParams;let o;if(De.string(t)){o=new pe.URLSearchParams(t)}else if(t instanceof pe.URLSearchParams){o=t}else{validateSearchParameters(t);o=new pe.URLSearchParams;for(const r in t){const a=t[r];if(a===null){o.append(r,"")}else if(a===undefined){i.delete(r)}else{o.append(r,a)}}}if(this._merging){for(const t of o.keys()){i.delete(t)}for(const[t,r]of o){i.append(t,r)}}else if(r){r.search=i.toString()}else{this._internals.searchParams=i}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(t){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(t){De.assert.any([De.function_,De.undefined],t);this._internals.dnsLookup=t}get dnsCache(){return this._internals.dnsCache}set dnsCache(t){De.assert.any([De.object,De.boolean,De.undefined],t);if(t===true){this._internals.dnsCache=getGlobalDnsCache()}else if(t===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=t}}get context(){return this._internals.context}set context(t){De.assert.object(t);if(this._merging){Object.assign(this._internals.context,t)}else{this._internals.context={...t}}}get hooks(){return this._internals.hooks}set hooks(t){De.assert.object(t);for(const r in t){if(!(r in this._internals.hooks)){throw new Error(`Unexpected hook event: ${r}`)}const i=r;const o=t;const a=o[i];De.assert.any([De.array,De.undefined],a);if(a){for(const t of a){De.assert.function_(t)}}if(this._merging){if(a){this._internals.hooks[i].push(...a)}}else{if(!a){throw new Error(`Missing hook event: ${r}`)}this._internals.hooks[r]=[...a]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(t){De.assert.boolean(t);this._internals.followRedirect=t}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(t){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(t){De.assert.number(t);this._internals.maxRedirects=t}get cache(){return this._internals.cache}set cache(t){De.assert.any([De.object,De.string,De.boolean,De.undefined],t);if(t===true){this._internals.cache=St}else if(t===false){this._internals.cache=undefined}else{this._internals.cache=t}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(t){De.assert.boolean(t);this._internals.throwHttpErrors=t}get username(){const t=this._internals.url;const r=t?t.username:this._internals.username;return decodeURIComponent(r)}set username(t){De.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.username=i}else{this._internals.username=i}}get password(){const t=this._internals.url;const r=t?t.password:this._internals.password;return decodeURIComponent(r)}set password(t){De.assert.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.password=i}else{this._internals.password=i}}get http2(){return this._internals.http2}set http2(t){De.assert.boolean(t);this._internals.http2=t}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(t){De.assert.boolean(t);this._internals.allowGetBody=t}get headers(){return this._internals.headers}set headers(t){De.assert.plainObject(t);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(t))}else{this._internals.headers=lowercaseKeys(t)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(t){De.assert.boolean(t);this._internals.methodRewriting=t}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(t){if(t!==undefined&&t!==4&&t!==6){throw new TypeError(`Invalid DNS lookup IP version: ${t}`)}this._internals.dnsLookupIpVersion=t}get parseJson(){return this._internals.parseJson}set parseJson(t){De.assert.function_(t);this._internals.parseJson=t}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(t){De.assert.function_(t);this._internals.stringifyJson=t}get retry(){return this._internals.retry}set retry(t){De.assert.plainObject(t);De.assert.any([De.function_,De.undefined],t.calculateDelay);De.assert.any([De.number,De.undefined],t.maxRetryAfter);De.assert.any([De.number,De.undefined],t.limit);De.assert.any([De.array,De.undefined],t.methods);De.assert.any([De.array,De.undefined],t.statusCodes);De.assert.any([De.array,De.undefined],t.errorCodes);De.assert.any([De.number,De.undefined],t.noise);if(t.noise&&Math.abs(t.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${t.noise}`)}for(const r in t){if(!(r in this._internals.retry)){throw new Error(`Unexpected retry option: ${r}`)}}if(this._merging){Object.assign(this._internals.retry,t)}else{this._internals.retry={...t}}const{retry:r}=this._internals;r.methods=[...new Set(r.methods.map((t=>t.toUpperCase())))];r.statusCodes=[...new Set(r.statusCodes)];r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(t){De.assert.any([De.string,De.undefined],t);this._internals.localAddress=t}get method(){return this._internals.method}set method(t){De.assert.string(t);this._internals.method=t.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(t){De.assert.any([De.function_,De.undefined],t);this._internals.createConnection=t}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(t){De.assert.plainObject(t);De.assert.any([De.boolean,De.undefined],t.shared);De.assert.any([De.number,De.undefined],t.cacheHeuristic);De.assert.any([De.number,De.undefined],t.immutableMinTimeToLive);De.assert.any([De.boolean,De.undefined],t.ignoreCargoCult);for(const r in t){if(!(r in this._internals.cacheOptions)){throw new Error(`Cache option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,t)}else{this._internals.cacheOptions={...t}}}get https(){return this._internals.https}set https(t){De.assert.plainObject(t);De.assert.any([De.boolean,De.undefined],t.rejectUnauthorized);De.assert.any([De.function_,De.undefined],t.checkServerIdentity);De.assert.any([De.string,De.object,De.array,De.undefined],t.certificateAuthority);De.assert.any([De.string,De.object,De.array,De.undefined],t.key);De.assert.any([De.string,De.object,De.array,De.undefined],t.certificate);De.assert.any([De.string,De.undefined],t.passphrase);De.assert.any([De.string,De.buffer,De.array,De.undefined],t.pfx);De.assert.any([De.array,De.undefined],t.alpnProtocols);De.assert.any([De.string,De.undefined],t.ciphers);De.assert.any([De.string,De.buffer,De.undefined],t.dhparam);De.assert.any([De.string,De.undefined],t.signatureAlgorithms);De.assert.any([De.string,De.undefined],t.minVersion);De.assert.any([De.string,De.undefined],t.maxVersion);De.assert.any([De.boolean,De.undefined],t.honorCipherOrder);De.assert.any([De.number,De.undefined],t.tlsSessionLifetime);De.assert.any([De.string,De.undefined],t.ecdhCurve);De.assert.any([De.string,De.buffer,De.array,De.undefined],t.certificateRevocationLists);for(const r in t){if(!(r in this._internals.https)){throw new Error(`HTTPS option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,t)}else{this._internals.https={...t}}}get encoding(){return this._internals.encoding}set encoding(t){if(t===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}De.assert.any([De.string,De.undefined],t);this._internals.encoding=t}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(t){De.assert.boolean(t);this._internals.resolveBodyOnly=t}get isStream(){return this._internals.isStream}set isStream(t){De.assert.boolean(t);this._internals.isStream=t}get responseType(){return this._internals.responseType}set responseType(t){if(t===undefined){this._internals.responseType="text";return}if(t!=="text"&&t!=="buffer"&&t!=="json"){throw new Error(`Invalid \`responseType\` option: ${t}`)}this._internals.responseType=t}get pagination(){return this._internals.pagination}set pagination(t){De.assert.object(t);if(this._merging){Object.assign(this._internals.pagination,t)}else{this._internals.pagination=t}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(t){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(t){De.assert.boolean(t);this._internals.setHost=t}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(t){De.assert.any([De.number,De.undefined],t);this._internals.maxHeaderSize=t}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](t,r){return(0,ft.inspect)(this._internals,r)}createNativeRequestOptions(){const t=this._internals;const r=t.url;let i;if(r.protocol==="https:"){i=t.http2?t.agent:t.agent.https}else{i=t.agent.http}const{https:o}=t;let{pfx:a}=o;if(De.array(a)&&De.plainObject(a[0])){a=a.map((t=>({buf:t.buffer,passphrase:t.passphrase})))}return{...t.cacheOptions,...this._unixOptions,ALPNProtocols:o.alpnProtocols,ca:o.certificateAuthority,cert:o.certificate,key:o.key,passphrase:o.passphrase,pfx:o.pfx,rejectUnauthorized:o.rejectUnauthorized,checkServerIdentity:o.checkServerIdentity??yt.checkServerIdentity,ciphers:o.ciphers,honorCipherOrder:o.honorCipherOrder,minVersion:o.minVersion,maxVersion:o.maxVersion,sigalgs:o.signatureAlgorithms,sessionTimeout:o.tlsSessionLifetime,dhparam:o.dhparam,ecdhCurve:o.ecdhCurve,crl:o.certificateRevocationLists,lookup:t.dnsLookup??t.dnsCache?.lookup,family:t.dnsLookupIpVersion,agent:i,setHost:t.setHost,method:t.method,maxHeaderSize:t.maxHeaderSize,localAddress:t.localAddress,headers:t.headers,createConnection:t.createConnection,timeout:t.http2?getHttp2TimeoutOption(t):undefined,h2session:t.h2session}}getRequestFunction(){const t=this._internals.url;const{request:r}=this._internals;if(!r&&t){return this.getFallbackRequestFunction()}return r}getFallbackRequestFunction(){const t=this._internals.url;if(!t){return}if(t.protocol==="https:"){if(this._internals.http2){if(wt<15||wt===15&&Et<10){const t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");t.code="EUNSUPPORTED";throw t}return _t.auto}return bt.request}return Ne.request}freeze(){const t=this._internals;Object.freeze(t);Object.freeze(t.hooks);Object.freeze(t.hooks.afterResponse);Object.freeze(t.hooks.beforeError);Object.freeze(t.hooks.beforeRedirect);Object.freeze(t.hooks.beforeRequest);Object.freeze(t.hooks.beforeRetry);Object.freeze(t.hooks.init);Object.freeze(t.https);Object.freeze(t.cacheOptions);Object.freeze(t.agent);Object.freeze(t.headers);Object.freeze(t.timeout);Object.freeze(t.retry);Object.freeze(t.retry.errorCodes);Object.freeze(t.retry.methods);Object.freeze(t.retry.statusCodes);Object.freeze(t.context)}}const isResponseOk=t=>{const{statusCode:r}=t;const i=t.request.options.followRedirect?299:399;return r>=200&&r<=i||r===304};class ParseError extends RequestError{constructor(t,r){const{options:i}=r.request;super(`${t.message} in "${i.url.toString()}"`,t,r.request);this.name="ParseError";this.code="ERR_BODY_PARSE_FAILURE"}}const parseBody=(t,r,i,o)=>{const{rawBody:a}=t;try{if(r==="text"){return a.toString(o)}if(r==="json"){return a.length===0?"":i(a.toString(o))}if(r==="buffer"){return a}}catch(r){throw new ParseError(r,t)}throw new ParseError({message:`Unknown body type '${r}'`,name:"Error"},t)};function isClientRequest(t){return t.writable&&!t.writableEnded}const xt=isClientRequest;const Tt=De.string(c.versions.brotli);const kt=new Set(["GET","HEAD"]);const At=new WeakableMap;const Ct=new Set([300,301,302,303,304,307,308]);const Pt=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends me.Duplex{constructor(t,r,i){super({autoDestroy:false,highWaterMark:0});Object.defineProperty(this,"constructor",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_noPipe",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"requestUrl",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"redirectUrls",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"retryCount",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopRetry",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_downloadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_uploadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopReading",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_pipedServerResponses",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_responseSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_bodySize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_unproxyEvents",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_isFromCache",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cannotHaveBody",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_triggerRead",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cancelTimeouts",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_nativeResponse",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_flushed",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_aborted",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_requestInitialized",{enumerable:true,configurable:true,writable:true,value:void 0});this._downloadedSize=0;this._uploadedSize=0;this._stopReading=false;this._pipedServerResponses=new Set;this._cannotHaveBody=false;this._unproxyEvents=core_noop;this._triggerRead=false;this._cancelTimeouts=core_noop;this._jobs=[];this._flushed=false;this._requestInitialized=false;this._aborted=false;this.redirectUrls=[];this.retryCount=0;this._stopRetry=core_noop;this.on("pipe",(t=>{if(t.headers){Object.assign(this.options.headers,t.headers)}}));this.on("newListener",(t=>{if(t==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(t,r,i);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url}catch(t){const{options:r}=t;if(r){this.options=r}this.flush=async()=>{this.flush=async()=>{};this.destroy(t)};return}const{body:o}=this.options;if(De.nodeStream(o)){o.once("error",(t=>{if(this._flushed){this._beforeError(new UploadError(t,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(t,this))}}}))}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const t of this._jobs){t()}this._jobs.length=0;this._requestInitialized=true}catch(t){this._beforeError(t)}}_beforeError(t){if(this._stopReading){return}const{response:r,options:i}=this;const o=this.retryCount+(t.name==="RetryError"?0:1);this._stopReading=true;if(!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}const a=t;void(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed){r.setEncoding(this.readableEncoding);const t=await this._setRawBody(r);if(t){r.body=r.rawBody.toString()}}if(this.listenerCount("retry")!==0){let l;try{let t;if(r&&"retry-after"in r.headers){t=Number(r.headers["retry-after"]);if(Number.isNaN(t)){t=Date.parse(r.headers["retry-after"])-Date.now();if(t<=0){t=1}}else{t*=1e3}}const c=i.retry;l=await c.calculateDelay({attemptCount:o,retryOptions:c,error:a,retryAfter:t,computedValue:mt({attemptCount:o,retryOptions:c,error:a,retryAfter:t,computedValue:c.maxRetryAfter??i.timeout.request??Number.POSITIVE_INFINITY})})}catch(t){void this._error(new RequestError(t.message,t,this));return}if(l){await new Promise((t=>{const r=setTimeout(t,l);this._stopRetry=()=>{clearTimeout(r);t()}}));if(this.destroyed){return}try{for(const t of this.options.hooks.beforeRetry){await t(a,this.retryCount+1)}}catch(r){void this._error(new RequestError(r.message,t,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",this.retryCount+1,t,(t=>{const r=new Request(i.url,t,i);r.retryCount=this.retryCount+1;c.nextTick((()=>{void r.flush()}));return r}));return}}void this._error(a)})()}_read(){this._triggerRead=true;const{response:t}=this;if(t&&!this._stopReading){if(t.readableLength){this._triggerRead=false}let r;while((r=t.read())!==null){this._downloadedSize+=r.length;const t=this.downloadProgress;if(t.percent<1){this.emit("downloadProgress",t)}this.push(r)}}}_write(t,r,i){const write=()=>{this._writeRequest(t,r,i)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(t){const endRequest=()=>{if(!this._request||this._request.destroyed){t();return}this._request.end((r=>{if(this._request._writableState?.errored){return}if(!r){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request.emit("upload-complete")}t(r)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(t,r){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();if(this.options){const{body:t}=this.options;if(De.nodeStream(t)){t.destroy()}}if(this._request){this._request.destroy()}if(t!==null&&!De.undefined(t)&&!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}r(t)}pipe(t,r){if(t instanceof Ne.ServerResponse){this._pipedServerResponses.add(t)}return super.pipe(t,r)}unpipe(t){if(t instanceof Ne.ServerResponse){this._pipedServerResponses.delete(t)}super.unpipe(t);return this}async _finalizeBody(){const{options:t}=this;const{headers:r}=t;const i=!De.undefined(t.form);const o=!De.undefined(t.json);const a=!De.undefined(t.body);const l=kt.has(t.method)&&!(t.method==="GET"&&t.allowGetBody);this._cannotHaveBody=l;if(i||o||a){if(l){throw new TypeError(`The \`${t.method}\` method cannot be used with a body`)}const o=!De.string(r["content-type"]);if(a){if(Ke(t.body)){const i=new FormDataEncoder(t.body);if(o){r["content-type"]=i.headers["Content-Type"]}r["content-length"]=i.headers["Content-Length"];t.body=i.encode()}if(is_form_data_isFormData(t.body)&&o){r["content-type"]=`multipart/form-data; boundary=${t.body.getBoundary()}`}}else if(i){if(o){r["content-type"]="application/x-www-form-urlencoded"}const{form:i}=t;t.form=undefined;t.body=new pe.URLSearchParams(i).toString()}else{if(o){r["content-type"]="application/json"}const{json:i}=t;t.json=undefined;t.body=t.stringifyJson(i)}const c=await getBodySize(t.body,t.headers);if(De.undefined(r["content-length"])&&De.undefined(r["transfer-encoding"])&&!l&&!De.undefined(c)){r["content-length"]=String(c)}}if(t.responseType==="json"&&!("accept"in t.headers)){t.headers.accept="application/json"}this._bodySize=Number(r["content-length"])||undefined}async _onResponseBase(t){if(this.isAborted){return}const{options:r}=this;const{url:i}=r;this._nativeResponse=t;if(r.decompress){t=Ue(t)}const o=t.statusCode;const a=t;a.statusMessage=a.statusMessage?a.statusMessage:Ne.STATUS_CODES[o];a.url=r.url.toString();a.requestUrl=this.requestUrl;a.redirectUrls=this.redirectUrls;a.request=this;a.isFromCache=this._nativeResponse.fromCache??false;a.ip=this.ip;a.retryCount=this.retryCount;this._isFromCache=a.isFromCache;this._responseSize=Number(t.headers["content-length"])||undefined;this.response=a;t.once("end",(()=>{this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress)}));t.once("error",(r=>{this._aborted=true;t.destroy();this._beforeError(new ReadError(r,this))}));t.once("aborted",(()=>{this._aborted=true;this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}));this.emit("downloadProgress",this.downloadProgress);const l=t.headers["set-cookie"];if(De.object(r.cookieJar)&&l){let t=l.map((async t=>r.cookieJar.setCookie(t,i.toString())));if(r.ignoreInvalidCookies){t=t.map((async t=>{try{await t}catch{}}))}try{await Promise.all(t)}catch(t){this._beforeError(t);return}}if(this.isAborted){return}if(r.followRedirect&&t.headers.location&&Ct.has(o)){t.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=r.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;const l=new Options(undefined,undefined,this.options);const c=o===303&&l.method!=="GET"&&l.method!=="HEAD";if(c||l.methodRewriting){l.method="GET";l.body=undefined;l.json=undefined;l.form=undefined;delete l.headers["content-length"]}try{const r=Me.Buffer.from(t.headers.location,"binary").toString();const o=new pe.URL(r,i);if(o.hostname!==i.hostname||o.port!==i.port){if("host"in l.headers){delete l.headers.host}if("cookie"in l.headers){delete l.headers.cookie}if("authorization"in l.headers){delete l.headers.authorization}if(l.username||l.password){l.username="";l.password=""}}else{o.username=l.username;o.password=l.password}this.redirectUrls.push(o);l.prefixUrl="";l.url=o;for(const t of l.hooks.beforeRedirect){await t(l,a)}this.emit("redirect",l,a);this.options=l;await this._makeRequest()}catch(t){this._beforeError(t);return}return}if(r.isStream&&r.throwHttpErrors&&!isResponseOk(a)){this._beforeError(new HTTPError(a));return}t.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{t.resume()}));this.on("pause",(()=>{t.pause()}));t.once("end",(()=>{this.push(null)}));if(this._noPipe){const r=await this._setRawBody();if(r){this.emit("response",t)}return}this.emit("response",t);for(const i of this._pipedServerResponses){if(i.headersSent){continue}for(const o in t.headers){const a=r.decompress?o!=="content-encoding":true;const l=t.headers[o];if(a){i.setHeader(o,l)}}i.statusCode=o}}async _setRawBody(t=this){if(t.readableEnded){return false}try{const r=await(0,qe.buffer)(t);if(!this.isAborted){this.response.rawBody=r;return true}}catch{}return false}async _onResponse(t){try{await this._onResponseBase(t)}catch(t){this._beforeError(t)}}_onRequest(t){const{options:r}=this;const{timeout:i,url:o}=r;$e(t);if(this.options.http2){t.setTimeout(0)}this._cancelTimeouts=timedOut(t,i,o);const a=r.cache?"cacheableResponse":"response";t.once(a,(t=>{void this._onResponse(t)}));t.once("error",(r=>{this._aborted=true;t.destroy();r=r instanceof timed_out_TimeoutError?new TimeoutError(r,this.timings,this):new RequestError(r.message,r,this);this._beforeError(r)}));this._unproxyEvents=proxyEvents(t,this,Pt);this._request=t;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",t)}async _asyncWrite(t){return new Promise(((r,i)=>{super.write(t,(t=>{if(t){i(t);return}r()}))}))}_sendBody(){const{body:t}=this.options;const r=this.redirectUrls.length===0?this:this._request??this;if(De.nodeStream(t)){t.pipe(r)}else if(De.generator(t)||De.asyncGenerator(t)){(async()=>{try{for await(const r of t){await this._asyncWrite(r)}super.end()}catch(t){this._beforeError(t)}})()}else if(!De.undefined(t)){this._writeRequest(t,undefined,(()=>{}));r.end()}else if(this._cannotHaveBody||this._noPipe){r.end()}}_prepareCache(t){if(!At.has(t)){At.set(t,new He(((t,r)=>{const i=t._request(t,r);if(De.promise(i)){i.once=(t,r)=>{if(t==="error"){(async()=>{try{await i}catch(t){r(t)}})()}else if(t==="abort"){(async()=>{try{const t=await i;t.once("abort",r)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${t}`)}return i}}return i}),t))}}async _createCacheableRequest(t,r){return new Promise(((i,o)=>{Object.assign(r,urlToOptions(t));let a;const l=At.get(r.cache)(r,(async t=>{t._readableState.autoDestroy=false;if(a){const fix=()=>{if(t.req){t.complete=t.req.res.complete}};t.prependOnceListener("end",fix);fix();(await a).emit("cacheableResponse",t)}i(t)}));l.once("error",o);l.once("request",(async t=>{a=t;i(a)}))}))}async _makeRequest(){const{options:t}=this;const{headers:r,username:i,password:o}=t;const a=t.cookieJar;for(const t in r){if(De.undefined(r[t])){delete r[t]}else if(De.null_(r[t])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(t.decompress&&De.undefined(r["accept-encoding"])){r["accept-encoding"]=Tt?"gzip, deflate, br":"gzip, deflate"}if(i||o){const t=Me.Buffer.from(`${i}:${o}`).toString("base64");r.authorization=`Basic ${t}`}if(a){const i=await a.getCookieString(t.url.toString());if(De.nonEmptyString(i)){r.cookie=i}}t.prefixUrl="";let l;for(const r of t.hooks.beforeRequest){const i=await r(t);if(!De.undefined(i)){l=()=>i;break}}if(!l){l=t.getRequestFunction()}const c=t.url;this._requestOptions=t.createNativeRequestOptions();if(t.cache){this._requestOptions._request=l;this._requestOptions.cache=t.cache;this._prepareCache(t.cache)}const u=t.cache?this._createCacheableRequest:l;try{let r=u(c,this._requestOptions);if(De.promise(r)){r=await r}if(De.undefined(r)){r=t.getFallbackRequestFunction()(c,this._requestOptions);if(De.promise(r)){r=await r}}if(xt(r)){this._onRequest(r)}else if(this.writable){this.once("finish",(()=>{void this._onResponse(r)}));this._sendBody()}else{void this._onResponse(r)}}catch(t){if(t instanceof He.CacheError){throw new CacheError(t,this)}throw t}}async _error(t){try{for(const r of this.options.hooks.beforeError){t=await r(t)}}catch(r){t=new RequestError(r.message,r,this)}this.destroy(t)}_writeRequest(t,r,i){if(!this._request||this._request.destroyed){return}this._request.write(t,r,(o=>{if(!o){this._uploadedSize+=Me.Buffer.byteLength(t,r);const i=this.uploadProgress;if(i.percent<1){this.emit("uploadProgress",i)}}i(o)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let t;if(this._responseSize){t=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){t=1}else{t=0}return{percent:t,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let t;if(this._bodySize){t=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){t=1}else{t=0}return{percent:t,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}}class types_CancelError extends RequestError{constructor(t){super("Promise was canceled",{},t);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const It=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(t){let r;let i;let o;const a=new re.EventEmitter;const l=new PCancelable(((c,u,h)=>{h((()=>{r.destroy()}));h.shouldReject=false;h((()=>{u(new types_CancelError(r))}));const makeRequest=d=>{h((()=>{}));const p=t??new Request(undefined,undefined,o);p.retryCount=d;p._noPipe=true;r=p;p.once("response",(async t=>{const r=(t.headers["content-encoding"]??"").toLowerCase();const o=r==="gzip"||r==="deflate"||r==="br";const{options:a}=p;if(o&&!a.decompress){t.body=t.rawBody}else{try{t.body=parseBody(t,a.responseType,a.parseJson,a.encoding)}catch(r){t.body=t.rawBody.toString();if(isResponseOk(t)){p._beforeError(r);return}}}try{const r=a.hooks.afterResponse;for(const[i,o]of r.entries()){t=await o(t,(async t=>{a.merge(t);a.prefixUrl="";if(t.url){a.url=t.url}a.hooks.afterResponse=a.hooks.afterResponse.slice(0,i);throw new RetryError(p)}));if(!(De.object(t)&&De.number(t.statusCode)&&!De.nullOrUndefined(t.body))){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(t){p._beforeError(t);return}i=t;if(!isResponseOk(t)){p._beforeError(new HTTPError(t));return}p.destroy();c(p.options.resolveBodyOnly?t.body:t)}));const onError=t=>{if(l.isCanceled){return}const{options:r}=p;if(t instanceof HTTPError&&!r.throwHttpErrors){const{response:r}=t;p.destroy();c(p.options.resolveBodyOnly?r.body:r);return}u(t)};p.once("error",onError);const m=p.options?.body;p.once("retry",((r,i)=>{t=undefined;const a=p.options.body;if(m===a&&De.nodeStream(a)){i.message="Cannot retry with consumed body stream";onError(i);return}o=p.options;makeRequest(r)}));proxyEvents(p,a,It);if(De.undefined(t)){void p.flush()}};makeRequest(0)}));l.on=(t,r)=>{a.on(t,r);return l};const shortcut=t=>{const r=(async()=>{await l;const{options:r}=i.request;return parseBody(i,t,r.parseJson,r.encoding)})();Object.defineProperties(r,Object.getOwnPropertyDescriptors(l));return r};l.json=()=>{if(r.options){const{headers:t}=r.options;if(!r.writableFinished&&!("accept"in t)){t.accept="application/json"}}return shortcut("json")};l.buffer=()=>shortcut("buffer");l.text=()=>shortcut("text");return l}const delay=async t=>new Promise((r=>{setTimeout(r,t)}));const isGotInstance=t=>De.function_(t);const Lt=["get","post","put","patch","head","delete"];const create=t=>{t={options:new Options(undefined,undefined,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults};Object.defineProperty(t,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(r,i,o=t.options)=>{const a=new Request(r,i,o);let l;const lastHandler=t=>{a.options=t;a._noPipe=!t.isStream;void a.flush();if(t.isStream){return a}if(!l){l=asPromise(a)}return l};let c=0;const iterateHandlers=r=>{const i=t.handlers[c++]??lastHandler;const o=i(r,iterateHandlers);if(De.promise(o)&&!a.options.isStream){if(!l){l=asPromise(a)}if(o!==l){const t=Object.getOwnPropertyDescriptors(l);for(const r in t){if(r in o){delete t[r]}}Object.defineProperties(o,t);o.cancel=l.cancel}}return o};return iterateHandlers(a.options)};got.extend=(...r)=>{const i=new Options(undefined,undefined,t.options);const o=[...t.handlers];let a;for(const t of r){if(isGotInstance(t)){i.merge(t.defaults.options);o.push(...t.defaults.handlers);a=t.defaults.mutableDefaults}else{i.merge(t);if(t.handlers){o.push(...t.handlers)}a=t.mutableDefaults}}return create({options:i,handlers:o,mutableDefaults:Boolean(a)})};const paginateEach=async function*(r,i){let o=new Options(r,i,t.options);o.resolveBodyOnly=false;const{pagination:a}=o;De.assert.function_(a.transform);De.assert.function_(a.shouldContinue);De.assert.function_(a.filter);De.assert.function_(a.paginate);De.assert.number(a.countLimit);De.assert.number(a.requestLimit);De.assert.number(a.backoff);const l=[];let{countLimit:c}=a;let u=0;while(u<a.requestLimit){if(u!==0){await delay(a.backoff)}const t=await got(undefined,undefined,o);const r=await a.transform(t);const i=[];De.assert.array(r);for(const t of r){if(a.filter({item:t,currentItems:i,allItems:l})){if(!a.shouldContinue({item:t,currentItems:i,allItems:l})){return}yield t;if(a.stackAllItems){l.push(t)}i.push(t);if(--c<=0){return}}}const h=a.paginate({response:t,currentItems:i,allItems:l});if(h===false){return}if(h===t.request.options){o=t.request.options}else{o.merge(h);De.assert.any([De.urlInstance,De.undefined],h.url);if(h.url!==undefined){o.prefixUrl="";o.url=h.url}}u++}};got.paginate=paginateEach;got.paginate.all=async(t,r)=>{const i=[];for await(const o of paginateEach(t,r)){i.push(o)}return i};got.paginate.each=paginateEach;got.stream=(t,r)=>got(t,{...r,isStream:true});for(const t of Lt){got[t]=(r,i)=>got(r,{...i,method:t});got.stream[t]=(r,i)=>got(r,{...i,method:t,isStream:true})}if(!t.mutableDefaults){Object.freeze(t.handlers);t.options.freeze()}Object.defineProperty(got,"defaults",{value:t,writable:false,configurable:false,enumerable:true});return got};const Dt=create;const Mt={options:new Options,handlers:[],mutableDefaults:false};const Nt=Dt(Mt);const jt=Nt;var Ft=i(2263);var Bt=i(2781);const $t=(0,Fe.promisify)(Bt.Stream.pipeline);async function isUrlOk(t){const r=await jt.head(t).catch((t=>t));return r.statusCode===200}async function getRepoInfo(t,r){const[,i,o,a,l,...c]=t.pathname.split("/");const u=r?r.replace(/^\//,""):c.join("/");if(a===undefined){const t=await jt(`https://api.github.com/repos/${i}/${o}`).catch((t=>t));if(t.statusCode!==200){return}const r=JSON.parse(t.body);return{username:i,name:o,branch:r["default_branch"],filePath:u}}const h=r?`${l}/${c.join("/")}`.replace(new RegExp(`/${u}|/$`),""):l;if(i&&o&&h&&a==="tree"){return{username:i,name:o,branch:h,filePath:u}}}function hasRepo({username:t,name:r,branch:i,filePath:o}){const a=`https://api.github.com/repos/${t}/${r}/contents`;const l=`${o?`/${o}`:""}/package.json`;return isUrlOk(a+l+`?ref=${i}`)}function hasTemplate(t){return isUrlOk(`https://api.github.com/repos/openpatch/hyperbook/contents/templates/${encodeURIComponent(t)}/package.json`)}function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){return $t(jt.stream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),Ft.extract({cwd:t,strip:a?a.split("/").length+1:1},[`${i}-${o}${a?`/${a}`:""}`]))}async function getTemplateInfo(t){let r;if(t){let i;try{i=new URL(t)}catch(t){if(t.code!=="ERR_INVALID_URL"){console.error(t);process.exit(1)}}if(i){if(i.origin!=="https://github.com"){console.error(`Invalid URL: ${k.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}r=await getRepoInfo(i);if(!r){console.error(`Found invalid GitHub URL: ${k.red(`"${t}"`)}. Please fix the URL and try again.`);process.exit(1)}const o=await hasRepo(r);if(!o){console.error(`Could not locate the repository for ${k.red(`"${t}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(t!=="__internal-testing-retry"){const r=await hasTemplate(t);if(!r){console.error(`Could not locate an template named ${k.red(`"${t}"`)}. It could be due to the following:\n`,`1. Your spelling of template ${k.red(`"${t}"`)} might be incorrect.\n`,`2. You might not be connected to the internet.`);process.exit(1)}}}return r}var Ht=i(9449);var Ut=i.n(Ht);function install(t,r,{packageManager:i,isOnline:o,devDependencies:a}){const l=[];const c=[];return new Promise(((u,h)=>{let d;let p=i;const m=i==="yarn";if(r&&r.length){if(m){d=["add","--exact"];if(!o)d.push("--offline");d.push("--cwd",t);if(a)d.push("--dev");d.push(...r)}else{d=["install","--save-exact"];d.push(a?"--save-dev":"--save");d.push(...r)}}else{d=["install"];if(!o){console.log(k.yellow("You appear to be offline."));if(m){console.log(k.yellow("Falling back to the local Yarn cache."));console.log();d.push("--offline")}else{console.log()}}}if(m){d.push(...c)}else{d.push(...l)}const y=X()(p,d,{stdio:"inherit",cwd:z().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});y.on("close",(t=>{if(t!==0){h({command:`${p} ${d.join(" ")}`});return}u()}))}))}var qt=i(9523);var zt=i.n(qt);var Gt=i(7310);var Wt=i.n(Gt);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,J.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}function getOnline(){return new Promise((t=>{zt().lookup("registry.yarnpkg.com",(r=>{if(!r){return t(true)}const i=getProxy();if(!i){return t(false)}const{hostname:o}=Wt().parse(i);if(!o){return t(false)}zt().lookup(o,(r=>{t(r==null)}))}))}))}async function makeSymlink(t,r){return new Promise(((i,o)=>{W().symlink(t,r,(t=>{if(t){o()}else{i()}}))}))}class DownloadError extends Error{}async function runSetup(t,r,i){if(!i){i=process.cwd()}if(!t){const r=await readHyperbook();t=r.template}if(!t){t="https://github.com/openpatch/hyperbook/tree/main/templates/simple"}if(!r){r=await getTemplateInfo(t)}const o=z().join(i,".hyperbook");console.log("Removing old template");Le().sync(o);await makeDir(o);const a=await getOnline();try{if(r){const i=r;console.log(`Downloading files from repo ${k.cyan(t)}. This might take a moment.`);console.log();await Ut()((()=>downloadAndExtractRepo(o,i)),{retries:3})}}catch(t){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(t)?t.message:t+"")}console.log("Installing packages. This might take a couple of minutes.");console.log();await install(o,null,{packageManager:"npm",isOnline:a});console.log();Le().sync(z().join(o,"book"));Le().sync(z().join(o,"public"));Le().sync(z().join(o,"glossary"));Le().sync(z().join(o,"hyperbook.json"));await makeSymlink(z().join(i,"book"),z().join(o,"book"));await makeSymlink(z().join(i,"public"),z().join(o,"public"));await makeSymlink(z().join(i,"glossary"),z().join(o,"glossary"));await makeSymlink(z().join(i,"hyperbook.json"),z().join(o,"hyperbook.json"))}async function runNew({programName:t,bookPath:r,template:o}){if(typeof r==="string"){r=r.trim()}if(!r){const t=await Pe()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){r=t.path.trim()}}if(!r){console.log();console.log("Please specify the book directory:");console.log(` ${k.cyan(t)} ${k.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${k.cyan(t)} ${k.green("my-new-book")}`);console.log();console.log(`Run ${k.cyan(`${t} --help`)} to see all options.`);process.exit(1)}let a=await getTemplateInfo(o);const l=z().resolve(r);if(!await isWriteable(z().dirname(l))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const c=z().basename(l);await makeDir(l);if(!isFolderEmpty(l,c)){process.exit(1)}const u=process.cwd();console.log(`Creating a new hyperbook in ${k.green(l)}.`);console.log();process.chdir(l);const{description:h}=await Pe()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:d}=await Pe()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:p}=await Pe()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:m}=await Pe()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(m==="custom"){const t=await Pe()({type:"text",name:"license",message:"Which custom license you want to use?"});m=t.license}const{language:y}=await Pe()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const g={name:c,version:"0.0.0",description:h,license:m,author:{name:d,url:p},language:y};W().writeFileSync(z().join(l,"hyperbook.json"),JSON.stringify(g,null,2)+te().EOL);console.log();const b=i.ab+"templates";await cpy("default/**",l,{cwd:i.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});await runSetup(o,a,l);if(tryGitInit(l)){console.log("Initialized a git repository.");console.log()}let v;if(z().join(u,c)===r){v=c}else{v=r}console.log(`${k.green("Success!")} Created ${c} at ${r}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(k.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(k.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(k.cyan(" cd"),v);console.log(` ${k.cyan(`hyperbook dev`)}`);console.log()}const Vt=JSON.parse('{"name":"hyperbook","version":"0.5.0","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"},"devDependencies":{"@types/archiver":"^5.3.1","@types/async-retry":"1.4.3","@types/cross-spawn":"6.0.2","@types/prompts":"2.0.14","@types/rimraf":"3.0.2","@types/tar":"6.1.1","@vercel/ncc":"0.33.4","archiver":"^5.3.1","async-retry":"1.3.3","chalk":"5.0.1","commander":"9.2.0","cpy":"9.0.1","cross-spawn":"7.0.3","got":"12.0.4","prompts":"2.4.2","rimraf":"3.0.2","tar":"6.1.11","update-check":"1.5.4"}}');const Yt=new N;Yt.name(Vt.name).version(Vt.version).hook("preAction",(async()=>{await notifyUpdate()}));Yt.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${k.green("<book-directory>")} [options]`).option("-t, --template [name]|[github-url]",`\n A template for your hyperbook. You can use an template name\n from the official hyperbook repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).action((async(t,r)=>{const i=typeof r.template==="string"&&r.template.trim();await runNew({programName:Yt.name(),bookPath:t,template:i}).catch((()=>process.exit(1)))}));Yt.command("dev").description("start the development server for a hyperbook").action((async()=>{await runDev().catch((()=>process.exit(1)))}));Yt.command("setup").description("downloads the latest version of the template of a hyperbook").action((async()=>{await runSetup().catch((()=>process.exit(1)))}));Yt.command("build").description("build a hyperbook").action((async()=>{await runArchive().catch((()=>process.exit(1)));await runBuild().catch((()=>process.exit(1)))}));Yt.command("archive").description("create archives from archives folder").action((async()=>{await runArchive().catch((()=>process.exit(1)))}));Yt.parseAsync(process.argv);const Zt=U()(Vt).catch((()=>null));async function notifyUpdate(){try{const t=await Zt;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(k.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+k.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}},9491:t=>{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2057:t=>{"use strict";t.exports=require("constants")},6113:t=>{"use strict";t.exports=require("crypto")},9523:t=>{"use strict";t.exports=require("dns")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5158:t=>{"use strict";t.exports=require("http2")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},4404:t=>{"use strict";t.exports=require("tls")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},2535:(t,r,i)=>{const{Argument:o}=i(6171);const{Command:a}=i(5736);const{CommanderError:l,InvalidArgumentError:c}=i(5117);const{Help:u}=i(8502);const{Option:h}=i(1836);r=t.exports=new a;r.program=r;r.Argument=o;r.Command=a;r.CommanderError=l;r.Help=u;r.InvalidArgumentError=c;r.InvalidOptionArgumentError=c;r.Option=h},6171:(t,r,i)=>{const{InvalidArgumentError:o}=i(5117);class Argument{constructor(t,r){this.description=r||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const r=t.name()+(t.variadic===true?"...":"");return t.required?"<"+r+">":"["+r+"]"}r.Argument=Argument;r.humanReadableArgName=humanReadableArgName},5736:(t,r,i)=>{const o=i(2361).EventEmitter;const a=i(2081);const l=i(1017);const c=i(7147);const u=i(7282);const{Argument:h,humanReadableArgName:d}=i(6171);const{CommanderError:p}=i(5117);const{Help:m}=i(8502);const{Option:y,splitOptionFlags:g}=i(1836);const{suggestSimilar:b}=i(336);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>u.stdout.write(t),writeErr:t=>u.stderr.write(t),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:undefined,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:undefined,outputError:(t,r)=>r(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,r,i){let o=r;let a=i;if(typeof o==="object"&&o!==null){a=o;o=null}a=a||{};const[,l,c]=t.match(/([^ ]+) *(.*)/);const u=this.createCommand(l);if(o){u.description(o);u._executableHandler=true}if(a.isDefault)this._defaultCommandName=u._name;u._hidden=!!(a.noHelp||a.hidden);u._executableFile=a.executableFile||null;if(c)u.arguments(c);this.commands.push(u);u.parent=this;u.copyInheritedSettings(this);if(o)return this;return u}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new m,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,r){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}r=r||{};if(r.isDefault)this._defaultCommandName=t._name;if(r.noHelp||r.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,r){return new h(t,r)}argument(t,r,i,o){const a=this.createArgument(t,r);if(typeof i==="function"){a.default(o).argParser(i)}else{a.default(i)}this.addArgument(a);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this._args.slice(-1)[0];if(r&&r.variadic){throw new Error(`only the last argument can be variadic '${r.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,r){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=r||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,r){const i=["preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(r)}else{this._lifeCycleHooks[t]=[r]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,r,i){if(this._exitCallback){this._exitCallback(new p(t,r,i))}u.exit(t)}action(t){const listener=r=>{const i=this._args.length;const o=r.slice(0,i);if(this._storeOptionsAsProperties){o[i]=this}else{o[i]=this.opts()}o.push(this);return t.apply(this,o)};this._actionHandler=listener;return this}createOption(t,r){return new y(t,r)}addOption(t){const r=t.name();const i=t.attributeName();if(t.negate){const r=t.long.replace(/^--no-/,"--");if(!this._findOption(r)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const l=this.getOptionValue(i);if(r!==null&&t.parseArg){try{r=t.parseArg(r,l)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}else if(r!==null&&t.variadic){r=t._concatValue(r,l)}if(r==null){if(t.negate){r=false}else if(t.isBoolean()||t.optional){r=true}else{r=""}}this.setOptionValueWithSource(i,r,a)};this.on("option:"+r,(r=>{const i=`error: option '${t.flags}' argument '${r}' is invalid.`;handleOptionValue(r,i,"cli")}));if(t.envVar){this.on("optionEnv:"+r,(r=>{const i=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;handleOptionValue(r,i,"env")}))}return this}_optionEx(t,r,i,o,a){if(typeof r==="object"&&r instanceof y){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const l=this.createOption(r,i);l.makeOptionMandatory(!!t.mandatory);if(typeof o==="function"){l.default(a).argParser(o)}else if(o instanceof RegExp){const t=o;o=(r,i)=>{const o=t.exec(r);return o?o[0]:i};l.default(a).argParser(o)}else{l.default(o)}return this.addOption(l)}option(t,r,i,o){return this._optionEx({},t,r,i,o)}requiredOption(t,r,i,o){return this._optionEx({mandatory:true},t,r,i,o)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}return this}setOptionValueWithSource(t,r,i){this.setOptionValue(t,r);this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}r=r||{};if(t===undefined){t=u.argv;if(u.versions&&u.versions.electron){r.from="electron"}}this.rawArgs=t.slice();let i;switch(r.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(u.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,r){const i=this._prepareUserArgs(t,r);this._parseCommand([],i);return this}async parseAsync(t,r){const i=this._prepareUserArgs(t,r);await this._parseCommand([],i);return this}_executeSubCommand(t,r){r=r.slice();let i=false;const o=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,r){const i=l.resolve(t,r);if(c.existsSync(i))return i;if(o.includes(l.extname(r)))return undefined;const a=o.find((t=>c.existsSync(`${i}${t}`)));if(a)return`${i}${a}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let h=t._executableFile||`${this._name}-${t._name}`;let d=this._executableDir||"";if(this._scriptPath){let t;try{t=c.realpathSync(this._scriptPath)}catch(r){t=this._scriptPath}d=l.resolve(l.dirname(t),d)}if(d){let r=findFile(d,h);if(!r&&!t._executableFile&&this._scriptPath){const i=l.basename(this._scriptPath,l.extname(this._scriptPath));if(i!==this._name){r=findFile(d,`${i}-${t._name}`)}}h=r||h}i=o.includes(l.extname(h));let m;if(u.platform!=="win32"){if(i){r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.argv[0],r,{stdio:"inherit"})}else{m=a.spawn(h,r,{stdio:"inherit"})}}else{r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.execPath,r,{stdio:"inherit"})}if(!m.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{u.on(t,(()=>{if(m.killed===false&&m.exitCode===null){m.kill(t)}}))}))}const y=this._exitCallback;if(!y){m.on("close",u.exit.bind(u))}else{m.on("close",(()=>{y(new p(u.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}m.on("error",(r=>{if(r.code==="ENOENT"){const r=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${h}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${r}`;throw new Error(i)}else if(r.code==="EACCES"){throw new Error(`'${h}' not executable`)}if(!y){u.exit(1)}else{const t=new p(1,"commander.executeSubCommandAsync","(error)");t.nestedError=r;y(t)}}));this.runningCommand=m}_dispatchSubcommand(t,r,i){const o=this._findCommand(t);if(!o)this.help({error:true});if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}_checkNumberOfArguments(){this._args.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){try{o=t.parseArg(r,i)}catch(i){if(i.code==="commander.invalidArgument"){const o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}return o};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(i<this.args.length){o=this.args.slice(i);if(r.parseArg){o=o.reduce(((t,i)=>myParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(i<this.args.length){o=this.args[i];if(r.parseArg){o=myParseArg(r,o,r.defaultValue)}}t[i]=o}));this.processedArgs=t}_chainOrCall(t,r){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>r()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[r]!==undefined)).forEach((t=>{t._lifeCycleHooks[r].forEach((r=>{o.push({hookedCommand:t,callback:r})}))}));if(r==="postAction"){o.reverse()}o.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();t=t.concat(i.operands);r=i.unknown;this.args=t.concat(r);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),r)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const o=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(o,t,r)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(o)){checkForUnknownOptions();this._processArguments();this.parent.emit(o,t,r)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,r)}if(this.listenerCount("command:*")){this.emit("command:*",t,r)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((r=>r._name===t||r._aliases.includes(t)))}_findOption(t){return this.options.find((r=>r.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((r=>{if(r.mandatory&&t.getOptionValue(r.attributeName())===undefined){t.missingMandatoryOptionValue(r)}}))}}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const r=t.attributeName();if(this.getOptionValue(r)===undefined){return false}return this.getOptionValueSource(r)!=="default"}));const r=t.filter((t=>t.conflictsWith.length>0));r.forEach((r=>{const i=t.find((t=>r.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(r,i)}}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent){t._checkForConflictingLocalOptions()}}parseOptions(t){const r=[];const i=[];let o=r;const a=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let l=null;while(a.length){const t=a.shift();if(t==="--"){if(o===i)o.push(t);o.push(...a);break}if(l&&!maybeOption(t)){this.emit(`option:${l.name()}`,t);continue}l=null;if(maybeOption(t)){const r=this._findOption(t);if(r){if(r.required){const t=a.shift();if(t===undefined)this.optionMissingArgument(r);this.emit(`option:${r.name()}`,t)}else if(r.optional){let t=null;if(a.length>0&&!maybeOption(a[0])){t=a.shift()}this.emit(`option:${r.name()}`,t)}else{this.emit(`option:${r.name()}`)}l=r.variadic?r:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const r=this._findOption(`-${t[1]}`);if(r){if(r.required||r.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${r.name()}`,t.slice(2))}else{this.emit(`option:${r.name()}`);a.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const r=t.indexOf("=");const i=this._findOption(t.slice(0,r));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(r+1));continue}}if(maybeOption(t)){o=i}if((this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(t)){r.push(t);if(a.length>0)i.push(...a);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(t);if(a.length>0)r.push(...a);break}else if(this._defaultCommandName){i.push(t);if(a.length>0)i.push(...a);break}}if(this._passThroughOptions){o.push(t);if(a.length>0)o.push(...a);break}o.push(t)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const r=this.options.length;for(let i=0;i<r;i++){const r=this.options[i].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,r)=>Object.assign(t,r.opts())),{})}error(t,r){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=r||{};const o=i.exitCode||1;const a=i.code||"commander.error";this._exit(o,a,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in u.env){const r=t.attributeName();if(this.getOptionValue(r)===undefined||["default","config","env"].includes(this.getOptionValueSource(r))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,u.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}missingArgument(t){const r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){const r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){const findBestOptionFromValue=t=>{const r=t.attributeName();const i=this.getOptionValue(r);const o=this.options.find((t=>t.negate&&r===t.attributeName()));const a=this.options.find((t=>!t.negate&&r===t.attributeName()));if(o&&(o.presetArg===undefined&&i===false||o.presetArg!==undefined&&i===o.presetArg)){return o}return a||t};const getErrorMessage=t=>{const r=findBestOptionFromValue(t);const i=r.attributeName();const o=this.getOptionValueSource(i);if(o==="env"){return`environment variable '${r.envVar}'`}return`option '${r.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let o=this;do{const t=o.createHelp().visibleOptions(o).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);o=o.parent}while(o&&!o._enablePositionalOptions);r=b(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this._args.length;const i=r===1?"":"s";const o=this.parent?` for '${this.name()}'`:"";const a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let r="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));r=b(t,i)}const i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===undefined)return this._version;this._version=t;r=r||"-V, --version";i=i||"output the version number";const o=this.createOption(r,i);this._versionOptionName=o.attributeName();this.options.push(o);this.on("option:"+o.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,r){if(t===undefined&&r===undefined)return this._description;this._description=t;if(r){this._argsDescription=r}return this}alias(t){if(t===undefined)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){r=this.commands[this.commands.length-1]}if(t===r._name)throw new Error("Command alias can't be the same as its name");r._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>d(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=l.basename(t,l.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const r=this.createHelp();if(r.helpWidth===undefined){r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return r.formatHelp(this,r)}_getHelpContext(t){t=t||{};const r={error:!!t.error};let i;if(r.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}r.write=t.write||i;r.command=this;return r}outputHelp(t){let r;if(typeof t==="function"){r=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let o=this.helpInformation(i);if(r){o=r(o);if(typeof o!=="string"&&!Buffer.isBuffer(o)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(o);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=r||this._helpDescription;const i=g(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let r=u.exitCode||0;if(r===0&&t&&typeof t!=="function"&&t.error){r=1}this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const o=`${t}Help`;this.on(o,(t=>{let i;if(typeof r==="function"){i=r({error:t.error,command:t.command})}else{i=r}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,r){const i=t._hasHelpOption&&r.find((r=>r===t._helpLongFlag||r===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let r;let i="127.0.0.1";let o="9229";let a;if((a=t.match(/^(--inspect(-brk)?)$/))!==null){r=a[1]}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){r=a[1];if(/^\d+$/.test(a[3])){o=a[3]}else{i=a[3]}}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){r=a[1];i=a[3];o=a[4]}if(r&&o!=="0"){return`${r}=${i}:${parseInt(o)+1}`}return t}))}function getCommandAndParents(t){const r=[];for(let i=t;i;i=i.parent){r.push(i)}return r}r.Command=Command},5117:(t,r)=>{class CommanderError extends Error{constructor(t,r,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=r;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}r.CommanderError=CommanderError;r.InvalidArgumentError=InvalidArgumentError},8502:(t,r,i)=>{const{humanReadableArgName:o}=i(6171);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,o]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const a=t.createCommand(i).helpOption(false);a.description(t._helpCommandDescription);if(o)a.arguments(o);r.push(a)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const o=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||o){let a;if(!i){a=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!o){a=t.createOption(t._helpShortFlag,t._helpDescription)}else{a=t.createOption(t._helpFlags,t._helpDescription)}r.push(a)}if(this.sortOptions){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");r.sort(((t,r)=>getSortKey(t).localeCompare(getSortKey(r))))}return r}visibleArguments(t){if(t._argsDescription){t._args.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const r=t._args.map((t=>o(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce(((t,i)=>Math.max(t,r.subcommandTerm(i).length)),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce(((t,i)=>Math.max(t,r.optionTerm(i).length)),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce(((t,i)=>Math.max(t,r.argumentTerm(i).length)),0)}commandUsage(t){let r=t._name;if(t._aliases[0]){r=r+"|"+t._aliases[0]}let i="";for(let r=t.parent;r;r=r.parent){i=r.name()+" "+i}return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.description()}optionDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){r.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){r.push(`env: ${t.envVar}`)}if(r.length>0){return`${t.description} (${r.join(", ")})`}return t.description}argumentDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(r.length>0){const i=`(${r.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,r){const i=r.padWidth(t,r);const o=r.helpWidth||80;const a=2;const l=2;function formatItem(t,c){if(c){const u=`${t.padEnd(i+l)}${c}`;return r.wrap(u,o-a,i+l)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(a))}let c=[`Usage: ${r.commandUsage(t)}`,""];const u=r.commandDescription(t);if(u.length>0){c=c.concat([u,""])}const h=r.visibleArguments(t).map((t=>formatItem(r.argumentTerm(t),r.argumentDescription(t))));if(h.length>0){c=c.concat(["Arguments:",formatList(h),""])}const d=r.visibleOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(d.length>0){c=c.concat(["Options:",formatList(d),""])}const p=r.visibleCommands(t).map((t=>formatItem(r.subcommandTerm(t),r.subcommandDescription(t))));if(p.length>0){c=c.concat(["Commands:",formatList(p),""])}return c.join("\n")}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){if(t.match(/[\n]\s+/))return t;const a=r-i;if(a<o)return t;const l=t.slice(0,i);const c=t.slice(i);const u=" ".repeat(i);const h=new RegExp(".{1,"+(a-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g");const d=c.match(h)||[];return l+d.map(((t,r)=>{if(t.slice(-1)==="\n"){t=t.slice(0,t.length-1)}return(r>0?u:"")+t.trimRight()})).join("\n")}}r.Help=Help},1836:(t,r,i)=>{const{InvalidArgumentError:o}=i(5117);class Option{constructor(t,r){this.flags=t;this.description=r||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[]}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}function camelcase(t){return t.split("-").reduce(((t,r)=>t+r[0].toUpperCase()+r.slice(1)))}function splitOptionFlags(t){let r;let i;const o=t.split(/[ |,]+/);if(o.length>1&&!/^[[<]/.test(o[1]))r=o.shift();i=o.shift();if(!r&&/^-[^-]$/.test(i)){r=i;i=undefined}return{shortFlag:r,longFlag:i}}r.Option=Option;r.splitOptionFlags=splitOptionFlags},336:(t,r)=>{const i=3;function editDistance(t,r){if(Math.abs(t.length-r.length)>i)return Math.max(t.length,r.length);const o=[];for(let r=0;r<=t.length;r++){o[r]=[r]}for(let t=0;t<=r.length;t++){o[0][t]=t}for(let i=1;i<=r.length;i++){for(let a=1;a<=t.length;a++){let l=1;if(t[a-1]===r[i-1]){l=0}else{l=1}o[a][i]=Math.min(o[a-1][i]+1,o[a][i-1]+1,o[a-1][i-1]+l);if(a>1&&i>1&&t[a-1]===r[i-2]&&t[a-2]===r[i-1]){o[a][i]=Math.min(o[a][i],o[a-2][i-2]+1)}}}return o[t.length][r.length]}function suggestSimilar(t,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const o=t.startsWith("--");if(o){t=t.slice(2);r=r.map((t=>t.slice(2)))}let a=[];let l=i;const c=.4;r.forEach((r=>{if(r.length<=1)return;const i=editDistance(t,r);const o=Math.max(t.length,r.length);const u=(o-i)/o;if(u>c){if(i<l){l=i;a=[r]}else if(i===l){a.push(r)}}}));a.sort(((t,r)=>t.localeCompare(r)));if(o){a=a.map((t=>`--${t}`))}if(a.length>1){return`\n(Did you mean one of ${a.join(", ")}?)`}if(a.length===1){return`\n(Did you mean ${a[0]}?)`}return""}r.suggestSimilar=suggestSimilar}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var l=true;try{t[i].call(a.exports,a,a.exports,__nccwpck_require__);l=false}finally{if(l)delete r[i]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(1663);module.exports=i})();
|