#!/usr/bin/env node (()=>{var t={2038:(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},3813:(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},8041:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(8185);const a=i(4073);const c=i(5812);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)}},8185:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(4585);const a=i(6116);const c=i(3813);const l=i(1989);const u=i(9142);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)}},9142:(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},4073:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(4585);const a=i(3813);const c=i(1989);const l=i(9142);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},5812:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(4585);const c=i(2038);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},9994:(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},1989:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(9994);r.fs=o},3834:(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},4585:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(1334);const a=i(8208);const c=i(3786);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)}},1334:(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)}},8208:(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},3786:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3834);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},4734:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(9458);const a=i(2479);const c=i(3444);const l=i(5317);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)}},9458:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(5045);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)}},2479:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9955);const a=i(5045);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},3444:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(6143);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},5045:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(8041);const c=i(7255);const l=i(1036);const u=i(5874);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},1036:(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},5874:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1036);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},6143:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8041);const a=i(1036);const c=i(5874);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},5317:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(8041);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},2836:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.formatNames=r.fastFormats=r.fullFormats=void 0;function fmtDef(t,r){return{validate:t,compare:r}}r.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),"date-time":fmtDef(getDateTime(true),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};r.fastFormats={...r.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};r.formatNames=Object.keys(r.fullFormats);function isLeapYear(t){return t%4===0&&(t%100!==0||t%400===0)}const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(t){const r=i.exec(t);if(!r)return false;const a=+r[1];const c=+r[2];const l=+r[3];return c>=1&&c<=12&&l>=1&&l<=(c===2&&isLeapYear(a)?29:o[c])}function compareDate(t,r){if(!(t&&r))return undefined;if(t>r)return 1;if(t23||p>59||t&&!u)return false;if(o<=23&&c<=59&&l<60)return true;const m=c-p*h;const g=o-d*h-(m<0?1:0);return(g===23||g===-1)&&(m===59||m===-1)&&l<61}}function compareTime(t,r){if(!(t&&r))return undefined;const i=new Date("2020-01-01T"+t).valueOf();const o=new Date("2020-01-01T"+r).valueOf();if(!(i&&o))return undefined;return i-o}function compareIsoTime(t,r){if(!(t&&r))return undefined;const i=a.exec(t);const o=a.exec(r);if(!(i&&o))return undefined;t=i[1]+i[2]+i[3];r=o[1]+o[2]+o[3];if(t>r)return 1;if(t=d}function validateInt64(t){return Number.isInteger(t)}function validateNumber(){return true}const m=/[^\\]\\Z/;function regex(t){if(m.test(t))return false;try{new RegExp(t);return true}catch(t){return false}}},8735:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2836);const a=i(5153);const c=i(1644);const l=new c.Name("fullFormats");const u=new c.Name("fastFormats");const formatsPlugin=(t,r={keywords:true})=>{if(Array.isArray(r)){addFormats(t,r,o.fullFormats,l);return t}const[i,c]=r.mode==="fast"?[o.fastFormats,u]:[o.fullFormats,l];const h=r.formats||o.formatNames;addFormats(t,h,i,c);if(r.keywords)(0,a.default)(t);return t};formatsPlugin.get=(t,r="full")=>{const i=r==="fast"?o.fastFormats:o.fullFormats;const a=i[t];if(!a)throw new Error(`Unknown format "${t}"`);return a};function addFormats(t,r,i,o){var a;var l;(a=(l=t.opts.code).formats)!==null&&a!==void 0?a:l.formats=(0,c._)`require("ajv-formats/dist/formats").${o}`;for(const o of r)t.addFormat(o,i[o])}t.exports=r=formatsPlugin;Object.defineProperty(r,"__esModule",{value:true});r["default"]=formatsPlugin},5153:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.formatLimitDefinition=void 0;const o=i(3678);const a=i(1644);const c=a.operators;const l={formatMaximum:{okStr:"<=",ok:c.LTE,fail:c.GT},formatMinimum:{okStr:">=",ok:c.GTE,fail:c.LT},formatExclusiveMaximum:{okStr:"<",ok:c.LT,fail:c.GTE},formatExclusiveMinimum:{okStr:">",ok:c.GT,fail:c.LTE}};const u={message:({keyword:t,schemaCode:r})=>(0,a.str)`should be ${l[t].okStr} ${r}`,params:({keyword:t,schemaCode:r})=>(0,a._)`{comparison: ${l[t].okStr}, limit: ${r}}`};r.formatLimitDefinition={keyword:Object.keys(l),type:"string",schemaType:"string",$data:true,error:u,code(t){const{gen:r,data:i,schemaCode:c,keyword:u,it:h}=t;const{opts:d,self:p}=h;if(!d.validateFormats)return;const m=new o.KeywordCxt(h,p.RULES.all.format.definition,"format");if(m.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const i=r.scopeValue("formats",{ref:p.formats,code:d.code.formats});const o=r.const("fmt",(0,a._)`${i}[${m.schemaCode}]`);t.fail$data((0,a.or)((0,a._)`typeof ${o} != "object"`,(0,a._)`${o} instanceof RegExp`,(0,a._)`typeof ${o}.compare != "function"`,compareCode(o)))}function validateFormat(){const i=m.schema;const o=p.formats[i];if(!o||o===true)return;if(typeof o!="object"||o instanceof RegExp||typeof o.compare!="function"){throw new Error(`"${u}": format "${i}" does not define "compare" function`)}const c=r.scopeValue("formats",{key:i,ref:o,code:d.code.formats?(0,a._)`${d.code.formats}${(0,a.getProperty)(i)}`:undefined});t.fail$data(compareCode(c))}function compareCode(t){return(0,a._)`${t}.compare(${i}, ${c}) ${l[u].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=t=>{t.addKeyword(r.formatLimitDefinition);return t};r["default"]=formatLimitPlugin},8018:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv2020=void 0;const o=i(6549);const a=i(5221);const c=i(5032);const l=i(5203);const u="https://json-schema.org/draft/2020-12/schema";class Ajv2020 extends o.default{constructor(t={}){super({...t,dynamicRef:true,next:true,unevaluated:true})}_addVocabularies(){super._addVocabularies();a.default.forEach((t=>this.addVocabulary(t)));if(this.opts.discriminator)this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:t,meta:r}=this.opts;if(!r)return;l.default.call(this,t);this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:undefined)}}r.Ajv2020=Ajv2020;t.exports=r=Ajv2020;t.exports.Ajv2020=Ajv2020;Object.defineProperty(r,"__esModule",{value:true});r["default"]=Ajv2020;var h=i(8403);Object.defineProperty(r,"KeywordCxt",{enumerable:true,get:function(){return h.KeywordCxt}});var d=i(1644);Object.defineProperty(r,"_",{enumerable:true,get:function(){return d._}});Object.defineProperty(r,"str",{enumerable:true,get:function(){return d.str}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return d.stringify}});Object.defineProperty(r,"nil",{enumerable:true,get:function(){return d.nil}});Object.defineProperty(r,"Name",{enumerable:true,get:function(){return d.Name}});Object.defineProperty(r,"CodeGen",{enumerable:true,get:function(){return d.CodeGen}});var p=i(1282);Object.defineProperty(r,"ValidationError",{enumerable:true,get:function(){return p.default}});var m=i(5963);Object.defineProperty(r,"MissingRefError",{enumerable:true,get:function(){return m.default}})},3678:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv=void 0;const o=i(6549);const a=i(7750);const c=i(5032);const l=i(5137);const u=["/properties"];const h="http://json-schema.org/draft-07/schema";class Ajv extends o.default{_addVocabularies(){super._addVocabularies();a.default.forEach((t=>this.addVocabulary(t)));if(this.opts.discriminator)this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(l,u):l;this.addMetaSchema(t,h,false);this.refs["http://json-schema.org/schema"]=h}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(h)?h:undefined)}}r.Ajv=Ajv;t.exports=r=Ajv;t.exports.Ajv=Ajv;Object.defineProperty(r,"__esModule",{value:true});r["default"]=Ajv;var d=i(8403);Object.defineProperty(r,"KeywordCxt",{enumerable:true,get:function(){return d.KeywordCxt}});var p=i(1644);Object.defineProperty(r,"_",{enumerable:true,get:function(){return p._}});Object.defineProperty(r,"str",{enumerable:true,get:function(){return p.str}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return p.stringify}});Object.defineProperty(r,"nil",{enumerable:true,get:function(){return p.nil}});Object.defineProperty(r,"Name",{enumerable:true,get:function(){return p.Name}});Object.defineProperty(r,"CodeGen",{enumerable:true,get:function(){return p.CodeGen}});var m=i(1282);Object.defineProperty(r,"ValidationError",{enumerable:true,get:function(){return m.default}});var g=i(5963);Object.defineProperty(r,"MissingRefError",{enumerable:true,get:function(){return g.default}})},4271:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.regexpCode=r.getEsmExportName=r.getProperty=r.safeStringify=r.stringify=r.strConcat=r.addCodeArg=r.str=r._=r.nil=r._Code=r.Name=r.IDENTIFIER=r._CodeOrName=void 0;class _CodeOrName{}r._CodeOrName=_CodeOrName;r.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(t){super();if(!r.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}r.Name=Name;class _Code extends _CodeOrName{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce(((t,r)=>`${t}${r}`),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce(((t,r)=>{if(r instanceof Name)t[r.str]=(t[r.str]||0)+1;return t}),{})}}r._Code=_Code;r.nil=new _Code("");function _(t,...r){const i=[t[0]];let o=0;while(o{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.or=r.and=r.not=r.CodeGen=r.operators=r.varKinds=r.ValueScopeName=r.ValueScope=r.Scope=r.Name=r.regexpCode=r.stringify=r.getProperty=r.nil=r.strConcat=r.str=r._=void 0;const o=i(4271);const a=i(816);var c=i(4271);Object.defineProperty(r,"_",{enumerable:true,get:function(){return c._}});Object.defineProperty(r,"str",{enumerable:true,get:function(){return c.str}});Object.defineProperty(r,"strConcat",{enumerable:true,get:function(){return c.strConcat}});Object.defineProperty(r,"nil",{enumerable:true,get:function(){return c.nil}});Object.defineProperty(r,"getProperty",{enumerable:true,get:function(){return c.getProperty}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return c.stringify}});Object.defineProperty(r,"regexpCode",{enumerable:true,get:function(){return c.regexpCode}});Object.defineProperty(r,"Name",{enumerable:true,get:function(){return c.Name}});var l=i(816);Object.defineProperty(r,"Scope",{enumerable:true,get:function(){return l.Scope}});Object.defineProperty(r,"ValueScope",{enumerable:true,get:function(){return l.ValueScope}});Object.defineProperty(r,"ValueScopeName",{enumerable:true,get:function(){return l.ValueScopeName}});Object.defineProperty(r,"varKinds",{enumerable:true,get:function(){return l.varKinds}});r.operators={GT:new o._Code(">"),GTE:new o._Code(">="),LT:new o._Code("<"),LTE:new o._Code("<="),EQ:new o._Code("==="),NEQ:new o._Code("!=="),NOT:new o._Code("!"),OR:new o._Code("||"),AND:new o._Code("&&"),ADD:new o._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(t,r){return this}}class Def extends Node{constructor(t,r,i){super();this.varKind=t;this.name=r;this.rhs=i}render({es5:t,_n:r}){const i=t?a.varKinds.var:this.varKind;const o=this.rhs===undefined?"":` = ${this.rhs}`;return`${i} ${this.name}${o};`+r}optimizeNames(t,r){if(!t[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,t,r);return this}get names(){return this.rhs instanceof o._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(t,r,i){super();this.lhs=t;this.rhs=r;this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(this.lhs instanceof o.Name&&!t[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,t,r);return this}get names(){const t=this.lhs instanceof o.Name?{}:{...this.lhs.names};return addExprNames(t,this.rhs)}}class AssignOp extends Assign{constructor(t,r,i,o){super(t,i,o);this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class Label extends Node{constructor(t){super();this.label=t;this.names={}}render({_n:t}){return`${this.label}:`+t}}class Break extends Node{constructor(t){super();this.label=t;this.names={}}render({_n:t}){const r=this.label?` ${this.label}`:"";return`break${r};`+t}}class Throw extends Node{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class AnyCode extends Node{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(t,r){this.code=optimizeExpr(this.code,t,r);return this}get names(){return this.code instanceof o._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce(((r,i)=>r+i.render(t)),"")}optimizeNodes(){const{nodes:t}=this;let r=t.length;while(r--){const i=t[r].optimizeNodes();if(Array.isArray(i))t.splice(r,1,...i);else if(i)t[r]=i;else t.splice(r,1)}return t.length>0?this:undefined}optimizeNames(t,r){const{nodes:i}=this;let o=i.length;while(o--){const a=i[o];if(a.optimizeNames(t,r))continue;subtractNames(t,a.names);i.splice(o,1)}return i.length>0?this:undefined}get names(){return this.nodes.reduce(((t,r)=>addNames(t,r.names)),{})}}class BlockNode extends ParentNode{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(t,r){super(r);this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);if(this.else)r+="else "+this.else.render(t);return r}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(t===true)return this.nodes;let r=this.else;if(r){const t=r.optimizeNodes();r=this.else=Array.isArray(t)?new Else(t):t}if(r){if(t===false)return r instanceof If?r:r.nodes;if(this.nodes.length)return this;return new If(not(t),r instanceof If?[r]:r.nodes)}if(t===false||!this.nodes.length)return undefined;return this}optimizeNames(t,r){var i;this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(t,r);if(!(super.optimizeNames(t,r)||this.else))return;this.condition=optimizeExpr(this.condition,t,r);return this}get names(){const t=super.names;addExprNames(t,this.condition);if(this.else)addNames(t,this.else.names);return t}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iteration=optimizeExpr(this.iteration,t,r);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(t,r,i,o){super();this.varKind=t;this.name=r;this.from=i;this.to=o}render(t){const r=t.es5?a.varKinds.var:this.varKind;const{name:i,from:o,to:c}=this;return`for(${r} ${i}=${o}; ${i}<${c}; ${i}++)`+super.render(t)}get names(){const t=addExprNames(super.names,this.from);return addExprNames(t,this.to)}}class ForIter extends For{constructor(t,r,i,o){super();this.loop=t;this.varKind=r;this.name=i;this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iterable=optimizeExpr(this.iterable,t,r);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(t,r,i){super();this.name=t;this.args=r;this.async=i}render(t){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(t)}}Func.kind="func";class Return extends ParentNode{render(t){return"return "+super.render(t)}}Return.kind="return";class Try extends BlockNode{render(t){let r="try"+super.render(t);if(this.catch)r+=this.catch.render(t);if(this.finally)r+=this.finally.render(t);return r}optimizeNodes(){var t,r;super.optimizeNodes();(t=this.catch)===null||t===void 0?void 0:t.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(t,r){var i,o;super.optimizeNames(t,r);(i=this.catch)===null||i===void 0?void 0:i.optimizeNames(t,r);(o=this.finally)===null||o===void 0?void 0:o.optimizeNames(t,r);return this}get names(){const t=super.names;if(this.catch)addNames(t,this.catch.names);if(this.finally)addNames(t,this.finally.names);return t}}class Catch extends BlockNode{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}Catch.kind="catch";class Finally extends BlockNode{render(t){return"finally"+super.render(t)}}Finally.kind="finally";class CodeGen{constructor(t,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=t;this._scope=new a.Scope({parent:t});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){const i=this._extScope.value(t,r);const o=this._values[i.prefix]||(this._values[i.prefix]=new Set);o.add(i);return i}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,i,o){const a=this._scope.toName(r);if(i!==undefined&&o)this._constants[a.str]=i;this._leafNode(new Def(t,a,i));return a}const(t,r,i){return this._def(a.varKinds.const,t,r,i)}let(t,r,i){return this._def(a.varKinds.let,t,r,i)}var(t,r,i){return this._def(a.varKinds.var,t,r,i)}assign(t,r,i){return this._leafNode(new Assign(t,r,i))}add(t,i){return this._leafNode(new AssignOp(t,r.operators.ADD,i))}code(t){if(typeof t=="function")t();else if(t!==o.nil)this._leafNode(new AnyCode(t));return this}object(...t){const r=["{"];for(const[i,a]of t){if(r.length>1)r.push(",");r.push(i);if(i!==a||this.opts.es5){r.push(":");(0,o.addCodeArg)(r,a)}}r.push("}");return new o._Code(r)}if(t,r,i){this._blockNode(new If(t));if(r&&i){this.code(r).else().code(i).endIf()}else if(r){this.code(r).endIf()}else if(i){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(t){return this._elseNode(new If(t))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(t,r){this._blockNode(t);if(r)this.code(r).endFor();return this}for(t,r){return this._for(new ForLoop(t),r)}forRange(t,r,i,o,c=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const l=this._scope.toName(t);return this._for(new ForRange(c,l,r,i),(()=>o(l)))}forOf(t,r,i,c=a.varKinds.const){const l=this._scope.toName(t);if(this.opts.es5){const t=r instanceof o.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,o._)`${t}.length`,(r=>{this.var(l,(0,o._)`${t}[${r}]`);i(l)}))}return this._for(new ForIter("of",c,l,r),(()=>i(l)))}forIn(t,r,i,c=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(t,(0,o._)`Object.keys(${r})`,i)}const l=this._scope.toName(t);return this._for(new ForIter("in",c,l,r),(()=>i(l)))}endFor(){return this._endBlockNode(For)}label(t){return this._leafNode(new Label(t))}break(t){return this._leafNode(new Break(t))}return(t){const r=new Return;this._blockNode(r);this.code(t);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(t,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const o=new Try;this._blockNode(o);this.code(t);if(r){const t=this.name("e");this._currNode=o.catch=new Catch(t);r(t)}if(i){this._currNode=o.finally=new Finally;this.code(i)}return this._endBlockNode(Catch,Finally)}throw(t){return this._leafNode(new Throw(t))}block(t,r){this._blockStarts.push(this._nodes.length);if(t)this.code(t).endBlock(r);return this}endBlock(t){const r=this._blockStarts.pop();if(r===undefined)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-r;if(i<0||t!==undefined&&i!==t){throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`)}this._nodes.length=r;return this}func(t,r=o.nil,i,a){this._blockNode(new Func(t,r,i));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(t=1){while(t-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(t){this._currNode.nodes.push(t);return this}_blockNode(t){this._currNode.nodes.push(t);this._nodes.push(t)}_endBlockNode(t,r){const i=this._currNode;if(i instanceof t||r&&i instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){const r=this._currNode;if(!(r instanceof If)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=t;return this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const r=this._nodes;r[r.length-1]=t}}r.CodeGen=CodeGen;function addNames(t,r){for(const i in r)t[i]=(t[i]||0)+(r[i]||0);return t}function addExprNames(t,r){return r instanceof o._CodeOrName?addNames(t,r.names):t}function optimizeExpr(t,r,i){if(t instanceof o.Name)return replaceName(t);if(!canOptimize(t))return t;return new o._Code(t._items.reduce(((t,r)=>{if(r instanceof o.Name)r=replaceName(r);if(r instanceof o._Code)t.push(...r._items);else t.push(r);return t}),[]));function replaceName(t){const o=i[t.str];if(o===undefined||r[t.str]!==1)return t;delete r[t.str];return o}function canOptimize(t){return t instanceof o._Code&&t._items.some((t=>t instanceof o.Name&&r[t.str]===1&&i[t.str]!==undefined))}}function subtractNames(t,r){for(const i in r)t[i]=(t[i]||0)-(r[i]||0)}function not(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,o._)`!${par(t)}`}r.not=not;const u=mappend(r.operators.AND);function and(...t){return t.reduce(u)}r.and=and;const h=mappend(r.operators.OR);function or(...t){return t.reduce(h)}r.or=or;function mappend(t){return(r,i)=>r===o.nil?i:i===o.nil?r:(0,o._)`${par(r)} ${t} ${par(i)}`}function par(t){return t instanceof o.Name?t:(0,o._)`(${t})`}},816:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.ValueScope=r.ValueScopeName=r.Scope=r.varKinds=r.UsedValueState=void 0;const o=i(4271);class ValueError extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}}var a;(function(t){t[t["Started"]=0]="Started";t[t["Completed"]=1]="Completed"})(a||(r.UsedValueState=a={}));r.varKinds={const:new o.Name("const"),let:new o.Name("let"),var:new o.Name("var")};class Scope{constructor({prefixes:t,parent:r}={}){this._names={};this._prefixes=t;this._parent=r}toName(t){return t instanceof o.Name?t:this.name(t)}name(t){return new o.Name(this._newName(t))}_newName(t){const r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,i;if(((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0?void 0:i.has(t))||this._prefixes&&!this._prefixes.has(t)){throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`)}return this._names[t]={prefix:t,index:0}}}r.Scope=Scope;class ValueScopeName extends o.Name{constructor(t,r){super(r);this.prefix=t}setValue(t,{property:r,itemIndex:i}){this.value=t;this.scopePath=(0,o._)`.${new o.Name(r)}[${i}]`}}r.ValueScopeName=ValueScopeName;const c=(0,o._)`\n`;class ValueScope extends Scope{constructor(t){super(t);this._values={};this._scope=t.scope;this.opts={...t,_n:t.lines?c:o.nil}}get(){return this._scope}name(t){return new ValueScopeName(t,this._newName(t))}value(t,r){var i;if(r.ref===undefined)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(t);const{prefix:a}=o;const c=(i=r.key)!==null&&i!==void 0?i:r.ref;let l=this._values[a];if(l){const t=l.get(c);if(t)return t}else{l=this._values[a]=new Map}l.set(c,o);const u=this._scope[a]||(this._scope[a]=[]);const h=u.length;u[h]=r.ref;o.setValue(r,{property:a,itemIndex:h});return o}getValue(t,r){const i=this._values[t];if(!i)return;return i.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,(r=>{if(r.scopePath===undefined)throw new Error(`CodeGen: name "${r}" has no value`);return(0,o._)`${t}${r.scopePath}`}))}scopeCode(t=this._values,r,i){return this._reduceValues(t,(t=>{if(t.value===undefined)throw new Error(`CodeGen: name "${t}" has no value`);return t.value.code}),r,i)}_reduceValues(t,i,c={},l){let u=o.nil;for(const h in t){const d=t[h];if(!d)continue;const p=c[h]=c[h]||new Map;d.forEach((t=>{if(p.has(t))return;p.set(t,a.Started);let c=i(t);if(c){const i=this.opts.es5?r.varKinds.var:r.varKinds.const;u=(0,o._)`${u}${i} ${t} = ${c};${this.opts._n}`}else if(c=l===null||l===void 0?void 0:l(t)){u=(0,o._)`${u}${c}${this.opts._n}`}else{throw new ValueError(t)}p.set(t,a.Completed)}))}return u}}r.ValueScope=ValueScope},9281:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.extendErrors=r.resetErrorsCount=r.reportExtraError=r.reportError=r.keyword$DataError=r.keywordError=void 0;const o=i(1644);const a=i(146);const c=i(2597);r.keywordError={message:({keyword:t})=>(0,o.str)`must pass "${t}" keyword validation`};r.keyword$DataError={message:({keyword:t,schemaType:r})=>r?(0,o.str)`"${t}" keyword must be ${r} ($data)`:(0,o.str)`"${t}" keyword is invalid ($data)`};function reportError(t,i=r.keywordError,a,c){const{it:l}=t;const{gen:u,compositeRule:h,allErrors:d}=l;const p=errorObjectCode(t,i,a);if(c!==null&&c!==void 0?c:h||d){addError(u,p)}else{returnErrors(l,(0,o._)`[${p}]`)}}r.reportError=reportError;function reportExtraError(t,i=r.keywordError,o){const{it:a}=t;const{gen:l,compositeRule:u,allErrors:h}=a;const d=errorObjectCode(t,i,o);addError(l,d);if(!(u||h)){returnErrors(a,c.default.vErrors)}}r.reportExtraError=reportExtraError;function resetErrorsCount(t,r){t.assign(c.default.errors,r);t.if((0,o._)`${c.default.vErrors} !== null`,(()=>t.if(r,(()=>t.assign((0,o._)`${c.default.vErrors}.length`,r)),(()=>t.assign(c.default.vErrors,null)))))}r.resetErrorsCount=resetErrorsCount;function extendErrors({gen:t,keyword:r,schemaValue:i,data:a,errsCount:l,it:u}){if(l===undefined)throw new Error("ajv implementation error");const h=t.name("err");t.forRange("i",l,c.default.errors,(l=>{t.const(h,(0,o._)`${c.default.vErrors}[${l}]`);t.if((0,o._)`${h}.instancePath === undefined`,(()=>t.assign((0,o._)`${h}.instancePath`,(0,o.strConcat)(c.default.instancePath,u.errorPath))));t.assign((0,o._)`${h}.schemaPath`,(0,o.str)`${u.errSchemaPath}/${r}`);if(u.opts.verbose){t.assign((0,o._)`${h}.schema`,i);t.assign((0,o._)`${h}.data`,a)}}))}r.extendErrors=extendErrors;function addError(t,r){const i=t.const("err",r);t.if((0,o._)`${c.default.vErrors} === null`,(()=>t.assign(c.default.vErrors,(0,o._)`[${i}]`)),(0,o._)`${c.default.vErrors}.push(${i})`);t.code((0,o._)`${c.default.errors}++`)}function returnErrors(t,r){const{gen:i,validateName:a,schemaEnv:c}=t;if(c.$async){i.throw((0,o._)`new ${t.ValidationError}(${r})`)}else{i.assign((0,o._)`${a}.errors`,r);i.return(false)}}const l={keyword:new o.Name("keyword"),schemaPath:new o.Name("schemaPath"),params:new o.Name("params"),propertyName:new o.Name("propertyName"),message:new o.Name("message"),schema:new o.Name("schema"),parentSchema:new o.Name("parentSchema")};function errorObjectCode(t,r,i){const{createErrors:a}=t.it;if(a===false)return(0,o._)`{}`;return errorObject(t,r,i)}function errorObject(t,r,i={}){const{gen:o,it:a}=t;const c=[errorInstancePath(a,i),errorSchemaPath(t,i)];extraErrorProps(t,r,c);return o.object(...c)}function errorInstancePath({errorPath:t},{instancePath:r}){const i=r?(0,o.str)`${t}${(0,a.getErrorPath)(r,a.Type.Str)}`:t;return[c.default.instancePath,(0,o.strConcat)(c.default.instancePath,i)]}function errorSchemaPath({keyword:t,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:c}){let u=c?r:(0,o.str)`${r}/${t}`;if(i){u=(0,o.str)`${u}${(0,a.getErrorPath)(i,a.Type.Str)}`}return[l.schemaPath,u]}function extraErrorProps(t,{params:r,message:i},a){const{keyword:u,data:h,schemaValue:d,it:p}=t;const{opts:m,propertyName:g,topSchemaRef:y,schemaPath:v}=p;a.push([l.keyword,u],[l.params,typeof r=="function"?r(t):r||(0,o._)`{}`]);if(m.messages){a.push([l.message,typeof i=="function"?i(t):i])}if(m.verbose){a.push([l.schema,d],[l.parentSchema,(0,o._)`${y}${v}`],[c.default.data,h])}if(g)a.push([l.propertyName,g])}},2705:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.resolveSchema=r.getCompilingSchema=r.resolveRef=r.compileSchema=r.SchemaEnv=void 0;const o=i(1644);const a=i(1282);const c=i(2597);const l=i(2101);const u=i(146);const h=i(8403);class SchemaEnv{constructor(t){var r;this.refs={};this.dynamicAnchors={};let i;if(typeof t.schema=="object")i=t.schema;this.schema=t.schema;this.schemaId=t.schemaId;this.root=t.root||this;this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,l.normalizeId)(i===null||i===void 0?void 0:i[t.schemaId||"$id"]);this.schemaPath=t.schemaPath;this.localRefs=t.localRefs;this.meta=t.meta;this.$async=i===null||i===void 0?void 0:i.$async;this.refs={}}}r.SchemaEnv=SchemaEnv;function compileSchema(t){const r=getCompilingSchema.call(this,t);if(r)return r;const i=(0,l.getFullPath)(this.opts.uriResolver,t.root.baseId);const{es5:u,lines:d}=this.opts.code;const{ownProperties:p}=this.opts;const m=new o.CodeGen(this.scope,{es5:u,lines:d,ownProperties:p});let g;if(t.$async){g=m.scopeValue("Error",{ref:a.default,code:(0,o._)`require("ajv/dist/runtime/validation_error").default`})}const y=m.scopeName("validate");t.validateName=y;const v={gen:m,allErrors:this.opts.allErrors,data:c.default.data,parentData:c.default.parentData,parentDataProperty:c.default.parentDataProperty,dataNames:[c.default.data],dataPathArr:[o.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:m.scopeValue("schema",this.opts.code.source===true?{ref:t.schema,code:(0,o.stringify)(t.schema)}:{ref:t.schema}),validateName:y,ValidationError:g,schema:t.schema,schemaEnv:t,rootId:i,baseId:t.baseId||i,schemaPath:o.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,o._)`""`,opts:this.opts,self:this};let b;try{this._compilations.add(t);(0,h.validateFunctionCode)(v);m.optimize(this.opts.code.optimize);const r=m.toString();b=`${m.scopeRefs(c.default.scope)}return ${r}`;if(this.opts.code.process)b=this.opts.code.process(b,t);const i=new Function(`${c.default.self}`,`${c.default.scope}`,b);const a=i(this,this.scope.get());this.scope.value(y,{ref:a});a.errors=null;a.schema=t.schema;a.schemaEnv=t;if(t.$async)a.$async=true;if(this.opts.code.source===true){a.source={validateName:y,validateCode:r,scopeValues:m._values}}if(this.opts.unevaluated){const{props:t,items:r}=v;a.evaluated={props:t instanceof o.Name?undefined:t,items:r instanceof o.Name?undefined:r,dynamicProps:t instanceof o.Name,dynamicItems:r instanceof o.Name};if(a.source)a.source.evaluated=(0,o.stringify)(a.evaluated)}t.validate=a;return t}catch(r){delete t.validate;delete t.validateName;if(b)this.logger.error("Error compiling schema, function code:",b);throw r}finally{this._compilations.delete(t)}}r.compileSchema=compileSchema;function resolveRef(t,r,i){var o;i=(0,l.resolveUrl)(this.opts.uriResolver,r,i);const a=t.refs[i];if(a)return a;let c=resolve.call(this,t,i);if(c===undefined){const a=(o=t.localRefs)===null||o===void 0?void 0:o[i];const{schemaId:l}=this.opts;if(a)c=new SchemaEnv({schema:a,schemaId:l,root:t,baseId:r})}if(c===undefined)return;return t.refs[i]=inlineOrCompile.call(this,c)}r.resolveRef=resolveRef;function inlineOrCompile(t){if((0,l.inlineRef)(t.schema,this.opts.inlineRefs))return t.schema;return t.validate?t:compileSchema.call(this,t)}function getCompilingSchema(t){for(const r of this._compilations){if(sameSchemaEnv(r,t))return r}}r.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(t,r){return t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId}function resolve(t,r){let i;while(typeof(i=this.refs[r])=="string")r=i;return i||this.schemas[r]||resolveSchema.call(this,t,r)}function resolveSchema(t,r){const i=this.opts.uriResolver.parse(r);const o=(0,l._getFullPath)(this.opts.uriResolver,i);let a=(0,l.getFullPath)(this.opts.uriResolver,t.baseId,undefined);if(Object.keys(t.schema).length>0&&o===a){return getJsonPointer.call(this,i,t)}const c=(0,l.normalizeId)(o);const u=this.refs[c]||this.schemas[c];if(typeof u=="string"){const r=resolveSchema.call(this,t,u);if(typeof(r===null||r===void 0?void 0:r.schema)!=="object")return;return getJsonPointer.call(this,i,r)}if(typeof(u===null||u===void 0?void 0:u.schema)!=="object")return;if(!u.validate)compileSchema.call(this,u);if(c===(0,l.normalizeId)(r)){const{schema:r}=u;const{schemaId:i}=this.opts;const o=r[i];if(o)a=(0,l.resolveUrl)(this.opts.uriResolver,a,o);return new SchemaEnv({schema:r,schemaId:i,root:t,baseId:a})}return getJsonPointer.call(this,i,u)}r.resolveSchema=resolveSchema;const d=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(t,{baseId:r,schema:i,root:o}){var a;if(((a=t.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(const o of t.fragment.slice(1).split("/")){if(typeof i==="boolean")return;const t=i[(0,u.unescapeFragment)(o)];if(t===undefined)return;i=t;const a=typeof i==="object"&&i[this.opts.schemaId];if(!d.has(o)&&a){r=(0,l.resolveUrl)(this.opts.uriResolver,r,a)}}let c;if(typeof i!="boolean"&&i.$ref&&!(0,u.schemaHasRulesButRef)(i,this.RULES)){const t=(0,l.resolveUrl)(this.opts.uriResolver,r,i.$ref);c=resolveSchema.call(this,o,t)}const{schemaId:h}=this.opts;c=c||new SchemaEnv({schema:i,schemaId:h,root:o,baseId:r});if(c.schema!==c.root.schema)return c;return undefined}},2597:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a={data:new o.Name("data"),valCxt:new o.Name("valCxt"),instancePath:new o.Name("instancePath"),parentData:new o.Name("parentData"),parentDataProperty:new o.Name("parentDataProperty"),rootData:new o.Name("rootData"),dynamicAnchors:new o.Name("dynamicAnchors"),vErrors:new o.Name("vErrors"),errors:new o.Name("errors"),this:new o.Name("this"),self:new o.Name("self"),scope:new o.Name("scope"),json:new o.Name("json"),jsonPos:new o.Name("jsonPos"),jsonLen:new o.Name("jsonLen"),jsonPart:new o.Name("jsonPart")};r["default"]=a},5963:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2101);class MissingRefError extends Error{constructor(t,r,i,a){super(a||`can't resolve reference ${i} from id ${r}`);this.missingRef=(0,o.resolveUrl)(t,r,i);this.missingSchema=(0,o.normalizeId)((0,o.getFullPath)(t,this.missingRef))}}r["default"]=MissingRefError},2101:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getSchemaRefs=r.resolveUrl=r.normalizeId=r._getFullPath=r.getFullPath=r.inlineRef=void 0;const o=i(146);const a=i(6688);const c=i(1567);const l=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(t,r=true){if(typeof t=="boolean")return true;if(r===true)return!hasRef(t);if(!r)return false;return countKeys(t)<=r}r.inlineRef=inlineRef;const u=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(t){for(const r in t){if(u.has(r))return true;const i=t[r];if(Array.isArray(i)&&i.some(hasRef))return true;if(typeof i=="object"&&hasRef(i))return true}return false}function countKeys(t){let r=0;for(const i in t){if(i==="$ref")return Infinity;r++;if(l.has(i))continue;if(typeof t[i]=="object"){(0,o.eachItem)(t[i],(t=>r+=countKeys(t)))}if(r===Infinity)return Infinity}return r}function getFullPath(t,r="",i){if(i!==false)r=normalizeId(r);const o=t.parse(r);return _getFullPath(t,o)}r.getFullPath=getFullPath;function _getFullPath(t,r){const i=t.serialize(r);return i.split("#")[0]+"#"}r._getFullPath=_getFullPath;const h=/#\/?$/;function normalizeId(t){return t?t.replace(h,""):""}r.normalizeId=normalizeId;function resolveUrl(t,r,i){i=normalizeId(i);return t.resolve(r,i)}r.resolveUrl=resolveUrl;const d=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(t,r){if(typeof t=="boolean")return{};const{schemaId:i,uriResolver:o}=this.opts;const l=normalizeId(t[i]||r);const u={"":l};const h=getFullPath(o,l,false);const p={};const m=new Set;c(t,{allKeys:true},((t,r,o,a)=>{if(a===undefined)return;const c=h+r;let l=u[a];if(typeof t[i]=="string")l=addRef.call(this,t[i]);addAnchor.call(this,t.$anchor);addAnchor.call(this,t.$dynamicAnchor);u[r]=l;function addRef(r){const i=this.opts.uriResolver.resolve;r=normalizeId(l?i(l,r):r);if(m.has(r))throw ambiguos(r);m.add(r);let o=this.refs[r];if(typeof o=="string")o=this.refs[o];if(typeof o=="object"){checkAmbiguosRef(t,o.schema,r)}else if(r!==normalizeId(c)){if(r[0]==="#"){checkAmbiguosRef(t,p[r],r);p[r]=t}else{this.refs[r]=c}}return r}function addAnchor(t){if(typeof t=="string"){if(!d.test(t))throw new Error(`invalid anchor "${t}"`);addRef.call(this,`#${t}`)}}}));return p;function checkAmbiguosRef(t,r,i){if(r!==undefined&&!a(t,r))throw ambiguos(i)}function ambiguos(t){return new Error(`reference "${t}" resolves to more than one schema`)}}r.getSchemaRefs=getSchemaRefs},2326:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getRules=r.isJSONType=void 0;const i=["string","number","integer","boolean","null","object","array"];const o=new Set(i);function isJSONType(t){return typeof t=="string"&&o.has(t)}r.isJSONType=isJSONType;function getRules(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:true,boolean:true,null:true},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}r.getRules=getRules},146:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.checkStrictMode=r.getErrorPath=r.Type=r.useFunc=r.setEvaluated=r.evaluatedPropsToName=r.mergeEvaluated=r.eachItem=r.unescapeJsonPointer=r.escapeJsonPointer=r.escapeFragment=r.unescapeFragment=r.schemaRefOrVal=r.schemaHasRulesButRef=r.schemaHasRules=r.checkUnknownRules=r.alwaysValidSchema=r.toHash=void 0;const o=i(1644);const a=i(4271);function toHash(t){const r={};for(const i of t)r[i]=true;return r}r.toHash=toHash;function alwaysValidSchema(t,r){if(typeof r=="boolean")return r;if(Object.keys(r).length===0)return true;checkUnknownRules(t,r);return!schemaHasRules(r,t.self.RULES.all)}r.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(t,r=t.schema){const{opts:i,self:o}=t;if(!i.strictSchema)return;if(typeof r==="boolean")return;const a=o.RULES.keywords;for(const i in r){if(!a[i])checkStrictMode(t,`unknown keyword: "${i}"`)}}r.checkUnknownRules=checkUnknownRules;function schemaHasRules(t,r){if(typeof t=="boolean")return!t;for(const i in t)if(r[i])return true;return false}r.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(t,r){if(typeof t=="boolean")return!t;for(const i in t)if(i!=="$ref"&&r.all[i])return true;return false}r.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:t,schemaPath:r},i,a,c){if(!c){if(typeof i=="number"||typeof i=="boolean")return i;if(typeof i=="string")return(0,o._)`${i}`}return(0,o._)`${t}${r}${(0,o.getProperty)(a)}`}r.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(t){return unescapeJsonPointer(decodeURIComponent(t))}r.unescapeFragment=unescapeFragment;function escapeFragment(t){return encodeURIComponent(escapeJsonPointer(t))}r.escapeFragment=escapeFragment;function escapeJsonPointer(t){if(typeof t=="number")return`${t}`;return t.replace(/~/g,"~0").replace(/\//g,"~1")}r.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}r.unescapeJsonPointer=unescapeJsonPointer;function eachItem(t,r){if(Array.isArray(t)){for(const i of t)r(i)}else{r(t)}}r.eachItem=eachItem;function makeMergeEvaluated({mergeNames:t,mergeToName:r,mergeValues:i,resultToName:a}){return(c,l,u,h)=>{const d=u===undefined?l:u instanceof o.Name?(l instanceof o.Name?t(c,l,u):r(c,l,u),u):l instanceof o.Name?(r(c,u,l),l):i(l,u);return h===o.Name&&!(d instanceof o.Name)?a(c,d):d}}r.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(t,r,i)=>t.if((0,o._)`${i} !== true && ${r} !== undefined`,(()=>{t.if((0,o._)`${r} === true`,(()=>t.assign(i,true)),(()=>t.assign(i,(0,o._)`${i} || {}`).code((0,o._)`Object.assign(${i}, ${r})`)))})),mergeToName:(t,r,i)=>t.if((0,o._)`${i} !== true`,(()=>{if(r===true){t.assign(i,true)}else{t.assign(i,(0,o._)`${i} || {}`);setEvaluated(t,i,r)}})),mergeValues:(t,r)=>t===true?true:{...t,...r},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(t,r,i)=>t.if((0,o._)`${i} !== true && ${r} !== undefined`,(()=>t.assign(i,(0,o._)`${r} === true ? true : ${i} > ${r} ? ${i} : ${r}`))),mergeToName:(t,r,i)=>t.if((0,o._)`${i} !== true`,(()=>t.assign(i,r===true?true:(0,o._)`${i} > ${r} ? ${i} : ${r}`))),mergeValues:(t,r)=>t===true?true:Math.max(t,r),resultToName:(t,r)=>t.var("items",r)})};function evaluatedPropsToName(t,r){if(r===true)return t.var("props",true);const i=t.var("props",(0,o._)`{}`);if(r!==undefined)setEvaluated(t,i,r);return i}r.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(t,r,i){Object.keys(i).forEach((i=>t.assign((0,o._)`${r}${(0,o.getProperty)(i)}`,true)))}r.setEvaluated=setEvaluated;const c={};function useFunc(t,r){return t.scopeValue("func",{ref:r,code:c[r.code]||(c[r.code]=new a._Code(r.code))})}r.useFunc=useFunc;var l;(function(t){t[t["Num"]=0]="Num";t[t["Str"]=1]="Str"})(l||(r.Type=l={}));function getErrorPath(t,r,i){if(t instanceof o.Name){const a=r===l.Num;return i?a?(0,o._)`"[" + ${t} + "]"`:(0,o._)`"['" + ${t} + "']"`:a?(0,o._)`"/" + ${t}`:(0,o._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,o.getProperty)(t).toString():"/"+escapeJsonPointer(t)}r.getErrorPath=getErrorPath;function checkStrictMode(t,r,i=t.opts.strictSchema){if(!i)return;r=`strict mode: ${r}`;if(i===true)throw new Error(r);t.self.logger.warn(r)}r.checkStrictMode=checkStrictMode},595:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.shouldUseRule=r.shouldUseGroup=r.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:t,self:r},i){const o=r.RULES.types[i];return o&&o!==true&&shouldUseGroup(t,o)}r.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(t,r){return r.rules.some((r=>shouldUseRule(t,r)))}r.shouldUseGroup=shouldUseGroup;function shouldUseRule(t,r){var i;return t[r.keyword]!==undefined||((i=r.definition.implements)===null||i===void 0?void 0:i.some((r=>t[r]!==undefined)))}r.shouldUseRule=shouldUseRule},7348:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.boolOrEmptySchema=r.topBoolOrEmptySchema=void 0;const o=i(9281);const a=i(1644);const c=i(2597);const l={message:"boolean schema is false"};function topBoolOrEmptySchema(t){const{gen:r,schema:i,validateName:o}=t;if(i===false){falseSchemaError(t,false)}else if(typeof i=="object"&&i.$async===true){r.return(c.default.data)}else{r.assign((0,a._)`${o}.errors`,null);r.return(true)}}r.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(t,r){const{gen:i,schema:o}=t;if(o===false){i.var(r,false);falseSchemaError(t)}else{i.var(r,true)}}r.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(t,r){const{gen:i,data:a}=t;const c={gen:i,keyword:"false schema",data:a,schema:false,schemaCode:false,schemaValue:false,params:{},it:t};(0,o.reportError)(c,l,undefined,r)}},582:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.reportTypeError=r.checkDataTypes=r.checkDataType=r.coerceAndCheckDataType=r.getJSONTypes=r.getSchemaTypes=r.DataType=void 0;const o=i(2326);const a=i(595);const c=i(9281);const l=i(1644);const u=i(146);var h;(function(t){t[t["Correct"]=0]="Correct";t[t["Wrong"]=1]="Wrong"})(h||(r.DataType=h={}));function getSchemaTypes(t){const r=getJSONTypes(t.type);const i=r.includes("null");if(i){if(t.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!r.length&&t.nullable!==undefined){throw new Error('"nullable" cannot be used without "type"')}if(t.nullable===true)r.push("null")}return r}r.getSchemaTypes=getSchemaTypes;function getJSONTypes(t){const r=Array.isArray(t)?t:t?[t]:[];if(r.every(o.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}r.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(t,r){const{gen:i,data:o,opts:c}=t;const l=coerceToTypes(r,c.coerceTypes);const u=r.length>0&&!(l.length===0&&r.length===1&&(0,a.schemaHasRulesForType)(t,r[0]));if(u){const a=checkDataTypes(r,o,c.strictNumbers,h.Wrong);i.if(a,(()=>{if(l.length)coerceData(t,r,l);else reportTypeError(t)}))}return u}r.coerceAndCheckDataType=coerceAndCheckDataType;const d=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(t,r){return r?t.filter((t=>d.has(t)||r==="array"&&t==="array")):[]}function coerceData(t,r,i){const{gen:o,data:a,opts:c}=t;const u=o.let("dataType",(0,l._)`typeof ${a}`);const h=o.let("coerced",(0,l._)`undefined`);if(c.coerceTypes==="array"){o.if((0,l._)`${u} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>o.assign(a,(0,l._)`${a}[0]`).assign(u,(0,l._)`typeof ${a}`).if(checkDataTypes(r,a,c.strictNumbers),(()=>o.assign(h,a)))))}o.if((0,l._)`${h} !== undefined`);for(const t of i){if(d.has(t)||t==="array"&&c.coerceTypes==="array"){coerceSpecificType(t)}}o.else();reportTypeError(t);o.endIf();o.if((0,l._)`${h} !== undefined`,(()=>{o.assign(a,h);assignParentData(t,h)}));function coerceSpecificType(t){switch(t){case"string":o.elseIf((0,l._)`${u} == "number" || ${u} == "boolean"`).assign(h,(0,l._)`"" + ${a}`).elseIf((0,l._)`${a} === null`).assign(h,(0,l._)`""`);return;case"number":o.elseIf((0,l._)`${u} == "boolean" || ${a} === null || (${u} == "string" && ${a} && ${a} == +${a})`).assign(h,(0,l._)`+${a}`);return;case"integer":o.elseIf((0,l._)`${u} === "boolean" || ${a} === null || (${u} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(h,(0,l._)`+${a}`);return;case"boolean":o.elseIf((0,l._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(h,false).elseIf((0,l._)`${a} === "true" || ${a} === 1`).assign(h,true);return;case"null":o.elseIf((0,l._)`${a} === "" || ${a} === 0 || ${a} === false`);o.assign(h,null);return;case"array":o.elseIf((0,l._)`${u} === "string" || ${u} === "number" || ${u} === "boolean" || ${a} === null`).assign(h,(0,l._)`[${a}]`)}}}function assignParentData({gen:t,parentData:r,parentDataProperty:i},o){t.if((0,l._)`${r} !== undefined`,(()=>t.assign((0,l._)`${r}[${i}]`,o)))}function checkDataType(t,r,i,o=h.Correct){const a=o===h.Correct?l.operators.EQ:l.operators.NEQ;let c;switch(t){case"null":return(0,l._)`${r} ${a} null`;case"array":c=(0,l._)`Array.isArray(${r})`;break;case"object":c=(0,l._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`;break;case"integer":c=numCond((0,l._)`!(${r} % 1) && !isNaN(${r})`);break;case"number":c=numCond();break;default:return(0,l._)`typeof ${r} ${a} ${t}`}return o===h.Correct?c:(0,l.not)(c);function numCond(t=l.nil){return(0,l.and)((0,l._)`typeof ${r} == "number"`,t,i?(0,l._)`isFinite(${r})`:l.nil)}}r.checkDataType=checkDataType;function checkDataTypes(t,r,i,o){if(t.length===1){return checkDataType(t[0],r,i,o)}let a;const c=(0,u.toHash)(t);if(c.array&&c.object){const t=(0,l._)`typeof ${r} != "object"`;a=c.null?t:(0,l._)`!${r} || ${t}`;delete c.null;delete c.array;delete c.object}else{a=l.nil}if(c.number)delete c.integer;for(const t in c)a=(0,l.and)(a,checkDataType(t,r,i,o));return a}r.checkDataTypes=checkDataTypes;const p={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:r})=>typeof t=="string"?(0,l._)`{type: ${t}}`:(0,l._)`{type: ${r}}`};function reportTypeError(t){const r=getTypeErrorContext(t);(0,c.reportError)(r,p)}r.reportTypeError=reportTypeError;function getTypeErrorContext(t){const{gen:r,data:i,schema:o}=t;const a=(0,u.schemaRefOrVal)(t,o,"type");return{gen:r,keyword:"type",data:i,schema:o.type,schemaCode:a,schemaValue:a,parentSchema:o,params:{},it:t}}},6019:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.assignDefaults=void 0;const o=i(1644);const a=i(146);function assignDefaults(t,r){const{properties:i,items:o}=t.schema;if(r==="object"&&i){for(const r in i){assignDefault(t,r,i[r].default)}}else if(r==="array"&&Array.isArray(o)){o.forEach(((r,i)=>assignDefault(t,i,r.default)))}}r.assignDefaults=assignDefaults;function assignDefault(t,r,i){const{gen:c,compositeRule:l,data:u,opts:h}=t;if(i===undefined)return;const d=(0,o._)`${u}${(0,o.getProperty)(r)}`;if(l){(0,a.checkStrictMode)(t,`default is ignored for: ${d}`);return}let p=(0,o._)`${d} === undefined`;if(h.useDefaults==="empty"){p=(0,o._)`${p} || ${d} === null || ${d} === ""`}c.if(p,(0,o._)`${d} = ${(0,o.stringify)(i)}`)}},8403:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getData=r.KeywordCxt=r.validateFunctionCode=void 0;const o=i(7348);const a=i(582);const c=i(595);const l=i(582);const u=i(6019);const h=i(9910);const d=i(9362);const p=i(1644);const m=i(2597);const g=i(2101);const y=i(146);const v=i(9281);function validateFunctionCode(t){if(isSchemaObj(t)){checkKeywords(t);if(schemaCxtHasRules(t)){topSchemaObjCode(t);return}}validateFunction(t,(()=>(0,o.topBoolOrEmptySchema)(t)))}r.validateFunctionCode=validateFunctionCode;function validateFunction({gen:t,validateName:r,schema:i,schemaEnv:o,opts:a},c){if(a.code.es5){t.func(r,(0,p._)`${m.default.data}, ${m.default.valCxt}`,o.$async,(()=>{t.code((0,p._)`"use strict"; ${funcSourceUrl(i,a)}`);destructureValCxtES5(t,a);t.code(c)}))}else{t.func(r,(0,p._)`${m.default.data}, ${destructureValCxt(a)}`,o.$async,(()=>t.code(funcSourceUrl(i,a)).code(c)))}}function destructureValCxt(t){return(0,p._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${t.dynamicRef?(0,p._)`, ${m.default.dynamicAnchors}={}`:p.nil}}={}`}function destructureValCxtES5(t,r){t.if(m.default.valCxt,(()=>{t.var(m.default.instancePath,(0,p._)`${m.default.valCxt}.${m.default.instancePath}`);t.var(m.default.parentData,(0,p._)`${m.default.valCxt}.${m.default.parentData}`);t.var(m.default.parentDataProperty,(0,p._)`${m.default.valCxt}.${m.default.parentDataProperty}`);t.var(m.default.rootData,(0,p._)`${m.default.valCxt}.${m.default.rootData}`);if(r.dynamicRef)t.var(m.default.dynamicAnchors,(0,p._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)}),(()=>{t.var(m.default.instancePath,(0,p._)`""`);t.var(m.default.parentData,(0,p._)`undefined`);t.var(m.default.parentDataProperty,(0,p._)`undefined`);t.var(m.default.rootData,m.default.data);if(r.dynamicRef)t.var(m.default.dynamicAnchors,(0,p._)`{}`)}))}function topSchemaObjCode(t){const{schema:r,opts:i,gen:o}=t;validateFunction(t,(()=>{if(i.$comment&&r.$comment)commentKeyword(t);checkNoDefault(t);o.let(m.default.vErrors,null);o.let(m.default.errors,0);if(i.unevaluated)resetEvaluated(t);typeAndKeywords(t);returnResults(t)}));return}function resetEvaluated(t){const{gen:r,validateName:i}=t;t.evaluated=r.const("evaluated",(0,p._)`${i}.evaluated`);r.if((0,p._)`${t.evaluated}.dynamicProps`,(()=>r.assign((0,p._)`${t.evaluated}.props`,(0,p._)`undefined`)));r.if((0,p._)`${t.evaluated}.dynamicItems`,(()=>r.assign((0,p._)`${t.evaluated}.items`,(0,p._)`undefined`)))}function funcSourceUrl(t,r){const i=typeof t=="object"&&t[r.schemaId];return i&&(r.code.source||r.code.process)?(0,p._)`/*# sourceURL=${i} */`:p.nil}function subschemaCode(t,r){if(isSchemaObj(t)){checkKeywords(t);if(schemaCxtHasRules(t)){subSchemaObjCode(t,r);return}}(0,o.boolOrEmptySchema)(t,r)}function schemaCxtHasRules({schema:t,self:r}){if(typeof t=="boolean")return!t;for(const i in t)if(r.RULES.all[i])return true;return false}function isSchemaObj(t){return typeof t.schema!="boolean"}function subSchemaObjCode(t,r){const{schema:i,gen:o,opts:a}=t;if(a.$comment&&i.$comment)commentKeyword(t);updateContext(t);checkAsyncSchema(t);const c=o.const("_errs",m.default.errors);typeAndKeywords(t,c);o.var(r,(0,p._)`${c} === ${m.default.errors}`)}function checkKeywords(t){(0,y.checkUnknownRules)(t);checkRefsAndKeywords(t)}function typeAndKeywords(t,r){if(t.opts.jtd)return schemaKeywords(t,[],false,r);const i=(0,a.getSchemaTypes)(t.schema);const o=(0,a.coerceAndCheckDataType)(t,i);schemaKeywords(t,i,!o,r)}function checkRefsAndKeywords(t){const{schema:r,errSchemaPath:i,opts:o,self:a}=t;if(r.$ref&&o.ignoreKeywordsWithRef&&(0,y.schemaHasRulesButRef)(r,a.RULES)){a.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}}function checkNoDefault(t){const{schema:r,opts:i}=t;if(r.default!==undefined&&i.useDefaults&&i.strictSchema){(0,y.checkStrictMode)(t,"default is ignored in the schema root")}}function updateContext(t){const r=t.schema[t.opts.schemaId];if(r)t.baseId=(0,g.resolveUrl)(t.opts.uriResolver,t.baseId,r)}function checkAsyncSchema(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function commentKeyword({gen:t,schemaEnv:r,schema:i,errSchemaPath:o,opts:a}){const c=i.$comment;if(a.$comment===true){t.code((0,p._)`${m.default.self}.logger.log(${c})`)}else if(typeof a.$comment=="function"){const i=(0,p.str)`${o}/$comment`;const a=t.scopeValue("root",{ref:r.root});t.code((0,p._)`${m.default.self}.opts.$comment(${c}, ${i}, ${a}.schema)`)}}function returnResults(t){const{gen:r,schemaEnv:i,validateName:o,ValidationError:a,opts:c}=t;if(i.$async){r.if((0,p._)`${m.default.errors} === 0`,(()=>r.return(m.default.data)),(()=>r.throw((0,p._)`new ${a}(${m.default.vErrors})`)))}else{r.assign((0,p._)`${o}.errors`,m.default.vErrors);if(c.unevaluated)assignEvaluated(t);r.return((0,p._)`${m.default.errors} === 0`)}}function assignEvaluated({gen:t,evaluated:r,props:i,items:o}){if(i instanceof p.Name)t.assign((0,p._)`${r}.props`,i);if(o instanceof p.Name)t.assign((0,p._)`${r}.items`,o)}function schemaKeywords(t,r,i,o){const{gen:a,schema:u,data:h,allErrors:d,opts:g,self:v}=t;const{RULES:b}=v;if(u.$ref&&(g.ignoreKeywordsWithRef||!(0,y.schemaHasRulesButRef)(u,b))){a.block((()=>keywordCode(t,"$ref",b.all.$ref.definition)));return}if(!g.jtd)checkStrictTypes(t,r);a.block((()=>{for(const t of b.rules)groupKeywords(t);groupKeywords(b.post)}));function groupKeywords(y){if(!(0,c.shouldUseGroup)(u,y))return;if(y.type){a.if((0,l.checkDataType)(y.type,h,g.strictNumbers));iterateKeywords(t,y);if(r.length===1&&r[0]===y.type&&i){a.else();(0,l.reportTypeError)(t)}a.endIf()}else{iterateKeywords(t,y)}if(!d)a.if((0,p._)`${m.default.errors} === ${o||0}`)}}function iterateKeywords(t,r){const{gen:i,schema:o,opts:{useDefaults:a}}=t;if(a)(0,u.assignDefaults)(t,r.type);i.block((()=>{for(const i of r.rules){if((0,c.shouldUseRule)(o,i)){keywordCode(t,i.keyword,i.definition,r.type)}}}))}function checkStrictTypes(t,r){if(t.schemaEnv.meta||!t.opts.strictTypes)return;checkContextTypes(t,r);if(!t.opts.allowUnionTypes)checkMultipleTypes(t,r);checkKeywordTypes(t,t.dataTypes)}function checkContextTypes(t,r){if(!r.length)return;if(!t.dataTypes.length){t.dataTypes=r;return}r.forEach((r=>{if(!includesType(t.dataTypes,r)){strictTypesError(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}}));narrowSchemaTypes(t,r)}function checkMultipleTypes(t,r){if(r.length>1&&!(r.length===2&&r.includes("null"))){strictTypesError(t,"use allowUnionTypes to allow union type keyword")}}function checkKeywordTypes(t,r){const i=t.self.RULES.all;for(const o in i){const a=i[o];if(typeof a=="object"&&(0,c.shouldUseRule)(t.schema,a)){const{type:i}=a.definition;if(i.length&&!i.some((t=>hasApplicableType(r,t)))){strictTypesError(t,`missing type "${i.join(",")}" for keyword "${o}"`)}}}}function hasApplicableType(t,r){return t.includes(r)||r==="number"&&t.includes("integer")}function includesType(t,r){return t.includes(r)||r==="integer"&&t.includes("number")}function narrowSchemaTypes(t,r){const i=[];for(const o of t.dataTypes){if(includesType(r,o))i.push(o);else if(r.includes("integer")&&o==="number")i.push("integer")}t.dataTypes=i}function strictTypesError(t,r){const i=t.schemaEnv.baseId+t.errSchemaPath;r+=` at "${i}" (strictTypes)`;(0,y.checkStrictMode)(t,r,t.opts.strictTypes)}class KeywordCxt{constructor(t,r,i){(0,h.validateKeywordUsage)(t,r,i);this.gen=t.gen;this.allErrors=t.allErrors;this.keyword=i;this.data=t.data;this.schema=t.schema[i];this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data;this.schemaValue=(0,y.schemaRefOrVal)(t,this.schema,i,this.$data);this.schemaType=r.schemaType;this.parentSchema=t.schema;this.params={};this.it=t;this.def=r;if(this.$data){this.schemaCode=t.gen.const("vSchema",getData(this.$data,t))}else{this.schemaCode=this.schemaValue;if(!(0,h.validSchemaType)(this.schema,r.schemaType,r.allowUndefined)){throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`)}}if("code"in r?r.trackErrors:r.errors!==false){this.errsCount=t.gen.const("_errs",m.default.errors)}}result(t,r,i){this.failResult((0,p.not)(t),r,i)}failResult(t,r,i){this.gen.if(t);if(i)i();else this.error();if(r){this.gen.else();r();if(this.allErrors)this.gen.endIf()}else{if(this.allErrors)this.gen.endIf();else this.gen.else()}}pass(t,r){this.failResult((0,p.not)(t),undefined,r)}fail(t){if(t===undefined){this.error();if(!this.allErrors)this.gen.if(false);return}this.gen.if(t);this.error();if(this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,p._)`${r} !== undefined && (${(0,p.or)(this.invalid$data(),t)})`)}error(t,r,i){if(r){this.setParams(r);this._error(t,i);this.setParams({});return}this._error(t,i)}_error(t,r){(t?v.reportExtraError:v.reportError)(this,this.def.error,r)}$dataError(){(0,v.reportError)(this,this.def.$dataError||v.keyword$DataError)}reset(){if(this.errsCount===undefined)throw new Error('add "trackErrors" to keyword definition');(0,v.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,r){if(r)Object.assign(this.params,t);else this.params=t}block$data(t,r,i=p.nil){this.gen.block((()=>{this.check$data(t,i);r()}))}check$data(t=p.nil,r=p.nil){if(!this.$data)return;const{gen:i,schemaCode:o,schemaType:a,def:c}=this;i.if((0,p.or)((0,p._)`${o} === undefined`,r));if(t!==p.nil)i.assign(t,true);if(a.length||c.validateSchema){i.elseIf(this.invalid$data());this.$dataError();if(t!==p.nil)i.assign(t,false)}i.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:i,def:o,it:a}=this;return(0,p.or)(wrong$DataType(),invalid$DataSchema());function wrong$DataType(){if(i.length){if(!(r instanceof p.Name))throw new Error("ajv implementation error");const t=Array.isArray(i)?i:[i];return(0,p._)`${(0,l.checkDataTypes)(t,r,a.opts.strictNumbers,l.DataType.Wrong)}`}return p.nil}function invalid$DataSchema(){if(o.validateSchema){const i=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,p._)`!${i}(${r})`}return p.nil}}subschema(t,r){const i=(0,d.getSubschema)(this.it,t);(0,d.extendSubschemaData)(i,this.it,t);(0,d.extendSubschemaMode)(i,t);const o={...this.it,...i,items:undefined,props:undefined};subschemaCode(o,r);return o}mergeEvaluated(t,r){const{it:i,gen:o}=this;if(!i.opts.unevaluated)return;if(i.props!==true&&t.props!==undefined){i.props=y.mergeEvaluated.props(o,t.props,i.props,r)}if(i.items!==true&&t.items!==undefined){i.items=y.mergeEvaluated.items(o,t.items,i.items,r)}}mergeValidEvaluated(t,r){const{it:i,gen:o}=this;if(i.opts.unevaluated&&(i.props!==true||i.items!==true)){o.if(r,(()=>this.mergeEvaluated(t,p.Name)));return true}}}r.KeywordCxt=KeywordCxt;function keywordCode(t,r,i,o){const a=new KeywordCxt(t,i,r);if("code"in i){i.code(a,o)}else if(a.$data&&i.validate){(0,h.funcKeywordCode)(a,i)}else if("macro"in i){(0,h.macroKeywordCode)(a,i)}else if(i.compile||i.validate){(0,h.funcKeywordCode)(a,i)}}const b=/^\/(?:[^~]|~0|~1)*$/;const w=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(t,{dataLevel:r,dataNames:i,dataPathArr:o}){let a;let c;if(t==="")return m.default.rootData;if(t[0]==="/"){if(!b.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);a=t;c=m.default.rootData}else{const l=w.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);const u=+l[1];a=l[2];if(a==="#"){if(u>=r)throw new Error(errorMsg("property/index",u));return o[r-u]}if(u>r)throw new Error(errorMsg("data",u));c=i[r-u];if(!a)return c}let l=c;const u=a.split("/");for(const t of u){if(t){c=(0,p._)`${c}${(0,p.getProperty)((0,y.unescapeJsonPointer)(t))}`;l=(0,p._)`${l} && ${c}`}}return l;function errorMsg(t,i){return`Cannot access ${t} ${i} levels up, current level is ${r}`}}r.getData=getData},9910:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.validateKeywordUsage=r.validSchemaType=r.funcKeywordCode=r.macroKeywordCode=void 0;const o=i(1644);const a=i(2597);const c=i(77);const l=i(9281);function macroKeywordCode(t,r){const{gen:i,keyword:a,schema:c,parentSchema:l,it:u}=t;const h=r.macro.call(u.self,c,l,u);const d=useKeyword(i,a,h);if(u.opts.validateSchema!==false)u.self.validateSchema(h,true);const p=i.name("valid");t.subschema({schema:h,schemaPath:o.nil,errSchemaPath:`${u.errSchemaPath}/${a}`,topSchemaRef:d,compositeRule:true},p);t.pass(p,(()=>t.error(true)))}r.macroKeywordCode=macroKeywordCode;function funcKeywordCode(t,r){var i;const{gen:l,keyword:u,schema:h,parentSchema:d,$data:p,it:m}=t;checkAsyncKeyword(m,r);const g=!p&&r.compile?r.compile.call(m.self,h,d,m):r.validate;const y=useKeyword(l,u,g);const v=l.let("valid");t.block$data(v,validateKeyword);t.ok((i=r.valid)!==null&&i!==void 0?i:v);function validateKeyword(){if(r.errors===false){assignValid();if(r.modifying)modifyData(t);reportErrs((()=>t.error()))}else{const i=r.async?validateAsync():validateSync();if(r.modifying)modifyData(t);reportErrs((()=>addErrs(t,i)))}}function validateAsync(){const t=l.let("ruleErrs",null);l.try((()=>assignValid((0,o._)`await `)),(r=>l.assign(v,false).if((0,o._)`${r} instanceof ${m.ValidationError}`,(()=>l.assign(t,(0,o._)`${r}.errors`)),(()=>l.throw(r)))));return t}function validateSync(){const t=(0,o._)`${y}.errors`;l.assign(t,null);assignValid(o.nil);return t}function assignValid(i=(r.async?(0,o._)`await `:o.nil)){const u=m.opts.passContext?a.default.this:a.default.self;const h=!("compile"in r&&!p||r.schema===false);l.assign(v,(0,o._)`${i}${(0,c.callValidateCode)(t,y,u,h)}`,r.modifying)}function reportErrs(t){var i;l.if((0,o.not)((i=r.valid)!==null&&i!==void 0?i:v),t)}}r.funcKeywordCode=funcKeywordCode;function modifyData(t){const{gen:r,data:i,it:a}=t;r.if(a.parentData,(()=>r.assign(i,(0,o._)`${a.parentData}[${a.parentDataProperty}]`)))}function addErrs(t,r){const{gen:i}=t;i.if((0,o._)`Array.isArray(${r})`,(()=>{i.assign(a.default.vErrors,(0,o._)`${a.default.vErrors} === null ? ${r} : ${a.default.vErrors}.concat(${r})`).assign(a.default.errors,(0,o._)`${a.default.vErrors}.length`);(0,l.extendErrors)(t)}),(()=>t.error()))}function checkAsyncKeyword({schemaEnv:t},r){if(r.async&&!t.$async)throw new Error("async keyword in sync schema")}function useKeyword(t,r,i){if(i===undefined)throw new Error(`keyword "${r}" failed to compile`);return t.scopeValue("keyword",typeof i=="function"?{ref:i}:{ref:i,code:(0,o.stringify)(i)})}function validSchemaType(t,r,i=false){return!r.length||r.some((r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||i&&typeof t=="undefined"))}r.validSchemaType=validSchemaType;function validateKeywordUsage({schema:t,opts:r,self:i,errSchemaPath:o},a,c){if(Array.isArray(a.keyword)?!a.keyword.includes(c):a.keyword!==c){throw new Error("ajv implementation error")}const l=a.dependencies;if(l===null||l===void 0?void 0:l.some((r=>!Object.prototype.hasOwnProperty.call(t,r)))){throw new Error(`parent schema must have dependencies of ${c}: ${l.join(",")}`)}if(a.validateSchema){const l=a.validateSchema(t[c]);if(!l){const t=`keyword "${c}" value is invalid at path "${o}": `+i.errorsText(a.validateSchema.errors);if(r.validateSchema==="log")i.logger.error(t);else throw new Error(t)}}}r.validateKeywordUsage=validateKeywordUsage},9362:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.extendSubschemaMode=r.extendSubschemaData=r.getSubschema=void 0;const o=i(1644);const a=i(146);function getSubschema(t,{keyword:r,schemaProp:i,schema:c,schemaPath:l,errSchemaPath:u,topSchemaRef:h}){if(r!==undefined&&c!==undefined){throw new Error('both "keyword" and "schema" passed, only one allowed')}if(r!==undefined){const c=t.schema[r];return i===undefined?{schema:c,schemaPath:(0,o._)`${t.schemaPath}${(0,o.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${r}`}:{schema:c[i],schemaPath:(0,o._)`${t.schemaPath}${(0,o.getProperty)(r)}${(0,o.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${r}/${(0,a.escapeFragment)(i)}`}}if(c!==undefined){if(l===undefined||u===undefined||h===undefined){throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')}return{schema:c,schemaPath:l,topSchemaRef:h,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}r.getSubschema=getSubschema;function extendSubschemaData(t,r,{dataProp:i,dataPropType:c,data:l,dataTypes:u,propertyName:h}){if(l!==undefined&&i!==undefined){throw new Error('both "data" and "dataProp" passed, only one allowed')}const{gen:d}=r;if(i!==undefined){const{errorPath:l,dataPathArr:u,opts:h}=r;const p=d.let("data",(0,o._)`${r.data}${(0,o.getProperty)(i)}`,true);dataContextProps(p);t.errorPath=(0,o.str)`${l}${(0,a.getErrorPath)(i,c,h.jsPropertySyntax)}`;t.parentDataProperty=(0,o._)`${i}`;t.dataPathArr=[...u,t.parentDataProperty]}if(l!==undefined){const r=l instanceof o.Name?l:d.let("data",l,true);dataContextProps(r);if(h!==undefined)t.propertyName=h}if(u)t.dataTypes=u;function dataContextProps(i){t.data=i;t.dataLevel=r.dataLevel+1;t.dataTypes=[];r.definedProperties=new Set;t.parentData=r.data;t.dataNames=[...r.dataNames,i]}}r.extendSubschemaData=extendSubschemaData;function extendSubschemaMode(t,{jtdDiscriminator:r,jtdMetadata:i,compositeRule:o,createErrors:a,allErrors:c}){if(o!==undefined)t.compositeRule=o;if(a!==undefined)t.createErrors=a;if(c!==undefined)t.allErrors=c;t.jtdDiscriminator=r;t.jtdMetadata=i}r.extendSubschemaMode=extendSubschemaMode},6549:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=void 0;var o=i(8403);Object.defineProperty(r,"KeywordCxt",{enumerable:true,get:function(){return o.KeywordCxt}});var a=i(1644);Object.defineProperty(r,"_",{enumerable:true,get:function(){return a._}});Object.defineProperty(r,"str",{enumerable:true,get:function(){return a.str}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return a.stringify}});Object.defineProperty(r,"nil",{enumerable:true,get:function(){return a.nil}});Object.defineProperty(r,"Name",{enumerable:true,get:function(){return a.Name}});Object.defineProperty(r,"CodeGen",{enumerable:true,get:function(){return a.CodeGen}});const c=i(1282);const l=i(5963);const u=i(2326);const h=i(2705);const d=i(1644);const p=i(2101);const m=i(582);const g=i(146);const y=i(5227);const v=i(1173);const defaultRegExp=(t,r)=>new RegExp(t,r);defaultRegExp.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"];const w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]);const E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."};const S={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};const $=200;function requiredOptions(t){var r,i,o,a,c,l,u,h,d,p,m,g,y,b,w,E,S,x,R,O,P,A,T,C,k;const I=t.strict;const N=(r=t.code)===null||r===void 0?void 0:r.optimize;const D=N===true||N===undefined?1:N||0;const L=(o=(i=t.code)===null||i===void 0?void 0:i.regExp)!==null&&o!==void 0?o:defaultRegExp;const M=(a=t.uriResolver)!==null&&a!==void 0?a:v.default;return{strictSchema:(l=(c=t.strictSchema)!==null&&c!==void 0?c:I)!==null&&l!==void 0?l:true,strictNumbers:(h=(u=t.strictNumbers)!==null&&u!==void 0?u:I)!==null&&h!==void 0?h:true,strictTypes:(p=(d=t.strictTypes)!==null&&d!==void 0?d:I)!==null&&p!==void 0?p:"log",strictTuples:(g=(m=t.strictTuples)!==null&&m!==void 0?m:I)!==null&&g!==void 0?g:"log",strictRequired:(b=(y=t.strictRequired)!==null&&y!==void 0?y:I)!==null&&b!==void 0?b:false,code:t.code?{...t.code,optimize:D,regExp:L}:{optimize:D,regExp:L},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:$,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:$,meta:(S=t.meta)!==null&&S!==void 0?S:true,messages:(x=t.messages)!==null&&x!==void 0?x:true,inlineRefs:(R=t.inlineRefs)!==null&&R!==void 0?R:true,schemaId:(O=t.schemaId)!==null&&O!==void 0?O:"$id",addUsedSchema:(P=t.addUsedSchema)!==null&&P!==void 0?P:true,validateSchema:(A=t.validateSchema)!==null&&A!==void 0?A:true,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:true,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:true,int32range:(k=t.int32range)!==null&&k!==void 0?k:true,uriResolver:M}}class Ajv{constructor(t={}){this.schemas={};this.refs={};this.formats={};this._compilations=new Set;this._loading={};this._cache=new Map;t=this.opts={...t,...requiredOptions(t)};const{es5:r,lines:i}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:w,es5:r,lines:i});this.logger=getLogger(t.logger);const o=t.validateFormats;t.validateFormats=false;this.RULES=(0,u.getRules)();checkOptions.call(this,E,t,"NOT SUPPORTED");checkOptions.call(this,S,t,"DEPRECATED","warn");this._metaOpts=getMetaSchemaOptions.call(this);if(t.formats)addInitialFormats.call(this);this._addVocabularies();this._addDefaultMetaSchema();if(t.keywords)addInitialKeywords.call(this,t.keywords);if(typeof t.meta=="object")this.addMetaSchema(t.meta);addInitialSchemas.call(this);t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:r,schemaId:i}=this.opts;let o=y;if(i==="id"){o={...y};o.id=o.$id;delete o.$id}if(r&&t)this.addMetaSchema(o,o[i],false)}defaultMeta(){const{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:undefined}validate(t,r){let i;if(typeof t=="string"){i=this.getSchema(t);if(!i)throw new Error(`no schema with key or ref "${t}"`)}else{i=this.compile(t)}const o=i(r);if(!("$async"in i))this.errors=i.errors;return o}compile(t,r){const i=this._addSchema(t,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function"){throw new Error("options.loadSchema should be a function")}const{loadSchema:i}=this.opts;return runCompileAsync.call(this,t,r);async function runCompileAsync(t,r){await loadMetaSchema.call(this,t.$schema);const i=this._addSchema(t,r);return i.validate||_compileAsync.call(this,i)}async function loadMetaSchema(t){if(t&&!this.getSchema(t)){await runCompileAsync.call(this,{$ref:t},true)}}async function _compileAsync(t){try{return this._compileSchemaEnv(t)}catch(r){if(!(r instanceof l.default))throw r;checkLoaded.call(this,r);await loadMissingSchema.call(this,r.missingSchema);return _compileAsync.call(this,t)}}function checkLoaded({missingSchema:t,missingRef:r}){if(this.refs[t]){throw new Error(`AnySchema ${t} is loaded but ${r} cannot be resolved`)}}async function loadMissingSchema(t){const i=await _loadSchema.call(this,t);if(!this.refs[t])await loadMetaSchema.call(this,i.$schema);if(!this.refs[t])this.addSchema(i,t,r)}async function _loadSchema(t){const r=this._loading[t];if(r)return r;try{return await(this._loading[t]=i(t))}finally{delete this._loading[t]}}}addSchema(t,r,i,o=this.opts.validateSchema){if(Array.isArray(t)){for(const r of t)this.addSchema(r,undefined,i,o);return this}let a;if(typeof t==="object"){const{schemaId:r}=this.opts;a=t[r];if(a!==undefined&&typeof a!="string"){throw new Error(`schema ${r} must be string`)}}r=(0,p.normalizeId)(r||a);this._checkUnique(r);this.schemas[r]=this._addSchema(t,i,r,o,true);return this}addMetaSchema(t,r,i=this.opts.validateSchema){this.addSchema(t,r,true,i);return this}validateSchema(t,r){if(typeof t=="boolean")return true;let i;i=t.$schema;if(i!==undefined&&typeof i!="string"){throw new Error("$schema must be a string")}i=i||this.opts.defaultMeta||this.defaultMeta();if(!i){this.logger.warn("meta-schema not available");this.errors=null;return true}const o=this.validate(i,t);if(!o&&r){const t="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(t);else throw new Error(t)}return o}getSchema(t){let r;while(typeof(r=getSchEnv.call(this,t))=="string")t=r;if(r===undefined){const{schemaId:i}=this.opts;const o=new h.SchemaEnv({schema:{},schemaId:i});r=h.resolveSchema.call(this,o,t);if(!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp){this._removeAllSchemas(this.schemas,t);this._removeAllSchemas(this.refs,t);return this}switch(typeof t){case"undefined":this._removeAllSchemas(this.schemas);this._removeAllSchemas(this.refs);this._cache.clear();return this;case"string":{const r=getSchEnv.call(this,t);if(typeof r=="object")this._cache.delete(r.schema);delete this.schemas[t];delete this.refs[t];return this}case"object":{const r=t;this._cache.delete(r);let i=t[this.opts.schemaId];if(i){i=(0,p.normalizeId)(i);delete this.schemas[i];delete this.refs[i]}return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const r of t)this.addKeyword(r);return this}addKeyword(t,r){let i;if(typeof t=="string"){i=t;if(typeof r=="object"){this.logger.warn("these parameters are deprecated, see docs for addKeyword");r.keyword=i}}else if(typeof t=="object"&&r===undefined){r=t;i=r.keyword;if(Array.isArray(i)&&!i.length){throw new Error("addKeywords: keyword must be string or non-empty array")}}else{throw new Error("invalid addKeywords parameters")}checkKeyword.call(this,i,r);if(!r){(0,g.eachItem)(i,(t=>addRule.call(this,t)));return this}keywordMetaschema.call(this,r);const o={...r,type:(0,m.getJSONTypes)(r.type),schemaType:(0,m.getJSONTypes)(r.schemaType)};(0,g.eachItem)(i,o.type.length===0?t=>addRule.call(this,t,o):t=>o.type.forEach((r=>addRule.call(this,t,o,r))));return this}getKeyword(t){const r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){const{RULES:r}=this;delete r.keywords[t];delete r.all[t];for(const i of r.rules){const r=i.rules.findIndex((r=>r.keyword===t));if(r>=0)i.rules.splice(r,1)}return this}addFormat(t,r){if(typeof r=="string")r=new RegExp(r);this.formats[t]=r;return this}errorsText(t=this.errors,{separator:r=", ",dataVar:i="data"}={}){if(!t||t.length===0)return"No errors";return t.map((t=>`${i}${t.instancePath} ${t.message}`)).reduce(((t,i)=>t+r+i))}$dataMetaSchema(t,r){const i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const o of r){const r=o.split("/").slice(1);let a=t;for(const t of r)a=a[t];for(const t in i){const r=i[t];if(typeof r!="object")continue;const{$data:o}=r.definition;const c=a[t];if(o&&c)a[t]=schemaOrData(c)}}return t}_removeAllSchemas(t,r){for(const i in t){const o=t[i];if(!r||r.test(i)){if(typeof o=="string"){delete t[i]}else if(o&&!o.meta){this._cache.delete(o.schema);delete t[i]}}}}_addSchema(t,r,i,o=this.opts.validateSchema,a=this.opts.addUsedSchema){let c;const{schemaId:l}=this.opts;if(typeof t=="object"){c=t[l]}else{if(this.opts.jtd)throw new Error("schema must be object");else if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==undefined)return u;i=(0,p.normalizeId)(c||i);const d=p.getSchemaRefs.call(this,t,i);u=new h.SchemaEnv({schema:t,schemaId:l,meta:r,baseId:i,localRefs:d});this._cache.set(u.schema,u);if(a&&!i.startsWith("#")){if(i)this._checkUnique(i);this.refs[i]=u}if(o)this.validateSchema(t,true);return u}_checkUnique(t){if(this.schemas[t]||this.refs[t]){throw new Error(`schema with key or id "${t}" already exists`)}}_compileSchemaEnv(t){if(t.meta)this._compileMetaSchema(t);else h.compileSchema.call(this,t);if(!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const r=this.opts;this.opts=this._metaOpts;try{h.compileSchema.call(this,t)}finally{this.opts=r}}}Ajv.ValidationError=c.default;Ajv.MissingRefError=l.default;r["default"]=Ajv;function checkOptions(t,r,i,o="error"){for(const a in t){const c=a;if(c in r)this.logger[o](`${i}: option ${a}. ${t[c]}`)}}function getSchEnv(t){t=(0,p.normalizeId)(t);return this.schemas[t]||this.refs[t]}function addInitialSchemas(){const t=this.opts.schemas;if(!t)return;if(Array.isArray(t))this.addSchema(t);else for(const r in t)this.addSchema(t[r],r)}function addInitialFormats(){for(const t in this.opts.formats){const r=this.opts.formats[t];if(r)this.addFormat(t,r)}}function addInitialKeywords(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const r in t){const i=t[r];if(!i.keyword)i.keyword=r;this.addKeyword(i)}}function getMetaSchemaOptions(){const t={...this.opts};for(const r of b)delete t[r];return t}const x={log(){},warn(){},error(){}};function getLogger(t){if(t===false)return x;if(t===undefined)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}const R=/^[a-z_$][a-z0-9_$:-]*$/i;function checkKeyword(t,r){const{RULES:i}=this;(0,g.eachItem)(t,(t=>{if(i.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!R.test(t))throw new Error(`Keyword ${t} has invalid name`)}));if(!r)return;if(r.$data&&!("code"in r||"validate"in r)){throw new Error('$data keyword must have "code" or "validate" function')}}function addRule(t,r,i){var o;const a=r===null||r===void 0?void 0:r.post;if(i&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:c}=this;let l=a?c.post:c.rules.find((({type:t})=>t===i));if(!l){l={type:i,rules:[]};c.rules.push(l)}c.keywords[t]=true;if(!r)return;const u={keyword:t,definition:{...r,type:(0,m.getJSONTypes)(r.type),schemaType:(0,m.getJSONTypes)(r.schemaType)}};if(r.before)addBeforeRule.call(this,l,u,r.before);else l.rules.push(u);c.all[t]=u;(o=r.implements)===null||o===void 0?void 0:o.forEach((t=>this.addKeyword(t)))}function addBeforeRule(t,r,i){const o=t.rules.findIndex((t=>t.keyword===i));if(o>=0){t.rules.splice(o,0,r)}else{t.rules.push(r);this.logger.warn(`rule ${i} is not defined`)}}function keywordMetaschema(t){let{metaSchema:r}=t;if(r===undefined)return;if(t.$data&&this.opts.$data)r=schemaOrData(r);t.validateSchema=this.compile(r,true)}const O={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function schemaOrData(t){return{anyOf:[t,O]}}},5203:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(6642);const a=i(2650);const c=i(8814);const l=i(1828);const u=i(2720);const h=i(8805);const d=i(5607);const p=i(1400);const m=["/properties"];function addMetaSchema2020(t){[o,a,c,l,u,with$data(this,h),d,with$data(this,p)].forEach((t=>this.addMetaSchema(t,undefined,false)));return this;function with$data(r,i){return t?r.$dataMetaSchema(i,m):i}}r["default"]=addMetaSchema2020},5151:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(6688);o.code='require("ajv/dist/runtime/equal").default';r["default"]=o},8694:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function ucs2length(t){const r=t.length;let i=0;let o=0;let a;while(o=55296&&a<=56319&&o{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2267);o.code='require("ajv/dist/runtime/uri").default';r["default"]=o},1282:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});class ValidationError extends Error{constructor(t){super("validation failed");this.errors=t;this.ajv=this.validation=true}}r["default"]=ValidationError},9640:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.validateAdditionalItems=void 0;const o=i(1644);const a=i(146);const c={message:({params:{len:t}})=>(0,o.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,o._)`{limit: ${t}}`};const l={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:c,code(t){const{parentSchema:r,it:i}=t;const{items:o}=r;if(!Array.isArray(o)){(0,a.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}validateAdditionalItems(t,o)}};function validateAdditionalItems(t,r){const{gen:i,schema:c,data:l,keyword:u,it:h}=t;h.items=true;const d=i.const("len",(0,o._)`${l}.length`);if(c===false){t.setParams({len:r.length});t.pass((0,o._)`${d} <= ${r.length}`)}else if(typeof c=="object"&&!(0,a.alwaysValidSchema)(h,c)){const a=i.var("valid",(0,o._)`${d} <= ${r.length}`);i.if((0,o.not)(a),(()=>validateItems(a)));t.ok(a)}function validateItems(c){i.forRange("i",r.length,d,(r=>{t.subschema({keyword:u,dataProp:r,dataPropType:a.Type.Num},c);if(!h.allErrors)i.if((0,o.not)(c),(()=>i.break()))}))}}r.validateAdditionalItems=validateAdditionalItems;r["default"]=l},2882:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(77);const a=i(1644);const c=i(2597);const l=i(146);const u={message:"must NOT have additional properties",params:({params:t})=>(0,a._)`{additionalProperty: ${t.additionalProperty}}`};const h={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:true,trackErrors:true,error:u,code(t){const{gen:r,schema:i,parentSchema:u,data:h,errsCount:d,it:p}=t;if(!d)throw new Error("ajv implementation error");const{allErrors:m,opts:g}=p;p.props=true;if(g.removeAdditional!=="all"&&(0,l.alwaysValidSchema)(p,i))return;const y=(0,o.allSchemaProperties)(u.properties);const v=(0,o.allSchemaProperties)(u.patternProperties);checkAdditionalProperties();t.ok((0,a._)`${d} === ${c.default.errors}`);function checkAdditionalProperties(){r.forIn("key",h,(t=>{if(!y.length&&!v.length)additionalPropertyCode(t);else r.if(isAdditional(t),(()=>additionalPropertyCode(t)))}))}function isAdditional(i){let c;if(y.length>8){const t=(0,l.schemaRefOrVal)(p,u.properties,"properties");c=(0,o.isOwnProperty)(r,t,i)}else if(y.length){c=(0,a.or)(...y.map((t=>(0,a._)`${i} === ${t}`)))}else{c=a.nil}if(v.length){c=(0,a.or)(c,...v.map((r=>(0,a._)`${(0,o.usePattern)(t,r)}.test(${i})`)))}return(0,a.not)(c)}function deleteAdditional(t){r.code((0,a._)`delete ${h}[${t}]`)}function additionalPropertyCode(o){if(g.removeAdditional==="all"||g.removeAdditional&&i===false){deleteAdditional(o);return}if(i===false){t.setParams({additionalProperty:o});t.error();if(!m)r.break();return}if(typeof i=="object"&&!(0,l.alwaysValidSchema)(p,i)){const i=r.name("valid");if(g.removeAdditional==="failing"){applyAdditionalSchema(o,i,false);r.if((0,a.not)(i),(()=>{t.reset();deleteAdditional(o)}))}else{applyAdditionalSchema(o,i);if(!m)r.if((0,a.not)(i),(()=>r.break()))}}}function applyAdditionalSchema(r,i,o){const a={keyword:"additionalProperties",dataProp:r,dataPropType:l.Type.Str};if(o===false){Object.assign(a,{compositeRule:true,createErrors:false,allErrors:false})}t.subschema(a,i)}}};r["default"]=h},2529:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(146);const a={keyword:"allOf",schemaType:"array",code(t){const{gen:r,schema:i,it:a}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");const c=r.name("valid");i.forEach(((r,i)=>{if((0,o.alwaysValidSchema)(a,r))return;const l=t.subschema({keyword:"allOf",schemaProp:i},c);t.ok(c);t.mergeEvaluated(l)}))}};r["default"]=a},5214:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(77);const a={keyword:"anyOf",schemaType:"array",trackErrors:true,code:o.validateUnion,error:{message:"must match a schema in anyOf"}};r["default"]=a},7230:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c={message:({params:{min:t,max:r}})=>r===undefined?(0,o.str)`must contain at least ${t} valid item(s)`:(0,o.str)`must contain at least ${t} and no more than ${r} valid item(s)`,params:({params:{min:t,max:r}})=>r===undefined?(0,o._)`{minContains: ${t}}`:(0,o._)`{minContains: ${t}, maxContains: ${r}}`};const l={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:c,code(t){const{gen:r,schema:i,parentSchema:c,data:l,it:u}=t;let h;let d;const{minContains:p,maxContains:m}=c;if(u.opts.next){h=p===undefined?1:p;d=m}else{h=1}const g=r.const("len",(0,o._)`${l}.length`);t.setParams({min:h,max:d});if(d===undefined&&h===0){(0,a.checkStrictMode)(u,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(d!==undefined&&h>d){(0,a.checkStrictMode)(u,`"minContains" > "maxContains" is always invalid`);t.fail();return}if((0,a.alwaysValidSchema)(u,i)){let r=(0,o._)`${g} >= ${h}`;if(d!==undefined)r=(0,o._)`${r} && ${g} <= ${d}`;t.pass(r);return}u.items=true;const y=r.name("valid");if(d===undefined&&h===1){validateItems(y,(()=>r.if(y,(()=>r.break()))))}else if(h===0){r.let(y,true);if(d!==undefined)r.if((0,o._)`${l}.length > 0`,validateItemsWithCount)}else{r.let(y,false);validateItemsWithCount()}t.result(y,(()=>t.reset()));function validateItemsWithCount(){const t=r.name("_valid");const i=r.let("count",0);validateItems(t,(()=>r.if(t,(()=>checkLimits(i)))))}function validateItems(i,o){r.forRange("i",0,g,(r=>{t.subschema({keyword:"contains",dataProp:r,dataPropType:a.Type.Num,compositeRule:true},i);o()}))}function checkLimits(t){r.code((0,o._)`${t}++`);if(d===undefined){r.if((0,o._)`${t} >= ${h}`,(()=>r.assign(y,true).break()))}else{r.if((0,o._)`${t} > ${d}`,(()=>r.assign(y,false).break()));if(h===1)r.assign(y,true);else r.if((0,o._)`${t} >= ${h}`,(()=>r.assign(y,true)))}}}};r["default"]=l},1296:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.validateSchemaDeps=r.validatePropertyDeps=r.error=void 0;const o=i(1644);const a=i(146);const c=i(77);r.error={message:({params:{property:t,depsCount:r,deps:i}})=>{const a=r===1?"property":"properties";return(0,o.str)`must have ${a} ${i} when property ${t} is present`},params:({params:{property:t,depsCount:r,deps:i,missingProperty:a}})=>(0,o._)`{property: ${t}, missingProperty: ${a}, depsCount: ${r}, deps: ${i}}`};const l={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(t){const[r,i]=splitDependencies(t);validatePropertyDeps(t,r);validateSchemaDeps(t,i)}};function splitDependencies({schema:t}){const r={};const i={};for(const o in t){if(o==="__proto__")continue;const a=Array.isArray(t[o])?r:i;a[o]=t[o]}return[r,i]}function validatePropertyDeps(t,r=t.schema){const{gen:i,data:a,it:l}=t;if(Object.keys(r).length===0)return;const u=i.let("missing");for(const h in r){const d=r[h];if(d.length===0)continue;const p=(0,c.propertyInData)(i,a,h,l.opts.ownProperties);t.setParams({property:h,depsCount:d.length,deps:d.join(", ")});if(l.allErrors){i.if(p,(()=>{for(const r of d){(0,c.checkReportMissingProp)(t,r)}}))}else{i.if((0,o._)`${p} && (${(0,c.checkMissingProp)(t,d,u)})`);(0,c.reportMissingProp)(t,u);i.else()}}}r.validatePropertyDeps=validatePropertyDeps;function validateSchemaDeps(t,r=t.schema){const{gen:i,data:o,keyword:l,it:u}=t;const h=i.name("valid");for(const d in r){if((0,a.alwaysValidSchema)(u,r[d]))continue;i.if((0,c.propertyInData)(i,o,d,u.opts.ownProperties),(()=>{const r=t.subschema({keyword:l,schemaProp:d},h);t.mergeValidEvaluated(r,h)}),(()=>i.var(h,true)));t.ok(h)}}r.validateSchemaDeps=validateSchemaDeps;r["default"]=l},4285:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1296);const a={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,o.validateSchemaDeps)(t)};r["default"]=a},4688:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c={message:({params:t})=>(0,o.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,o._)`{failingKeyword: ${t.ifClause}}`};const l={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:c,code(t){const{gen:r,parentSchema:i,it:c}=t;if(i.then===undefined&&i.else===undefined){(0,a.checkStrictMode)(c,'"if" without "then" and "else" is ignored')}const l=hasSchema(c,"then");const u=hasSchema(c,"else");if(!l&&!u)return;const h=r.let("valid",true);const d=r.name("_valid");validateIf();t.reset();if(l&&u){const i=r.let("ifClause");t.setParams({ifClause:i});r.if(d,validateClause("then",i),validateClause("else",i))}else if(l){r.if(d,validateClause("then"))}else{r.if((0,o.not)(d),validateClause("else"))}t.pass(h,(()=>t.error(true)));function validateIf(){const r=t.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},d);t.mergeEvaluated(r)}function validateClause(i,a){return()=>{const c=t.subschema({keyword:i},d);r.assign(h,d);t.mergeValidEvaluated(c,h);if(a)r.assign(a,(0,o._)`${i}`);else t.setParams({ifClause:i})}}}};function hasSchema(t,r){const i=t.schema[r];return i!==undefined&&!(0,a.alwaysValidSchema)(t,i)}r["default"]=l},1132:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9640);const a=i(8152);const c=i(2724);const l=i(4698);const u=i(7230);const h=i(1296);const d=i(5053);const p=i(2882);const m=i(2825);const g=i(8481);const y=i(4983);const v=i(5214);const b=i(5123);const w=i(2529);const E=i(4688);const S=i(1367);function getApplicator(t=false){const r=[y.default,v.default,b.default,w.default,E.default,S.default,d.default,p.default,h.default,m.default,g.default];if(t)r.push(a.default,l.default);else r.push(o.default,c.default);r.push(u.default);return r}r["default"]=getApplicator},2724:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.validateTuple=void 0;const o=i(1644);const a=i(146);const c=i(77);const l={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:r,it:i}=t;if(Array.isArray(r))return validateTuple(t,"additionalItems",r);i.items=true;if((0,a.alwaysValidSchema)(i,r))return;t.ok((0,c.validateArray)(t))}};function validateTuple(t,r,i=t.schema){const{gen:c,parentSchema:l,data:u,keyword:h,it:d}=t;checkStrictTuple(l);if(d.opts.unevaluated&&i.length&&d.items!==true){d.items=a.mergeEvaluated.items(c,i.length,d.items)}const p=c.name("valid");const m=c.const("len",(0,o._)`${u}.length`);i.forEach(((r,i)=>{if((0,a.alwaysValidSchema)(d,r))return;c.if((0,o._)`${m} > ${i}`,(()=>t.subschema({keyword:h,schemaProp:i,dataProp:i},p)));t.ok(p)}));function checkStrictTuple(t){const{opts:o,errSchemaPath:c}=d;const l=i.length;const u=l===t.minItems&&(l===t.maxItems||t[r]===false);if(o.strictTuples&&!u){const t=`"${h}" is ${l}-tuple, but minItems or maxItems/${r} are not specified or different at path "${c}"`;(0,a.checkStrictMode)(d,t,o.strictTuples)}}}r.validateTuple=validateTuple;r["default"]=l},4698:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c=i(77);const l=i(9640);const u={message:({params:{len:t}})=>(0,o.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,o._)`{limit: ${t}}`};const h={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:u,code(t){const{schema:r,parentSchema:i,it:o}=t;const{prefixItems:u}=i;o.items=true;if((0,a.alwaysValidSchema)(o,r))return;if(u)(0,l.validateAdditionalItems)(t,u);else t.ok((0,c.validateArray)(t))}};r["default"]=h},4983:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(146);const a={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(t){const{gen:r,schema:i,it:a}=t;if((0,o.alwaysValidSchema)(a,i)){t.fail();return}const c=r.name("valid");t.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},c);t.failResult(c,(()=>t.reset()),(()=>t.error()))},error:{message:"must NOT be valid"}};r["default"]=a},5123:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,o._)`{passingSchemas: ${t.passing}}`};const l={keyword:"oneOf",schemaType:"array",trackErrors:true,error:c,code(t){const{gen:r,schema:i,parentSchema:c,it:l}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");if(l.opts.discriminator&&c.discriminator)return;const u=i;const h=r.let("valid",false);const d=r.let("passing",null);const p=r.name("_valid");t.setParams({passing:d});r.block(validateOneOf);t.result(h,(()=>t.reset()),(()=>t.error(true)));function validateOneOf(){u.forEach(((i,c)=>{let u;if((0,a.alwaysValidSchema)(l,i)){r.var(p,true)}else{u=t.subschema({keyword:"oneOf",schemaProp:c,compositeRule:true},p)}if(c>0){r.if((0,o._)`${p} && ${h}`).assign(h,false).assign(d,(0,o._)`[${d}, ${c}]`).else()}r.if(p,(()=>{r.assign(h,true);r.assign(d,c);if(u)t.mergeEvaluated(u,o.Name)}))}))}}};r["default"]=l},8481:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(77);const a=i(1644);const c=i(146);const l=i(146);const u={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:r,schema:i,data:u,parentSchema:h,it:d}=t;const{opts:p}=d;const m=(0,o.allSchemaProperties)(i);const g=m.filter((t=>(0,c.alwaysValidSchema)(d,i[t])));if(m.length===0||g.length===m.length&&(!d.opts.unevaluated||d.props===true)){return}const y=p.strictSchema&&!p.allowMatchingProperties&&h.properties;const v=r.name("valid");if(d.props!==true&&!(d.props instanceof a.Name)){d.props=(0,l.evaluatedPropsToName)(r,d.props)}const{props:b}=d;validatePatternProperties();function validatePatternProperties(){for(const t of m){if(y)checkMatchingProperties(t);if(d.allErrors){validateProperties(t)}else{r.var(v,true);validateProperties(t);r.if(v)}}}function checkMatchingProperties(t){for(const r in y){if(new RegExp(t).test(r)){(0,c.checkStrictMode)(d,`property ${r} matches pattern ${t} (use allowMatchingProperties)`)}}}function validateProperties(i){r.forIn("key",u,(c=>{r.if((0,a._)`${(0,o.usePattern)(t,i)}.test(${c})`,(()=>{const o=g.includes(i);if(!o){t.subschema({keyword:"patternProperties",schemaProp:i,dataProp:c,dataPropType:l.Type.Str},v)}if(d.opts.unevaluated&&b!==true){r.assign((0,a._)`${b}[${c}]`,true)}else if(!o&&!d.allErrors){r.if((0,a.not)(v),(()=>r.break()))}}))}))}}};r["default"]=u},8152:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2724);const a={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,o.validateTuple)(t,"items")};r["default"]=a},2825:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8403);const a=i(77);const c=i(146);const l=i(2882);const u={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:r,schema:i,parentSchema:u,data:h,it:d}=t;if(d.opts.removeAdditional==="all"&&u.additionalProperties===undefined){l.default.code(new o.KeywordCxt(d,l.default,"additionalProperties"))}const p=(0,a.allSchemaProperties)(i);for(const t of p){d.definedProperties.add(t)}if(d.opts.unevaluated&&p.length&&d.props!==true){d.props=c.mergeEvaluated.props(r,(0,c.toHash)(p),d.props)}const m=p.filter((t=>!(0,c.alwaysValidSchema)(d,i[t])));if(m.length===0)return;const g=r.name("valid");for(const i of m){if(hasDefault(i)){applyPropertySchema(i)}else{r.if((0,a.propertyInData)(r,h,i,d.opts.ownProperties));applyPropertySchema(i);if(!d.allErrors)r.else().var(g,true);r.endIf()}t.it.definedProperties.add(i);t.ok(g)}function hasDefault(t){return d.opts.useDefaults&&!d.compositeRule&&i[t].default!==undefined}function applyPropertySchema(r){t.subschema({keyword:"properties",schemaProp:r,dataProp:r},g)}}};r["default"]=u},5053:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c={message:"property name must be valid",params:({params:t})=>(0,o._)`{propertyName: ${t.propertyName}}`};const l={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:c,code(t){const{gen:r,schema:i,data:c,it:l}=t;if((0,a.alwaysValidSchema)(l,i))return;const u=r.name("valid");r.forIn("key",c,(i=>{t.setParams({propertyName:i});t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:true},u);r.if((0,o.not)(u),(()=>{t.error(true);if(!l.allErrors)r.break()}))}));t.ok(u)}};r["default"]=l},1367:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(146);const a={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:r,it:i}){if(r.if===undefined)(0,o.checkStrictMode)(i,`"${t}" without "if" is ignored`)}};r["default"]=a},77:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.validateUnion=r.validateArray=r.usePattern=r.callValidateCode=r.schemaProperties=r.allSchemaProperties=r.noPropertyInData=r.propertyInData=r.isOwnProperty=r.hasPropFunc=r.reportMissingProp=r.checkMissingProp=r.checkReportMissingProp=void 0;const o=i(1644);const a=i(146);const c=i(2597);const l=i(146);function checkReportMissingProp(t,r){const{gen:i,data:a,it:c}=t;i.if(noPropertyInData(i,a,r,c.opts.ownProperties),(()=>{t.setParams({missingProperty:(0,o._)`${r}`},true);t.error()}))}r.checkReportMissingProp=checkReportMissingProp;function checkMissingProp({gen:t,data:r,it:{opts:i}},a,c){return(0,o.or)(...a.map((a=>(0,o.and)(noPropertyInData(t,r,a,i.ownProperties),(0,o._)`${c} = ${a}`))))}r.checkMissingProp=checkMissingProp;function reportMissingProp(t,r){t.setParams({missingProperty:r},true);t.error()}r.reportMissingProp=reportMissingProp;function hasPropFunc(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,o._)`Object.prototype.hasOwnProperty`})}r.hasPropFunc=hasPropFunc;function isOwnProperty(t,r,i){return(0,o._)`${hasPropFunc(t)}.call(${r}, ${i})`}r.isOwnProperty=isOwnProperty;function propertyInData(t,r,i,a){const c=(0,o._)`${r}${(0,o.getProperty)(i)} !== undefined`;return a?(0,o._)`${c} && ${isOwnProperty(t,r,i)}`:c}r.propertyInData=propertyInData;function noPropertyInData(t,r,i,a){const c=(0,o._)`${r}${(0,o.getProperty)(i)} === undefined`;return a?(0,o.or)(c,(0,o.not)(isOwnProperty(t,r,i))):c}r.noPropertyInData=noPropertyInData;function allSchemaProperties(t){return t?Object.keys(t).filter((t=>t!=="__proto__")):[]}r.allSchemaProperties=allSchemaProperties;function schemaProperties(t,r){return allSchemaProperties(r).filter((i=>!(0,a.alwaysValidSchema)(t,r[i])))}r.schemaProperties=schemaProperties;function callValidateCode({schemaCode:t,data:r,it:{gen:i,topSchemaRef:a,schemaPath:l,errorPath:u},it:h},d,p,m){const g=m?(0,o._)`${t}, ${r}, ${a}${l}`:r;const y=[[c.default.instancePath,(0,o.strConcat)(c.default.instancePath,u)],[c.default.parentData,h.parentData],[c.default.parentDataProperty,h.parentDataProperty],[c.default.rootData,c.default.rootData]];if(h.opts.dynamicRef)y.push([c.default.dynamicAnchors,c.default.dynamicAnchors]);const v=(0,o._)`${g}, ${i.object(...y)}`;return p!==o.nil?(0,o._)`${d}.call(${p}, ${v})`:(0,o._)`${d}(${v})`}r.callValidateCode=callValidateCode;const u=(0,o._)`new RegExp`;function usePattern({gen:t,it:{opts:r}},i){const a=r.unicodeRegExp?"u":"";const{regExp:c}=r.code;const h=c(i,a);return t.scopeValue("pattern",{key:h.toString(),ref:h,code:(0,o._)`${c.code==="new RegExp"?u:(0,l.useFunc)(t,c)}(${i}, ${a})`})}r.usePattern=usePattern;function validateArray(t){const{gen:r,data:i,keyword:c,it:l}=t;const u=r.name("valid");if(l.allErrors){const t=r.let("valid",true);validateItems((()=>r.assign(t,false)));return t}r.var(u,true);validateItems((()=>r.break()));return u;function validateItems(l){const h=r.const("len",(0,o._)`${i}.length`);r.forRange("i",0,h,(i=>{t.subschema({keyword:c,dataProp:i,dataPropType:a.Type.Num},u);r.if((0,o.not)(u),l)}))}}r.validateArray=validateArray;function validateUnion(t){const{gen:r,schema:i,keyword:c,it:l}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");const u=i.some((t=>(0,a.alwaysValidSchema)(l,t)));if(u&&!l.opts.unevaluated)return;const h=r.let("valid",false);const d=r.name("_valid");r.block((()=>i.forEach(((i,a)=>{const l=t.subschema({keyword:c,schemaProp:a,compositeRule:true},d);r.assign(h,(0,o._)`${h} || ${d}`);const u=t.mergeValidEvaluated(l,d);if(!u)r.if((0,o.not)(h))}))));t.result(h,(()=>t.reset()),(()=>t.error(true)))}r.validateUnion=validateUnion},9162:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};r["default"]=i},9024:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9162);const a=i(5481);const c=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",o.default,a.default];r["default"]=c},5481:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.callRef=r.getValidate=void 0;const o=i(5963);const a=i(77);const c=i(1644);const l=i(2597);const u=i(2705);const h=i(146);const d={keyword:"$ref",schemaType:"string",code(t){const{gen:r,schema:i,it:a}=t;const{baseId:l,schemaEnv:h,validateName:d,opts:p,self:m}=a;const{root:g}=h;if((i==="#"||i==="#/")&&l===g.baseId)return callRootRef();const y=u.resolveRef.call(m,g,l,i);if(y===undefined)throw new o.default(a.opts.uriResolver,l,i);if(y instanceof u.SchemaEnv)return callValidate(y);return inlineRefSchema(y);function callRootRef(){if(h===g)return callRef(t,d,h,h.$async);const i=r.scopeValue("root",{ref:g});return callRef(t,(0,c._)`${i}.validate`,g,g.$async)}function callValidate(r){const i=getValidate(t,r);callRef(t,i,r,r.$async)}function inlineRefSchema(o){const a=r.scopeValue("schema",p.code.source===true?{ref:o,code:(0,c.stringify)(o)}:{ref:o});const l=r.name("valid");const u=t.subschema({schema:o,dataTypes:[],schemaPath:c.nil,topSchemaRef:a,errSchemaPath:i},l);t.mergeEvaluated(u);t.ok(l)}}};function getValidate(t,r){const{gen:i}=t;return r.validate?i.scopeValue("validate",{ref:r.validate}):(0,c._)`${i.scopeValue("wrapper",{ref:r})}.validate`}r.getValidate=getValidate;function callRef(t,r,i,o){const{gen:u,it:d}=t;const{allErrors:p,schemaEnv:m,opts:g}=d;const y=g.passContext?l.default.this:c.nil;if(o)callAsyncRef();else callSyncRef();function callAsyncRef(){if(!m.$async)throw new Error("async schema referenced by sync schema");const i=u.let("valid");u.try((()=>{u.code((0,c._)`await ${(0,a.callValidateCode)(t,r,y)}`);addEvaluatedFrom(r);if(!p)u.assign(i,true)}),(t=>{u.if((0,c._)`!(${t} instanceof ${d.ValidationError})`,(()=>u.throw(t)));addErrorsFrom(t);if(!p)u.assign(i,false)}));t.ok(i)}function callSyncRef(){t.result((0,a.callValidateCode)(t,r,y),(()=>addEvaluatedFrom(r)),(()=>addErrorsFrom(r)))}function addErrorsFrom(t){const r=(0,c._)`${t}.errors`;u.assign(l.default.vErrors,(0,c._)`${l.default.vErrors} === null ? ${r} : ${l.default.vErrors}.concat(${r})`);u.assign(l.default.errors,(0,c._)`${l.default.vErrors}.length`)}function addEvaluatedFrom(t){var r;if(!d.opts.unevaluated)return;const o=(r=i===null||i===void 0?void 0:i.validate)===null||r===void 0?void 0:r.evaluated;if(d.props!==true){if(o&&!o.dynamicProps){if(o.props!==undefined){d.props=h.mergeEvaluated.props(u,o.props,d.props)}}else{const r=u.var("props",(0,c._)`${t}.evaluated.props`);d.props=h.mergeEvaluated.props(u,r,d.props,c.Name)}}if(d.items!==true){if(o&&!o.dynamicItems){if(o.items!==undefined){d.items=h.mergeEvaluated.items(u,o.items,d.items)}}else{const r=u.var("items",(0,c._)`${t}.evaluated.items`);d.items=h.mergeEvaluated.items(u,r,d.items,c.Name)}}}}r.callRef=callRef;r["default"]=d},5032:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(7497);const c=i(2705);const l=i(5963);const u=i(146);const h={message:({params:{discrError:t,tagName:r}})=>t===a.DiscrError.Tag?`tag "${r}" must be string`:`value of tag "${r}" must be in oneOf`,params:({params:{discrError:t,tag:r,tagName:i}})=>(0,o._)`{error: ${t}, tag: ${i}, tagValue: ${r}}`};const d={keyword:"discriminator",type:"object",schemaType:"object",error:h,code(t){const{gen:r,data:i,schema:h,parentSchema:d,it:p}=t;const{oneOf:m}=d;if(!p.opts.discriminator){throw new Error("discriminator: requires discriminator option")}const g=h.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!m)throw new Error("discriminator: requires oneOf keyword");const y=r.let("valid",false);const v=r.const("tag",(0,o._)`${i}${(0,o.getProperty)(g)}`);r.if((0,o._)`typeof ${v} == "string"`,(()=>validateMapping()),(()=>t.error(false,{discrError:a.DiscrError.Tag,tag:v,tagName:g})));t.ok(y);function validateMapping(){const i=getMapping();r.if(false);for(const t in i){r.elseIf((0,o._)`${v} === ${t}`);r.assign(y,applyTagSchema(i[t]))}r.else();t.error(false,{discrError:a.DiscrError.Mapping,tag:v,tagName:g});r.endIf()}function applyTagSchema(i){const a=r.name("valid");const c=t.subschema({keyword:"oneOf",schemaProp:i},a);t.mergeEvaluated(c,o.Name);return a}function getMapping(){var t;const r={};const i=hasRequired(d);let o=true;for(let r=0;r{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.DiscrError=void 0;var i;(function(t){t["Tag"]="tag";t["Mapping"]="mapping"})(i||(r.DiscrError=i={}))},5221:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9024);const a=i(6285);const c=i(1132);const l=i(4749);const u=i(5543);const h=i(4540);const d=i(3521);const p=i(5749);const m=[l.default,o.default,a.default,(0,c.default)(true),d.default,p.metadataVocabulary,p.contentVocabulary,u.default,h.default];r["default"]=m},7750:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9024);const a=i(6285);const c=i(1132);const l=i(3521);const u=i(5749);const h=[o.default,a.default,(0,c.default)(),l.default,u.metadataVocabulary,u.contentVocabulary];r["default"]=h},5633:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.dynamicAnchor=void 0;const o=i(1644);const a=i(2597);const c=i(2705);const l=i(5481);const u={keyword:"$dynamicAnchor",schemaType:"string",code:t=>dynamicAnchor(t,t.schema)};function dynamicAnchor(t,r){const{gen:i,it:c}=t;c.schemaEnv.root.dynamicAnchors[r]=true;const l=(0,o._)`${a.default.dynamicAnchors}${(0,o.getProperty)(r)}`;const u=c.errSchemaPath==="#"?c.validateName:_getValidate(t);i.if((0,o._)`!${l}`,(()=>i.assign(l,u)))}r.dynamicAnchor=dynamicAnchor;function _getValidate(t){const{schemaEnv:r,schema:i,self:o}=t.it;const{root:a,baseId:u,localRefs:h,meta:d}=r.root;const{schemaId:p}=o.opts;const m=new c.SchemaEnv({schema:i,schemaId:p,root:a,baseId:u,localRefs:h,meta:d});c.compileSchema.call(o,m);return(0,l.getValidate)(t,m)}r["default"]=u},8946:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.dynamicRef=void 0;const o=i(1644);const a=i(2597);const c=i(5481);const l={keyword:"$dynamicRef",schemaType:"string",code:t=>dynamicRef(t,t.schema)};function dynamicRef(t,r){const{gen:i,keyword:l,it:u}=t;if(r[0]!=="#")throw new Error(`"${l}" only supports hash fragment reference`);const h=r.slice(1);if(u.allErrors){_dynamicRef()}else{const r=i.let("valid",false);_dynamicRef(r);t.ok(r)}function _dynamicRef(t){if(u.schemaEnv.root.dynamicAnchors[h]){const r=i.let("_v",(0,o._)`${a.default.dynamicAnchors}${(0,o.getProperty)(h)}`);i.if(r,_callRef(r,t),_callRef(u.validateName,t))}else{_callRef(u.validateName,t)()}}function _callRef(r,o){return o?()=>i.block((()=>{(0,c.callRef)(t,r);i.let(o,true)})):()=>(0,c.callRef)(t,r)}}r.dynamicRef=dynamicRef;r["default"]=l},4749:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(5633);const a=i(8946);const c=i(1303);const l=i(9649);const u=[o.default,a.default,c.default,l.default];r["default"]=u},1303:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(5633);const a=i(146);const c={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){if(t.schema)(0,o.dynamicAnchor)(t,"");else(0,a.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};r["default"]=c},9649:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(8946);const a={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,o.dynamicRef)(t,t.schema)};r["default"]=a},7556:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a={message:({schemaCode:t})=>(0,o.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,o._)`{format: ${t}}`};const c={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:a,code(t,r){const{gen:i,data:a,$data:c,schema:l,schemaCode:u,it:h}=t;const{opts:d,errSchemaPath:p,schemaEnv:m,self:g}=h;if(!d.validateFormats)return;if(c)validate$DataFormat();else validateFormat();function validate$DataFormat(){const c=i.scopeValue("formats",{ref:g.formats,code:d.code.formats});const l=i.const("fDef",(0,o._)`${c}[${u}]`);const h=i.let("fType");const p=i.let("format");i.if((0,o._)`typeof ${l} == "object" && !(${l} instanceof RegExp)`,(()=>i.assign(h,(0,o._)`${l}.type || "string"`).assign(p,(0,o._)`${l}.validate`)),(()=>i.assign(h,(0,o._)`"string"`).assign(p,l)));t.fail$data((0,o.or)(unknownFmt(),invalidFmt()));function unknownFmt(){if(d.strictSchema===false)return o.nil;return(0,o._)`${u} && !${p}`}function invalidFmt(){const t=m.$async?(0,o._)`(${l}.async ? await ${p}(${a}) : ${p}(${a}))`:(0,o._)`${p}(${a})`;const i=(0,o._)`(typeof ${p} == "function" ? ${t} : ${p}.test(${a}))`;return(0,o._)`${p} && ${p} !== true && ${h} === ${r} && !${i}`}}function validateFormat(){const c=g.formats[l];if(!c){unknownFormat();return}if(c===true)return;const[u,h,y]=getFormat(c);if(u===r)t.pass(validCondition());function unknownFormat(){if(d.strictSchema===false){g.logger.warn(unknownMsg());return}throw new Error(unknownMsg());function unknownMsg(){return`unknown format "${l}" ignored in schema at path "${p}"`}}function getFormat(t){const r=t instanceof RegExp?(0,o.regexpCode)(t):d.code.formats?(0,o._)`${d.code.formats}${(0,o.getProperty)(l)}`:undefined;const a=i.scopeValue("formats",{key:l,ref:t,code:r});if(typeof t=="object"&&!(t instanceof RegExp)){return[t.type||"string",t.validate,(0,o._)`${a}.validate`]}return["string",t,a]}function validCondition(){if(typeof c=="object"&&!(c instanceof RegExp)&&c.async){if(!m.$async)throw new Error("async format in sync schema");return(0,o._)`await ${y}(${a})`}return typeof h=="function"?(0,o._)`${y}(${a})`:(0,o._)`${y}.test(${a})`}}}};r["default"]=c},3521:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(7556);const a=[o.default];r["default"]=a},5749:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.contentVocabulary=r.metadataVocabulary=void 0;r.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];r.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},5543:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9339);const a=i(4285);const c=i(2210);const l=[o.default,a.default,c.default];r["default"]=l},4540:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3200);const a=i(2931);const c=[o.default,a.default];r["default"]=c},2931:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c={message:({params:{len:t}})=>(0,o.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,o._)`{limit: ${t}}`};const l={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:c,code(t){const{gen:r,schema:i,data:c,it:l}=t;const u=l.items||0;if(u===true)return;const h=r.const("len",(0,o._)`${c}.length`);if(i===false){t.setParams({len:u});t.fail((0,o._)`${h} > ${u}`)}else if(typeof i=="object"&&!(0,a.alwaysValidSchema)(l,i)){const i=r.var("valid",(0,o._)`${h} <= ${u}`);r.if((0,o.not)(i),(()=>validateItems(i,u)));t.ok(i)}l.items=true;function validateItems(i,c){r.forRange("i",c,h,(c=>{t.subschema({keyword:"unevaluatedItems",dataProp:c,dataPropType:a.Type.Num},i);if(!l.allErrors)r.if((0,o.not)(i),(()=>r.break()))}))}}};r["default"]=l},3200:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c=i(2597);const l={message:"must NOT have unevaluated properties",params:({params:t})=>(0,o._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`};const u={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:true,error:l,code(t){const{gen:r,schema:i,data:l,errsCount:u,it:h}=t;if(!u)throw new Error("ajv implementation error");const{allErrors:d,props:p}=h;if(p instanceof o.Name){r.if((0,o._)`${p} !== true`,(()=>r.forIn("key",l,(t=>r.if(unevaluatedDynamic(p,t),(()=>unevaluatedPropCode(t)))))))}else if(p!==true){r.forIn("key",l,(t=>p===undefined?unevaluatedPropCode(t):r.if(unevaluatedStatic(p,t),(()=>unevaluatedPropCode(t)))))}h.props=true;t.ok((0,o._)`${u} === ${c.default.errors}`);function unevaluatedPropCode(c){if(i===false){t.setParams({unevaluatedProperty:c});t.error();if(!d)r.break();return}if(!(0,a.alwaysValidSchema)(h,i)){const i=r.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:c,dataPropType:a.Type.Str},i);if(!d)r.if((0,o.not)(i),(()=>r.break()))}}function unevaluatedDynamic(t,r){return(0,o._)`!${t} || !${t}[${r}]`}function unevaluatedStatic(t,r){const i=[];for(const a in t){if(t[a]===true)i.push((0,o._)`${r} !== ${a}`)}return(0,o.and)(...i)}}};r["default"]=u},6310:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c=i(5151);const l={message:"must be equal to constant",params:({schemaCode:t})=>(0,o._)`{allowedValue: ${t}}`};const u={keyword:"const",$data:true,error:l,code(t){const{gen:r,data:i,$data:l,schemaCode:u,schema:h}=t;if(l||h&&typeof h=="object"){t.fail$data((0,o._)`!${(0,a.useFunc)(r,c.default)}(${i}, ${u})`)}else{t.fail((0,o._)`${h} !== ${i}`)}}};r["default"]=u},9339:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1296);const a={keyword:"dependentRequired",type:"object",schemaType:"object",error:o.error,code:t=>(0,o.validatePropertyDeps)(t)};r["default"]=a},4035:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c=i(5151);const l={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,o._)`{allowedValues: ${t}}`};const u={keyword:"enum",schemaType:"array",$data:true,error:l,code(t){const{gen:r,data:i,$data:l,schema:u,schemaCode:h,it:d}=t;if(!l&&u.length===0)throw new Error("enum must have non-empty array");const p=u.length>=d.opts.loopEnum;let m;const getEql=()=>m!==null&&m!==void 0?m:m=(0,a.useFunc)(r,c.default);let g;if(p||l){g=r.let("valid");t.block$data(g,loopEnum)}else{if(!Array.isArray(u))throw new Error("ajv implementation error");const t=r.const("vSchema",h);g=(0,o.or)(...u.map(((r,i)=>equalCode(t,i))))}t.pass(g);function loopEnum(){r.assign(g,false);r.forOf("v",h,(t=>r.if((0,o._)`${getEql()}(${i}, ${t})`,(()=>r.assign(g,true).break()))))}function equalCode(t,r){const a=u[r];return typeof a==="object"&&a!==null?(0,o._)`${getEql()}(${i}, ${t}[${r}])`:(0,o._)`${i} === ${a}`}}};r["default"]=u},6285:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(6576);const a=i(402);const c=i(139);const l=i(573);const u=i(3075);const h=i(7671);const d=i(8463);const p=i(6542);const m=i(6310);const g=i(4035);const y=[o.default,a.default,c.default,l.default,u.default,h.default,d.default,p.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,g.default];r["default"]=y},2210:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(146);const a={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:r,it:i}){if(r.contains===undefined){(0,o.checkStrictMode)(i,`"${t}" without "contains" is ignored`)}}};r["default"]=a},8463:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a={message({keyword:t,schemaCode:r}){const i=t==="maxItems"?"more":"fewer";return(0,o.str)`must NOT have ${i} than ${r} items`},params:({schemaCode:t})=>(0,o._)`{limit: ${t}}`};const c={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:a,code(t){const{keyword:r,data:i,schemaCode:a}=t;const c=r==="maxItems"?o.operators.GT:o.operators.LT;t.fail$data((0,o._)`${i}.length ${c} ${a}`)}};r["default"]=c},139:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=i(146);const c=i(8694);const l={message({keyword:t,schemaCode:r}){const i=t==="maxLength"?"more":"fewer";return(0,o.str)`must NOT have ${i} than ${r} characters`},params:({schemaCode:t})=>(0,o._)`{limit: ${t}}`};const u={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:l,code(t){const{keyword:r,data:i,schemaCode:l,it:u}=t;const h=r==="maxLength"?o.operators.GT:o.operators.LT;const d=u.opts.unicode===false?(0,o._)`${i}.length`:(0,o._)`${(0,a.useFunc)(t.gen,c.default)}(${i})`;t.fail$data((0,o._)`${d} ${h} ${l}`)}};r["default"]=u},6576:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a=o.operators;const c={maximum:{okStr:"<=",ok:a.LTE,fail:a.GT},minimum:{okStr:">=",ok:a.GTE,fail:a.LT},exclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},exclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}};const l={message:({keyword:t,schemaCode:r})=>(0,o.str)`must be ${c[t].okStr} ${r}`,params:({keyword:t,schemaCode:r})=>(0,o._)`{comparison: ${c[t].okStr}, limit: ${r}}`};const u={keyword:Object.keys(c),type:"number",schemaType:"number",$data:true,error:l,code(t){const{keyword:r,data:i,schemaCode:a}=t;t.fail$data((0,o._)`${i} ${c[r].fail} ${a} || isNaN(${i})`)}};r["default"]=u},3075:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a={message({keyword:t,schemaCode:r}){const i=t==="maxProperties"?"more":"fewer";return(0,o.str)`must NOT have ${i} than ${r} properties`},params:({schemaCode:t})=>(0,o._)`{limit: ${t}}`};const c={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:a,code(t){const{keyword:r,data:i,schemaCode:a}=t;const c=r==="maxProperties"?o.operators.GT:o.operators.LT;t.fail$data((0,o._)`Object.keys(${i}).length ${c} ${a}`)}};r["default"]=c},402:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1644);const a={message:({schemaCode:t})=>(0,o.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,o._)`{multipleOf: ${t}}`};const c={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:a,code(t){const{gen:r,data:i,schemaCode:a,it:c}=t;const l=c.opts.multipleOfPrecision;const u=r.let("res");const h=l?(0,o._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${l}`:(0,o._)`${u} !== parseInt(${u})`;t.fail$data((0,o._)`(${a} === 0 || (${u} = ${i}/${a}, ${h}))`)}};r["default"]=c},573:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(77);const a=i(1644);const c={message:({schemaCode:t})=>(0,a.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,a._)`{pattern: ${t}}`};const l={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:c,code(t){const{data:r,$data:i,schema:c,schemaCode:l,it:u}=t;const h=u.opts.unicodeRegExp?"u":"";const d=i?(0,a._)`(new RegExp(${l}, ${h}))`:(0,o.usePattern)(t,c);t.fail$data((0,a._)`!${d}.test(${r})`)}};r["default"]=l},7671:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(77);const a=i(1644);const c=i(146);const l={message:({params:{missingProperty:t}})=>(0,a.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,a._)`{missingProperty: ${t}}`};const u={keyword:"required",type:"object",schemaType:"array",$data:true,error:l,code(t){const{gen:r,schema:i,schemaCode:l,data:u,$data:h,it:d}=t;const{opts:p}=d;if(!h&&i.length===0)return;const m=i.length>=p.loopRequired;if(d.allErrors)allErrorsMode();else exitOnErrorMode();if(p.strictRequired){const r=t.parentSchema.properties;const{definedProperties:o}=t.it;for(const t of i){if((r===null||r===void 0?void 0:r[t])===undefined&&!o.has(t)){const r=d.schemaEnv.baseId+d.errSchemaPath;const i=`required property "${t}" is not defined at "${r}" (strictRequired)`;(0,c.checkStrictMode)(d,i,d.opts.strictRequired)}}}function allErrorsMode(){if(m||h){t.block$data(a.nil,loopAllRequired)}else{for(const r of i){(0,o.checkReportMissingProp)(t,r)}}}function exitOnErrorMode(){const a=r.let("missing");if(m||h){const i=r.let("valid",true);t.block$data(i,(()=>loopUntilMissing(a,i)));t.ok(i)}else{r.if((0,o.checkMissingProp)(t,i,a));(0,o.reportMissingProp)(t,a);r.else()}}function loopAllRequired(){r.forOf("prop",l,(i=>{t.setParams({missingProperty:i});r.if((0,o.noPropertyInData)(r,u,i,p.ownProperties),(()=>t.error()))}))}function loopUntilMissing(i,c){t.setParams({missingProperty:i});r.forOf(i,l,(()=>{r.assign(c,(0,o.propertyInData)(r,u,i,p.ownProperties));r.if((0,a.not)(c),(()=>{t.error();r.break()}))}),a.nil)}}};r["default"]=u},6542:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(582);const a=i(1644);const c=i(146);const l=i(5151);const u={message:({params:{i:t,j:r}})=>(0,a.str)`must NOT have duplicate items (items ## ${r} and ${t} are identical)`,params:({params:{i:t,j:r}})=>(0,a._)`{i: ${t}, j: ${r}}`};const h={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:u,code(t){const{gen:r,data:i,$data:u,schema:h,parentSchema:d,schemaCode:p,it:m}=t;if(!u&&!h)return;const g=r.let("valid");const y=d.items?(0,o.getSchemaTypes)(d.items):[];t.block$data(g,validateUniqueItems,(0,a._)`${p} === false`);t.ok(g);function validateUniqueItems(){const o=r.let("i",(0,a._)`${i}.length`);const c=r.let("j");t.setParams({i:o,j:c});r.assign(g,true);r.if((0,a._)`${o} > 1`,(()=>(canOptimize()?loopN:loopN2)(o,c)))}function canOptimize(){return y.length>0&&!y.some((t=>t==="object"||t==="array"))}function loopN(c,l){const u=r.name("item");const h=(0,o.checkDataTypes)(y,u,m.opts.strictNumbers,o.DataType.Wrong);const d=r.const("indices",(0,a._)`{}`);r.for((0,a._)`;${c}--;`,(()=>{r.let(u,(0,a._)`${i}[${c}]`);r.if(h,(0,a._)`continue`);if(y.length>1)r.if((0,a._)`typeof ${u} == "string"`,(0,a._)`${u} += "_"`);r.if((0,a._)`typeof ${d}[${u}] == "number"`,(()=>{r.assign(l,(0,a._)`${d}[${u}]`);t.error();r.assign(g,false).break()})).code((0,a._)`${d}[${u}] = ${c}`)}))}function loopN2(o,u){const h=(0,c.useFunc)(r,l.default);const d=r.name("outer");r.label(d).for((0,a._)`;${o}--;`,(()=>r.for((0,a._)`${u} = ${o}; ${u}--;`,(()=>r.if((0,a._)`${h}(${i}[${o}], ${i}[${u}])`,(()=>{t.error();r.assign(g,false).break(d)}))))))}}};r["default"]=h},8311:(t,r,i)=>{var o=i(9675);function retry(t,r){function run(i,a){var c=r||{};if(!("randomize"in c)){c.randomize=true}var 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},833:function(t,r,i){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:true});const a=o(i(2361));function arrayMove(t,r,i,o,a){for(let c=0;c>>0;t=t-1;t=t|t>>1;t=t|t>>2;t=t|t>>4;t=t|t>>8;t=t|t>>16;return t+1}function getCapacity(t){return pow2AtLeast(Math.min(Math.max(16,t),1073741824))}class Deque{constructor(t){this._capacity=getCapacity(t);this._length=0;this._front=0;this.arr=[]}push(t){const r=this._length;this.checkCapacity(r+1);const i=this._front+r&this._capacity-1;this.arr[i]=t;this._length=r+1;return r+1}pop(){const t=this._length;if(t===0){return void 0}const r=this._front+t-1&this._capacity-1;const i=this.arr[r];this.arr[r]=void 0;this._length=t-1;return i}shift(){const t=this._length;if(t===0){return void 0}const r=this._front;const i=this.arr[r];this.arr[r]=void 0;this._front=r+1&this._capacity-1;this._length=t-1;return i}get length(){return this._length}checkCapacity(t){if(this._capacityr){const t=i+o&r-1;arrayMove(this.arr,0,this.arr,r,t)}}}class ReleaseEmitter extends a.default{}function isFn(t){return typeof t==="function"}function defaultInit(){return"1"}class Sema{constructor(t,{initFn:r=defaultInit,pauseFn:i,resumeFn:o,capacity:a=10}={}){if(isFn(i)!==isFn(o)){throw new Error("pauseFn and resumeFn must be both set for pausing")}this.nrTokens=t;this.free=new Deque(t);this.waiting=new Deque(a);this.releaseEmitter=new ReleaseEmitter;this.noTokens=r===defaultInit;this.pauseFn=i;this.resumeFn=o;this.paused=false;this.releaseEmitter.on("release",(t=>{const r=this.waiting.shift();if(r){r.resolve(t)}else{if(this.resumeFn&&this.paused){this.paused=false;this.resumeFn()}this.free.push(t)}}));for(let i=0;i{if(this.pauseFn&&!this.paused){this.paused=true;this.pauseFn()}this.waiting.push({resolve:t,reject:r})}))}release(t){this.releaseEmitter.emit("release",this.noTokens?"1":t)}drain(){const t=new Array(this.nrTokens);for(let r=0;ro.release()),a)}}r.RateLimit=RateLimit},2761:(t,r,i)=>{"use strict";const o=i(6455);const a=i(3370);const c=i(5652);const l=i(3266);const braces=(t,r={})=>{let i=[];if(Array.isArray(t)){for(const o of t){const 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},3370:(t,r,i)=>{"use strict";const o=i(7176);const a=i(3342);const compile=(t,r={})=>{const walk=(t,i={})=>{const c=a.isInvalidBrace(i);const l=t.invalid===true&&r.escapeInvalid===true;const u=c===true||l===true;const h=r.escapeInvalid===true?"\\":"";let d="";if(t.isOpen===true){return h+t.value}if(t.isClose===true){console.log("node.isClose",h,t.value);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){const i=a.reduce(t.nodes);const c=o(...i,{...r,wrap:false,toRegex:true,strictZeros:true});if(c.length!==0){return i.length>1&&c.length>1?`(${c})`:c}}if(t.nodes){for(const r of t.nodes){d+=walk(r,t)}}return d};return walk(t)};t.exports=compile},3713:t=>{"use strict";t.exports={MAX_LENGTH:1e4,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"}},5652:(t,r,i)=>{"use strict";const o=i(7176);const a=i(6455);const c=i(3342);const append=(t="",r="",i=false)=>{const 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(const a of t){if(Array.isArray(a)){for(const 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={})=>{const i=r.rangeLimit===undefined?1e3:r.rangeLimit;const 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){const 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}const 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{"use strict";const o=i(6455);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:v,CHAR_DOUBLE_QUOTE:b,CHAR_SINGLE_QUOTE:w,CHAR_NO_BREAK_SPACE:E,CHAR_ZERO_WIDTH_NOBREAK_SPACE:S}=i(3713);const parse=(t,r={})=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}const i=r||{};const $=typeof i.maxLength==="number"?Math.min(a,i.maxLength):a;if(t.length>$){throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${$})`)}const x={type:"root",input:t,nodes:[]};const R=[x];let O=x;let P=x;let A=0;const T=t.length;let C=0;let k=0;let I;const advance=()=>t[C++];const push=t=>{if(t.type==="text"&&P.type==="dot"){P.type="text"}if(P&&P.type==="text"&&t.type==="text"){P.value+=t.value;return}O.nodes.push(t);t.parent=O;t.prev=P;P=t;return t};push({type:"bos"});while(C0){if(O.ranges>0){O.ranges=0;const t=O.nodes.shift();O.nodes=[t,{type:"text",value:o(O)}]}push({type:"comma",value:I});O.commas++;continue}if(I===h&&k>0&&O.commas===0){const t=O.nodes;if(k===0||t.length===0){push({type:"text",value:I});continue}if(P.type==="dot"){O.range=[];P.value+=I;P.type="range";if(O.nodes.length!==3&&O.nodes.length!==5){O.invalid=true;O.ranges=0;P.type="text";continue}O.ranges++;O.args=[];continue}if(P.type==="range"){t.pop();const r=t[t.length-1];r.value+=P.value+I;P=r;O.ranges--;continue}push({type:"dot",value:I});continue}push({type:"text",value:I})}do{O=R.pop();if(O.type!=="root"){O.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}}));const t=R[R.length-1];const r=t.nodes.indexOf(O);t.nodes.splice(r,1,...O.nodes)}}while(R.length>0);push({type:"eos"});return x};t.exports=parse},6455:(t,r,i)=>{"use strict";const o=i(3342);t.exports=(t,r={})=>{const stringify=(t,i={})=>{const a=r.escapeInvalid&&o.isInvalidBrace(i);const 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(const r of t.nodes){l+=stringify(r)}}return l};return stringify(t)}},3342:(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)=>{const 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{"use strict";const o=i(9116);const a=process.env;Object.defineProperty(r,"_vendors",{value:o.map((function(t){return t.constant}))});r.name=null;r.isPR=null;o.forEach((function(t){const i=Array.isArray(t.env)?t.env:[t.env];const o=i.every((function(t){return checkEnv(t)}));r[t.constant]=o;if(!o){return}r.name=t.name;switch(typeof t.pr){case"string":r.isPR=!!a[t.pr];break;case"object":if("env"in t.pr){r.isPR=t.pr.env in a&&a[t.pr.env]!==t.pr.ne}else if("any"in t.pr){r.isPR=t.pr.any.some((function(t){return!!a[t]}))}else{r.isPR=checkEnv(t.pr)}break;default:r.isPR=null}}));r.isCI=!!(a.CI!=="false"&&(a.BUILD_ID||a.BUILD_NUMBER||a.CI||a.CI_APP_ID||a.CI_BUILD_ID||a.CI_BUILD_NUMBER||a.CI_NAME||a.CONTINUOUS_INTEGRATION||a.RUN_ID||r.name||false));function checkEnv(t){if(typeof t==="string")return!!a[t];if("env"in t){return a[t.env]&&a[t.env].includes(t.includes)}if("any"in t){return t.any.some((function(t){return!!a[t]}))}return Object.keys(t).every((function(r){return a[r]===t[r]}))}},1405:(t,r,i)=>{"use strict";const o=i(2081);const a=i(3466);const c=i(9190);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},9190: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}},3466:(t,r,i)=>{"use strict";const o=i(1017);const a=i(2472);const c=i(2976);const l=i(628);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},2976: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},628:(t,r,i)=>{"use strict";const o=i(7147);const a=i(5036);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},2472:(t,r,i)=>{"use strict";const o=i(1017);const a=i(6470);const c=i(1829);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},1706:t=>{"use strict"; /*! * @description Recursive object extending * @author Viacheslav Lotsmanov * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */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}},6688:t=>{"use strict";t.exports=function equal(t,r){if(t===r)return true;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return false;var i,o,a;if(Array.isArray(t)){i=t.length;if(i!=r.length)return false;for(o=i;o--!==0;)if(!equal(t[o],r[o]))return false;return true}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();a=Object.keys(t);i=a.length;if(i!==Object.keys(r).length)return false;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return false;for(o=i;o--!==0;){var c=a[o];if(!equal(t[c],r[c]))return false}return true}return t!==t&&r!==r}},9453:(t,r,i)=>{"use strict";const o=i(6925);const a=i(9306);const c=i(875);const l=i(7838);const u=i(7306);const h=i(653);async function FastGlob(t,r){assertPatternsInput(t);const i=getWorks(t,a.default,r);const o=await Promise.all(i);return h.array.flatten(o)}(function(t){t.glob=t;t.globSync=sync;t.globStream=stream;t.async=t;function sync(t,r){assertPatternsInput(t);const i=getWorks(t,l.default,r);return h.array.flatten(i)}t.sync=sync;function stream(t,r){assertPatternsInput(t);const i=getWorks(t,c.default,r);return h.stream.merge(i)}t.stream=stream;function generateTasks(t,r){assertPatternsInput(t);const i=[].concat(t);const a=new u.default(r);return o.generate(i,a)}t.generateTasks=generateTasks;function isDynamicPattern(t,r){assertPatternsInput(t);const i=new u.default(r);return h.pattern.isDynamicPattern(t,i)}t.isDynamicPattern=isDynamicPattern;function escapePath(t){assertPatternsInput(t);return h.path.escape(t)}t.escapePath=escapePath;function convertPathToPattern(t){assertPatternsInput(t);return h.path.convertPathToPattern(t)}t.convertPathToPattern=convertPathToPattern;let r;(function(t){function escapePath(t){assertPatternsInput(t);return h.path.escapePosixPath(t)}t.escapePath=escapePath;function convertPathToPattern(t){assertPatternsInput(t);return h.path.convertPosixPathToPattern(t)}t.convertPathToPattern=convertPathToPattern})(r=t.posix||(t.posix={}));let i;(function(t){function escapePath(t){assertPatternsInput(t);return h.path.escapeWindowsPath(t)}t.escapePath=escapePath;function convertPathToPattern(t){assertPatternsInput(t);return h.path.convertWindowsPathToPattern(t)}t.convertPathToPattern=convertPathToPattern})(i=t.win32||(t.win32={}))})(FastGlob||(FastGlob={}));function getWorks(t,r,i){const a=[].concat(t);const c=new u.default(i);const l=o.generate(a,c);const h=new r(c);return l.map(h.read,h)}function assertPatternsInput(t){const r=[].concat(t);const i=r.every((t=>h.string.isString(t)&&!h.string.isEmpty(t)));if(!i){throw new TypeError("Patterns must be a string (non empty) or an array of strings")}}t.exports=FastGlob},6925:(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(653);function generate(t,r){const i=processPatterns(t,r);const a=processPatterns(r.ignore,r);const c=getPositivePatterns(i);const l=getNegativePatternsAsPositive(i,a);const u=c.filter((t=>o.pattern.isStaticPattern(t,r)));const h=c.filter((t=>o.pattern.isDynamicPattern(t,r)));const d=convertPatternsToTasks(u,l,false);const p=convertPatternsToTasks(h,l,true);return d.concat(p)}r.generate=generate;function processPatterns(t,r){let i=t;if(r.braceExpansion){i=o.pattern.expandPatternsWithBraceExpansion(i)}if(r.baseNameMatch){i=i.map((t=>t.includes("/")?t:`**/${t}`))}return i.map((t=>o.pattern.removeDuplicateSlashes(t)))}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},9306:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(3314);const a=i(1307);class ProviderAsync extends a.default{constructor(){super(...arguments);this._reader=new o.default(this._settings)}async read(t){const r=this._getRootDirectory(t);const i=this._getReaderOptions(t);const o=await this.api(r,t,i);return o.map((t=>i.transform(t)))}api(t,r,i){if(r.dynamic){return this._reader.dynamic(t,i)}return this._reader.static(r.patterns,i)}}r["default"]=ProviderAsync},6225:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(653);const a=i(3020);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},2191:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(653);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,Object.assign(Object.assign({},this._micromatchOptions),{dot:true}));return t=>this._filter(t,i,a)}_filter(t,r,i){const a=o.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(a)){return false}if(this._onlyFileFilter(t)||this._onlyDirectoryFilter(t)){return false}if(this._isSkippedByAbsoluteNegativePatterns(a,i)){return false}const c=t.dirent.isDirectory();const l=this._isMatchToPatterns(a,r,c)&&!this._isMatchToPatterns(a,i,c);if(this._settings.unique&&l){this._createIndexRecord(a)}return l}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,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,i){const a=o.pattern.matchAny(t,r);if(!a&&i){return o.pattern.matchAny(t+"/",r)}return a}}r["default"]=EntryFilter},9289:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(653);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},7657:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(653);class Matcher{constructor(t,r,i){this._patterns=t;this._settings=r;this._micromatchOptions=i;this._storage=[];this._fillStorage()}_fillStorage(){for(const t of this._patterns){const r=this._getPatternSegments(t);const i=this._splitSegmentsIntoSections(r);this._storage.push({complete:i.length<=1,pattern:t,segments:r,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},3020:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(7657);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},1307:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(6225);const c=i(2191);const l=i(9289);const u=i(9153);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},875:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9955);const a=i(5166);const c=i(1307);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},7838:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(4678);const a=i(1307);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},9153:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(653);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},3314:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(4734);const a=i(3612);const c=i(5166);class ReaderAsync extends a.default{constructor(){super(...arguments);this._walkAsync=o.walk;this._readerStream=new c.default(this._settings)}dynamic(t,r){return new Promise(((i,o)=>{this._walkAsync(t,r,((t,r)=>{if(t===null){i(r)}else{o(t)}}))}))}async static(t,r){const i=[];const o=this._readerStream.static(t,r);return new Promise(((t,r)=>{o.once("error",r);o.on("data",(t=>i.push(t)));o.once("end",(()=>t(i)))}))}}r["default"]=ReaderAsync},3612:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(4585);const c=i(653);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},5166:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9955);const a=i(4585);const c=i(4734);const l=i(3612);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;tthis._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},4678:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(4585);const a=i(4734);const c=i(3612);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},7306:(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}this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===undefined?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},r.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}r["default"]=Settings},1280:(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},5242:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code==="ENOENT"}r.isEnoentCodeError=isEnoentCodeError},2524:(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},653:(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(1280);r.array=o;const a=i(5242);r.errno=a;const c=i(2524);r.fs=c;const l=i(2428);r.path=l;const u=i(6674);r.pattern=u;const h=i(7514);r.stream=h;const d=i(746);r.string=d},2428:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.convertPosixPathToPattern=r.convertWindowsPathToPattern=r.convertPathToPattern=r.escapePosixPath=r.escapeWindowsPath=r.escape=r.removeLeadingDotSegment=r.makeAbsolute=r.unixify=void 0;const o=i(2037);const a=i(1017);const c=o.platform()==="win32";const l=2;const u=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;const h=/(\\?)([(){}]|^!|[!+@](?=\())/g;const d=/^\\\\([.?])/;const p=/\\(?![!()+@{}])/g;function unixify(t){return t.replace(/\\/g,"/")}r.unixify=unixify;function makeAbsolute(t,r){return a.resolve(t,r)}r.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)==="."){const r=t.charAt(1);if(r==="/"||r==="\\"){return t.slice(l)}}return t}r.removeLeadingDotSegment=removeLeadingDotSegment;r.escape=c?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(h,"\\$2")}r.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(u,"\\$2")}r.escapePosixPath=escapePosixPath;r.convertPathToPattern=c?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(d,"//$1").replace(p,"/")}r.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}r.convertPosixPathToPattern=convertPosixPathToPattern},6674:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.removeDuplicateSlashes=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(514);const c=i(3361);const l="**";const u="\\";const h=/[*?]|^!/;const d=/\[[^[]*]/;const p=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;const m=/[!*+?@]\([^(]*\)/;const g=/,|\.\./;const y=/(?!^)\/{2,}/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){const r=c.braces(t,{expand:true,nodupes:true});r.sort(((t,r)=>t.length-r.length));return r.filter((t=>t!==""))}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;function removeDuplicateSlashes(t){return t.replace(y,"/")}r.removeDuplicateSlashes=removeDuplicateSlashes},7514:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.merge=void 0;const o=i(4876);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")))}},746:(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},7255:(t,r,i)=>{"use strict";var o=i(7361);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 equal to or 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,get concurrency(){return i},set concurrency(t){if(!(t>=1)){throw new Error("fastqueue concurrency must be equal to or greater than 1")}i=t;if(d.paused)return;for(;c&&u=i||d.paused){if(l){l.next=m;l=m}else{c=m;l=m;d.saturated()}}else{u++;r.call(t,m.value,m.worked)}}function unshift(o,p){var m=a.get();m.context=t;m.release=release;m.value=o;m.callback=p||noop;m.errorHandler=h;if(u>=i||d.paused){if(c){m.next=c;c=m}else{c=m;l=m;d.saturated()}}else{u++;r.call(t,m.value,m.worked)}}function release(o){if(o){a.release(o)}var h=c;if(h&&u<=i){if(!d.paused){if(l===c){l=null}c=h.next;h.next=null;r.call(t,h.value,h.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(){if(o.idle()){return new Promise((function(t){t()}))}var t=o.drain;var r=new Promise((function(r){o.drain=function(){t();r()}}));return r}}t.exports=fastqueue;t.exports.promise=queueAsPromised},7176:(t,r,i)=>{"use strict"; /*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */const o=i(3837);const a=i(9238);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{t.negatives.sort(((t,r)=>tr?1:0));t.positives.sort(((t,r)=>tr?1:0));let o=r.capture?"":"?:";let a="";let c="";let l;if(t.positives.length){a=t.positives.map((t=>toMaxLen(String(t),i))).join("|")}if(t.negatives.length){c=`-(${o}${t.negatives.map((t=>toMaxLen(String(t),i))).join("|")})`}if(a&&c){l=`${a}|${c}`}else{l=a||c}if(r.wrap){return`(${o}${l})`}return l};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 v={negatives:[],positives:[]};let push=t=>v[t<0?"negatives":"positives"].push(Math.abs(t));let b=[];let w=0;while(l?a>=c:a<=c){if(o.toRegex===true&&i>1){push(a)}else{b.push(pad(y(a,w),m,g))}a=l?a-i:a+i;w++}if(o.toRegex===true){return i>1?toSequence(v,o,m):toRegex(b,null,{wrap:false,...o})}return b};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},514:(t,r,i)=>{"use strict";var o=i(11);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")}},7057:(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{ /*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ 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}},11:(t,r,i)=>{ /*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ var o=i(7862);var a={"{":"}","(":")","[":"]"};var strictCheck=function(t){if(t[0]==="!"){return true}var r=0;var i=-2;var o=-2;var c=-2;var l=-2;var u=-2;while(rr){if(u===-1||u>o){return true}u=t.indexOf("\\",r);if(u===-1||u>o){return true}}}if(c!==-1&&t[r]==="{"&&t[r+1]!=="}"){c=t.indexOf("}",r);if(c>r){u=t.indexOf("\\",r);if(u===-1||u>c){return true}}}if(l!==-1&&t[r]==="("&&t[r+1]==="?"&&/[:!=]/.test(t[r+2])&&t[r+3]!==")"){l=t.indexOf(")",r);if(l>r){u=t.indexOf("\\",r);if(u===-1||u>l){return true}}}if(i!==-1&&t[r]==="("&&t[r+1]!=="|"){if(ii){u=t.indexOf("\\",i);if(u===-1||u>l){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{"use strict"; /*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. */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}},2636:(t,r,i)=>{var o=i(7147);var a;if(process.platform==="win32"||global.TESTING_WINDOWS){a=i(7273)}else{a=i(8345)}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}}}},8345:(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}},7273:(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{"use strict";var r=t.exports=function(t,r,i){if(typeof r=="function"){i=r;r={}}i=r.cb||i;var o=typeof i=="function"?i:i.pre||function(){};var a=i.post||function(){};_traverse(r,o,a,t,"",t)};r.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true,if:true,then:true,else:true};r.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};r.propsKeywords={$defs:true,definitions:true,properties:true,patternProperties:true,dependencies:true};r.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(t,i,o,a,c,l,u,h,d,p){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,c,l,u,h,d,p);for(var m in a){var g=a[m];if(Array.isArray(g)){if(m in r.arrayKeywords){for(var y=0;y{"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{"use strict";const o=i(9955);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;r0){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{"use strict";const o=i(3837);const a=i(2761);const c=i(4902);const l=i(7724);const isEmptyString=t=>t===""||t==="./";const hasBraces=t=>{const r=t.indexOf("{");return r>-1&&t.indexOf("}",r)>-1};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!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=new Set(micromatch(t,r,{...i,onResult:onResult}));for(let t of a){if(!c.has(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||!hasBraces(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})};micromatch.hasBraces=hasBraces;t.exports=micromatch},4599:t=>{"use strict";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)}function isConstructorOrProto(t,r){return r==="constructor"&&typeof t[r]==="function"||r==="__proto__"}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={};function aliasIsBoolean(t){return o[t].some((function(t){return i.bools[t]}))}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]){[].concat(o[t]).forEach((function(t){i.strings[t]=true}))}}));var a=r.default||{};var c={_:[]};function argDefined(t,r){return i.allBools&&/^--[^=]+$/.test(r)||i.strings[t]||i.bools[t]||o[t]}function setKey(t,r,o){var a=t;for(var c=0;c{"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},6399:(t,r,i)=>{let o=i(6224);let a=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||o.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env);let formatter=(t,r,i=t)=>o=>{let a=""+o;let c=a.indexOf(r,t.length);return~c?t+replaceClose(a,r,i,c)+r:t+a+r};let replaceClose=(t,r,i,o)=>{let a=t.substring(0,o)+i;let c=t.substring(o+r.length);let l=c.indexOf(r);return~l?a+replaceClose(c,r,i,l):a+c};let createColors=(t=a)=>({isColorSupported:t,reset:t?t=>`${t}`:String,bold:t?formatter("","",""):String,dim:t?formatter("","",""):String,italic:t?formatter("",""):String,underline:t?formatter("",""):String,inverse:t?formatter("",""):String,hidden:t?formatter("",""):String,strikethrough:t?formatter("",""):String,black:t?formatter("",""):String,red:t?formatter("",""):String,green:t?formatter("",""):String,yellow:t?formatter("",""):String,blue:t?formatter("",""):String,magenta:t?formatter("",""):String,cyan:t?formatter("",""):String,white:t?formatter("",""):String,gray:t?formatter("",""):String,bgBlack:t?formatter("",""):String,bgRed:t?formatter("",""):String,bgGreen:t?formatter("",""):String,bgYellow:t?formatter("",""):String,bgBlue:t?formatter("",""):String,bgMagenta:t?formatter("",""):String,bgCyan:t?formatter("",""):String,bgWhite:t?formatter("",""):String});t.exports=createColors();t.exports.createColors=createColors},4902:(t,r,i)=>{"use strict";t.exports=i(7109)},4280:(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 v=`${l}{1,2}${g}`;const b=`(?!${l})`;const w=`(?!${y}${v})`;const E=`(?!${l}{0,1}${g})`;const S=`(?!${v})`;const $=`[^.${d}]`;const x=`${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:v,NO_DOT:b,NO_DOTS:w,NO_DOT_SLASH:E,NO_DOTS_SLASH:S,QMARK_NO_DOT:$,STAR:x,START_ANCHOR:y};const O={...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 P={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:P,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?O:R}}},6278:(t,r,i)=>{"use strict";const o=i(4280);const a=i(7724);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 v=i.capture?"":"?:";const b=a.isWindows(r);const w=o.globChars(b);const E=o.extglobChars(w);const{DOT_LITERAL:S,PLUS_LITERAL:$,SLASH_LITERAL:x,ONE_CHAR:R,DOTS_SLASH:O,NO_DOT:P,NO_DOT_SLASH:A,NO_DOTS_SLASH:T,QMARK:C,QMARK_NO_DOT:k,STAR:I,START_ANCHOR:N}=w;const globstar=t=>`(${v}(?:(?!${N}${t.dot?O:S}).)*?)`;const D=i.dot?"":P;const L=i.dot?C:k;let M=i.bash===true?globstar(i):I;if(i.capture){M=`(${M})`}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 U=[];const B=[];const H=[];let V=g;let z;const eos=()=>j.index===m-1;const G=j.peek=(r=1)=>t[j.index+r];const q=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)==="?")){q();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(V.type==="globstar"){const r=j.braces>0&&(t.type==="comma"||t.type==="brace");const i=t.extglob===true||U.length&&(t.type==="pipe"||t.type==="paren");if(t.type!=="slash"&&t.type!=="paren"&&!r&&!i){j.output=j.output.slice(0,-V.output.length);V.type="star";V.value="*";V.output=M;j.output+=V.output}}if(U.length&&t.type!=="paren"){U[U.length-1].inner+=t.value}if(t.value||t.output)append(t);if(V&&V.type==="text"&&t.type==="text"){V.value+=t.value;V.output=(V.output||"")+t.value;return}t.prev=V;y.push(t);V=t};const extglobOpen=(t,r)=>{const o={...E[r],conditions:1,inner:""};o.prev=V;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:q(),output:a});U.push(o)};const extglobClose=t=>{let o=t.close+(i.capture?")":"");let a;if(t.type==="negate"){let c=M;if(t.inner&&t.inner.length>1&&t.inner.includes("/")){c=globstar(i)}if(c!==M||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:z,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 L+(c?C.repeat(c.length):"")}return C.repeat(i.length)}if(a==="."){return S.repeat(i.length)}if(a==="*"){if(r){return r+a+(c?M:"")}return M}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()){z=q();if(z==="\0"){continue}if(z==="\\"){const t=G();if(t==="/"&&i.bash!==true){continue}if(t==="."||t===";"){continue}if(!t){z+="\\";push({type:"text",value:z});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){z+="\\"}}if(i.unescape===true){z=q()}else{z+=q()}if(j.brackets===0){push({type:"text",value:z});continue}}if(j.brackets>0&&(z!=="]"||V.value==="["||V.value==="[^")){if(i.posix!==false&&z===":"){const t=V.value.slice(1);if(t.includes("[")){V.posix=true;if(t.includes(":")){const t=V.value.lastIndexOf("[");const r=V.value.slice(0,t);const i=V.value.slice(t+2);const o=l[i];if(o){V.value=r+o;j.backtrack=true;q();if(!g.output&&y.indexOf(V)===1){g.output=R}continue}}}}if(z==="["&&G()!==":"||z==="-"&&G()==="]"){z=`\\${z}`}if(z==="]"&&(V.value==="["||V.value==="[^")){z=`\\${z}`}if(i.posix===true&&z==="!"&&V.value==="["){z="^"}V.value+=z;append({value:z});continue}if(j.quotes===1&&z!=='"'){z=a.escapeRegex(z);V.value+=z;append({value:z});continue}if(z==='"'){j.quotes=j.quotes===1?0:1;if(i.keepQuotes===true){push({type:"text",value:z})}continue}if(z==="("){increment("parens");push({type:"paren",value:z});continue}if(z===")"){if(j.parens===0&&i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const t=U[U.length-1];if(t&&j.parens===t.parens+1){extglobClose(U.pop());continue}push({type:"paren",value:z,output:j.parens?")":"\\)"});decrement("parens");continue}if(z==="["){if(i.nobracket===true||!remaining().includes("]")){if(i.nobracket!==true&&i.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}z=`\\${z}`}else{increment("brackets")}push({type:"bracket",value:z});continue}if(z==="]"){if(i.nobracket===true||V&&V.type==="bracket"&&V.value.length===1){push({type:"text",value:z,output:`\\${z}`});continue}if(j.brackets===0){if(i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:z,output:`\\${z}`});continue}decrement("brackets");const t=V.value.slice(1);if(V.posix!==true&&t[0]==="^"&&!t.includes("/")){z=`/${z}`}V.value+=z;append({value:z});if(i.literalBrackets===false||a.hasRegexChars(t)){continue}const r=a.escapeRegex(V.value);j.output=j.output.slice(0,-V.value.length);if(i.literalBrackets===true){j.output+=r;V.value=r;continue}V.value=`(${v}${r}|${V.value})`;j.output+=V.value;continue}if(z==="{"&&i.nobrace!==true){increment("braces");const t={type:"brace",value:z,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};B.push(t);push(t);continue}if(z==="}"){const t=B[B.length-1];if(i.nobrace===true||!t){push({type:"text",value:z,output:z});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="\\{";z=r="\\}";j.output=i;for(const t of o){j.output+=t.output||t.value}}push({type:"brace",value:z,output:r});decrement("braces");B.pop();continue}if(z==="|"){if(U.length>0){U[U.length-1].conditions++}push({type:"text",value:z});continue}if(z===","){let t=z;const r=B[B.length-1];if(r&&H[H.length-1]==="braces"){r.comma=true;t="|"}push({type:"comma",value:z,output:t});continue}if(z==="/"){if(V.type==="dot"&&j.index===j.start+1){j.start=j.index+1;j.consumed="";j.output="";y.pop();V=g;continue}push({type:"slash",value:z,output:x});continue}if(z==="."){if(j.braces>0&&V.type==="dot"){if(V.value===".")V.output=S;const t=B[B.length-1];V.type="dots";V.output+=z;V.value+=z;t.dots=true;continue}if(j.braces+j.parens===0&&V.type!=="bos"&&V.type!=="slash"){push({type:"text",value:z,output:S});continue}push({type:"dot",value:z,output:S});continue}if(z==="?"){const t=V&&V.value==="(";if(!t&&i.noextglob!==true&&G()==="("&&G(2)!=="?"){extglobOpen("qmark",z);continue}if(V&&V.type==="paren"){const t=G();let r=z;if(t==="<"&&!a.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(V.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(remaining())){r=`\\${z}`}push({type:"text",value:z,output:r});continue}if(i.dot!==true&&(V.type==="slash"||V.type==="bos")){push({type:"qmark",value:z,output:k});continue}push({type:"qmark",value:z,output:C});continue}if(z==="!"){if(i.noextglob!==true&&G()==="("){if(G(2)!=="?"||!/[!=<:]/.test(G(3))){extglobOpen("negate",z);continue}}if(i.nonegate!==true&&j.index===0){negate();continue}}if(z==="+"){if(i.noextglob!==true&&G()==="("&&G(2)!=="?"){extglobOpen("plus",z);continue}if(V&&V.value==="("||i.regex===false){push({type:"plus",value:z,output:$});continue}if(V&&(V.type==="bracket"||V.type==="paren"||V.type==="brace")||j.parens>0){push({type:"plus",value:z});continue}push({type:"plus",value:$});continue}if(z==="@"){if(i.noextglob!==true&&G()==="("&&G(2)!=="?"){push({type:"at",extglob:true,value:z,output:""});continue}push({type:"text",value:z});continue}if(z!=="*"){if(z==="$"||z==="^"){z=`\\${z}`}const t=u.exec(remaining());if(t){z+=t[0];j.index+=t[0].length}push({type:"text",value:z});continue}if(V&&(V.type==="globstar"||V.star===true)){V.type="star";V.star=true;V.value+=z;V.output=M;j.backtrack=true;j.globstar=true;consume(z);continue}let r=remaining();if(i.noextglob!==true&&/^\([^?]/.test(r)){extglobOpen("star",z);continue}if(V.type==="star"){if(i.noglobstar===true){consume(z);continue}const o=V.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:z,output:""});continue}const u=j.braces>0&&(o.type==="comma"||o.type==="brace");const h=U.length&&(o.type==="pipe"||o.type==="paren");if(!c&&o.type!=="paren"&&!u&&!h){push({type:"star",value:z,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()){V.type="globstar";V.value+=z;V.output=globstar(i);j.output=V.output;j.globstar=true;consume(z);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&!l&&eos()){j.output=j.output.slice(0,-(o.output+V.output).length);o.output=`(?:${o.output}`;V.type="globstar";V.output=globstar(i)+(i.strictSlashes?")":"|$)");V.value+=z;j.globstar=true;j.output+=o.output+V.output;consume(z);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+V.output).length);o.output=`(?:${o.output}`;V.type="globstar";V.output=`${globstar(i)}${x}|${x}${t})`;V.value+=z;j.output+=o.output+V.output;j.globstar=true;consume(z+q());push({type:"slash",value:"/",output:""});continue}if(o.type==="bos"&&r[0]==="/"){V.type="globstar";V.value+=z;V.output=`(?:^|${x}|${globstar(i)}${x})`;j.output=V.output;j.globstar=true;consume(z+q());push({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-V.output.length);V.type="globstar";V.output=globstar(i);V.value+=z;j.output+=V.output;j.globstar=true;consume(z);continue}const o={type:"star",value:z,output:M};if(i.bash===true){o.output=".*?";if(V.type==="bos"||V.type==="slash"){o.output=D+o.output}push(o);continue}if(V&&(V.type==="bracket"||V.type==="paren")&&i.regex===true){o.output=z;push(o);continue}if(j.index===j.start||V.type==="slash"||V.type==="dot"){if(V.type==="dot"){j.output+=A;V.output+=A}else if(i.dot===true){j.output+=T;V.output+=T}else{j.output+=D;V.output+=D}if(G()!=="*"){j.output+=R;V.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&&(V.type==="star"||V.type==="bracket")){push({type:"maybe_slash",value:"",output:`${x}?`})}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:v,NO_DOTS:b,NO_DOTS_SLASH:w,STAR:E,START_ANCHOR:S}=o.globChars(h);const $=i.dot?b:v;const x=i.dot?w:v;const R=i.capture?"":"?:";const O={negated:false,prefix:""};let P=i.bash===true?".*?":E;if(i.capture){P=`(${P})`}const globstar=t=>{if(t.noglobstar===true)return P;return`(${R}(?:(?!${S}${t.dot?y:p}).)*?)`};const create=t=>{switch(t){case"*":return`${$}${g}${P}`;case".*":return`${p}${g}${P}`;case"*.*":return`${$}${P}${p}${g}${P}`;case"*/*":return`${$}${P}${m}${g}${x}${P}`;case"**":return $+globstar(i);case"**/*":return`(?:${$}${globstar(i)}${m})?${x}${g}${P}`;case"**/*.*":return`(?:${$}${globstar(i)}${m})?${x}${P}${p}${g}${P}`;case"**/.*":return`(?:${$}${globstar(i)}${m})?${p}${g}${P}`;default:{const r=/^(.*?)\.(\w+)$/.exec(t);if(!r)return;const i=create(r[1]);if(!i)return;return i+p+r[2]}}};const A=a.removePrefix(t,O);let T=create(A);if(T&&i.strictSlashes!==true){T+=`${m}?`}return T};t.exports=parse},7109:(t,r,i)=>{"use strict";const o=i(1017);const a=i(5363);const c=i(6278);const l=i(7724);const u=i(4280);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},5363:(t,r,i)=>{"use strict";const o=i(7724);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:v,CHAR_QUESTION_MARK:b,CHAR_RIGHT_CURLY_BRACE:w,CHAR_RIGHT_PARENTHESES:E,CHAR_RIGHT_SQUARE_BRACKET:S}=i(4280);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 $=t.length-1;const x=i.parts===true||i.scanToEnd===true;const R=[];const O=[];const P=[];let A=t;let T=-1;let C=0;let k=0;let I=false;let N=false;let D=false;let L=false;let M=false;let j=false;let U=false;let B=false;let H=false;let V=false;let z=0;let G;let q;let W={value:"",depth:0,isGlob:false};const eos=()=>T>=$;const peek=()=>A.charCodeAt(T+1);const advance=()=>{G=q;return A.charCodeAt(++T)};while(T<$){q=advance();let t;if(q===l){U=W.backslashes=true;q=advance();if(q===m){j=true}continue}if(j===true||q===m){z++;while(eos()!==true&&(q=advance())){if(q===l){U=W.backslashes=true;advance();continue}if(q===m){z++;continue}if(j!==true&&q===h&&(q=advance())===h){I=W.isBrace=true;D=W.isGlob=true;V=true;if(x===true){continue}break}if(j!==true&&q===u){I=W.isBrace=true;D=W.isGlob=true;V=true;if(x===true){continue}break}if(q===w){z--;if(z===0){j=false;I=W.isBrace=true;V=true;break}}}if(x===true){continue}break}if(q===p){R.push(T);O.push(W);W={value:"",depth:0,isGlob:false};if(V===true)continue;if(G===h&&T===C+1){C+=2;continue}k=T+1;continue}if(i.noext!==true){const t=q===v||q===c||q===a||q===b||q===d;if(t===true&&peek()===g){D=W.isGlob=true;L=W.isExtglob=true;V=true;if(q===d&&T===C){H=true}if(x===true){while(eos()!==true&&(q=advance())){if(q===l){U=W.backslashes=true;q=advance();continue}if(q===E){D=W.isGlob=true;V=true;break}}continue}break}}if(q===a){if(G===a)M=W.isGlobstar=true;D=W.isGlob=true;V=true;if(x===true){continue}break}if(q===b){D=W.isGlob=true;V=true;if(x===true){continue}break}if(q===y){while(eos()!==true&&(t=advance())){if(t===l){U=W.backslashes=true;advance();continue}if(t===S){N=W.isBracket=true;D=W.isGlob=true;V=true;break}}if(x===true){continue}break}if(i.nonegate!==true&&q===d&&T===C){B=W.negated=true;C++;continue}if(i.noparen!==true&&q===g){D=W.isGlob=true;if(x===true){while(eos()!==true&&(q=advance())){if(q===g){U=W.backslashes=true;q=advance();continue}if(q===E){V=true;break}}continue}break}if(D===true){V=true;if(x===true){continue}break}}if(i.noext===true){L=false;D=false}let K=A;let Y="";let Z="";if(C>0){Y=A.slice(0,C);A=A.slice(C);k-=C}if(K&&D===true&&k>0){K=A.slice(0,k);Z=A.slice(k)}else if(D===true){K="";Z=A}else{K=A}if(K&&K!==""&&K!=="/"&&K!==A){if(isPathSeparator(K.charCodeAt(K.length-1))){K=K.slice(0,-1)}}if(i.unescape===true){if(Z)Z=o.removeBackslashes(Z);if(K&&U===true){K=o.removeBackslashes(K)}}const X={prefix:Y,input:t,start:C,base:K,glob:Z,isBrace:I,isBracket:N,isGlob:D,isExtglob:L,isGlobstar:M,negated:B,negatedExtglob:H};if(i.tokens===true){X.maxDepth=0;if(!isPathSeparator(q)){O.push(W)}X.tokens=O}if(i.parts===true||i.tokens===true){let r;for(let o=0;o{"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(4280);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}},3: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},9265:(t,r,i)=>{"use strict";const o=i(3);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},4169:(t,r,i)=>{"use strict";const o=i(3);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},1373:(t,r,i)=>{"use strict";t.exports={DatePart:i(3),Meridiem:i(2065),Day:i(9265),Hours:i(4169),Milliseconds:i(8589),Minutes:i(2781),Month:i(7025),Seconds:i(5246),Year:i(9301)}},2065:(t,r,i)=>{"use strict";const o=i(3);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},8589:(t,r,i)=>{"use strict";const o=i(3);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},2781:(t,r,i)=>{"use strict";const o=i(3);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},7025:(t,r,i)=>{"use strict";const o=i(3);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},5246:(t,r,i)=>{"use strict";const o=i(3);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},9301:(t,r,i)=>{"use strict";const o=i(3);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},4804:(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(1081);const a=i(2547);const c=i(5624),l=c.erase,u=c.cursor;const h=i(5970),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{"use strict";const o=i(1081);const a=i(5624),c=a.cursor;const l=i(4562);const u=i(5970),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},8547:(t,r,i)=>{"use strict";const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear;const h=i(5624),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},6947:(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(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear,h=c.figures;const d=i(5624),p=d.erase,m=d.cursor;const g=i(1373),y=g.DatePart,v=g.Meridiem,b=g.Day,w=g.Hours,E=g.Milliseconds,S=g.Minutes,$=g.Month,x=g.Seconds,R=g.Year;const O=/\\(.)|"((?:\\["\\]|[^"])+)"|(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 P={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new b(t),3:t=>new $(t),4:t=>new R(t),5:t=>new v(t),6:t=>new w(t),7:t=>new S(t),8:t=>new x(t),9:t=>new E(t)};const A={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(A,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=O.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in P?P[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},8595:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(7740),SelectPrompt:i(2999),TogglePrompt:i(4641),DatePrompt:i(6947),NumberPrompt:i(4827),MultiselectPrompt:i(4562),AutocompletePrompt:i(4804),AutocompleteMultiselectPrompt:i(6463),ConfirmPrompt:i(8547)}},4562:(t,r,i)=>{"use strict";const o=i(1081);const a=i(5624),c=a.cursor;const l=i(2547);const u=i(5970),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.lengtht.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;r0){c=d.arrowUp}else if(r===a-1&&at.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},4827:(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(1081);const a=i(2547);const c=i(5624),l=c.cursor,u=c.erase;const h=i(5970),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.value1e3)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.valuet+`\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},2547:(t,r,i)=>{"use strict";const o=i(4521);const a=i(5970),c=a.action;const l=i(2361);const u=i(5624),h=u.beep,d=u.cursor;const p=i(1081);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},2999:(t,r,i)=>{"use strict";const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear,h=c.figures,d=c.wrap,p=c.entriesToDisplay;const m=i(5624),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;t0){c=h.arrowUp}else if(t===i-1&&i=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},7740:(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(1081);const a=i(2547);const c=i(5624),l=c.erase,u=c.cursor;const h=i(5970),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},4641:(t,r,i)=>{"use strict";const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear;const h=i(5624),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},9037:(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=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{};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 v=_createForOfIteratorHelper(t),b;try{for(v.s();!(b=v.n()).done;){h=b.value;var w=h;p=w.name;m=w.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 E=h;p=E.name;m=E.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){v.e(t)}finally{v.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})},8078:(t,r,i)=>{"use strict";const o=r;const a=i(8595);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)}},8075: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}},7640:(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[...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)}},1899: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}}},171: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},5970:(t,r,i)=>{"use strict";t.exports={action:i(8075),clear:i(7640),style:i(3392),strip:i(6375),figures:i(171),lines:i(1496),wrap:i(6328),entriesToDisplay:i(1899)}},1496:(t,r,i)=>{"use strict";const o=i(6375);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))}},6375: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}},3392:(t,r,i)=>{"use strict";const o=i(1081);const a=i(171);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}},6328: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{function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;rt[r])return false;if(t[r]>i[r])return true}return false}t.exports=isNodeLT("8.6.0")?i(9037):i(8837)},9611: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},6205:(t,r,i)=>{"use strict";const o=i(9611);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},1428:(t,r,i)=>{"use strict";const o=i(9611);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},5876:(t,r,i)=>{"use strict";t.exports={DatePart:i(9611),Meridiem:i(3437),Day:i(6205),Hours:i(1428),Milliseconds:i(7908),Minutes:i(1745),Month:i(8043),Seconds:i(8331),Year:i(2197)}},3437:(t,r,i)=>{"use strict";const o=i(9611);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},7908:(t,r,i)=>{"use strict";const o=i(9611);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},1745:(t,r,i)=>{"use strict";const o=i(9611);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},8043:(t,r,i)=>{"use strict";const o=i(9611);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},8331:(t,r,i)=>{"use strict";const o=i(9611);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},2197:(t,r,i)=>{"use strict";const o=i(9611);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},4485:(t,r,i)=>{"use strict";const o=i(1081);const a=i(432);const{erase:c,cursor:l}=i(5624);const{style:u,clear:h,figures:d,wrap:p,entriesToDisplay:m}=i(1202);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{"use strict";const o=i(1081);const{cursor:a}=i(5624);const c=i(244);const{clear:l,style:u,figures:h}=i(1202);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},3223:(t,r,i)=>{const o=i(1081);const a=i(432);const{style:c,clear:l}=i(1202);const{erase:u,cursor:h}=i(5624);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},4233:(t,r,i)=>{"use strict";const o=i(1081);const a=i(432);const{style:c,clear:l,figures:u}=i(1202);const{erase:h,cursor:d}=i(5624);const{DatePart:p,Meridiem:m,Day:g,Hours:y,Milliseconds:v,Minutes:b,Month:w,Seconds:E,Year:S}=i(5876);const $=/\\(.)|"((?:\\["\\]|[^"])+)"|(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 x={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new g(t),3:t=>new w(t),4:t=>new S(t),5:t=>new m(t),6:t=>new y(t),7:t=>new b(t),8:t=>new E(t),9:t=>new v(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=$.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in x?x[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},3022:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(321),SelectPrompt:i(5238),TogglePrompt:i(5362),DatePrompt:i(4233),NumberPrompt:i(9146),MultiselectPrompt:i(244),AutocompletePrompt:i(4485),AutocompleteMultiselectPrompt:i(6061),ConfirmPrompt:i(3223)}},244:(t,r,i)=>{"use strict";const o=i(1081);const{cursor:a}=i(5624);const c=i(432);const{clear:l,figures:u,style:h,wrap:d,entriesToDisplay:p}=i(1202);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.lengtht.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;o0){a=u.arrowUp}else if(o===i-1&&it.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},9146:(t,r,i)=>{const o=i(1081);const a=i(432);const{cursor:c,erase:l}=i(5624);const{style:u,figures:h,clear:d,lines:p}=i(1202);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.value1e3)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.valuet+`\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},432:(t,r,i)=>{"use strict";const o=i(4521);const{action:a}=i(1202);const c=i(2361);const{beep:l,cursor:u}=i(5624);const h=i(1081);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},5238:(t,r,i)=>{"use strict";const o=i(1081);const a=i(432);const{style:c,clear:l,figures:u,wrap:h,entriesToDisplay:d}=i(1202);const{cursor:p}=i(5624);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;i0){c=u.arrowUp}else if(i===r-1&&r=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},321:(t,r,i)=>{const o=i(1081);const a=i(432);const{erase:c,cursor:l}=i(5624);const{style:u,clear:h,lines:d,figures:p}=i(1202);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},5362:(t,r,i)=>{const o=i(1081);const a=i(432);const{style:c,clear:l}=i(1202);const{cursor:u,erase:h}=i(5624);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},8837:(t,r,i)=>{"use strict";const o=i(3017);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})},3017:(t,r,i)=>{"use strict";const o=r;const a=i(3022);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)}},1393: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}},9837:(t,r,i)=>{"use strict";const o=i(8029);const{erase:a,cursor:c}=i(5624);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)}},3123: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}}},6098: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},1202:(t,r,i)=>{"use strict";t.exports={action:i(1393),clear:i(9837),style:i(4677),strip:i(8029),figures:i(6098),lines:i(957),wrap:i(342),entriesToDisplay:i(3123)}},957:(t,r,i)=>{"use strict";const o=i(8029);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))}},8029: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}},4677:(t,r,i)=>{"use strict";const o=i(1081);const a=i(6098);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}},342: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{ /*! queue-microtask. MIT License. Feross Aboukhadijeh */ 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)))},5835:(t,r,i)=>{var o=i(5877);var a=i(1017).join;var c=i(1706);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(4599)(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]))}},5877:(t,r,i)=>{"use strict";var o=i(7147);var a=i(7057);var c=i(1017);var l=i(411);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)}},4813:(t,r,i)=>{const o=i(1398).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}},6084:(t,r,i)=>{var o=i(7310);var a=i(4813);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(5835)("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}}},2107:(t,r,i)=>{"use strict";t.exports=function(t){var r=i(5835)("npm",{registry:"https://registry.npmjs.org/"});var o=r[t+":registry"]||r.registry;return o.slice(-1)==="/"?o:o+"/"}},9675:(t,r,i)=>{t.exports=i(651)},651:(t,r,i)=>{var o=i(3764);r.operation=function(t){var i=r.timeouts(t);return new o(i,{forever:t&&t.forever,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{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;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}t.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts};RetryOperation.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}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.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(this._errors.length-1,this._errors.length);this._timeouts=this._cachedTimeouts.slice(0);i=this._timeouts.shift()}else{return false}}var o=this;var a=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){a.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=i){r=a;i=l}}return r}},7361: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},6116:(t,r,i)=>{ /*! run-parallel. MIT License. Feross Aboukhadijeh */ t.exports=runParallel;const o=i(1630);function runParallel(t,r){let i,a,c;let l=true;if(Array.isArray(t)){i=[];a=t.length}else{c=Object.keys(t);i={};a=c.length}function done(t){function end(){if(r)r(t,i);r=null}if(l)o(end);else end()}function each(t,r,o){i[t]=o;if(--a===0||r){done(r)}}if(!a){done(null)}else if(c){c.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)}))}))}l=false}},1398:(t,r,i)=>{ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ 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)}},775:(t,r,i)=>{const o=Symbol("SemVer ANY");class Comparator{static get ANY(){return o}constructor(t,r){r=a(r);if(t instanceof Comparator){if(t.loose===!!r.loose){return t}else{t=t.value}}t=t.trim().split(/\s+/).join(" ");h("comparator",t,r);this.options=r;this.loose=!!r.loose;this.parse(t);if(this.semver===o){this.value=""}else{this.value=this.operator+this.semver.version}h("comp",this)}parse(t){const r=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR];const 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=o}else{this.semver=new d(i[2],this.options.loose)}}toString(){return this.value}test(t){h("Comparator.test",t,this.options.loose);if(this.semver===o||t===o){return true}if(typeof t==="string"){try{t=new d(t,this.options)}catch(t){return false}}return u(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof Comparator)){throw new TypeError("a Comparator is required")}if(this.operator===""){if(this.value===""){return true}return new p(t.value,r).test(this.value)}else if(t.operator===""){if(t.value===""){return true}return new p(this.value,r).test(t.semver)}r=a(r);if(r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")){return false}if(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))){return false}if(this.operator.startsWith(">")&&t.operator.startsWith(">")){return true}if(this.operator.startsWith("<")&&t.operator.startsWith("<")){return true}if(this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")){return true}if(u(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")){return true}if(u(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")){return true}return false}}t.exports=Comparator;const a=i(4074);const{safeRe:c,t:l}=i(6632);const u=i(7548);const h=i(8775);const d=i(6997);const p=i(9001)},9001:(t,r,i)=>{const o=/\s+/g;class Range{constructor(t,r){r=l(r);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 u){this.raw=t.value;this.set=[[t]];this.formatted=undefined;return this}this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;this.raw=t.trim().replace(o," ");this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length));if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${this.raw}`)}if(this.set.length>1){const t=this.set[0];this.set=this.set.filter((t=>!isNullSet(t[0])));if(this.set.length===0){this.set=[t]}else if(this.set.length>1){for(const t of this.set){if(t.length===1&&isAny(t[0])){this.set=[t];break}}}}this.formatted=undefined}get range(){if(this.formatted===undefined){this.formatted="";for(let t=0;t0){this.formatted+="||"}const r=this.set[t];for(let t=0;t0){this.formatted+=" "}this.formatted+=r[t].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){const r=(this.options.includePrerelease&&b)|(this.options.loose&&w);const i=r+":"+t;const o=c.get(i);if(o){return o}const a=this.options.loose;const l=a?p[m.HYPHENRANGELOOSE]:p[m.HYPHENRANGE];t=t.replace(l,hyphenReplace(this.options.includePrerelease));h("hyphen replace",t);t=t.replace(p[m.COMPARATORTRIM],g);h("comparator trim",t);t=t.replace(p[m.TILDETRIM],y);h("tilde trim",t);t=t.replace(p[m.CARETTRIM],v);h("caret trim",t);let d=t.split(" ").map((t=>parseComparator(t,this.options))).join(" ").split(/\s+/).map((t=>replaceGTE0(t,this.options)));if(a){d=d.filter((t=>{h("loose invalid filter",t,this.options);return!!t.match(p[m.COMPARATORLOOSE])}))}h("range list",d);const E=new Map;const S=d.map((t=>new u(t,this.options)));for(const t of S){if(isNullSet(t)){return[t]}E.set(t.value,t)}if(E.size>1&&E.has("")){E.delete("")}const $=[...E.values()];c.set(i,$);return $}intersects(t,r){if(!(t instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((i=>isSatisfiable(i,r)&&t.set.some((t=>isSatisfiable(t,r)&&i.every((i=>t.every((t=>i.intersects(t,r)))))))))}test(t){if(!t){return false}if(typeof t==="string"){try{t=new d(t,this.options)}catch(t){return false}}for(let r=0;rt.value==="<0.0.0-0";const isAny=t=>t.value==="";const isSatisfiable=(t,r)=>{let i=true;const o=t.slice();let a=o.pop();while(i&&o.length){i=o.every((t=>a.intersects(t,r)));a=o.pop()}return i};const parseComparator=(t,r)=>{h("comp",t,r);t=replaceCarets(t,r);h("caret",t);t=replaceTildes(t,r);h("tildes",t);t=replaceXRanges(t,r);h("xrange",t);t=replaceStars(t,r);h("stars",t);return t};const isX=t=>!t||t.toLowerCase()==="x"||t==="*";const replaceTildes=(t,r)=>t.trim().split(/\s+/).map((t=>replaceTilde(t,r))).join(" ");const replaceTilde=(t,r)=>{const i=r.loose?p[m.TILDELOOSE]:p[m.TILDE];return t.replace(i,((r,i,o,a,c)=>{h("tilde",t,r,i,o,a,c);let l;if(isX(i)){l=""}else if(isX(o)){l=`>=${i}.0.0 <${+i+1}.0.0-0`}else if(isX(a)){l=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`}else if(c){h("replaceTilde pr",c);l=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`}else{l=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`}h("tilde return",l);return l}))};const replaceCarets=(t,r)=>t.trim().split(/\s+/).map((t=>replaceCaret(t,r))).join(" ");const replaceCaret=(t,r)=>{h("caret",t,r);const i=r.loose?p[m.CARETLOOSE]:p[m.CARET];const o=r.includePrerelease?"-0":"";return t.replace(i,((r,i,a,c,l)=>{h("caret",t,r,i,a,c,l);let u;if(isX(i)){u=""}else if(isX(a)){u=`>=${i}.0.0${o} <${+i+1}.0.0-0`}else if(isX(c)){if(i==="0"){u=`>=${i}.${a}.0${o} <${i}.${+a+1}.0-0`}else{u=`>=${i}.${a}.0${o} <${+i+1}.0.0-0`}}else if(l){h("replaceCaret pr",l);if(i==="0"){if(a==="0"){u=`>=${i}.${a}.${c}-${l} <${i}.${a}.${+c+1}-0`}else{u=`>=${i}.${a}.${c}-${l} <${i}.${+a+1}.0-0`}}else{u=`>=${i}.${a}.${c}-${l} <${+i+1}.0.0-0`}}else{h("no pr");if(i==="0"){if(a==="0"){u=`>=${i}.${a}.${c}${o} <${i}.${a}.${+c+1}-0`}else{u=`>=${i}.${a}.${c}${o} <${i}.${+a+1}.0-0`}}else{u=`>=${i}.${a}.${c} <${+i+1}.0.0-0`}}h("caret return",u);return u}))};const replaceXRanges=(t,r)=>{h("replaceXRanges",t,r);return t.split(/\s+/).map((t=>replaceXRange(t,r))).join(" ")};const replaceXRange=(t,r)=>{t=t.trim();const i=r.loose?p[m.XRANGELOOSE]:p[m.XRANGE];return t.replace(i,((i,o,a,c,l,u)=>{h("xRange",t,i,o,a,c,l,u);const d=isX(a);const p=d||isX(c);const m=p||isX(l);const g=m;if(o==="="&&g){o=""}u=r.includePrerelease?"-0":"";if(d){if(o===">"||o==="<"){i="<0.0.0-0"}else{i="*"}}else if(o&&g){if(p){c=0}l=0;if(o===">"){o=">=";if(p){a=+a+1;c=0;l=0}else{c=+c+1;l=0}}else if(o==="<="){o="<";if(p){a=+a+1}else{c=+c+1}}if(o==="<"){u="-0"}i=`${o+a}.${c}.${l}${u}`}else if(p){i=`>=${a}.0.0${u} <${+a+1}.0.0-0`}else if(m){i=`>=${a}.${c}.0${u} <${a}.${+c+1}.0-0`}h("xRange return",i);return i}))};const replaceStars=(t,r)=>{h("replaceStars",t,r);return t.trim().replace(p[m.STAR],"")};const replaceGTE0=(t,r)=>{h("replaceGTE0",t,r);return t.trim().replace(p[r.includePrerelease?m.GTE0PRE:m.GTE0],"")};const hyphenReplace=t=>(r,i,o,a,c,l,u,h,d,p,m,g)=>{if(isX(o)){i=""}else if(isX(a)){i=`>=${o}.0.0${t?"-0":""}`}else if(isX(c)){i=`>=${o}.${a}.0${t?"-0":""}`}else if(l){i=`>=${i}`}else{i=`>=${i}${t?"-0":""}`}if(isX(d)){h=""}else if(isX(p)){h=`<${+d+1}.0.0-0`}else if(isX(m)){h=`<${d}.${+p+1}.0-0`}else if(g){h=`<=${d}.${p}.${m}-${g}`}else if(t){h=`<${d}.${p}.${+m+1}-0`}else{h=`<=${h}`}return`${i} ${h}`.trim()};const testSet=(t,r,i)=>{for(let i=0;i0){const o=t[i].semver;if(o.major===r.major&&o.minor===r.minor&&o.patch===r.patch){return true}}}return false}return true}},6997:(t,r,i)=>{const o=i(8775);const{MAX_LENGTH:a,MAX_SAFE_INTEGER:c}=i(7425);const{safeRe:l,t:u}=i(6632);const h=i(4074);const{compareIdentifiers:d}=i(2683);class SemVer{constructor(t,r){r=h(r);if(t instanceof SemVer){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{t=t.version}}else if(typeof t!=="string"){throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`)}if(t.length>a){throw new TypeError(`version is longer than ${a} characters`)}o("SemVer",t,r);this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;const i=t.trim().match(r.loose?l[u.LOOSE]:l[u.FULL]);if(!i){throw new TypeError(`Invalid Version: ${t}`)}this.raw=t;this.major=+i[1];this.minor=+i[2];this.patch=+i[3];if(this.major>c||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>c||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>c||this.patch<0){throw new TypeError("Invalid patch version")}if(!i[4]){this.prerelease=[]}else{this.prerelease=i[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const r=+t;if(r>=0&&r=0){if(typeof this.prerelease[o]==="number"){this.prerelease[o]++;o=-2}}if(o===-1){if(r===this.prerelease.join(".")&&i===false){throw new Error("invalid increment argument: identifier already exists")}this.prerelease.push(t)}}if(r){let o=[r,t];if(i===false){o=[r]}if(d(this.prerelease[0],r)===0){if(isNaN(this.prerelease[1])){this.prerelease=o}}else{this.prerelease=o}}break}default:throw new Error(`invalid increment argument: ${t}`)}this.raw=this.format();if(this.build.length){this.raw+=`+${this.build.join(".")}`}return this}}t.exports=SemVer},2875:(t,r,i)=>{const o=i(8523);const clean=(t,r)=>{const i=o(t.trim().replace(/^[=v]+/,""),r);return i?i.version:null};t.exports=clean},7548:(t,r,i)=>{const o=i(7995);const a=i(2354);const c=i(5106);const l=i(195);const u=i(7344);const h=i(211);const cmp=(t,r,i,d)=>{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 o(t,i,d);case"!=":return a(t,i,d);case">":return c(t,i,d);case">=":return l(t,i,d);case"<":return u(t,i,d);case"<=":return h(t,i,d);default:throw new TypeError(`Invalid operator: ${r}`)}};t.exports=cmp},9632:(t,r,i)=>{const o=i(6997);const a=i(8523);const{safeRe:c,t:l}=i(6632);const coerce=(t,r)=>{if(t instanceof o){return t}if(typeof t==="number"){t=String(t)}if(typeof t!=="string"){return null}r=r||{};let i=null;if(!r.rtl){i=t.match(r.includePrerelease?c[l.COERCEFULL]:c[l.COERCE])}else{const o=r.includePrerelease?c[l.COERCERTLFULL]:c[l.COERCERTL];let a;while((a=o.exec(t))&&(!i||i.index+i[0].length!==t.length)){if(!i||a.index+a[0].length!==i.index+i[0].length){i=a}o.lastIndex=a.index+a[1].length+a[2].length}o.lastIndex=-1}if(i===null){return null}const u=i[2];const h=i[3]||"0";const d=i[4]||"0";const p=r.includePrerelease&&i[5]?`-${i[5]}`:"";const m=r.includePrerelease&&i[6]?`+${i[6]}`:"";return a(`${u}.${h}.${d}${p}${m}`,r)};t.exports=coerce},7313:(t,r,i)=>{const o=i(6997);const compareBuild=(t,r,i)=>{const a=new o(t,i);const c=new o(r,i);return a.compare(c)||a.compareBuild(c)};t.exports=compareBuild},4924:(t,r,i)=>{const o=i(588);const compareLoose=(t,r)=>o(t,r,true);t.exports=compareLoose},588:(t,r,i)=>{const o=i(6997);const compare=(t,r,i)=>new o(t,i).compare(new o(r,i));t.exports=compare},9443:(t,r,i)=>{const o=i(8523);const diff=(t,r)=>{const i=o(t,null,true);const a=o(r,null,true);const c=i.compare(a);if(c===0){return null}const l=c>0;const u=l?i:a;const h=l?a:i;const d=!!u.prerelease.length;const p=!!h.prerelease.length;if(p&&!d){if(!h.patch&&!h.minor){return"major"}if(u.patch){return"patch"}if(u.minor){return"minor"}return"major"}const m=d?"pre":"";if(i.major!==a.major){return m+"major"}if(i.minor!==a.minor){return m+"minor"}if(i.patch!==a.patch){return m+"patch"}return"prerelease"};t.exports=diff},7995:(t,r,i)=>{const o=i(588);const eq=(t,r,i)=>o(t,r,i)===0;t.exports=eq},5106:(t,r,i)=>{const o=i(588);const gt=(t,r,i)=>o(t,r,i)>0;t.exports=gt},195:(t,r,i)=>{const o=i(588);const gte=(t,r,i)=>o(t,r,i)>=0;t.exports=gte},6183:(t,r,i)=>{const o=i(6997);const inc=(t,r,i,a,c)=>{if(typeof i==="string"){c=a;a=i;i=undefined}try{return new o(t instanceof o?t.version:t,i).inc(r,a,c).version}catch(t){return null}};t.exports=inc},7344:(t,r,i)=>{const o=i(588);const lt=(t,r,i)=>o(t,r,i)<0;t.exports=lt},211:(t,r,i)=>{const o=i(588);const lte=(t,r,i)=>o(t,r,i)<=0;t.exports=lte},5763:(t,r,i)=>{const o=i(6997);const major=(t,r)=>new o(t,r).major;t.exports=major},5387:(t,r,i)=>{const o=i(6997);const minor=(t,r)=>new o(t,r).minor;t.exports=minor},2354:(t,r,i)=>{const o=i(588);const neq=(t,r,i)=>o(t,r,i)!==0;t.exports=neq},8523:(t,r,i)=>{const o=i(6997);const parse=(t,r,i=false)=>{if(t instanceof o){return t}try{return new o(t,r)}catch(t){if(!i){return null}throw t}};t.exports=parse},7209:(t,r,i)=>{const o=i(6997);const patch=(t,r)=>new o(t,r).patch;t.exports=patch},9987:(t,r,i)=>{const o=i(8523);const prerelease=(t,r)=>{const i=o(t,r);return i&&i.prerelease.length?i.prerelease:null};t.exports=prerelease},7446:(t,r,i)=>{const o=i(588);const rcompare=(t,r,i)=>o(r,t,i);t.exports=rcompare},5077:(t,r,i)=>{const o=i(7313);const rsort=(t,r)=>t.sort(((t,i)=>o(i,t,r)));t.exports=rsort},6059:(t,r,i)=>{const o=i(9001);const satisfies=(t,r,i)=>{try{r=new o(r,i)}catch(t){return false}return r.test(t)};t.exports=satisfies},9731:(t,r,i)=>{const o=i(7313);const sort=(t,r)=>t.sort(((t,i)=>o(t,i,r)));t.exports=sort},5626:(t,r,i)=>{const o=i(8523);const valid=(t,r)=>{const i=o(t,r);return i?i.version:null};t.exports=valid},6546:(t,r,i)=>{const o=i(6632);const a=i(7425);const c=i(6997);const l=i(2683);const u=i(8523);const h=i(5626);const d=i(2875);const p=i(6183);const m=i(9443);const g=i(5763);const y=i(5387);const v=i(7209);const b=i(9987);const w=i(588);const E=i(7446);const S=i(4924);const $=i(7313);const x=i(9731);const R=i(5077);const O=i(5106);const P=i(7344);const A=i(7995);const T=i(2354);const C=i(195);const k=i(211);const I=i(7548);const N=i(9632);const D=i(775);const L=i(9001);const M=i(6059);const j=i(6282);const U=i(9770);const B=i(4446);const H=i(7914);const V=i(4667);const z=i(2190);const G=i(34);const q=i(6780);const W=i(6475);const K=i(1147);const Y=i(1021);t.exports={parse:u,valid:h,clean:d,inc:p,diff:m,major:g,minor:y,patch:v,prerelease:b,compare:w,rcompare:E,compareLoose:S,compareBuild:$,sort:x,rsort:R,gt:O,lt:P,eq:A,neq:T,gte:C,lte:k,cmp:I,coerce:N,Comparator:D,Range:L,satisfies:M,toComparators:j,maxSatisfying:U,minSatisfying:B,minVersion:H,validRange:V,outside:z,gtr:G,ltr:q,intersects:W,simplifyRange:K,subset:Y,SemVer:c,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:l.compareIdentifiers,rcompareIdentifiers:l.rcompareIdentifiers}},7425:t=>{const r="2.0.0";const i=256;const o=Number.MAX_SAFE_INTEGER||9007199254740991;const a=16;const c=i-6;const l=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t.exports={MAX_LENGTH:i,MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:o,RELEASE_TYPES:l,SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},8775:t=>{const r=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=r},2683:t=>{const r=/^[0-9]+$/;const compareIdentifiers=(t,i)=>{const o=r.test(t);const a=r.test(i);if(o&&a){t=+t;i=+i}return t===i?0:o&&!a?-1:a&&!o?1:tcompareIdentifiers(r,t);t.exports={compareIdentifiers:compareIdentifiers,rcompareIdentifiers:rcompareIdentifiers}},3795:t=>{class LRUCache{constructor(){this.max=1e3;this.map=new Map}get(t){const r=this.map.get(t);if(r===undefined){return undefined}else{this.map.delete(t);this.map.set(t,r);return r}}delete(t){return this.map.delete(t)}set(t,r){const i=this.delete(t);if(!i&&r!==undefined){if(this.map.size>=this.max){const t=this.map.keys().next().value;this.delete(t)}this.map.set(t,r)}return this}}t.exports=LRUCache},4074:t=>{const r=Object.freeze({loose:true});const i=Object.freeze({});const parseOptions=t=>{if(!t){return i}if(typeof t!=="object"){return r}return t};t.exports=parseOptions},6632:(t,r,i)=>{const{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:c}=i(7425);const l=i(8775);r=t.exports={};const u=r.re=[];const h=r.safeRe=[];const d=r.src=[];const p=r.t={};let m=0;const g="[a-zA-Z0-9-]";const y=[["\\s",1],["\\d",c],[g,a]];const makeSafeRegex=t=>{for(const[r,i]of y){t=t.split(`${r}*`).join(`${r}{0,${i}}`).split(`${r}+`).join(`${r}{1,${i}}`)}return t};const createToken=(t,r,i)=>{const o=makeSafeRegex(r);const a=m++;l(t,a,r);p[t]=a;d[a]=r;u[a]=new RegExp(r,i?"g":undefined);h[a]=new RegExp(o,i?"g":undefined)};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","\\d+");createToken("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`);createToken("MAINVERSION",`(${d[p.NUMERICIDENTIFIER]})\\.`+`(${d[p.NUMERICIDENTIFIER]})\\.`+`(${d[p.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${d[p.NUMERICIDENTIFIERLOOSE]})\\.`+`(${d[p.NUMERICIDENTIFIERLOOSE]})\\.`+`(${d[p.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${d[p.NUMERICIDENTIFIER]}|${d[p.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${d[p.NUMERICIDENTIFIERLOOSE]}|${d[p.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASE",`(?:-(${d[p.PRERELEASEIDENTIFIER]}(?:\\.${d[p.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${d[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[p.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER",`${g}+`);createToken("BUILD",`(?:\\+(${d[p.BUILDIDENTIFIER]}(?:\\.${d[p.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${d[p.MAINVERSION]}${d[p.PRERELEASE]}?${d[p.BUILD]}?`);createToken("FULL",`^${d[p.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${d[p.MAINVERSIONLOOSE]}${d[p.PRERELEASELOOSE]}?${d[p.BUILD]}?`);createToken("LOOSE",`^${d[p.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${d[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${d[p.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${d[p.XRANGEIDENTIFIER]})`+`(?:\\.(${d[p.XRANGEIDENTIFIER]})`+`(?:\\.(${d[p.XRANGEIDENTIFIER]})`+`(?:${d[p.PRERELEASE]})?${d[p.BUILD]}?`+`)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${d[p.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${d[p.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${d[p.XRANGEIDENTIFIERLOOSE]})`+`(?:${d[p.PRERELEASELOOSE]})?${d[p.BUILD]}?`+`)?)?`);createToken("XRANGE",`^${d[p.GTLT]}\\s*${d[p.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${d[p.GTLT]}\\s*${d[p.XRANGEPLAINLOOSE]}$`);createToken("COERCEPLAIN",`${"(^|[^\\d])"+"(\\d{1,"}${o}})`+`(?:\\.(\\d{1,${o}}))?`+`(?:\\.(\\d{1,${o}}))?`);createToken("COERCE",`${d[p.COERCEPLAIN]}(?:$|[^\\d])`);createToken("COERCEFULL",d[p.COERCEPLAIN]+`(?:${d[p.PRERELEASE]})?`+`(?:${d[p.BUILD]})?`+`(?:$|[^\\d])`);createToken("COERCERTL",d[p.COERCE],true);createToken("COERCERTLFULL",d[p.COERCEFULL],true);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${d[p.LONETILDE]}\\s+`,true);r.tildeTrimReplace="$1~";createToken("TILDE",`^${d[p.LONETILDE]}${d[p.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${d[p.LONETILDE]}${d[p.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${d[p.LONECARET]}\\s+`,true);r.caretTrimReplace="$1^";createToken("CARET",`^${d[p.LONECARET]}${d[p.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${d[p.LONECARET]}${d[p.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${d[p.GTLT]}\\s*(${d[p.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${d[p.GTLT]}\\s*(${d[p.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${d[p.GTLT]}\\s*(${d[p.LOOSEPLAIN]}|${d[p.XRANGEPLAIN]})`,true);r.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${d[p.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${d[p.XRANGEPLAIN]})`+`\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${d[p.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${d[p.XRANGEPLAINLOOSE]})`+`\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},34:(t,r,i)=>{const o=i(2190);const gtr=(t,r,i)=>o(t,r,">",i);t.exports=gtr},6475:(t,r,i)=>{const o=i(9001);const intersects=(t,r,i)=>{t=new o(t,i);r=new o(r,i);return t.intersects(r,i)};t.exports=intersects},6780:(t,r,i)=>{const o=i(2190);const ltr=(t,r,i)=>o(t,r,"<",i);t.exports=ltr},9770:(t,r,i)=>{const o=i(6997);const a=i(9001);const maxSatisfying=(t,r,i)=>{let c=null;let l=null;let u=null;try{u=new a(r,i)}catch(t){return null}t.forEach((t=>{if(u.test(t)){if(!c||l.compare(t)===-1){c=t;l=new o(c,i)}}}));return c};t.exports=maxSatisfying},4446:(t,r,i)=>{const o=i(6997);const a=i(9001);const minSatisfying=(t,r,i)=>{let c=null;let l=null;let u=null;try{u=new a(r,i)}catch(t){return null}t.forEach((t=>{if(u.test(t)){if(!c||l.compare(t)===1){c=t;l=new o(c,i)}}}));return c};t.exports=minSatisfying},7914:(t,r,i)=>{const o=i(6997);const a=i(9001);const c=i(5106);const minVersion=(t,r)=>{t=new a(t,r);let i=new o("0.0.0");if(t.test(i)){return i}i=new o("0.0.0-0");if(t.test(i)){return i}i=null;for(let r=0;r{const r=new o(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(!l||c(r,l)){l=r}break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}));if(l&&(!i||c(i,l))){i=l}}if(i&&t.test(i)){return i}return null};t.exports=minVersion},2190:(t,r,i)=>{const o=i(6997);const a=i(775);const{ANY:c}=a;const l=i(9001);const u=i(6059);const h=i(5106);const d=i(7344);const p=i(211);const m=i(195);const outside=(t,r,i,g)=>{t=new o(t,g);r=new l(r,g);let y,v,b,w,E;switch(i){case">":y=h;v=p;b=d;w=">";E=">=";break;case"<":y=d;v=m;b=h;w="<";E="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(t,r,g)){return false}for(let i=0;i{if(t.semver===c){t=new a(">=0.0.0")}l=l||t;u=u||t;if(y(t.semver,l.semver,g)){l=t}else if(b(t.semver,u.semver,g)){u=t}}));if(l.operator===w||l.operator===E){return false}if((!u.operator||u.operator===w)&&v(t,u.semver)){return false}else if(u.operator===E&&b(t,u.semver)){return false}}return true};t.exports=outside},1147:(t,r,i)=>{const o=i(6059);const a=i(588);t.exports=(t,r,i)=>{const c=[];let l=null;let u=null;const h=t.sort(((t,r)=>a(t,r,i)));for(const t of h){const a=o(t,r,i);if(a){u=t;if(!l){l=t}}else{if(u){c.push([l,u])}u=null;l=null}}if(l){c.push([l,null])}const d=[];for(const[t,r]of c){if(t===r){d.push(t)}else if(!r&&t===h[0]){d.push("*")}else if(!r){d.push(`>=${t}`)}else if(t===h[0]){d.push(`<=${r}`)}else{d.push(`${t} - ${r}`)}}const p=d.join(" || ");const m=typeof r.raw==="string"?r.raw:String(r);return p.length{const o=i(9001);const a=i(775);const{ANY:c}=a;const l=i(6059);const u=i(588);const subset=(t,r,i={})=>{if(t===r){return true}t=new o(t,i);r=new o(r,i);let a=false;e:for(const o of t.set){for(const t of r.set){const r=simpleSubset(o,t,i);a=a||r!==null;if(r){continue e}}if(a){return false}}return true};const h=[new a(">=0.0.0-0")];const d=[new a(">=0.0.0")];const simpleSubset=(t,r,i)=>{if(t===r){return true}if(t.length===1&&t[0].semver===c){if(r.length===1&&r[0].semver===c){return true}else if(i.includePrerelease){t=h}else{t=d}}if(r.length===1&&r[0].semver===c){if(i.includePrerelease){return true}else{r=d}}const o=new Set;let a,p;for(const r of t){if(r.operator===">"||r.operator===">="){a=higherGT(a,r,i)}else if(r.operator==="<"||r.operator==="<="){p=lowerLT(p,r,i)}else{o.add(r.semver)}}if(o.size>1){return null}let m;if(a&&p){m=u(a.semver,p.semver,i);if(m>0){return null}else if(m===0&&(a.operator!==">="||p.operator!=="<=")){return null}}for(const t of o){if(a&&!l(t,String(a),i)){return null}if(p&&!l(t,String(p),i)){return null}for(const o of r){if(!l(t,String(o),i)){return false}}return true}let g,y;let v,b;let w=p&&!i.includePrerelease&&p.semver.prerelease.length?p.semver:false;let E=a&&!i.includePrerelease&&a.semver.prerelease.length?a.semver:false;if(w&&w.prerelease.length===1&&p.operator==="<"&&w.prerelease[0]===0){w=false}for(const t of r){b=b||t.operator===">"||t.operator===">=";v=v||t.operator==="<"||t.operator==="<=";if(a){if(E){if(t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===E.major&&t.semver.minor===E.minor&&t.semver.patch===E.patch){E=false}}if(t.operator===">"||t.operator===">="){g=higherGT(a,t,i);if(g===t&&g!==a){return false}}else if(a.operator===">="&&!l(a.semver,String(t),i)){return false}}if(p){if(w){if(t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===w.major&&t.semver.minor===w.minor&&t.semver.patch===w.patch){w=false}}if(t.operator==="<"||t.operator==="<="){y=lowerLT(p,t,i);if(y===t&&y!==p){return false}}else if(p.operator==="<="&&!l(p.semver,String(t),i)){return false}}if(!t.operator&&(p||a)&&m!==0){return false}}if(a&&v&&!p&&m!==0){return false}if(p&&b&&!a&&m!==0){return false}if(E||w){return false}return true};const higherGT=(t,r,i)=>{if(!t){return r}const o=u(t.semver,r.semver,i);return o>0?t:o<0?r:r.operator===">"&&t.operator===">="?r:t};const lowerLT=(t,r,i)=>{if(!t){return r}const o=u(t.semver,r.semver,i);return o<0?t:o>0?r:r.operator==="<"&&t.operator==="<="?r:t};t.exports=subset},6282:(t,r,i)=>{const o=i(9001);const toComparators=(t,r)=>new o(t,r).set.map((t=>t.map((t=>t.value)).join(" ").trim().split(" ")));t.exports=toComparators},4667:(t,r,i)=>{const o=i(9001);const validRange=(t,r)=>{try{return new o(t,r).range||"*"}catch(t){return null}};t.exports=validRange},5036:(t,r,i)=>{"use strict";const o=i(8071);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}},8071:t=>{"use strict";t.exports=/^#!(.*)/},5624: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{"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{"use strict"; /*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */const o=i(3576);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 v=[];let b=[];if(g){y.isPadded=g;y.maxLen=String(y.max).length}if(p<0){let t=m<0?Math.abs(m):1;b=splitToPatterns(t,Math.abs(p),y,a);p=y.a=0}if(m>=0){v=splitToPatterns(p,m,y,a)}y.negatives=b;y.positives=v;y.result=collatePatterns(b,v,a);if(a.capture===true){y.result=`(${y.result})`}else if(a.wrap!==false&&v.length+b.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(t1){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;or?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},9886:(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(2107);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(6084);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}},2267:function(t,r){ /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ (function(t,i){true?i(r):0})(this,(function(t){"use strict";function merge(){for(var t=arguments.length,r=Array(t),i=0;i1){r[0]=r[0].slice(0,-1);var o=r.length-1;for(var a=1;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var E=c-l;var S=Math.floor;var $=String.fromCharCode;function error$1(t){throw new RangeError(w[t])}function map(t,r){var i=[];var o=t.length;while(o--){i[o]=r(t[o])}return i}function mapDomain(t,r){var i=t.split("@");var o="";if(i.length>1){o=i[0]+"@";t=i[1]}t=t.replace(b,".");var a=t.split(".");var c=map(a,r).join(".");return o+c}function ucs2decode(t){var r=[];var i=0;var o=t.length;while(i=55296&&a<=56319&&i>1;t+=S(t/r);for(;t>E*u>>1;o+=c){t=S(t/E)}return S(o+(E+1)*t/(t+h))};var A=function decode(t){var r=[];var i=t.length;var o=0;var h=m;var d=p;var y=t.lastIndexOf(g);if(y<0){y=0}for(var v=0;v=128){error$1("not-basic")}r.push(t.charCodeAt(v))}for(var b=y>0?y+1:0;b=i){error$1("invalid-input")}var x=R(t.charCodeAt(b++));if(x>=c||x>S((a-o)/E)){error$1("overflow")}o+=x*E;var O=$<=d?l:$>=d+u?u:$-d;if(xS(a/A)){error$1("overflow")}E*=A}var T=r.length+1;d=P(o-w,T,w==0);if(S(o/T)>a-h){error$1("overflow")}h+=S(o/T);o%=T;r.splice(o++,0,h)}return String.fromCodePoint.apply(String,r)};var T=function encode(t){var r=[];t=ucs2decode(t);var i=t.length;var o=m;var h=0;var d=p;var y=true;var v=false;var b=undefined;try{for(var w=t[Symbol.iterator](),E;!(y=(E=w.next()).done);y=true){var x=E.value;if(x<128){r.push($(x))}}}catch(t){v=true;b=t}finally{try{if(!y&&w.return){w.return()}}finally{if(v){throw b}}}var R=r.length;var A=R;if(R){r.push(g)}while(A=o&&LS((a-h)/M)){error$1("overflow")}h+=(T-o)*M;o=T;var j=true;var U=false;var B=undefined;try{for(var H=t[Symbol.iterator](),V;!(j=(V=H.next()).done);j=true){var z=V.value;if(za){error$1("overflow")}if(z==o){var G=h;for(var q=c;;q+=c){var W=q<=d?l:q>=d+u?u:q-d;if(G>6|192).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();else i="%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();return i}function pctDecChars(t){var r="";var i=0;var o=t.length;while(i=194&&a<224){if(o-i>=6){var c=parseInt(t.substr(i+4,2),16);r+=String.fromCharCode((a&31)<<6|c&63)}else{r+=t.substr(i,6)}i+=6}else if(a>=224){if(o-i>=9){var l=parseInt(t.substr(i+4,2),16);var u=parseInt(t.substr(i+7,2),16);r+=String.fromCharCode((a&15)<<12|(l&63)<<6|u&63)}else{r+=t.substr(i,9)}i+=9}else{r+=t.substr(i,3);i+=3}}return r}function _normalizeComponentEncoding(t,r){function decodeUnreserved(t){var i=pctDecChars(t);return!i.match(r.UNRESERVED)?t:i}if(t.scheme)t.scheme=String(t.scheme).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_SCHEME,"");if(t.userinfo!==undefined)t.userinfo=String(t.userinfo).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_USERINFO,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(t.host!==undefined)t.host=String(t.host).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_HOST,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(t.path!==undefined)t.path=String(t.path).replace(r.PCT_ENCODED,decodeUnreserved).replace(t.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(t.query!==undefined)t.query=String(t.query).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_QUERY,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(t.fragment!==undefined)t.fragment=String(t.fragment).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_FRAGMENT,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);return t}function _stripLeadingZeros(t){return t.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(t,r){var i=t.match(r.IPV4ADDRESS)||[];var a=o(i,2),c=a[1];if(c){return c.split(".").map(_stripLeadingZeros).join(".")}else{return t}}function _normalizeIPv6(t,r){var i=t.match(r.IPV6ADDRESS)||[];var a=o(i,3),c=a[1],l=a[2];if(c){var u=c.toLowerCase().split("::").reverse(),h=o(u,2),d=h[0],p=h[1];var m=p?p.split(":").map(_stripLeadingZeros):[];var g=d.split(":").map(_stripLeadingZeros);var y=r.IPV4ADDRESS.test(g[g.length-1]);var v=y?7:8;var b=g.length-v;var w=Array(v);for(var E=0;E1){var R=w.slice(0,$.index);var O=w.slice($.index+$.length);x=R.join(":")+"::"+O.join(":")}else{x=w.join(":")}if(l){x+="%"+l}return x}else{return t}}var D=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var L="".match(/(){0}/)[1]===undefined;function parse(t){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a={};var c=o.iri!==false?i:r;if(o.reference==="suffix")t=(o.scheme?o.scheme+":":"")+"//"+t;var l=t.match(D);if(l){if(L){a.scheme=l[1];a.userinfo=l[3];a.host=l[4];a.port=parseInt(l[5],10);a.path=l[6]||"";a.query=l[7];a.fragment=l[8];if(isNaN(a.port)){a.port=l[5]}}else{a.scheme=l[1]||undefined;a.userinfo=t.indexOf("@")!==-1?l[3]:undefined;a.host=t.indexOf("//")!==-1?l[4]:undefined;a.port=parseInt(l[5],10);a.path=l[6]||"";a.query=t.indexOf("?")!==-1?l[7]:undefined;a.fragment=t.indexOf("#")!==-1?l[8]:undefined;if(isNaN(a.port)){a.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?l[4]:undefined}}if(a.host){a.host=_normalizeIPv6(_normalizeIPv4(a.host,c),c)}if(a.scheme===undefined&&a.userinfo===undefined&&a.host===undefined&&a.port===undefined&&!a.path&&a.query===undefined){a.reference="same-document"}else if(a.scheme===undefined){a.reference="relative"}else if(a.fragment===undefined){a.reference="absolute"}else{a.reference="uri"}if(o.reference&&o.reference!=="suffix"&&o.reference!==a.reference){a.error=a.error||"URI is not a "+o.reference+" reference."}var u=N[(o.scheme||a.scheme||"").toLowerCase()];if(!o.unicodeSupport&&(!u||!u.unicodeSupport)){if(a.host&&(o.domainHost||u&&u.domainHost)){try{a.host=I.toASCII(a.host.replace(c.PCT_ENCODED,pctDecChars).toLowerCase())}catch(t){a.error=a.error||"Host's domain name can not be converted to ASCII via punycode: "+t}}_normalizeComponentEncoding(a,r)}else{_normalizeComponentEncoding(a,c)}if(u&&u.parse){u.parse(a,o)}}else{a.error=a.error||"URI can not be parsed."}return a}function _recomposeAuthority(t,o){var a=o.iri!==false?i:r;var c=[];if(t.userinfo!==undefined){c.push(t.userinfo);c.push("@")}if(t.host!==undefined){c.push(_normalizeIPv6(_normalizeIPv4(String(t.host),a),a).replace(a.IPV6ADDRESS,(function(t,r,i){return"["+r+(i?"%25"+i:"")+"]"})))}if(typeof t.port==="number"||typeof t.port==="string"){c.push(":");c.push(String(t.port))}return c.length?c.join(""):undefined}var M=/^\.\.?\//;var j=/^\/\.(\/|$)/;var U=/^\/\.\.(\/|$)/;var B=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(t){var r=[];while(t.length){if(t.match(M)){t=t.replace(M,"")}else if(t.match(j)){t=t.replace(j,"/")}else if(t.match(U)){t=t.replace(U,"/");r.pop()}else if(t==="."||t===".."){t=""}else{var i=t.match(B);if(i){var o=i[0];t=t.slice(o.length);r.push(o)}else{throw new Error("Unexpected dot segment condition")}}}return r.join("")}function serialize(t){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=o.iri?i:r;var c=[];var l=N[(o.scheme||t.scheme||"").toLowerCase()];if(l&&l.serialize)l.serialize(t,o);if(t.host){if(a.IPV6ADDRESS.test(t.host)){}else if(o.domainHost||l&&l.domainHost){try{t.host=!o.iri?I.toASCII(t.host.replace(a.PCT_ENCODED,pctDecChars).toLowerCase()):I.toUnicode(t.host)}catch(r){t.error=t.error||"Host's domain name can not be converted to "+(!o.iri?"ASCII":"Unicode")+" via punycode: "+r}}}_normalizeComponentEncoding(t,a);if(o.reference!=="suffix"&&t.scheme){c.push(t.scheme);c.push(":")}var u=_recomposeAuthority(t,o);if(u!==undefined){if(o.reference!=="suffix"){c.push("//")}c.push(u);if(t.path&&t.path.charAt(0)!=="/"){c.push("/")}}if(t.path!==undefined){var h=t.path;if(!o.absolutePath&&(!l||!l.absolutePath)){h=removeDotSegments(h)}if(u===undefined){h=h.replace(/^\/\//,"/%2F")}c.push(h)}if(t.query!==undefined){c.push("?");c.push(t.query)}if(t.fragment!==undefined){c.push("#");c.push(t.fragment)}return c.join("")}function resolveComponents(t,r){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var o=arguments[3];var a={};if(!o){t=parse(serialize(t,i),i);r=parse(serialize(r,i),i)}i=i||{};if(!i.tolerant&&r.scheme){a.scheme=r.scheme;a.userinfo=r.userinfo;a.host=r.host;a.port=r.port;a.path=removeDotSegments(r.path||"");a.query=r.query}else{if(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined){a.userinfo=r.userinfo;a.host=r.host;a.port=r.port;a.path=removeDotSegments(r.path||"");a.query=r.query}else{if(!r.path){a.path=t.path;if(r.query!==undefined){a.query=r.query}else{a.query=t.query}}else{if(r.path.charAt(0)==="/"){a.path=removeDotSegments(r.path)}else{if((t.userinfo!==undefined||t.host!==undefined||t.port!==undefined)&&!t.path){a.path="/"+r.path}else if(!t.path){a.path=r.path}else{a.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+r.path}a.path=removeDotSegments(a.path)}a.query=r.query}a.userinfo=t.userinfo;a.host=t.host;a.port=t.port}a.scheme=t.scheme}a.fragment=r.fragment;return a}function resolve(t,r,i){var o=assign({scheme:"null"},i);return serialize(resolveComponents(parse(t,o),parse(r,o),o,true),o)}function normalize(t,r){if(typeof t==="string"){t=serialize(parse(t,r),r)}else if(typeOf(t)==="object"){t=parse(serialize(t,r),r)}return t}function equal(t,r,i){if(typeof t==="string"){t=serialize(parse(t,i),i)}else if(typeOf(t)==="object"){t=serialize(t,i)}if(typeof r==="string"){r=serialize(parse(r,i),i)}else if(typeOf(r)==="object"){r=serialize(r,i)}return t===r}function escapeComponent(t,o){return t&&t.toString().replace(!o||!o.iri?r.ESCAPE:i.ESCAPE,pctEncChar)}function unescapeComponent(t,o){return t&&t.toString().replace(!o||!o.iri?r.PCT_ENCODED:i.PCT_ENCODED,pctDecChars)}var H={scheme:"http",domainHost:true,parse:function parse(t,r){if(!t.host){t.error=t.error||"HTTP URIs must have a host."}return t},serialize:function serialize(t,r){var i=String(t.scheme).toLowerCase()==="https";if(t.port===(i?443:80)||t.port===""){t.port=undefined}if(!t.path){t.path="/"}return t}};var V={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function isSecure(t){return typeof t.secure==="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}var z={scheme:"ws",domainHost:true,parse:function parse(t,r){var i=t;i.secure=isSecure(i);i.resourceName=(i.path||"/")+(i.query?"?"+i.query:"");i.path=undefined;i.query=undefined;return i},serialize:function serialize(t,r){if(t.port===(isSecure(t)?443:80)||t.port===""){t.port=undefined}if(typeof t.secure==="boolean"){t.scheme=t.secure?"wss":"ws";t.secure=undefined}if(t.resourceName){var i=t.resourceName.split("?"),a=o(i,2),c=a[0],l=a[1];t.path=c&&c!=="/"?c:undefined;t.query=l;t.resourceName=undefined}t.fragment=undefined;return t}};var G={scheme:"wss",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};var q={};var W=true;var K="[A-Za-z0-9\\-\\.\\_\\~"+(W?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var Y="[0-9A-Fa-f]";var Z=subexp(subexp("%[EFef]"+Y+"%"+Y+Y+"%"+Y+Y)+"|"+subexp("%[89A-Fa-f]"+Y+"%"+Y+Y)+"|"+subexp("%"+Y+Y));var X="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var J="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var Q=merge(J,'[\\"\\\\]');var ee="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var te=new RegExp(K,"g");var re=new RegExp(Z,"g");var se=new RegExp(merge("[^]",X,"[\\.]",'[\\"]',Q),"g");var ie=new RegExp(merge("[^]",K,ee),"g");var ne=ie;function decodeUnreserved(t){var r=pctDecChars(t);return!r.match(te)?t:r}var oe={scheme:"mailto",parse:function parse$$1(t,r){var i=t;var o=i.to=i.path?i.path.split(","):[];i.path=undefined;if(i.query){var a=false;var c={};var l=i.query.split("&");for(var u=0,h=l.length;u{"use strict";const{builtinModules:o}=i(8188);var a=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var c=["node_modules","favicon.ico"];function validate(t){var r=[];var i=[];if(t===null){i.push("name cannot be null");return done(r,i)}if(t===undefined){i.push("name cannot be undefined");return done(r,i)}if(typeof t!=="string"){i.push("name must be a string");return done(r,i)}if(!t.length){i.push("name length must be greater than zero")}if(t.match(/^\./)){i.push("name cannot start with a period")}if(t.match(/^_/)){i.push("name cannot start with an underscore")}if(t.trim()!==t){i.push("name cannot contain leading or trailing spaces")}c.forEach((function(r){if(t.toLowerCase()===r){i.push(r+" is a blacklisted name")}}));if(o.includes(t.toLowerCase())){r.push(t+" is a core module name")}if(t.length>214){r.push("name can no longer contain more than 214 characters")}if(t.toLowerCase()!==t){r.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(t.split("/").slice(-1)[0])){r.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(t)!==t){var l=t.match(a);if(l){var u=l[1];var h=l[2];if(encodeURIComponent(u)===u&&encodeURIComponent(h)===h){return done(r,i)}}i.push("name can only contain URL-friendly characters")}return done(r,i)}var done=function(t,r){var i={validForNewPackages:r.length===0&&t.length===0,validForOldPackages:r.length===0,warnings:t,errors:r};if(!i.warnings.length){delete i.warnings}if(!i.errors.length){delete i.errors}return i};t.exports=validate},6470:(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(2636);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{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5687:t=>{"use strict";t.exports=require("https")},8188:t=>{"use strict";t.exports=require("module")},7718:t=>{"use strict";t.exports=require("node:child_process")},5673:t=>{"use strict";t.exports=require("node:events")},7561:t=>{"use strict";t.exports=require("node:fs")},9411:t=>{"use strict";t.exports=require("node:path")},7742:t=>{"use strict";t.exports=require("node:process")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},4521:t=>{"use strict";t.exports=require("readline")},9955:t=>{"use strict";t.exports=require("stream")},6224:t=>{"use strict";t.exports=require("tty")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},8878:(t,r,i)=>{const{Argument:o}=i(6654);const{Command:a}=i(5955);const{CommanderError:c,InvalidArgumentError:l}=i(2829);const{Help:u}=i(8567);const{Option:h}=i(9230);r.program=new a;r.createCommand=t=>new a(t);r.createOption=(t,r)=>new h(t,r);r.createArgument=(t,r)=>new o(t,r);r.Command=a;r.Option=h;r.Argument=o;r.Help=u;r.CommanderError=c;r.InvalidArgumentError=l;r.InvalidOptionArgumentError=l},6654:(t,r,i)=>{const{InvalidArgumentError:o}=i(2829);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},5955:(t,r,i)=>{const o=i(5673).EventEmitter;const a=i(7718);const c=i(9411);const l=i(7561);const u=i(7742);const{Argument:h,humanReadableArgName:d}=i(6654);const{CommanderError:p}=i(2829);const{Help:m}=i(8567);const{Option:g,DualOptions:y}=i(9230);const{suggestSimilar:v}=i(3241);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;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._summary="";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._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._helpOption=t._helpOption;this._helpCommand=t._helpCommand;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}_getCommandAndAncestors(){const t=[];for(let r=this;r;r=r.parent){t.push(r)}return t}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._registerCommand(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._registerCommand(t);t.parent=this;t._checkForBrokenPassThrough();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.trim().split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this.registeredArguments.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.registeredArguments.push(t);return this}helpCommand(t,r){if(typeof t==="boolean"){this._addImplicitHelpCommand=t;return this}t=t??"help [command]";const[,i,o]=t.match(/([^ ]+) *(.*)/);const a=r??"display help for command";const c=this.createCommand(i);c.helpOption(false);if(o)c.arguments(o);if(a)c.description(a);this._addImplicitHelpCommand=true;this._helpCommand=c;return this}addHelpCommand(t,r){if(typeof t!=="object"){this.helpCommand(t,r);return this}this._addImplicitHelpCommand=true;this._helpCommand=t;return this}_getHelpCommand(){const t=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(t){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(t,r){const i=["preSubcommand","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.registeredArguments.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)}_callParseArg(t,r,i,o){try{return t.parseArg(r,i)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){const r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){const i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'\n- already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){const knownBy=t=>[t.name()].concat(t.aliases());const r=knownBy(t).find((t=>this._findCommand(t)));if(r){const i=knownBy(this._findCommand(r)).join("|");const o=knownBy(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(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")}const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const c=this.getOptionValue(i);if(r!==null&&t.parseArg){r=this._callParseArg(t,r,c,o)}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;this._checkForBrokenPassThrough();return this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions){throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}}storeOptionsAsProperties(t=true){if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}if(Object.keys(this._optionValues).length){throw new Error("call .storeOptionsAsProperties() before setting option values")}this._storeOptionsAsProperties=!!t;return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,undefined)}setOptionValueWithSource(t,r,i){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;this._getCommandAndAncestors().forEach((i=>{if(i.getOptionValueSource(t)!==undefined){r=i.getOptionValueSource(t)}}));return r}_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&&r.from===undefined){if(u.versions?.electron){r.from="electron"}const t=u.execArgv??[];if(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print")){r.from="eval"}}if(t===undefined){t=u.argv}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;case"eval":i=t.slice(1);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();this._checkForConflictingOptions();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;m.on("close",(t=>{t=t??1;if(!g){u.exit(t)}else{g(new p(t,"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});let a;a=this._chainOrCallSubCommandHook(a,o,"preSubcommand");a=this._chainOrCall(a,(()=>{if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}));return a}_dispatchHelpCommand(t){if(!t){this.help()}const r=this._findCommand(t);if(r&&!r._executableHandler){r.help()}return this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){const a=`error: command-argument value '${r}' is invalid for argument '${t.name()}'.`;o=this._callParseArg(t,r,i,a)}return o};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(imyParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(ir()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];this._getCommandAndAncestors().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}_chainOrCallSubCommandHook(t,r,i){let o=t;if(this._lifeCycleHooks[i]!==undefined){this._lifeCycleHooks[i].forEach((t=>{o=this._chainOrCall(o,(()=>t(this,r)))}))}return o}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();this._parseOptionsImplied();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._getHelpCommand()&&t[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(t[1])}if(this._defaultCommandName){this._outputHelpIfRequested(r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(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(){this._getCommandAndAncestors().forEach((t=>{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(){this._getCommandAndAncestors().forEach((t=>{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 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(this._getHelpCommand()&&t===this._getHelpCommand().name()){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;iObject.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()}`)}}}}))}_parseOptionsImplied(){const t=new y(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((r=>r.implied!==undefined&&hasCustomOptionValue(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((r=>{this.setOptionValueWithSource(r,t.implied[r],"implied")}))}))}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=v(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this.registeredArguments.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=v(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._registerOption(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}summary(t){if(t===undefined)return this._summary;this._summary=t;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");const i=this.parent?._findCommand(t);if(i){const r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${r}'`)}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.registeredArguments.map((t=>d(t)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.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);this._getCommandAndAncestors().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);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",i);this._getCommandAndAncestors().forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){if(t){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}t=t??"-h, --help";r=r??"display help for command";this._helpOption=this.createOption(t,r);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(t){this._helpOption=t;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}_outputHelpIfRequested(t){const r=this._getHelpOption();const i=r&&t.find((t=>r.is(t)));if(i){this.outputHelp();this._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}))}r.Command=Command},2829:(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},8567:(t,r,i)=>{const{humanReadableArgName:o}=i(6654);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));const i=t._getHelpCommand();if(i&&!i._hidden){r.push(i)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}compareOptions(t,r){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return getSortKey(t).localeCompare(getSortKey(r))}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._getHelpOption();if(i&&!i.hidden){const o=i.short&&t._findOption(i.short);const a=i.long&&t._findOption(i.long);if(!o&&!a){r.push(i)}else if(i.long&&!a){r.push(t.createOption(i.long,i.description))}else if(i.short&&!o){r.push(t.createOption(i.short,i.description))}}if(this.sortOptions){r.sort(this.compareOptions)}return r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const r=[];for(let i=t.parent;i;i=i.parent){const t=i.options.filter((t=>!t.hidden));r.push(...t)}if(this.sortOptions){r.sort(this.compareOptions)}return r}visibleArguments(t){if(t._argsDescription){t.registeredArguments.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t.registeredArguments.find((t=>t.description))){return t.registeredArguments}return[]}subcommandTerm(t){const r=t.registeredArguments.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)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(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.summary()||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([r.wrap(u,o,0),""])}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),""])}if(this.showGlobalOptions){const i=r.visibleGlobalOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(i.length>0){l=l.concat(["Global Options:",formatList(i),""])}}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.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){const a=" \\f\\t\\v   -    \ufeff";const c=new RegExp(`[\\n][${a}]+`);if(t.match(c))return t;const l=r-i;if(l{if(t==="\n")return"";return(r>0?d:"")+t.trimEnd()})).join("\n")}}r.Help=Help},9230:(t,r,i)=>{const{InvalidArgumentError:o}=i(2829);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=[];this.implied=undefined}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}implies(t){let r=t;if(typeof t==="string"){r={[t]:true}}this.implied=Object.assign(this.implied||{},r);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}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,r)=>{if(this.positiveOptions.has(r)){this.dualOptions.add(r)}}))}valueFromOption(t,r){const i=r.attributeName();if(!this.dualOptions.has(i))return true;const o=this.negativeOptions.get(i).presetArg;const a=o!==undefined?o:false;return r.negate===(a===t)}}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.DualOptions=DualOptions},3241:(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(it.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},5227:t=>{"use strict";t.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},2650:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/applicator":true},"$dynamicAnchor":"meta","title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"prefixItems":{"$ref":"#/$defs/schemaArray"},"items":{"$dynamicRef":"#meta"},"contains":{"$dynamicRef":"#meta"},"additionalProperties":{"$dynamicRef":"#meta"},"properties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"propertyNames":{"$dynamicRef":"#meta"},"if":{"$dynamicRef":"#meta"},"then":{"$dynamicRef":"#meta"},"else":{"$dynamicRef":"#meta"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$dynamicRef":"#meta"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$dynamicRef":"#meta"}}}}')},1828:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/content","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentEncoding":{"type":"string"},"contentMediaType":{"type":"string"},"contentSchema":{"$dynamicRef":"#meta"}}}')},2720:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/core","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true},"$dynamicAnchor":"meta","title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"$ref":"#/$defs/uriReferenceString","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"$ref":"#/$defs/uriString"},"$ref":{"$ref":"#/$defs/uriReferenceString"},"$anchor":{"$ref":"#/$defs/anchorString"},"$dynamicRef":{"$ref":"#/$defs/uriReferenceString"},"$dynamicAnchor":{"$ref":"#/$defs/anchorString"},"$vocabulary":{"type":"object","propertyNames":{"$ref":"#/$defs/uriString"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"}}},"$defs":{"anchorString":{"type":"string","pattern":"^[A-Za-z_][-A-Za-z0-9._]*$"},"uriString":{"type":"string","format":"uri"},"uriReferenceString":{"type":"string","format":"uri-reference"}}}')},8805:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/format-annotation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},"$dynamicAnchor":"meta","title":"Format vocabulary meta-schema for annotation results","type":["object","boolean"],"properties":{"format":{"type":"string"}}}')},5607:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},"$dynamicAnchor":"meta","title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}')},8814:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/unevaluated","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},"$dynamicAnchor":"meta","title":"Unevaluated applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"unevaluatedItems":{"$dynamicRef":"#meta"},"unevaluatedProperties":{"$dynamicRef":"#meta"}}}')},1400:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/validation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/validation":true},"$dynamicAnchor":"meta","title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]},"const":true,"enum":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}')},6642:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/unevaluated"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format-annotation"},{"$ref":"meta/content"}],"type":["object","boolean"],"$comment":"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.","properties":{"definitions":{"$comment":"\\"definitions\\" has been replaced by \\"$defs\\".","type":"object","additionalProperties":{"$dynamicRef":"#meta"},"deprecated":true,"default":{}},"dependencies":{"$comment":"\\"dependencies\\" has been split and replaced by \\"dependentSchemas\\" and \\"dependentRequired\\" in order to serve their differing semantics.","type":"object","additionalProperties":{"anyOf":[{"$dynamicRef":"#meta"},{"$ref":"meta/validation#/$defs/stringArray"}]},"deprecated":true,"default":{}},"$recursiveAnchor":{"$comment":"\\"$recursiveAnchor\\" has been replaced by \\"$dynamicAnchor\\".","$ref":"meta/core#/$defs/anchorString","deprecated":true},"$recursiveRef":{"$comment":"\\"$recursiveRef\\" has been replaced by \\"$dynamicRef\\".","$ref":"meta/core#/$defs/uriReferenceString","deprecated":true}}}')},5137:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},9116:t=>{"use strict";t.exports=JSON.parse('[{"name":"Agola CI","constant":"AGOLA","env":"AGOLA_GIT_REF","pr":"AGOLA_PULL_REQUEST_ID"},{"name":"Appcircle","constant":"APPCIRCLE","env":"AC_APPCIRCLE"},{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"TF_BUILD","pr":{"BUILD_REASON":"PullRequest"}},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"Codefresh","constant":"CODEFRESH","env":"CF_BUILD_ID","pr":{"any":["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{"name":"Codemagic","constant":"CODEMAGIC","env":"CM_BUILD_ID","pr":"CM_PULL_REQUEST"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"Earthly","constant":"EARTHLY","env":"EARTHLY_CI"},{"name":"Expo Application Services","constant":"EAS","env":"EAS_BUILD"},{"name":"Gerrit","constant":"GERRIT","env":"GERRIT_PROJECT"},{"name":"Gitea Actions","constant":"GITEA_ACTIONS","env":"GITEA_ACTIONS"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI","pr":"CI_MERGE_REQUEST_ID"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Google Cloud Build","constant":"GOOGLE_CLOUD_BUILD","env":"BUILDER_OUTPUT"},{"name":"Harness CI","constant":"HARNESS","env":"HARNESS_BUILD_ID"},{"name":"Heroku","constant":"HEROKU","env":{"env":"NODE","includes":"/app/.heroku/node/bin/node"}},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"LayerCI","constant":"LAYERCI","env":"LAYERCI","pr":"LAYERCI_PULL_REQUEST"},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Nevercode","constant":"NEVERCODE","env":"NEVERCODE","pr":{"env":"NEVERCODE_PULL_REQUEST","ne":"false"}},{"name":"Prow","constant":"PROW","env":"PROW_JOB_ID"},{"name":"ReleaseHub","constant":"RELEASEHUB","env":"RELEASE_BUILD_ID"},{"name":"Render","constant":"RENDER","env":"RENDER","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Screwdriver","constant":"SCREWDRIVER","env":"SCREWDRIVER","pr":{"env":"SD_PULL_REQUEST","ne":"false"}},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Sourcehut","constant":"SOURCEHUT","env":{"CI_NAME":"sourcehut"}},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}},{"name":"Vela","constant":"VELA","env":"VELA","pr":{"VELA_PULL_REQUEST":"1"}},{"name":"Vercel","constant":"VERCEL","env":{"any":["NOW_BUILDER","VERCEL"]},"pr":"VERCEL_GIT_PULL_REQUEST_ID"},{"name":"Visual Studio App Center","constant":"APPCENTER","env":"APPCENTER_BUILD_ID"},{"name":"Woodpecker","constant":"WOODPECKER","env":{"CI":"woodpecker"},"pr":{"CI_BUILD_EVENT":"pull_request"}},{"name":"Xcode Cloud","constant":"XCODE_CLOUD","env":"CI_XCODE_PROJECT","pr":"CI_PULL_REQUEST_NUMBER"},{"name":"Xcode Server","constant":"XCODE_SERVER","env":"XCS"}]')}};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].call(a.exports,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={};(()=>{"use strict";__nccwpck_require__.r(i);var t=__nccwpck_require__(150);var r=__nccwpck_require__.n(t);var o=__nccwpck_require__(8878);const{program:a,createCommand:c,createArgument:l,createOption:u,CommanderError:h,InvalidArgumentError:d,InvalidOptionArgumentError:p,Command:m,Argument:g,Option:y,Help:v}=o;const b=require("node:util");var w=__nccwpck_require__(7742);var E=__nccwpck_require__(7561);var S=__nccwpck_require__(9411);const $=require("node:crypto");const x=require("node:assert");const isObject=t=>{const r=typeof t;return t!==null&&(r==="object"||r==="function")};const isEmptyObject=t=>isObject(t)&&Object.keys(t).length===0;const R=new Set(["__proto__","prototype","constructor"]);const O=new Set("0123456789");function getPathSegments(t){const r=[];let i="";let o="start";let a=false;for(const c of t){switch(c){case"\\":{if(o==="index"){throw new Error("Invalid character in an index")}if(o==="indexEnd"){throw new Error("Invalid character after an index")}if(a){i+=c}o="property";a=!a;break}case".":{if(o==="index"){throw new Error("Invalid character in an index")}if(o==="indexEnd"){o="property";break}if(a){a=false;i+=c;break}if(R.has(i)){return[]}r.push(i);i="";o="property";break}case"[":{if(o==="index"){throw new Error("Invalid character in an index")}if(o==="indexEnd"){o="index";break}if(a){a=false;i+=c;break}if(o==="property"){if(R.has(i)){return[]}r.push(i);i=""}o="index";break}case"]":{if(o==="index"){r.push(Number.parseInt(i,10));i="";o="indexEnd";break}if(o==="indexEnd"){throw new Error("Invalid character after an index")}}default:{if(o==="index"&&!O.has(c)){throw new Error("Invalid character in an index")}if(o==="indexEnd"){throw new Error("Invalid character after an index")}if(o==="start"){o="property"}if(a){a=false;i+="\\"}i+=c}}}if(a){i+="\\"}switch(o){case"property":{if(R.has(i)){return[]}r.push(i);break}case"index":{throw new Error("Index was not closed")}case"start":{r.push("");break}}return r}function isStringIndex(t,r){if(typeof r!=="number"&&Array.isArray(t)){const i=Number.parseInt(r,10);return Number.isInteger(i)&&t[i]===t[r]}return false}function assertNotStringIndex(t,r){if(isStringIndex(t,r)){throw new Error("Cannot use string index")}}function getProperty(t,r,i){if(!isObject(t)||typeof r!=="string"){return i===undefined?t:i}const o=getPathSegments(r);if(o.length===0){return i}for(let r=0;r[Number(t),r]))}return r}function stringifyPath(t){let r="";for(let[i,o]of entries(t)){if(typeof o==="number"){r+=`[${o}]`}else{o=escapePath(o);r+=i===0?o:`.${o}`}}return r}function*deepKeysIterator(t,r=[]){if(!isObject(t)||isEmptyObject(t)){if(r.length>0){yield stringifyPath(r)}return}for(const[i,o]of entries(t)){yield*deepKeysIterator(o,[...r,i])}}function deepKeys(t){return[...deepKeysIterator(t)]}const P=require("node:os");const A=P.homedir();const T=P.tmpdir();const{env:C}=w;const macos=t=>{const r=S.join(A,"Library");return{data:S.join(r,"Application Support",t),config:S.join(r,"Preferences",t),cache:S.join(r,"Caches",t),log:S.join(r,"Logs",t),temp:S.join(T,t)}};const windows=t=>{const r=C.APPDATA||S.join(A,"AppData","Roaming");const i=C.LOCALAPPDATA||S.join(A,"AppData","Local");return{data:S.join(i,t,"Data"),config:S.join(r,t,"Config"),cache:S.join(i,t,"Cache"),log:S.join(i,t,"Log"),temp:S.join(T,t)}};const linux=t=>{const r=S.basename(A);return{data:S.join(C.XDG_DATA_HOME||S.join(A,".local","share"),t),config:S.join(C.XDG_CONFIG_HOME||S.join(A,".config"),t),cache:S.join(C.XDG_CACHE_HOME||S.join(A,".cache"),t),log:S.join(C.XDG_STATE_HOME||S.join(A,".local","state"),t),temp:S.join(T,r,t)}};function envPaths(t,{suffix:r="nodejs"}={}){if(typeof t!=="string"){throw new TypeError(`Expected a string, got ${typeof t}`)}if(r){t+=`-${r}`}if(w.platform==="darwin"){return macos(t)}if(w.platform==="win32"){return windows(t)}return linux(t)}const attemptifyAsync=(t,r)=>function attemptified(...i){return t.apply(undefined,i).catch(r)};const attemptifySync=(t,r)=>function attemptified(...i){try{return t.apply(undefined,i)}catch(t){return r(t)}};const k=w.getuid?!w.getuid():false;const I=1e4;const NOOP=()=>undefined;const N={isChangeErrorOk:t=>{if(!N.isNodeError(t))return false;const{code:r}=t;if(r==="ENOSYS")return true;if(!k&&(r==="EINVAL"||r==="EPERM"))return true;return false},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!N.isNodeError(t))return false;const{code:r}=t;if(r==="EMFILE"||r==="ENFILE"||r==="EAGAIN"||r==="EBUSY"||r==="EACCESS"||r==="EACCES"||r==="EACCS"||r==="EPERM")return true;return false},onChangeError:t=>{if(!N.isNodeError(t))throw t;if(N.isChangeErrorOk(t))return;throw t}};const D=N;class RetryfyQueue{constructor(){this.interval=25;this.intervalId=undefined;this.limit=I;this.queueActive=new Set;this.queueWaiting=new Set;this.init=()=>{if(this.intervalId)return;this.intervalId=setInterval(this.tick,this.interval)};this.reset=()=>{if(!this.intervalId)return;clearInterval(this.intervalId);delete this.intervalId};this.add=t=>{this.queueWaiting.add(t);if(this.queueActive.size{this.queueWaiting.delete(t);this.queueActive.delete(t)};this.schedule=()=>new Promise((t=>{const cleanup=()=>this.remove(resolver);const resolver=()=>t(cleanup);this.add(resolver)}));this.tick=()=>{if(this.queueActive.size>=this.limit)return;if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t);this.queueActive.add(t);t()}}}}const L=new RetryfyQueue;const retryifyAsync=(t,r)=>function retrified(i){return function attempt(...o){return L.schedule().then((a=>{const onResolve=t=>{a();return t};const onReject=t=>{a();if(Date.now()>=i)throw t;if(r(t)){const t=Math.round(100*Math.random());const r=new Promise((r=>setTimeout(r,t)));return r.then((()=>attempt.apply(undefined,o)))}throw t};return t.apply(undefined,o).then(onResolve,onReject)}))}};const retryifySync=(t,r)=>function retrified(i){return function attempt(...o){try{return t.apply(undefined,o)}catch(t){if(Date.now()>i)throw t;if(r(t))return attempt.apply(undefined,o);throw t}}};const M={attempt:{chmod:attemptifyAsync((0,b.promisify)(E.chmod),D.onChangeError),chown:attemptifyAsync((0,b.promisify)(E.chown),D.onChangeError),close:attemptifyAsync((0,b.promisify)(E.close),NOOP),fsync:attemptifyAsync((0,b.promisify)(E.fsync),NOOP),mkdir:attemptifyAsync((0,b.promisify)(E.mkdir),NOOP),realpath:attemptifyAsync((0,b.promisify)(E.realpath),NOOP),stat:attemptifyAsync((0,b.promisify)(E.stat),NOOP),unlink:attemptifyAsync((0,b.promisify)(E.unlink),NOOP),chmodSync:attemptifySync(E.chmodSync,D.onChangeError),chownSync:attemptifySync(E.chownSync,D.onChangeError),closeSync:attemptifySync(E.closeSync,NOOP),existsSync:attemptifySync(E.existsSync,NOOP),fsyncSync:attemptifySync(E.fsync,NOOP),mkdirSync:attemptifySync(E.mkdirSync,NOOP),realpathSync:attemptifySync(E.realpathSync,NOOP),statSync:attemptifySync(E.statSync,NOOP),unlinkSync:attemptifySync(E.unlinkSync,NOOP)},retry:{close:retryifyAsync((0,b.promisify)(E.close),D.isRetriableError),fsync:retryifyAsync((0,b.promisify)(E.fsync),D.isRetriableError),open:retryifyAsync((0,b.promisify)(E.open),D.isRetriableError),readFile:retryifyAsync((0,b.promisify)(E.readFile),D.isRetriableError),rename:retryifyAsync((0,b.promisify)(E.rename),D.isRetriableError),stat:retryifyAsync((0,b.promisify)(E.stat),D.isRetriableError),write:retryifyAsync((0,b.promisify)(E.write),D.isRetriableError),writeFile:retryifyAsync((0,b.promisify)(E.writeFile),D.isRetriableError),closeSync:retryifySync(E.closeSync,D.isRetriableError),fsyncSync:retryifySync(E.fsyncSync,D.isRetriableError),openSync:retryifySync(E.openSync,D.isRetriableError),readFileSync:retryifySync(E.readFileSync,D.isRetriableError),renameSync:retryifySync(E.renameSync,D.isRetriableError),statSync:retryifySync(E.statSync,D.isRetriableError),writeSync:retryifySync(E.writeSync,D.isRetriableError),writeFileSync:retryifySync(E.writeFileSync,D.isRetriableError)}};const j=M;const U="utf8";const B=438;const H=511;const V={};const z={};const G=P.userInfo().uid;const q=P.userInfo().gid;const W=7500;const K=1e3;const Y=!!w.getuid;const Z=w.getuid?!w.getuid():false;const X=128;const J=1e4;const constants_NOOP=()=>{};const lang_isException=t=>t instanceof Error&&"code"in t;const lang_isFunction=t=>typeof t==="function";const lang_isString=t=>typeof t==="string";const lang_isUndefined=t=>t===undefined;const Q={};const ee={next:t=>{const r=Q[t];if(!r)return;r.shift();const i=r[0];if(i){i((()=>ee.next(t)))}else{delete Q[t]}},schedule:t=>new Promise((r=>{let i=Q[t];if(!i)i=Q[t]=[];i.push(r);if(i.length>1)return;r((()=>ee.next(t)))}))};const te=null&ⅇconst re=w.platform==="linux";const se=w.platform==="win32";const ie=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(!se){ie.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(re){ie.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}const ne=ie;class Interceptor{constructor(){this.callbacks=new Set;this.exited=false;this.exit=t=>{if(this.exited)return;this.exited=true;for(const t of this.callbacks){t()}if(t){if(se&&(t!=="SIGINT"&&t!=="SIGTERM"&&t!=="SIGKILL")){w.kill(w.pid,"SIGTERM")}else{w.kill(w.pid,t)}}};this.hook=()=>{w.once("exit",(()=>this.exit()));for(const t of ne){w.once(t,(()=>this.exit(t)))}};this.register=t=>{this.callbacks.add(t);return()=>{this.callbacks.delete(t)}};this.hook()}}const oe=new Interceptor;const ae=oe.register;const ce=ae;const le={store:{},create:t=>{const r=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6);const i=Date.now().toString().slice(-10);const o="tmp-";const a=`.${o}${i}${r}`;const c=`${t}${a}`;return c},get:(t,r,i=true)=>{const o=le.truncate(r(t));if(o in le.store)return le.get(t,r,i);le.store[o]=i;const disposer=()=>delete le.store[o];return[o,disposer]},purge:t=>{if(!le.store[t])return;delete le.store[t];j.attempt.unlink(t)},purgeSync:t=>{if(!le.store[t])return;delete le.store[t];j.attempt.unlinkSync(t)},purgeSyncAll:()=>{for(const t in le.store){le.purgeSync(t)}},truncate:t=>{const r=S.basename(t);if(r.length<=X)return t;const i=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(r);if(!i)return t;const o=r.length-X;return`${t.slice(0,-r.length)}${i[1]}${i[2].slice(0,-o)}${i[3]}`}};ce(le.purgeSyncAll);const ue=le;function readFile(t,r=DEFAULT_READ_OPTIONS){if(isString(r))return readFile(t,{encoding:r});const i=Date.now()+((r.timeout??DEFAULT_TIMEOUT_ASYNC)||-1);return fs.retry.readFile(i)(t,r)}function readFileSync(t,r=DEFAULT_READ_OPTIONS){if(isString(r))return readFileSync(t,{encoding:r});const i=Date.now()+((r.timeout??DEFAULT_TIMEOUT_SYNC)||-1);return fs.retry.readFileSync(i)(t,r)}function writeFile(t,r,i,o){if(isFunction(i))return writeFile(t,r,DEFAULT_WRITE_OPTIONS,i);const a=writeFileAsync(t,r,i);if(o)a.then(o,o);return a}async function writeFileAsync(t,r,i=DEFAULT_WRITE_OPTIONS){if(isString(i))return writeFileAsync(t,r,{encoding:i});const o=Date.now()+((i.timeout??DEFAULT_TIMEOUT_ASYNC)||-1);let a=null;let c=null;let l=null;let u=null;let h=null;try{if(i.schedule)a=await i.schedule(t);c=await Scheduler.schedule(t);const d=await fs.attempt.realpath(t);const p=!!d;t=d||t;[u,l]=Temp.get(t,i.tmpCreate||Temp.create,!(i.tmpPurge===false));const m=IS_POSIX&&isUndefined(i.chown);const g=isUndefined(i.mode);if(p&&(m||g)){const r=await fs.attempt.stat(t);if(r){i={...i};if(m){i.chown={uid:r.uid,gid:r.gid}}if(g){i.mode=r.mode}}}if(!p){const r=path.dirname(t);await fs.attempt.mkdir(r,{mode:DEFAULT_FOLDER_MODE,recursive:true})}h=await fs.retry.open(o)(u,"w",i.mode||DEFAULT_FILE_MODE);if(i.tmpCreated){i.tmpCreated(u)}if(isString(r)){await fs.retry.write(o)(h,r,0,i.encoding||DEFAULT_ENCODING)}else if(!isUndefined(r)){await fs.retry.write(o)(h,r,0,r.length,0)}if(i.fsync!==false){if(i.fsyncWait!==false){await fs.retry.fsync(o)(h)}else{fs.attempt.fsync(h)}}await fs.retry.close(o)(h);h=null;if(i.chown&&(i.chown.uid!==DEFAULT_USER_UID||i.chown.gid!==DEFAULT_USER_GID)){await fs.attempt.chown(u,i.chown.uid,i.chown.gid)}if(i.mode&&i.mode!==DEFAULT_FILE_MODE){await fs.attempt.chmod(u,i.mode)}try{await fs.retry.rename(o)(u,t)}catch(r){if(!isException(r))throw r;if(r.code!=="ENAMETOOLONG")throw r;await fs.retry.rename(o)(u,Temp.truncate(t))}l();u=null}finally{if(h)await fs.attempt.close(h);if(u)Temp.purge(u);if(a)a();if(c)c()}}function writeFileSync(t,r,i=z){if(lang_isString(i))return writeFileSync(t,r,{encoding:i});const o=Date.now()+((i.timeout??K)||-1);let a=null;let c=null;let l=null;try{const u=j.attempt.realpathSync(t);const h=!!u;t=u||t;[c,a]=ue.get(t,i.tmpCreate||ue.create,!(i.tmpPurge===false));const d=Y&&lang_isUndefined(i.chown);const p=lang_isUndefined(i.mode);if(h&&(d||p)){const r=j.attempt.statSync(t);if(r){i={...i};if(d){i.chown={uid:r.uid,gid:r.gid}}if(p){i.mode=r.mode}}}if(!h){const r=S.dirname(t);j.attempt.mkdirSync(r,{mode:H,recursive:true})}l=j.retry.openSync(o)(c,"w",i.mode||B);if(i.tmpCreated){i.tmpCreated(c)}if(lang_isString(r)){j.retry.writeSync(o)(l,r,0,i.encoding||U)}else if(!lang_isUndefined(r)){j.retry.writeSync(o)(l,r,0,r.length,0)}if(i.fsync!==false){if(i.fsyncWait!==false){j.retry.fsyncSync(o)(l)}else{j.attempt.fsync(l)}}j.retry.closeSync(o)(l);l=null;if(i.chown&&(i.chown.uid!==G||i.chown.gid!==q)){j.attempt.chownSync(c,i.chown.uid,i.chown.gid)}if(i.mode&&i.mode!==B){j.attempt.chmodSync(c,i.mode)}try{j.retry.renameSync(o)(c,t)}catch(r){if(!lang_isException(r))throw r;if(r.code!=="ENAMETOOLONG")throw r;j.retry.renameSync(o)(c,ue.truncate(t))}a();c=null}finally{if(l)j.attempt.closeSync(l);if(c)ue.purge(c)}}var he=__nccwpck_require__(8018);var de=__nccwpck_require__(8735);const copyProperty=(t,r,i,o)=>{if(i==="length"||i==="prototype"){return}if(i==="arguments"||i==="caller"){return}const a=Object.getOwnPropertyDescriptor(t,i);const c=Object.getOwnPropertyDescriptor(r,i);if(!canCopyProperty(a,c)&&o){return}Object.defineProperty(t,i,c)};const canCopyProperty=function(t,r){return t===undefined||t.configurable||t.writable===r.writable&&t.enumerable===r.enumerable&&t.configurable===r.configurable&&(t.writable||t.value===r.value)};const changePrototype=(t,r)=>{const i=Object.getPrototypeOf(r);if(i===Object.getPrototypeOf(t)){return}Object.setPrototypeOf(t,i)};const wrappedToString=(t,r)=>`/* Wrapped ${t}*/\n${r}`;const fe=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const pe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(t,r,i)=>{const o=i===""?"":`with ${i.trim()}() `;const a=wrappedToString.bind(null,o,r.toString());Object.defineProperty(a,"name",pe);const{writable:c,enumerable:l,configurable:u}=fe;Object.defineProperty(t,"toString",{value:a,writable:c,enumerable:l,configurable:u})};function mimicFunction(t,r,{ignoreNonConfigurable:i=false}={}){const{name:o}=t;for(const o of Reflect.ownKeys(r)){copyProperty(t,r,o,i)}changePrototype(t,r);changeToString(t,r,o);return t}const debounceFunction=(t,r={})=>{if(typeof t!=="function"){throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``)}const{wait:i=0,maxWait:o=Number.POSITIVE_INFINITY,before:a=false,after:c=true}=r;if(i<0||o<0){throw new RangeError("`wait` and `maxWait` must not be negative.")}if(!a&&!c){throw new Error("Both `before` and `after` are false, function wouldn't be called.")}let l;let u;let h;const debouncedFunction=function(...r){const d=this;const later=()=>{l=undefined;if(u){clearTimeout(u);u=undefined}if(c){h=t.apply(d,r)}};const maxLater=()=>{u=undefined;if(l){clearTimeout(l);l=undefined}if(c){h=t.apply(d,r)}};const p=a&&!l;clearTimeout(l);l=setTimeout(later,i);if(o>0&&o!==Number.POSITIVE_INFINITY&&!u){u=setTimeout(maxLater,o)}if(p){h=t.apply(d,r)}return h};mimicFunction(debouncedFunction,t);debouncedFunction.cancel=()=>{if(l){clearTimeout(l);l=undefined}if(u){clearTimeout(u);u=undefined}};return debouncedFunction};const me=debounceFunction;var ge=__nccwpck_require__(6546);const ye=Object.prototype.toString;const ve="[object Uint8Array]";function isUint8Array(t){if(!t){return false}if(t.constructor===Uint8Array){return true}return ye.call(t)===ve}function assertUint8Array(t){if(!isUint8Array(t)){throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}}function toUint8Array(t){if(t instanceof ArrayBuffer){return new Uint8Array(t)}if(ArrayBuffer.isView(t)){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}throw new TypeError(`Unsupported value, got \`${typeof t}\`.`)}function concatUint8Arrays(t,r){if(t.length===0){return new Uint8Array(0)}r??=t.reduce(((t,r)=>t+r.length),0);const i=new Uint8Array(r);let o=0;for(const r of t){assertUint8Array(r);i.set(r,o);o+=r.length}return i}function areUint8ArraysEqual(t,r){assertUint8Array(t);assertUint8Array(r);if(t===r){return true}if(t.length!==r.length){return false}for(let i=0;it.codePointAt(0)))}function stringToBase64(t,{urlSafe:r=false}={}){assertString(t);return uint8ArrayToBase64(stringToUint8Array(t),{urlSafe:r})}function base64ToString(t){assertString(t);return uint8ArrayToString(base64ToUint8Array(t))}const Ee=Array.from({length:256},((t,r)=>r.toString(16).padStart(2,"0")));function uint8ArrayToHex(t){assertUint8Array(t);let r="";for(let i=0;iObject.create(null);const isExist=t=>t!==undefined&&t!==null;const checkValueType=(t,r)=>{const i=new Set(["undefined","symbol","function"]);const o=typeof r;if(i.has(o)){throw new TypeError(`Setting a value of type \`${o}\` for key \`${t}\` is not allowed as it's not supported by JSON`)}};const Re="__internal__";const Oe=`${Re}.migrations.version`;class Conf{path;events;#e;#t;#r;#s={};constructor(t={}){const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:false,accessPropertiesByDotNotation:true,configFileMode:438,...t};if(!r.cwd){if(!r.projectName){throw new Error("Please specify the `projectName` option.")}r.cwd=envPaths(r.projectName,{suffix:r.projectSuffix}).config}this.#r=r;if(r.schema){if(typeof r.schema!=="object"){throw new TypeError("The `schema` option must be an object.")}const t=new he.Ajv2020({allErrors:true,useDefaults:true});$e(t);const i={type:"object",properties:r.schema};this.#e=t.compile(i);for(const[t,i]of Object.entries(r.schema)){if(i?.default){this.#s[t]=i.default}}}if(r.defaults){this.#s={...this.#s,...r.defaults}}if(r.serialize){this._serialize=r.serialize}if(r.deserialize){this._deserialize=r.deserialize}this.events=new EventTarget;this.#t=r.encryptionKey;const i=r.fileExtension?`.${r.fileExtension}`:"";this.path=S.resolve(r.cwd,`${r.configName??"config"}${i}`);const o=this.store;const a=Object.assign(createPlainObject(),r.defaults,o);if(r.migrations){if(!r.projectVersion){throw new Error("Please specify the `projectVersion` option.")}this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(a);try{x.deepEqual(o,a)}catch{this.store=a}if(r.watch){this._watch()}}get(t,r){if(this.#r.accessPropertiesByDotNotation){return this._get(t,r)}const{store:i}=this;return t in i?i[t]:r}set(t,r){if(typeof t!=="string"&&typeof t!=="object"){throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`)}if(typeof t!=="object"&&r===undefined){throw new TypeError("Use `delete()` to clear values")}if(this._containsReservedKey(t)){throw new TypeError(`Please don't use the ${Re} key, as it's used to manage this module internal operations.`)}const{store:i}=this;const set=(t,r)=>{checkValueType(t,r);if(this.#r.accessPropertiesByDotNotation){setProperty(i,t,r)}else{i[t]=r}};if(typeof t==="object"){const r=t;for(const[t,i]of Object.entries(r)){set(t,i)}}else{set(t,r)}this.store=i}has(t){if(this.#r.accessPropertiesByDotNotation){return hasProperty(this.store,t)}return t in this.store}reset(...t){for(const r of t){if(isExist(this.#s[r])){this.set(r,this.#s[r])}}}delete(t){const{store:r}=this;if(this.#r.accessPropertiesByDotNotation){deleteProperty(r,t)}else{delete r[t]}this.store=r}clear(){this.store=createPlainObject();for(const t of Object.keys(this.#s)){this.reset(t)}}onDidChange(t,r){if(typeof t!=="string"){throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`)}if(typeof r!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`)}return this._handleChange((()=>this.get(t)),r)}onDidAnyChange(t){if(typeof t!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`)}return this._handleChange((()=>this.store),t)}get size(){return Object.keys(this.store).length}get store(){try{const t=E.readFileSync(this.path,this.#t?null:"utf8");const r=this._encryptData(t);const i=this._deserialize(r);this._validate(i);return Object.assign(createPlainObject(),i)}catch(t){if(t?.code==="ENOENT"){this._ensureDirectory();return createPlainObject()}if(this.#r.clearInvalidConfig&&t.name==="SyntaxError"){return createPlainObject()}throw t}}set store(t){this._ensureDirectory();this._validate(t);this._write(t);this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,r]of Object.entries(this.store)){yield[t,r]}}_encryptData(t){if(!this.#t){return typeof t==="string"?t:uint8ArrayToString(t)}try{const r=t.slice(0,16);const i=$.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512");const o=$.createDecipheriv(xe,i,r);const a=t.slice(17);const c=typeof a==="string"?stringToUint8Array(a):a;return uint8ArrayToString(concatUint8Arrays([o.update(c),o.final()]))}catch{}return t.toString()}_handleChange(t,r){let i=t();const onChange=()=>{const o=i;const a=t();if((0,b.isDeepStrictEqual)(a,o)){return}i=a;r.call(this,a,o)};this.events.addEventListener("change",onChange);return()=>{this.events.removeEventListener("change",onChange)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,undefined,"\t");_validate(t){if(!this.#e){return}const r=this.#e(t);if(r||!this.#e.errors){return}const i=this.#e.errors.map((({instancePath:t,message:r=""})=>`\`${t.slice(1)}\` ${r}`));throw new Error("Config schema violation: "+i.join("; "))}_ensureDirectory(){E.mkdirSync(S.dirname(this.path),{recursive:true})}_write(t){let r=this._serialize(t);if(this.#t){const t=$.randomBytes(16);const i=$.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512");const o=$.createCipheriv(xe,i,t);r=concatUint8Arrays([t,stringToUint8Array(":"),o.update(stringToUint8Array(r)),o.final()])}if(w.env.SNAP){E.writeFileSync(this.path,r,{mode:this.#r.configFileMode})}else{try{writeFileSync(this.path,r,{mode:this.#r.configFileMode})}catch(t){if(t?.code==="EXDEV"){E.writeFileSync(this.path,r,{mode:this.#r.configFileMode});return}throw t}}}_watch(){this._ensureDirectory();if(!E.existsSync(this.path)){this._write(createPlainObject())}if(w.platform==="win32"){E.watch(this.path,{persistent:false},me((()=>{this.events.dispatchEvent(new Event("change"))}),{wait:100}))}else{E.watchFile(this.path,{persistent:false},me((()=>{this.events.dispatchEvent(new Event("change"))}),{wait:5e3}))}}_migrate(t,r,i){let o=this._get(Oe,"0.0.0");const a=Object.keys(t).filter((t=>this._shouldPerformMigration(t,o,r)));let c={...this.store};for(const l of a){try{if(i){i(this,{fromVersion:o,toVersion:l,finalVersion:r,versions:a})}const u=t[l];u?.(this);this._set(Oe,l);o=l;c={...this.store}}catch(t){this.store=c;throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${t}`)}}if(this._isVersionInRangeFormat(o)||!ge.eq(o,r)){this._set(Oe,r)}}_containsReservedKey(t){if(typeof t==="object"){const r=Object.keys(t)[0];if(r===Re){return true}}if(typeof t!=="string"){return false}if(this.#r.accessPropertiesByDotNotation){if(t.startsWith(`${Re}.`)){return true}return false}return false}_isVersionInRangeFormat(t){return ge.clean(t)===null}_shouldPerformMigration(t,r,i){if(this._isVersionInRangeFormat(t)){if(r!=="0.0.0"&&ge.satisfies(r,t)){return false}return ge.satisfies(i,t)}if(ge.lte(t,r)){return false}if(ge.gt(t,i)){return false}return true}_get(t,r){return getProperty(this.store,t,r)}_set(t,r){const{store:i}=this;setProperty(i,t,r);this.store=i}}var Pe=__nccwpck_require__(6399);var Ae=__nccwpck_require__(5918);var Te=__nccwpck_require__.n(Ae);var Ce=__nccwpck_require__(9886);var ke=__nccwpck_require__.n(Ce);var Ie=__nccwpck_require__(8311);var Ne=__nccwpck_require__.n(Ie);const De=require("node:stream");const Le=require("node:stream/promises");var Me=__nccwpck_require__(2361);var je=__nccwpck_require__(7147);var Fe=__nccwpck_require__(5673);const Ue=require("node:string_decoder");const Be=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=t=>!!t&&typeof t==="object"&&(t instanceof Minipass||t instanceof De||isReadable(t)||isWritable(t));const isReadable=t=>!!t&&typeof t==="object"&&t instanceof Fe.EventEmitter&&typeof t.pipe==="function"&&t.pipe!==De.Writable.prototype.pipe;const isWritable=t=>!!t&&typeof t==="object"&&t instanceof Fe.EventEmitter&&typeof t.write==="function"&&typeof t.end==="function";const He=Symbol("EOF");const Ve=Symbol("maybeEmitEnd");const ze=Symbol("emittedEnd");const Ge=Symbol("emittingEnd");const qe=Symbol("emittedError");const We=Symbol("closed");const Ke=Symbol("read");const Ye=Symbol("flush");const Ze=Symbol("flushChunk");const Xe=Symbol("encoding");const Je=Symbol("decoder");const Qe=Symbol("flowing");const et=Symbol("paused");const tt=Symbol("resume");const rt=Symbol("buffer");const st=Symbol("pipes");const it=Symbol("bufferLength");const nt=Symbol("bufferPush");const ot=Symbol("bufferShift");const at=Symbol("objectMode");const ct=Symbol("destroyed");const ut=Symbol("error");const ht=Symbol("emitData");const dt=Symbol("emitEnd");const ft=Symbol("emitEnd2");const pt=Symbol("async");const mt=Symbol("abort");const yt=Symbol("aborted");const vt=Symbol("signal");const bt=Symbol("dataListeners");const _t=Symbol("discarded");const defer=t=>Promise.resolve().then(t);const nodefer=t=>t();const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBufferLike=t=>t instanceof ArrayBuffer||!!t&&typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);class Pipe{src;dest;opts;ondrain;constructor(t,r,i){this.src=t;this.dest=r;this.opts=i;this.ondrain=()=>t[tt]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(t,r,i){super(t,r,i);this.proxyErrors=t=>r.emit("error",t);t.on("error",this.proxyErrors)}}const isObjectModeOptions=t=>!!t.objectMode;const isEncodingOptions=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer";class Minipass extends Fe.EventEmitter{[Qe]=false;[et]=false;[st]=[];[rt]=[];[at];[Xe];[pt];[Je];[He]=false;[ze]=false;[Ge]=false;[We]=false;[qe]=null;[it]=0;[ct]=false;[vt];[yt]=false;[bt]=0;[_t]=false;writable=true;readable=true;constructor(...t){const r=t[0]||{};super();if(r.objectMode&&typeof r.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(r)){this[at]=true;this[Xe]=null}else if(isEncodingOptions(r)){this[Xe]=r.encoding;this[at]=false}else{this[at]=false;this[Xe]=null}this[pt]=!!r.async;this[Je]=this[Xe]?new Ue.StringDecoder(this[Xe]):null;if(r&&r.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[rt]})}if(r&&r.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[st]})}const{signal:i}=r;if(i){this[vt]=i;if(i.aborted){this[mt]()}else{i.addEventListener("abort",(()=>this[mt]()))}}}get bufferLength(){return this[it]}get encoding(){return this[Xe]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[at]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[pt]}set["async"](t){this[pt]=this[pt]||!!t}[mt](){this[yt]=true;this.emit("abort",this[vt]?.reason);this.destroy(this[vt]?.reason)}get aborted(){return this[yt]}set aborted(t){}write(t,r,i){if(this[yt])return false;if(this[He])throw new Error("write after end");if(this[ct]){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";const o=this[pt]?defer:nodefer;if(!this[at]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t)){t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(isArrayBufferLike(t)){t=Buffer.from(t)}else if(typeof t!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[at]){if(this[Qe]&&this[it]!==0)this[Ye](true);if(this[Qe])this.emit("data",t);else this[nt](t);if(this[it]!==0)this.emit("readable");if(i)o(i);return this[Qe]}if(!t.length){if(this[it]!==0)this.emit("readable");if(i)o(i);return this[Qe]}if(typeof t==="string"&&!(r===this[Xe]&&!this[Je]?.lastNeed)){t=Buffer.from(t,r)}if(Buffer.isBuffer(t)&&this[Xe]){t=this[Je].write(t)}if(this[Qe]&&this[it]!==0)this[Ye](true);if(this[Qe])this.emit("data",t);else this[nt](t);if(this[it]!==0)this.emit("readable");if(i)o(i);return this[Qe]}read(t){if(this[ct])return null;this[_t]=false;if(this[it]===0||t===0||t&&t>this[it]){this[Ve]();return null}if(this[at])t=null;if(this[rt].length>1&&!this[at]){this[rt]=[this[Xe]?this[rt].join(""):Buffer.concat(this[rt],this[it])]}const r=this[Ke](t||null,this[rt][0]);this[Ve]();return r}[Ke](t,r){if(this[at])this[ot]();else{const i=r;if(t===i.length||t===null)this[ot]();else if(typeof i==="string"){this[rt][0]=i.slice(t);r=i.slice(0,t);this[it]-=t}else{this[rt][0]=i.subarray(t);r=i.subarray(0,t);this[it]-=t}}this.emit("data",r);if(!this[rt].length&&!this[He])this.emit("drain");return r}end(t,r,i){if(typeof t==="function"){i=t;t=undefined}if(typeof r==="function"){i=r;r="utf8"}if(t!==undefined)this.write(t,r);if(i)this.once("end",i);this[He]=true;this.writable=false;if(this[Qe]||!this[et])this[Ve]();return this}[tt](){if(this[ct])return;if(!this[bt]&&!this[st].length){this[_t]=true}this[et]=false;this[Qe]=true;this.emit("resume");if(this[rt].length)this[Ye]();else if(this[He])this[Ve]();else this.emit("drain")}resume(){return this[tt]()}pause(){this[Qe]=false;this[et]=true;this[_t]=false}get destroyed(){return this[ct]}get flowing(){return this[Qe]}get paused(){return this[et]}[nt](t){if(this[at])this[it]+=1;else this[it]+=t.length;this[rt].push(t)}[ot](){if(this[at])this[it]-=1;else this[it]-=this[rt][0].length;return this[rt].shift()}[Ye](t=false){do{}while(this[Ze](this[ot]())&&this[rt].length);if(!t&&!this[rt].length&&!this[He])this.emit("drain")}[Ze](t){this.emit("data",t);return this[Qe]}pipe(t,r){if(this[ct])return t;this[_t]=false;const i=this[ze];r=r||{};if(t===Be.stdout||t===Be.stderr)r.end=false;else r.end=r.end!==false;r.proxyErrors=!!r.proxyErrors;if(i){if(r.end)t.end()}else{this[st].push(!r.proxyErrors?new Pipe(this,t,r):new PipeProxyErrors(this,t,r));if(this[pt])defer((()=>this[tt]()));else this[tt]()}return t}unpipe(t){const r=this[st].find((r=>r.dest===t));if(r){if(this[st].length===1){if(this[Qe]&&this[bt]===0){this[Qe]=false}this[st]=[]}else this[st].splice(this[st].indexOf(r),1);r.unpipe()}}addListener(t,r){return this.on(t,r)}on(t,r){const i=super.on(t,r);if(t==="data"){this[_t]=false;this[bt]++;if(!this[st].length&&!this[Qe]){this[tt]()}}else if(t==="readable"&&this[it]!==0){super.emit("readable")}else if(isEndish(t)&&this[ze]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[qe]){const t=r;if(this[pt])defer((()=>t.call(this,this[qe])));else t.call(this,this[qe])}return i}removeListener(t,r){return this.off(t,r)}off(t,r){const i=super.off(t,r);if(t==="data"){this[bt]=this.listeners("data").length;if(this[bt]===0&&!this[_t]&&!this[st].length){this[Qe]=false}}return i}removeAllListeners(t){const r=super.removeAllListeners(t);if(t==="data"||t===undefined){this[bt]=0;if(!this[_t]&&!this[st].length){this[Qe]=false}}return r}get emittedEnd(){return this[ze]}[Ve](){if(!this[Ge]&&!this[ze]&&!this[ct]&&this[rt].length===0&&this[He]){this[Ge]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[We])this.emit("close");this[Ge]=false}}emit(t,...r){const i=r[0];if(t!=="error"&&t!=="close"&&t!==ct&&this[ct]){return false}else if(t==="data"){return!this[at]&&!i?false:this[pt]?(defer((()=>this[ht](i))),true):this[ht](i)}else if(t==="end"){return this[dt]()}else if(t==="close"){this[We]=true;if(!this[ze]&&!this[ct])return false;const t=super.emit("close");this.removeAllListeners("close");return t}else if(t==="error"){this[qe]=i;super.emit(ut,i);const t=!this[vt]||this.listeners("error").length?super.emit("error",i):false;this[Ve]();return t}else if(t==="resume"){const t=super.emit("resume");this[Ve]();return t}else if(t==="finish"||t==="prefinish"){const r=super.emit(t);this.removeAllListeners(t);return r}const o=super.emit(t,...r);this[Ve]();return o}[ht](t){for(const r of this[st]){if(r.dest.write(t)===false)this.pause()}const r=this[_t]?false:super.emit("data",t);this[Ve]();return r}[dt](){if(this[ze])return false;this[ze]=true;this.readable=false;return this[pt]?(defer((()=>this[ft]())),true):this[ft]()}[ft](){if(this[Je]){const t=this[Je].end();if(t){for(const r of this[st]){r.dest.write(t)}if(!this[_t])super.emit("data",t)}}for(const t of this[st]){t.end()}const t=super.emit("end");this.removeAllListeners("end");return t}async collect(){const t=Object.assign([],{dataLength:0});if(!this[at])t.dataLength=0;const r=this.promise();this.on("data",(r=>{t.push(r);if(!this[at])t.dataLength+=r.length}));await r;return t}async concat(){if(this[at]){throw new Error("cannot concat in objectMode")}const t=await this.collect();return this[Xe]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,r)=>{this.on(ct,(()=>r(new Error("stream destroyed"))));this.on("error",(t=>r(t)));this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[_t]=false;let t=false;const stop=async()=>{this.pause();t=true;return{value:undefined,done:true}};const next=()=>{if(t)return stop();const r=this.read();if(r!==null)return Promise.resolve({done:false,value:r});if(this[He])return stop();let i;let o;const onerr=t=>{this.off("data",ondata);this.off("end",onend);this.off(ct,ondestroy);stop();o(t)};const ondata=t=>{this.off("error",onerr);this.off("end",onend);this.off(ct,ondestroy);this.pause();i({value:t,done:!!this[He]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(ct,ondestroy);stop();i({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,r)=>{o=r;i=t;this.once(ct,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[_t]=false;let t=false;const stop=()=>{this.pause();this.off(ut,stop);this.off(ct,stop);this.off("end",stop);t=true;return{done:true,value:undefined}};const next=()=>{if(t)return stop();const r=this.read();return r===null?stop():{done:false,value:r}};this.once("end",stop);this.once(ut,stop);this.once(ct,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(t){if(this[ct]){if(t)this.emit("error",t);else this.emit(ct);return this}this[ct]=true;this[_t]=true;this[rt].length=0;this[it]=0;const r=this;if(typeof r.close==="function"&&!this[We])r.close();if(t)this.emit("error",t);else this.emit(ct);return this}static get isStream(){return isStream}}const wt=je.writev;const Et=Symbol("_autoClose");const St=Symbol("_close");const $t=Symbol("_ended");const xt=Symbol("_fd");const Rt=Symbol("_finished");const Ot=Symbol("_flags");const Pt=Symbol("_flush");const At=Symbol("_handleChunk");const Tt=Symbol("_makeBuf");const Ct=Symbol("_mode");const kt=Symbol("_needDrain");const It=Symbol("_onerror");const Nt=Symbol("_onopen");const Dt=Symbol("_onread");const Lt=Symbol("_onwrite");const Mt=Symbol("_open");const jt=Symbol("_path");const Ft=Symbol("_pos");const Ut=Symbol("_queue");const Bt=Symbol("_read");const Ht=Symbol("_readSize");const Vt=Symbol("_reading");const zt=Symbol("_remain");const Gt=Symbol("_size");const qt=Symbol("_write");const Wt=Symbol("_writing");const Kt=Symbol("_defaultFlag");const Yt=Symbol("_errored");class ReadStream extends Minipass{[Yt]=false;[xt];[jt];[Ht];[Vt]=false;[Gt];[zt];[Et];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[Yt]=false;this[xt]=typeof r.fd==="number"?r.fd:undefined;this[jt]=t;this[Ht]=r.readSize||16*1024*1024;this[Vt]=false;this[Gt]=typeof r.size==="number"?r.size:Infinity;this[zt]=this[Gt];this[Et]=typeof r.autoClose==="boolean"?r.autoClose:true;if(typeof this[xt]==="number"){this[Bt]()}else{this[Mt]()}}get fd(){return this[xt]}get path(){return this[jt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Mt](){je.open(this[jt],"r",((t,r)=>this[Nt](t,r)))}[Nt](t,r){if(t){this[It](t)}else{this[xt]=r;this.emit("open",r);this[Bt]()}}[Tt](){return Buffer.allocUnsafe(Math.min(this[Ht],this[zt]))}[Bt](){if(!this[Vt]){this[Vt]=true;const t=this[Tt]();if(t.length===0){return process.nextTick((()=>this[Dt](null,0,t)))}je.read(this[xt],t,0,t.length,null,((t,r,i)=>this[Dt](t,r,i)))}}[Dt](t,r,i){this[Vt]=false;if(t){this[It](t)}else if(this[At](r,i)){this[Bt]()}}[St](){if(this[Et]&&typeof this[xt]==="number"){const t=this[xt];this[xt]=undefined;je.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[It](t){this[Vt]=true;this[St]();this.emit("error",t)}[At](t,r){let i=false;this[zt]-=t;if(t>0){i=super.write(tthis[Nt](t,r)))}[Nt](t,r){if(this[Kt]&&this[Ot]==="r+"&&t&&t.code==="ENOENT"){this[Ot]="w";this[Mt]()}else if(t){this[It](t)}else{this[xt]=r;this.emit("open",r);if(!this[Wt]){this[Pt]()}}}end(t,r){if(t){this.write(t,r)}this[$t]=true;if(!this[Wt]&&!this[Ut].length&&typeof this[xt]==="number"){this[Lt](null,0)}return this}write(t,r){if(typeof t==="string"){t=Buffer.from(t,r)}if(this[$t]){this.emit("error",new Error("write() after end()"));return false}if(this[xt]===undefined||this[Wt]||this[Ut].length){this[Ut].push(t);this[kt]=true;return false}this[Wt]=true;this[qt](t);return true}[qt](t){je.write(this[xt],t,0,t.length,this[Ft],((t,r)=>this[Lt](t,r)))}[Lt](t,r){if(t){this[It](t)}else{if(this[Ft]!==undefined&&typeof r==="number"){this[Ft]+=r}if(this[Ut].length){this[Pt]()}else{this[Wt]=false;if(this[$t]&&!this[Rt]){this[Rt]=true;this[St]();this.emit("finish")}else if(this[kt]){this[kt]=false;this.emit("drain")}}}}[Pt](){if(this[Ut].length===0){if(this[$t]){this[Lt](null,0)}}else if(this[Ut].length===1){this[qt](this[Ut].pop())}else{const t=this[Ut];this[Ut]=[];wt(this[xt],t,this[Ft],((t,r)=>this[Lt](t,r)))}}[St](){if(this[Et]&&typeof this[xt]==="number"){const t=this[xt];this[xt]=undefined;je.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[Mt](){let t;if(this[Kt]&&this[Ot]==="r+"){try{t=je.openSync(this[jt],this[Ot],this[Ct])}catch(t){if(t?.code==="ENOENT"){this[Ot]="w";return this[Mt]()}else{throw t}}}else{t=je.openSync(this[jt],this[Ot],this[Ct])}this[Nt](null,t)}[St](){if(this[Et]&&typeof this[xt]==="number"){const t=this[xt];this[xt]=undefined;je.closeSync(t);this.emit("close")}}[qt](t){let r=true;try{this[Lt](null,je.writeSync(this[xt],t,0,t.length,this[Ft]));r=false}finally{if(r){try{this[St]()}catch{}}}}}var Zt=__nccwpck_require__(1017);var Xt=__nccwpck_require__.n(Zt);const Jt=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"],["onentry","onReadEntry"]]);const isSyncFile=t=>!!t.sync&&!!t.file;const isAsyncFile=t=>!t.sync&&!!t.file;const isSyncNoFile=t=>!!t.sync&&!t.file;const isAsyncNoFile=t=>!t.sync&&!t.file;const isSync=t=>!!t.sync;const isAsync=t=>!t.sync;const isFile=t=>!!t.file;const isNoFile=t=>!t.file;const dealiasKey=t=>{const r=Jt.get(t);if(r)return r;return t};const dealias=(t={})=>{if(!t)return{};const r={};for(const[i,o]of Object.entries(t)){const t=dealiasKey(i);r[t]=o}if(r.chmod===undefined&&r.noChmod===false){r.chmod=true}delete r.noChmod;return r};const makeCommand=(t,r,i,o,a)=>Object.assign(((c=[],l,u)=>{if(Array.isArray(c)){l=c;c={}}if(typeof l==="function"){u=l;l=undefined}if(!l){l=[]}else{l=Array.from(l)}const h=dealias(c);a?.(h,l);if(isSyncFile(h)){if(typeof u==="function"){throw new TypeError("callback not supported for sync tar functions")}return t(h,l)}else if(isAsyncFile(h)){const t=r(h,l);const i=u?u:undefined;return i?t.then((()=>i()),i):t}else if(isSyncNoFile(h)){if(typeof u==="function"){throw new TypeError("callback not supported for sync tar functions")}return i(h,l)}else if(isAsyncNoFile(h)){if(typeof u==="function"){throw new TypeError("callback only supported with file option")}return o(h,l)}else{throw new Error("impossible options??")}}),{syncFile:t,asyncFile:r,syncNoFile:i,asyncNoFile:o,validate:a});const Qt=require("assert");var er=__nccwpck_require__(4300);const tr=require("zlib");const rr=tr.constants||{ZLIB_VERNUM:4736};const sr=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},rr));const ir=er.Buffer.concat;const nr=Symbol("_superWrite");class ZlibError extends Error{code;errno;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 ar=Symbol("flushFlag");class ZlibBase extends Minipass{#i=false;#n=false;#o;#a;#c;#l;#u;get sawError(){return this.#i}get handle(){return this.#l}get flushFlag(){return this.#o}constructor(t,r){if(!t||typeof t!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(t);this.#o=t.flush??0;this.#a=t.finishFlush??0;this.#c=t.fullFlushFlag??0;try{this.#l=new tr[r](t)}catch(t){throw new ZlibError(t)}this.#u=t=>{if(this.#i)return;this.#i=true;this.close();this.emit("error",t)};this.#l?.on("error",(t=>this.#u(new ZlibError(t))));this.once("end",(()=>this.close))}close(){if(this.#l){this.#l.close();this.#l=undefined;this.emit("close")}}reset(){if(!this.#i){Qt(this.#l,"zlib binding closed");return this.#l.reset?.()}}flush(t){if(this.ended)return;if(typeof t!=="number")t=this.#c;this.write(Object.assign(er.Buffer.alloc(0),{[ar]:t}))}end(t,r,i){if(typeof t==="function"){i=t;r=undefined;t=undefined}if(typeof r==="function"){i=r;r=undefined}if(t){if(r)this.write(t,r);else this.write(t)}this.flush(this.#a);this.#n=true;return super.end(i)}get ended(){return this.#n}[nr](t){return super.write(t)}write(t,r,i){if(typeof r==="function")i=r,r="utf8";if(typeof t==="string")t=er.Buffer.from(t,r);if(this.#i)return;Qt(this.#l,"zlib binding closed");const o=this.#l._handle;const a=o.close;o.close=()=>{};const c=this.#l.close;this.#l.close=()=>{};er.Buffer.concat=t=>t;let l=undefined;try{const r=typeof t[ar]==="number"?t[ar]:this.#o;l=this.#l._processChunk(t,r);er.Buffer.concat=ir}catch(t){er.Buffer.concat=ir;this.#u(new ZlibError(t))}finally{if(this.#l){this.#l._handle=o;o.close=a;this.#l.close=c;this.#l.removeAllListeners("error")}}if(this.#l)this.#l.on("error",(t=>this.#u(new ZlibError(t))));let u;if(l){if(Array.isArray(l)&&l.length>0){const t=l[0];u=this[nr](er.Buffer.from(t));for(let t=1;t{if(typeof t==="function"){r=t;t=this.flushFlag}this.flush(t);r?.()};try{this.handle.params(t,r)}finally{this.handle.flush=i}if(this.handle){this.#h=t;this.#d=r}}}}class Deflate extends(null&&Zlib){constructor(t){super(t,"Deflate")}}class Inflate extends(null&&Zlib){constructor(t){super(t,"Inflate")}}class Gzip extends Zlib{#f;constructor(t){super(t,"Gzip");this.#f=t&&!!t.portable}[nr](t){if(!this.#f)return super[nr](t);this.#f=false;t[9]=255;return super[nr](t)}}class Gunzip extends(null&&Zlib){constructor(t){super(t,"Gunzip")}}class DeflateRaw extends(null&&Zlib){constructor(t){super(t,"DeflateRaw")}}class InflateRaw extends(null&&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||sr.BROTLI_OPERATION_PROCESS;t.finishFlush=t.finishFlush||sr.BROTLI_OPERATION_FINISH;t.fullFlushFlag=sr.BROTLI_OPERATION_FLUSH;super(t,r)}}class BrotliCompress extends Brotli{constructor(t){super(t,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(t){super(t,"BrotliDecompress")}}class Yallist{tail;head;length=0;static create(t=[]){return new Yallist(t)}constructor(t=[]){for(const r of t){this.push(r)}}*[Symbol.iterator](){for(let t=this.head;t;t=t.next){yield t.value}}removeNode(t){if(t.list!==this){throw new Error("removing node which does not belong to this list")}const r=t.next;const 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}this.length--;t.next=undefined;t.prev=undefined;t.list=undefined;return r}unshiftNode(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}const 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++}pushNode(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}const 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++}push(...t){for(let r=0,i=t.length;r1){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;a++){i=t(i,o.value,a);o=o.next}return i}reduceReverse(t,r){let i;let 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(let r=this.length-1;!!o;r--){i=t(i,o.value,r);o=o.prev}return i}toArray(){const t=new Array(this.length);for(let r=0,i=this.head;!!i;r++){t[r]=i.value;i=i.next}return t}toArrayReverse(){const t=new Array(this.length);for(let r=0,i=this.tail;!!i;r++){t[r]=i.value;i=i.prev}return t}slice(t=0,r=this.length){if(r<0){r+=this.length}if(t<0){t+=this.length}const i=new Yallist;if(rthis.length){r=this.length}let o=this.head;let a=0;for(a=0;!!o&&athis.length){r=this.length}let o=this.length;let a=this.tail;for(;!!a&&o>r;o--){a=a.prev}for(;!!a&&o>t;o--,a=a.prev){i.push(a.value)}return i}splice(t,r=0,...i){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}let o=this.head;for(let r=0;!!o&&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.subarray(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=Number(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=Number(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;const isCode=t=>cr.has(t);const isName=t=>lr.has(t);const cr=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"]]);const lr=new Map(Array.from(cr).map((t=>[t[1],t[0]])));class Header{cksumValid=false;needPax=false;nullBlock=false;block;path;mode;uid;gid;size;cksum;#p="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,r=0,i,o){if(Buffer.isBuffer(t)){this.decode(t,r||0,i,o)}else if(t){this.#m(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);if(o)this.#m(o,true);if(i)this.#m(i);const a=decString(t,r+156,1);if(isCode(a)){this.#p=a||"0"}if(this.#p==="0"&&this.path.slice(-1)==="/"){this.#p="5"}if(this.#p==="5"){this.size=0}this.linkpath=decString(t,r+157,100);if(t.subarray(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)??0;this.devmin=decNumber(t,r+337,8)??0;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 c=8*32;for(let i=r;i!(i===null||i===undefined||t==="path"&&r||t==="linkpath"&&r||t==="global")))))}encode(t,r=0){if(!t){t=this.block=Buffer.alloc(512)}if(this.#p==="Unsupported"){this.#p="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.#p.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{const i=100;let o=t;let a="";let c=undefined;const l=S.posix.parse(t).root||".";if(Buffer.byteLength(o)i&&Buffer.byteLength(a)<=r){c=[o.slice(0,i-1),a,true]}else{o=S.posix.join(S.posix.basename(a),o);a=S.posix.dirname(a)}}while(a!==l&&c===undefined);if(!c){c=[t.slice(0,i-1),"",true]}}return c};const decString=(t,r,i)=>t.subarray(r,r+i).toString("utf8").replace(/\0.*/,"");const decDate=(t,r,i)=>numToDate(decNumber(t,r,i));const numToDate=t=>t===undefined?undefined:new Date(t*1e3);const decNumber=(t,r,i)=>Number(t[r])&128?parse(t.subarray(r,r+i)):decSmallNumber(t,r,i);const nanUndef=t=>isNaN(t)?undefined:t;const decSmallNumber=(t,r,i)=>nanUndef(parseInt(t.subarray(r,r+i).toString("utf8").replace(/\0.*$/,"").trim(),8));const ur={12:8589934591,8:2097151};const encNumber=(t,r,i,o)=>o===undefined?false:o>ur[i]||o<0?(encode(o,t.subarray(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===undefined?false:encNumber(t,r,i,o.getTime()/1e3);const hr=new Array(156).join("\0");const encString=(t,r,i,o)=>o===undefined?false:(t.write(o+hr,r,i,"utf8"),o.length!==Buffer.byteLength(o)||o.length>i);class Pax{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,r=false){this.atime=t.atime;this.charset=t.charset;this.comment=t.comment;this.ctime=t.ctime;this.dev=t.dev;this.gid=t.gid;this.global=r;this.gname=t.gname;this.ino=t.ino;this.linkpath=t.linkpath;this.mtime=t.mtime;this.nlink=t.nlink;this.path=t.path;this.size=t.size;this.uid=t.uid;this.uname=t.uname}encode(){const t=this.encodeBody();if(t===""){return Buffer.allocUnsafe(0)}const r=Buffer.byteLength(t);const i=512*Math.ceil(1+r/512);const o=Buffer.allocUnsafe(i);for(let t=0;t<512;t++){o[t]=0}new Header({path:("PaxHeader/"+(0,S.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:r,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(o);o.write(t,512,r,"utf8");for(let t=r+512;t=Math.pow(10,c)){c+=1}const l=c+a;return l+o}static parse(t,r,i=false){return new Pax(merge(parseKV(t),r),i)}}const merge=(t,r)=>r?Object.assign({},r,t):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.slice((i+" ").length);const o=r.split("=");const a=o.shift();if(!a){return t}const c=a.replace(/^SCHILY\.(dev|ino|nlink)/,"$1");const l=o.join("=");t[c]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(c)?new Date(Number(l)*1e3):/^[0-9]+$/.test(l)?+l:l;return t};const dr=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const fr=dr!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/");class ReadEntry extends Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=false;ignore=false;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=false;absolute;unsupported=false;constructor(t,r,i){super({});this.pause();this.extended=r;this.globalExtended=i;this.header=t;this.remain=t.size??0;this.startBlockSize=512*Math.ceil(this.remain/512);this.blockRemain=this.startBlockSize;this.type=t.type;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}if(!t.path){throw new Error("no path provided for tar.ReadEntry")}this.path=fr(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=this.remain;this.mtime=t.mtime;this.atime=t.atime;this.ctime=t.ctime;this.linkpath=t.linkpath?fr(t.linkpath):undefined;this.uname=t.uname;this.gname=t.gname;if(r){this.#m(r)}if(i){this.#m(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.subarray(0,i))}#m(t,r=false){if(t.path)t.path=fr(t.path);if(t.linkpath)t.linkpath=fr(t.linkpath);Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,i])=>!(i===null||i===undefined||t==="path"&&r)))))}}const warnMethod=(t,r,i,o={})=>{if(t.file){o.file=t.file}if(t.cwd){o.cwd=t.cwd}o.code=i instanceof Error&&i.code||r;o.tarCode=r;if(!t.strict&&o.recoverable!==false){if(i instanceof Error){o=Object.assign(i,o);i=i.message}t.emit("warn",r,i,o)}else if(i instanceof Error){t.emit("error",Object.assign(i,o))}else{t.emit("error",Object.assign(new Error(`${r}: ${i}`),o))}};const pr=1024*1024;const mr=Buffer.from([31,139]);const gr=Symbol("state");const yr=Symbol("writeEntry");const vr=Symbol("readEntry");const br=Symbol("nextEntry");const _r=Symbol("processEntry");const wr=Symbol("extendedHeader");const Er=Symbol("globalExtendedHeader");const Sr=Symbol("meta");const $r=Symbol("emitMeta");const xr=Symbol("buffer");const Rr=Symbol("queue");const Or=Symbol("ended");const Pr=Symbol("emittedEnd");const Ar=Symbol("emit");const Tr=Symbol("unzip");const Cr=Symbol("consumeChunk");const kr=Symbol("consumeChunkSub");const Ir=Symbol("consumeBody");const Nr=Symbol("consumeMeta");const Dr=Symbol("consumeHeader");const Lr=Symbol("consuming");const Mr=Symbol("bufferConcat");const jr=Symbol("maybeEnd");const Fr=Symbol("writing");const Ur=Symbol("aborted");const Br=Symbol("onDone");const Hr=Symbol("sawValidEntry");const Vr=Symbol("sawNullBlock");const zr=Symbol("sawEOF");const Gr=Symbol("closeStream");const noop=()=>true;class Parser extends Me.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;writable=true;readable=false;[Rr]=new Yallist;[xr];[vr];[yr];[gr]="begin";[Sr]="";[wr];[Er];[Or]=false;[Tr];[Ur]=false;[Hr];[Vr]=false;[zr]=false;[Fr]=false;[Lr]=false;[Pr]=false;constructor(t={}){super();this.file=t.file||"";this.on(Br,(()=>{if(this[gr]==="begin"||this[Hr]===false){this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}}));if(t.ondone){this.on(Br,t.ondone)}else{this.on(Br,(()=>{this.emit("prefinish");this.emit("finish");this.emit("end")}))}this.strict=!!t.strict;this.maxMetaEntrySize=t.maxMetaEntrySize||pr;this.filter=typeof t.filter==="function"?t.filter:noop;const r=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=!t.gzip&&t.brotli!==undefined?t.brotli:r?undefined:false;this.on("end",(()=>this[Gr]()));if(typeof t.onwarn==="function"){this.on("warn",t.onwarn)}if(typeof t.onReadEntry==="function"){this.on("entry",t.onReadEntry)}}warn(t,r,i={}){warnMethod(this,t,r,i)}[Dr](t,r){if(this[Hr]===undefined){this[Hr]=false}let i;try{i=new Header(t,r,this[wr],this[Er])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(i.nullBlock){if(this[Vr]){this[zr]=true;if(this[gr]==="begin"){this[gr]="header"}this[Ar]("eof")}else{this[Vr]=true;this[Ar]("nullBlock")}}else{this[Vr]=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)&&!/^(Global)?ExtendedHeader$/.test(t)&&i.linkpath){this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i})}else{const t=this[yr]=new ReadEntry(i,this[wr],this[Er]);if(!this[Hr]){if(t.remain){const onend=()=>{if(!t.invalid){this[Hr]=true}};t.on("end",onend)}else{this[Hr]=true}}if(t.meta){if(t.size>this.maxMetaEntrySize){t.ignore=true;this[Ar]("ignoredEntry",t);this[gr]="ignore";t.resume()}else if(t.size>0){this[Sr]="";t.on("data",(t=>this[Sr]+=t));this[gr]="meta"}}else{this[wr]=undefined;t.ignore=t.ignore||!this.filter(t.path,t);if(t.ignore){this[Ar]("ignoredEntry",t);this[gr]=t.remain?"ignore":"header";t.resume()}else{if(t.remain){this[gr]="body"}else{this[gr]="header";t.end()}if(!this[vr]){this[Rr].push(t);this[br]()}else{this[Rr].push(t)}}}}}}}[Gr](){queueMicrotask((()=>this.emit("close")))}[_r](t){let r=true;if(!t){this[vr]=undefined;r=false}else if(Array.isArray(t)){const[r,...i]=t;this.emit(r,...i)}else{this[vr]=t;this.emit("entry",t);if(!t.emittedEnd){t.on("end",(()=>this[br]()));r=false}}return r}[br](){do{}while(this[_r](this[Rr].shift()));if(!this[Rr].length){const t=this[vr];const r=!t||t.flowing||t.size===t.remain;if(r){if(!this[Fr]){this.emit("drain")}}else{t.once("drain",(()=>this.emit("drain")))}}}[Ir](t,r){const i=this[yr];if(!i){throw new Error("attempt to consume body without entry??")}const o=i.blockRemain??0;const a=o>=t.length&&r===0?t:t.subarray(r,r+o);i.write(a);if(!i.blockRemain){this[gr]="header";this[yr]=undefined;i.end()}return a.length}[Nr](t,r){const i=this[yr];const o=this[Ir](t,r);if(!this[yr]&&i){this[$r](i)}return o}[Ar](t,r,i){if(!this[Rr].length&&!this[vr]){this.emit(t,r,i)}else{this[Rr].push([t,r,i])}}[$r](t){this[Ar]("meta",this[Sr]);switch(t.type){case"ExtendedHeader":case"OldExtendedHeader":this[wr]=Pax.parse(this[Sr],this[wr],false);break;case"GlobalExtendedHeader":this[Er]=Pax.parse(this[Sr],this[Er],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":{const t=this[wr]??Object.create(null);this[wr]=t;t.path=this[Sr].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{const t=this[wr]||Object.create(null);this[wr]=t;t.linkpath=this[Sr].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+t.type)}}abort(t){this[Ur]=true;this.emit("abort",t);this.warn("TAR_ABORT",t,{recoverable:false})}write(t,r,i){if(typeof r==="function"){i=r;r=undefined}if(typeof t==="string"){t=Buffer.from(t,typeof r==="string"?r:"utf8")}if(this[Ur]){i?.();return false}const o=this[Tr]===undefined||this.brotli===undefined&&this[Tr]===false;if(o&&t){if(this[xr]){t=Buffer.concat([this[xr],t]);this[xr]=undefined}if(t.lengththis[Cr](t)));this[Tr].on("error",(t=>this.abort(t)));this[Tr].on("end",(()=>{this[Or]=true;this[Cr]()}));this[Fr]=true;const o=!!this[Tr][r?"end":"write"](t);this[Fr]=false;i?.();return o}}this[Fr]=true;if(this[Tr]){this[Tr].write(t)}else{this[Cr](t)}this[Fr]=false;const a=this[Rr].length?false:this[vr]?this[vr].flowing:true;if(!a&&!this[Rr].length){this[vr]?.once("drain",(()=>this.emit("drain")))}i?.();return a}[Mr](t){if(t&&!this[Ur]){this[xr]=this[xr]?Buffer.concat([this[xr],t]):t}}[jr](){if(this[Or]&&!this[Pr]&&!this[Ur]&&!this[Lr]){this[Pr]=true;const t=this[yr];if(t&&t.blockRemain){const r=this[xr]?this[xr].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${r} available)`,{entry:t});if(this[xr]){t.write(this[xr])}t.end()}this[Ar](Br)}}[Cr](t){if(this[Lr]&&t){this[Mr](t)}else if(!t&&!this[xr]){this[jr]()}else if(t){this[Lr]=true;if(this[xr]){this[Mr](t);const r=this[xr];this[xr]=undefined;this[kr](r)}else{this[kr](t)}while(this[xr]&&this[xr]?.length>=512&&!this[Ur]&&!this[zr]){const t=this[xr];this[xr]=undefined;this[kr](t)}this[Lr]=false}if(!this[xr]||this[Or]){this[jr]()}}[kr](t){let r=0;const i=t.length;while(r+512<=i&&!this[Ur]&&!this[zr]){switch(this[gr]){case"begin":case"header":this[Dr](t,r);r+=512;break;case"ignore":case"body":r+=this[Ir](t,r);break;case"meta":r+=this[Nr](t,r);break;default:throw new Error("invalid state: "+this[gr])}}if(r{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)};const onReadEntryFunction=t=>{const r=t.onReadEntry;t.onReadEntry=r?t=>{r(t);t.resume()}:t=>t.resume()};const filesFilter=(t,r)=>{const i=new Map(r.map((t=>[stripTrailingSlashes(t),true])));const o=t.filter;const mapHas=(t,r="")=>{const o=r||(0,Zt.parse)(t).root||".";let a;if(t===o)a=false;else{const r=i.get(t);if(r!==undefined){a=r}else{a=mapHas((0,Zt.dirname)(t),o)}}i.set(t,a);return a};t.filter=o?(t,r)=>o(t,r)&&mapHas(stripTrailingSlashes(t)):t=>mapHas(stripTrailingSlashes(t))};const listFileSync=t=>{const r=new Parser(t);const i=t.file;let o;try{const a=E.statSync(i);const c=t.maxReadSize||16*1024*1024;if(a.size{const i=new Parser(t);const o=t.maxReadSize||16*1024*1024;const a=t.file;const c=new Promise(((t,r)=>{i.on("error",r);i.on("end",t);E.stat(a,((t,c)=>{if(t){r(t)}else{const t=new ReadStream(a,{readSize:o,size:c.size});t.on("error",r);t.pipe(i)}}))}));return c};const qr=makeCommand(listFileSync,listFile,(t=>new Parser(t)),(t=>new Parser(t)),((t,r)=>{if(r?.length)filesFilter(t,r);if(!t.noResume)onReadEntryFunction(t)}));const modeFix=(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};const{isAbsolute:Wr,parse:Kr}=S.win32;const stripAbsolutePath=t=>{let r="";let i=Kr(t);while(Wr(t)||i.root){const o=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":i.root;t=t.slice(o.length);r+=o;i=Kr(t)}return[r,t]};const Yr=["|","<",">","?",":"];const Zr=Yr.map((t=>String.fromCharCode(61440+t.charCodeAt(0))));const Xr=new Map(Yr.map(((t,r)=>[t,Zr[r]])));const Jr=new Map(Zr.map(((t,r)=>[t,Yr[r]])));const winchars_encode=t=>Yr.reduce(((t,r)=>t.split(r).join(Xr.get(r))),t);const decode=t=>Zr.reduce(((t,r)=>t.split(r).join(Jr.get(r))),t);const prefixPath=(t,r)=>{if(!r){return fr(t)}t=fr(t).replace(/^\.(\/|$)/,"");return stripTrailingSlashes(r)+"/"+t};const Qr=16*1024*1024;const es=Symbol("process");const ts=Symbol("file");const rs=Symbol("directory");const ss=Symbol("symlink");const is=Symbol("hardlink");const ns=Symbol("header");const os=Symbol("read");const as=Symbol("lstat");const cs=Symbol("onlstat");const ls=Symbol("onread");const us=Symbol("onreadlink");const hs=Symbol("openfile");const ds=Symbol("onopenfile");const ps=Symbol("close");const ms=Symbol("mode");const gs=Symbol("awaitDrain");const ys=Symbol("ondrain");const vs=Symbol("prefix");class WriteEntry extends Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#g=false;constructor(t,r={}){const i=dealias(r);super();this.path=fr(t);this.portable=!!i.portable;this.maxReadSize=i.maxReadSize||Qr;this.linkCache=i.linkCache||new Map;this.statCache=i.statCache||new Map;this.preservePaths=!!i.preservePaths;this.cwd=fr(i.cwd||process.cwd());this.strict=!!i.strict;this.noPax=!!i.noPax;this.noMtime=!!i.noMtime;this.mtime=i.mtime;this.prefix=i.prefix?fr(i.prefix):undefined;this.onWriteEntry=i.onWriteEntry;if(typeof i.onwarn==="function"){this.on("warn",i.onwarn)}let o=false;if(!this.preservePaths){const[t,r]=stripAbsolutePath(this.path);if(t&&typeof r==="string"){this.path=r;o=t}}this.win32=!!i.win32||process.platform==="win32";if(this.win32){this.path=decode(this.path.replace(/\\/g,"/"));t=t.replace(/\\/g,"/")}this.absolute=fr(i.absolute||Zt.resolve(this.cwd,t));if(this.path===""){this.path="./"}if(o){this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:this,path:o+this.path})}const a=this.statCache.get(this.absolute);if(a){this[cs](a)}else{this[as]()}}warn(t,r,i={}){return warnMethod(this,t,r,i)}emit(t,...r){if(t==="error"){this.#g=true}return super.emit(t,...r)}[as](){je.lstat(this.absolute,((t,r)=>{if(t){return this.emit("error",t)}this[cs](r)}))}[cs](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[es]()}[es](){switch(this.type){case"File":return this[ts]();case"Directory":return this[rs]();case"SymbolicLink":return this[ss]();default:return this.end()}}[ms](t){return modeFix(t,this.type==="Directory",this.portable)}[vs](t){return prefixPath(t,this.prefix)}[ns](){if(!this.stat){throw new Error("cannot write header before stat")}if(this.type==="Directory"&&this.portable){this.noMtime=true}this.onWriteEntry?.(this);this.header=new Header({path:this[vs](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[vs](this.linkpath):this.linkpath,mode:this[ms](this.stat.mode),uid:this.portable?undefined:this.stat.uid,gid:this.portable?undefined:this.stat.gid,size:this.stat.size,mtime:this.noMtime?undefined:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?undefined:this.type,uname:this.portable?undefined:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?undefined:this.stat.atime,ctime:this.portable?undefined:this.stat.ctime});if(this.header.encode()&&!this.noPax){super.write(new Pax({atime:this.portable?undefined:this.header.atime,ctime:this.portable?undefined:this.header.ctime,gid:this.portable?undefined:this.header.gid,mtime:this.noMtime?undefined:this.mtime||this.header.mtime,path:this[vs](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[vs](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?undefined:this.header.uid,uname:this.portable?undefined:this.header.uname,dev:this.portable?undefined:this.stat.dev,ino:this.portable?undefined:this.stat.ino,nlink:this.portable?undefined:this.stat.nlink}).encode())}const t=this.header?.block;if(!t){throw new Error("failed to encode header")}super.write(t)}[rs](){if(!this.stat){throw new Error("cannot create directory entry without stat")}if(this.path.slice(-1)!=="/"){this.path+="/"}this.stat.size=0;this[ns]();this.end()}[ss](){je.readlink(this.absolute,((t,r)=>{if(t){return this.emit("error",t)}this[us](r)}))}[us](t){this.linkpath=fr(t);this[ns]();this.end()}[is](t){if(!this.stat){throw new Error("cannot create link entry without stat")}this.type="Link";this.linkpath=fr(Zt.relative(this.cwd,t));this.stat.size=0;this[ns]();this.end()}[ts](){if(!this.stat){throw new Error("cannot create file entry without stat")}if(this.stat.nlink>1){const t=`${this.stat.dev}:${this.stat.ino}`;const r=this.linkCache.get(t);if(r?.indexOf(this.cwd)===0){return this[is](r)}this.linkCache.set(t,this.absolute)}this[ns]();if(this.stat.size===0){return this.end()}this[hs]()}[hs](){je.open(this.absolute,"r",((t,r)=>{if(t){return this.emit("error",t)}this[ds](r)}))}[ds](t){this.fd=t;if(this.#g){return this[ps]()}if(!this.stat){throw new Error("should stat before calling onopenfile")}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[os]()}[os](){const{fd:t,buf:r,offset:i,length:o,pos:a}=this;if(t===undefined||r===undefined){throw new Error("cannot read file without first opening")}je.read(t,r,i,o,a,((t,r)=>{if(t){return this[ps]((()=>this.emit("error",t)))}this[ls](r)}))}[ps](t=(()=>{})){if(this.fd!==undefined)je.close(this.fd,t)}[ls](t){if(t<=0&&this.remain>0){const t=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ps]((()=>this.emit("error",t)))}if(t>this.remain){const t=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ps]((()=>this.emit("error",t)))}if(!this.buf){throw new Error("should have created buffer prior to reading")}if(t===this.remain){for(let r=t;rthis[ys]()))}else{this[ys]()}}[gs](t){this.once("drain",t)}write(t,r,i){if(typeof r==="function"){i=r;r=undefined}if(typeof t==="string"){t=Buffer.from(t,typeof r==="string"?r:"utf8")}if(this.blockRemaint?this.emit("error",t):this.end()))}if(!this.buf){throw new Error("buffer lost somehow in ONDRAIN")}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[os]()}}class WriteEntrySync extends WriteEntry{sync=true;[as](){this[cs](je.lstatSync(this.absolute))}[ss](){this[us](je.readlinkSync(this.absolute))}[hs](){this[ds](je.openSync(this.absolute,"r"))}[os](){let t=true;try{const{fd:r,buf:i,offset:o,length:a,pos:c}=this;if(r===undefined||i===undefined){throw new Error("fd and buf must be set in READ method")}const l=je.readSync(r,i,o,a,c);this[ls](l);t=false}finally{if(t){try{this[ps]((()=>{}))}catch(t){}}}}[gs](t){t()}[ps](t=(()=>{})){if(this.fd!==undefined)je.closeSync(this.fd);t()}}class WriteEntryTar extends Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(t,r,i={}){return warnMethod(this,t,r,i)}constructor(t,r={}){const i=dealias(r);super();this.preservePaths=!!i.preservePaths;this.portable=!!i.portable;this.strict=!!i.strict;this.noPax=!!i.noPax;this.noMtime=!!i.noMtime;this.onWriteEntry=i.onWriteEntry;this.readEntry=t;const{type:o}=t;if(o==="Unsupported"){throw new Error("writing entry that should be ignored")}this.type=o;if(this.type==="Directory"&&this.portable){this.noMtime=true}this.prefix=i.prefix;this.path=fr(t.path);this.mode=t.mode!==undefined?this[ms](t.mode):undefined;this.uid=this.portable?undefined:t.uid;this.gid=this.portable?undefined:t.gid;this.uname=this.portable?undefined:t.uname;this.gname=this.portable?undefined:t.gname;this.size=t.size;this.mtime=this.noMtime?undefined:i.mtime||t.mtime;this.atime=this.portable?undefined:t.atime;this.ctime=this.portable?undefined:t.ctime;this.linkpath=t.linkpath!==undefined?fr(t.linkpath):undefined;if(typeof i.onwarn==="function"){this.on("warn",i.onwarn)}let a=false;if(!this.preservePaths){const[t,r]=stripAbsolutePath(this.path);if(t&&typeof r==="string"){this.path=r;a=t}}this.remain=t.size;this.blockRemain=t.startBlockSize;this.onWriteEntry?.(this);this.header=new Header({path:this[vs](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[vs](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?undefined:this.uid,gid:this.portable?undefined:this.gid,size:this.size,mtime:this.noMtime?undefined:this.mtime,type:this.type,uname:this.portable?undefined:this.uname,atime:this.portable?undefined:this.atime,ctime:this.portable?undefined:this.ctime});if(a){this.warn("TAR_ENTRY_INFO",`stripping ${a} from absolute path`,{entry:this,path:a+this.path})}if(this.header.encode()&&!this.noPax){super.write(new Pax({atime:this.portable?undefined:this.atime,ctime:this.portable?undefined:this.ctime,gid:this.portable?undefined:this.gid,mtime:this.noMtime?undefined:this.mtime,path:this[vs](this.path),linkpath:this.type==="Link"&&this.linkpath!==undefined?this[vs](this.linkpath):this.linkpath,size:this.size,uid:this.portable?undefined:this.uid,uname:this.portable?undefined:this.uname,dev:this.portable?undefined:this.readEntry.dev,ino:this.portable?undefined:this.readEntry.ino,nlink:this.portable?undefined:this.readEntry.nlink}).encode())}const c=this.header?.block;if(!c)throw new Error("failed to encode header");super.write(c);t.pipe(this)}[vs](t){return prefixPath(t,this.prefix)}[ms](t){return modeFix(t,this.type==="Directory",this.portable)}write(t,r,i){if(typeof r==="function"){i=r;r=undefined}if(typeof t==="string"){t=Buffer.from(t,typeof r==="string"?r:"utf8")}const o=t.length;if(o>this.blockRemain){throw new Error("writing more to entry than is appropriate")}this.blockRemain-=o;return super.write(t,i)}end(t,r,i){if(this.blockRemain){super.write(Buffer.alloc(this.blockRemain))}if(typeof t==="function"){i=t;r=undefined;t=undefined}if(typeof r==="function"){i=r;r=undefined}if(typeof t==="string"){t=Buffer.from(t,r??"utf8")}if(i)this.once("finish",i);t?super.end(t,i):super.end(i);return this}}const getType=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";class PackJob{path;absolute;entry;stat;readdir;pending=false;ignore=false;piped=false;constructor(t,r){this.path=t||"./";this.absolute=r}}const bs=Buffer.alloc(1024);const _s=Symbol("onStat");const ws=Symbol("ended");const Es=Symbol("queue");const Ss=Symbol("current");const $s=Symbol("process");const xs=Symbol("processing");const Rs=Symbol("processJob");const Os=Symbol("jobs");const Ps=Symbol("jobDone");const As=Symbol("addFSEntry");const Ts=Symbol("addTarEntry");const Cs=Symbol("stat");const ks=Symbol("readdir");const Is=Symbol("onreaddir");const Ns=Symbol("pipe");const Ds=Symbol("entry");const Ls=Symbol("entryOpt");const Ms=Symbol("writeEntryClass");const js=Symbol("write");const Fs=Symbol("ondrain");class Pack extends Minipass{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Ms];onWriteEntry;[Es];[Os]=0;[xs]=false;[ws]=false;constructor(t={}){super();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=fr(t.prefix||"");this.linkCache=t.linkCache||new Map;this.statCache=t.statCache||new Map;this.readdirCache=t.readdirCache||new Map;this.onWriteEntry=t.onWriteEntry;this[Ms]=WriteEntry;if(typeof t.onwarn==="function"){this.on("warn",t.onwarn)}this.portable=!!t.portable;if(t.gzip||t.brotli){if(t.gzip&&t.brotli){throw new TypeError("gzip and brotli are mutually exclusive")}if(t.gzip){if(typeof t.gzip!=="object"){t.gzip={}}if(this.portable){t.gzip.portable=true}this.zip=new Gzip(t.gzip)}if(t.brotli){if(typeof t.brotli!=="object"){t.brotli={}}this.zip=new BrotliCompress(t.brotli)}if(!this.zip)throw new Error("impossible");const r=this.zip;r.on("data",(t=>super.write(t)));r.on("end",(()=>super.end()));r.on("drain",(()=>this[Fs]()));this.on("resume",(()=>r.resume()))}else{this.on("drain",this[Fs])}this.noDirRecurse=!!t.noDirRecurse;this.follow=!!t.follow;this.noMtime=!!t.noMtime;if(t.mtime)this.mtime=t.mtime;this.filter=typeof t.filter==="function"?t.filter:()=>true;this[Es]=new Yallist;this[Os]=0;this.jobs=Number(t.jobs)||4;this[xs]=false;this[ws]=false}[js](t){return super.write(t)}add(t){this.write(t);return this}end(t,r,i){if(typeof t==="function"){i=t;t=undefined}if(typeof r==="function"){i=r;r=undefined}if(t){this.add(t)}this[ws]=true;this[$s]();if(i)i();return this}write(t){if(this[ws]){throw new Error("write after end")}if(t instanceof ReadEntry){this[Ts](t)}else{this[As](t)}return this.flowing}[Ts](t){const r=fr(Zt.resolve(this.cwd,t.path));if(!this.filter(t.path,t)){t.resume()}else{const i=new PackJob(t.path,r);i.entry=new WriteEntryTar(t,this[Ls](i));i.entry.on("end",(()=>this[Ps](i)));this[Os]+=1;this[Es].push(i)}this[$s]()}[As](t){const r=fr(Zt.resolve(this.cwd,t));this[Es].push(new PackJob(t,r));this[$s]()}[Cs](t){t.pending=true;this[Os]+=1;const r=this.follow?"stat":"lstat";je[r](t.absolute,((r,i)=>{t.pending=false;this[Os]-=1;if(r){this.emit("error",r)}else{this[_s](t,i)}}))}[_s](t,r){this.statCache.set(t.absolute,r);t.stat=r;if(!this.filter(t.path,r)){t.ignore=true}this[$s]()}[ks](t){t.pending=true;this[Os]+=1;je.readdir(t.absolute,((r,i)=>{t.pending=false;this[Os]-=1;if(r){return this.emit("error",r)}this[Is](t,i)}))}[Is](t,r){this.readdirCache.set(t.absolute,r);t.readdir=r;this[$s]()}[$s](){if(this[xs]){return}this[xs]=true;for(let t=this[Es].head;!!t&&this[Os]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,onWriteEntry:this.onWriteEntry}}[Ds](t){this[Os]+=1;try{const r=new this[Ms](t.path,this[Ls](t));return r.on("end",(()=>this[Ps](t))).on("error",(t=>this.emit("error",t)))}catch(t){this.emit("error",t)}}[Fs](){if(this[Ss]&&this[Ss].entry){this[Ss].entry.resume()}}[Ns](t){t.piped=true;if(t.readdir){t.readdir.forEach((r=>{const i=t.path;const o=i==="./"?"":i.replace(/\/*$/,"/");this[As](o+r)}))}const r=t.entry;const i=this.zip;if(!r)throw new Error("cannot pipe without source");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()}warn(t,r,i={}){warnMethod(this,t,r,i)}}class PackSync extends Pack{sync=true;constructor(t){super(t);this[Ms]=WriteEntrySync}pause(){}resume(){}[Cs](t){const r=this.follow?"statSync":"lstatSync";this[_s](t,je[r](t.absolute))}[ks](t){this[Is](t,je.readdirSync(t.absolute))}[Ns](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[As](o+r)}))}if(!r)throw new Error("Cannot pipe without source");if(i){r.on("data",(t=>{i.write(t)}))}else{r.on("data",(t=>{super[js](t)}))}}}const createFileSync=(t,r)=>{const i=new PackSync(t);const o=new WriteStreamSync(t.file,{mode:t.mode||438});i.pipe(o);addFilesSync(i,r)};const createFile=(t,r)=>{const i=new Pack(t);const o=new WriteStream(t.file,{mode:t.mode||438});i.pipe(o);const a=new Promise(((t,r)=>{o.on("error",r);o.on("close",t);i.on("error",r)}));addFilesAsync(i,r);return a};const addFilesSync=(t,r)=>{r.forEach((r=>{if(r.charAt(0)==="@"){qr({file:S.resolve(t.cwd,r.slice(1)),sync:true,noResume:true,onReadEntry:r=>t.add(r)})}else{t.add(r)}}));t.end()};const addFilesAsync=async(t,r)=>{for(let i=0;i{t.add(r)}})}else{t.add(o)}}t.end()};const createSync=(t,r)=>{const i=new PackSync(t);addFilesSync(i,r);return i};const createAsync=(t,r)=>{const i=new Pack(t);addFilesAsync(i,r);return i};const Us=makeCommand(createFileSync,createFile,createSync,createAsync,((t,r)=>{if(!r?.length){throw new TypeError("no paths specified to add to archive")}}));const Bs=process.env.__FAKE_PLATFORM__||process.platform;const Hs=Bs==="win32";const{O_CREAT:Vs,O_TRUNC:zs,O_WRONLY:Gs}=je.constants;const qs=Number(process.env.__FAKE_FS_O_FILENAME__)||je.constants.UV_FS_O_FILEMAP||0;const Ws=Hs&&!!qs;const Ks=512*1024;const Ys=qs|zs|Vs|Gs;const Zs=!Ws?()=>"w":t=>t{try{return E.lchownSync(t,r,i)}catch(t){if(t?.code!=="ENOENT")throw t}};const chown=(t,r,i,o)=>{E.lchown(t,r,i,(t=>{o(t&&t?.code!=="ENOENT"?t:null)}))};const chownrKid=(t,r,i,o,a)=>{if(r.isDirectory()){chownr(S.resolve(t,r.name),i,o,(c=>{if(c)return a(c);const l=S.resolve(t,r.name);chown(l,i,o,a)}))}else{const c=S.resolve(t,r.name);chown(c,i,o,a)}};const chownr=(t,r,i,o)=>{E.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)};for(const o of c){chownrKid(t,o,r,i,then)}}))};const chownrKidSync=(t,r,i,o)=>{if(r.isDirectory())chownrSync(S.resolve(t,r.name),i,o);lchownSync(S.resolve(t,r.name),i,o)};const chownrSync=(t,r,i)=>{let o;try{o=E.readdirSync(t,{withFileTypes:true})}catch(o){const a=o;if(a?.code==="ENOENT")return;else if(a?.code==="ENOTDIR"||a?.code==="ENOTSUP")return lchownSync(t,r,i);else throw a}for(const a of o){chownrKidSync(t,a,r,i)}return lchownSync(t,r,i)};const optsArg=t=>{if(!t){t={mode:511}}else if(typeof t==="object"){t={mode:511,...t}}else if(typeof t==="number"){t={mode:t}}else if(typeof t==="string"){t={mode:parseInt(t,8)}}else{throw new TypeError("invalid options argument")}const r=t;const i=t.fs||{};t.mkdir=t.mkdir||i.mkdir||je.mkdir;t.mkdirAsync=t.mkdirAsync?t.mkdirAsync:async(t,i)=>new Promise(((o,a)=>r.mkdir(t,i,((t,r)=>t?a(t):o(r)))));t.stat=t.stat||i.stat||je.stat;t.statAsync=t.statAsync?t.statAsync:async t=>new Promise(((i,o)=>r.stat(t,((t,r)=>t?o(t):i(r)))));t.statSync=t.statSync||i.statSync||je.statSync;t.mkdirSync=t.mkdirSync||i.mkdirSync||je.mkdirSync;return r};const mkdirp_manual_mkdirpManualSync=(t,r,i)=>{const o=(0,Zt.dirname)(t);const a={...optsArg(r),recursive:false};if(o===t){try{return a.mkdirSync(t,a)}catch(t){const r=t;if(r&&r.code!=="EISDIR"){throw t}return}}try{a.mkdirSync(t,a);return i||t}catch(r){const c=r;if(c&&c.code==="ENOENT"){return mkdirp_manual_mkdirpManualSync(t,a,mkdirp_manual_mkdirpManualSync(o,a,i))}if(c&&c.code!=="EEXIST"&&c&&c.code!=="EROFS"){throw r}try{if(!a.statSync(t).isDirectory())throw r}catch(t){throw r}}};const Xs=Object.assign((async(t,r,i)=>{const o=optsArg(r);o.recursive=false;const a=(0,Zt.dirname)(t);if(a===t){return o.mkdirAsync(t,o).catch((t=>{const r=t;if(r&&r.code!=="EISDIR"){throw t}}))}return o.mkdirAsync(t,o).then((()=>i||t),(async r=>{const c=r;if(c&&c.code==="ENOENT"){return Xs(a,o).then((r=>Xs(t,o,r)))}if(c&&c.code!=="EEXIST"&&c.code!=="EROFS"){throw r}return o.statAsync(t).then((t=>{if(t.isDirectory()){return i}else{throw r}}),(()=>{throw r}))}))}),{sync:mkdirp_manual_mkdirpManualSync});const findMade=async(t,r,i)=>{if(i===r){return}return t.statAsync(r).then((t=>t.isDirectory()?i:undefined),(i=>{const o=i;return o&&o.code==="ENOENT"?findMade(t,(0,Zt.dirname)(r),r):undefined}))};const findMadeSync=(t,r,i)=>{if(i===r){return undefined}try{return t.statSync(r).isDirectory()?i:undefined}catch(i){const o=i;return o&&o.code==="ENOENT"?findMadeSync(t,(0,Zt.dirname)(r),r):undefined}};const mkdirp_native_mkdirpNativeSync=(t,r)=>{const i=optsArg(r);i.recursive=true;const o=(0,Zt.dirname)(t);if(o===t){return i.mkdirSync(t,i)}const a=findMadeSync(i,t);try{i.mkdirSync(t,i);return a}catch(r){const o=r;if(o&&o.code==="ENOENT"){return mkdirp_manual_mkdirpManualSync(t,i)}else{throw r}}};const Js=Object.assign((async(t,r)=>{const i={...optsArg(r),recursive:true};const o=(0,Zt.dirname)(t);if(o===t){return await i.mkdirAsync(t,i)}return findMade(i,t).then((r=>i.mkdirAsync(t,i).then((t=>r||t)).catch((r=>{const o=r;if(o&&o.code==="ENOENT"){return Xs(t,i)}else{throw r}}))))}),{sync:mkdirp_native_mkdirpNativeSync});const Qs=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;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=(0,Zt.resolve)(t);if(Qs==="win32"){const r=/[*|"<>?:]/;const{root:i}=(0,Zt.parse)(t);if(r.test(t.substring(i.length))){throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}}return t};const ei=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const ti=ei.replace(/^v/,"").split(".");const ri=+ti[0]>10||+ti[0]===10&&+ti[1]>=12;const si=!ri?()=>false:t=>optsArg(t).mkdirSync===je.mkdirSync;const ii=Object.assign(!ri?()=>false:t=>optsArg(t).mkdir===je.mkdir,{sync:si});const mkdirpSync=(t,r)=>{t=pathArg(t);const i=optsArg(r);return si(i)?mkdirp_native_mkdirpNativeSync(t,i):mkdirp_manual_mkdirpManualSync(t,i)};const ni=null&&mkdirpSync;const oi=null&&mkdirpManual;const ai=null&&mkdirpManualSync;const ci=null&&mkdirpNative;const li=null&&mkdirpNativeSync;const ui=Object.assign((async(t,r)=>{t=pathArg(t);const i=optsArg(r);return ii(i)?Js(t,i):Xs(t,i)}),{mkdirpSync:mkdirpSync,mkdirpNative:Js,mkdirpNativeSync:mkdirp_native_mkdirpNativeSync,mkdirpManual:Xs,mkdirpManualSync:mkdirp_manual_mkdirpManualSync,sync:mkdirpSync,native:Js,nativeSync:mkdirp_native_mkdirpNativeSync,manual:Xs,manualSync:mkdirp_manual_mkdirpManualSync,useNative:ii,useNativeSync:si});class CwdError extends Error{path;code;syscall="chdir";constructor(t,r){super(`${r}: Cannot cd into '${t}'`);this.path=t;this.code=r}get name(){return"CwdError"}}class SymlinkError extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,r){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link");this.symlink=t;this.path=r}get name(){return"SymlinkError"}}const cGet=(t,r)=>t.get(fr(r));const cSet=(t,r,i)=>t.set(fr(r),i);const checkCwd=(t,r)=>{je.stat(t,((i,o)=>{if(i||!o.isDirectory()){i=new CwdError(t,i?.code||"ENOTDIR")}r(i)}))};const mkdir=(t,r,i)=>{t=fr(t);const o=r.umask??18;const a=r.mode|448;const c=(a&o)!==0;const l=r.uid;const u=r.gid;const h=typeof l==="number"&&typeof u==="number"&&(l!==r.processUid||u!==r.processGid);const d=r.preserve;const p=r.unlink;const m=r.cache;const g=fr(r.cwd);const done=(r,o)=>{if(r){i(r)}else{cSet(m,t,true);if(o&&h){chownr(o,l,u,(t=>done(t)))}else if(c){je.chmod(t,a,i)}else{i()}}};if(m&&cGet(m,t)===true){return done()}if(t===g){return checkCwd(t,done)}if(d){return ui(t,{mode:a}).then((t=>done(null,t??undefined)),done)}const y=fr(S.relative(g,t));const v=y.split("/");mkdir_(g,v,a,m,p,g,undefined,done)};const mkdir_=(t,r,i,o,a,c,l,u)=>{if(!r.length){return u(null,l)}const h=r.shift();const d=fr(S.resolve(t+"/"+h));if(cGet(o,d)){return mkdir_(d,r,i,o,a,c,l,u)}je.mkdir(d,i,onmkdir(d,r,i,o,a,c,l,u))};const onmkdir=(t,r,i,o,a,c,l,u)=>h=>{if(h){je.lstat(t,((d,p)=>{if(d){d.path=d.path&&fr(d.path);u(d)}else if(p.isDirectory()){mkdir_(t,r,i,o,a,c,l,u)}else if(a){je.unlink(t,(h=>{if(h){return u(h)}je.mkdir(t,i,onmkdir(t,r,i,o,a,c,l,u))}))}else if(p.isSymbolicLink()){return u(new SymlinkError(t,t+"/"+r.join("/")))}else{u(h)}}))}else{l=l||t;mkdir_(t,r,i,o,a,c,l,u)}};const checkCwdSync=t=>{let r=false;let i=undefined;try{r=je.statSync(t).isDirectory()}catch(t){i=t?.code}finally{if(!r){throw new CwdError(t,i??"ENOTDIR")}}};const mkdirSync=(t,r)=>{t=fr(t);const i=r.umask??18;const o=r.mode|448;const a=(o&i)!==0;const c=r.uid;const l=r.gid;const u=typeof c==="number"&&typeof l==="number"&&(c!==r.processUid||l!==r.processGid);const h=r.preserve;const d=r.unlink;const p=r.cache;const m=fr(r.cwd);const done=r=>{cSet(p,t,true);if(r&&u){chownrSync(r,c,l)}if(a){je.chmodSync(t,o)}};if(p&&cGet(p,t)===true){return done()}if(t===m){checkCwdSync(m);return done()}if(h){return done(mkdirpSync(t,o)??undefined)}const g=fr(S.relative(m,t));const y=g.split("/");let v=undefined;for(let t=y.shift(),r=m;t&&(r+="/"+t);t=y.shift()){r=fr(S.resolve(r));if(cGet(p,r)){continue}try{je.mkdirSync(r,o);v=v||r;cSet(p,r,true)}catch(t){const i=je.lstatSync(r);if(i.isDirectory()){cSet(p,r,true);continue}else if(d){je.unlinkSync(r);je.mkdirSync(r,o);v=v||r;cSet(p,r,true);continue}else if(i.isSymbolicLink()){return new SymlinkError(r,r+"/"+y.join("/"))}}}return done(v)};const hi=Object.create(null);const{hasOwnProperty:di}=Object.prototype;const normalizeUnicode=t=>{if(!di.call(hi,t)){hi[t]=t.normalize("NFD")}return hi[t]};const fi=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const pi=fi==="win32";const getDirs=t=>{const r=t.split("/").slice(0,-1).reduce(((t,r)=>{const i=t[t.length-1];if(i!==undefined){r=(0,S.join)(i,r)}t.push(r||"/");return t}),[]);return r};class PathReservations{#y=new Map;#v=new Map;#b=new Set;reserve(t,r){t=pi?["win32 parallelization disabled"]:t.map((t=>stripTrailingSlashes((0,S.join)(normalizeUnicode(t))).toLowerCase()));const i=new Set(t.map((t=>getDirs(t))).reduce(((t,r)=>t.concat(r))));this.#v.set(r,{dirs:i,paths:t});for(const i of t){const t=this.#y.get(i);if(!t){this.#y.set(i,[r])}else{t.push(r)}}for(const t of i){const i=this.#y.get(t);if(!i){this.#y.set(t,[new Set([r])])}else{const t=i[i.length-1];if(t instanceof Set){t.add(r)}else{i.push(new Set([r]))}}}return this.#_(r)}#w(t){const r=this.#v.get(t);if(!r){throw new Error("function does not have any path reservations")}return{paths:r.paths.map((t=>this.#y.get(t))),dirs:[...r.dirs].map((t=>this.#y.get(t)))}}check(t){const{paths:r,dirs:i}=this.#w(t);return r.every((r=>r&&r[0]===t))&&i.every((r=>r&&r[0]instanceof Set&&r[0].has(t)))}#_(t){if(this.#b.has(t)||!this.check(t)){return false}this.#b.add(t);t((()=>this.#E(t)));return true}#E(t){if(!this.#b.has(t)){return false}const r=this.#v.get(t);if(!r){throw new Error("invalid reservation")}const{paths:i,dirs:o}=r;const a=new Set;for(const r of i){const i=this.#y.get(r);if(!i||i?.[0]!==t){continue}const o=i[1];if(!o){this.#y.delete(r);continue}i.shift();if(typeof o==="function"){a.add(o)}else{for(const t of o){a.add(t)}}}for(const r of o){const i=this.#y.get(r);const o=i?.[0];if(!i||!(o instanceof Set))continue;if(o.size===1&&i.length===1){this.#y.delete(r);continue}else if(o.size===1){i.shift();const t=i[0];if(typeof t==="function"){a.add(t)}}else{o.delete(t)}}this.#b.delete(t);a.forEach((t=>this.#_(t)));return true}}const mi=Symbol("onEntry");const gi=Symbol("checkFs");const yi=Symbol("checkFs2");const vi=Symbol("pruneCache");const bi=Symbol("isReusable");const _i=Symbol("makeFs");const wi=Symbol("file");const Ei=Symbol("directory");const Si=Symbol("link");const $i=Symbol("symlink");const xi=Symbol("hardlink");const Ri=Symbol("unsupported");const Oi=Symbol("checkPath");const Pi=Symbol("mkdir");const Ai=Symbol("onError");const Ti=Symbol("pending");const Ci=Symbol("pend");const ki=Symbol("unpend");const Ii=Symbol("ended");const Ni=Symbol("maybeClose");const Di=Symbol("skip");const Li=Symbol("doChown");const Mi=Symbol("uid");const ji=Symbol("gid");const Fi=Symbol("checkedCwd");const Ui=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;const Bi=Ui==="win32";const Hi=1024;const unlinkFile=(t,r)=>{if(!Bi){return E.unlink(t,r)}const i=t+".DELETE."+(0,$.randomBytes)(16).toString("hex");E.rename(t,i,(t=>{if(t){return r(t)}E.unlink(i,r)}))};const unlinkFileSync=t=>{if(!Bi){return E.unlinkSync(t)}const r=t+".DELETE."+(0,$.randomBytes)(16).toString("hex");E.renameSync(t,r);E.unlinkSync(r)};const uint32=(t,r,i)=>t!==undefined&&t===t>>>0?t:r!==undefined&&r===r>>>0?r:i;const cacheKeyNormalize=t=>stripTrailingSlashes(fr(normalizeUnicode(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 Parser{[Ii]=false;[Fi]=false;[Ti]=0;reservations=new PathReservations;transform;writable=true;readable=false;dirCache;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(t={}){t.ondone=()=>{this[Ii]=true;this[Ni]()};super(t);this.transform=t.transform;this.dirCache=t.dirCache||new Map;this.chmod=!!t.chmod;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=undefined;this.gid=undefined;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():undefined;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():undefined;this.maxDepth=typeof t.maxDepth==="number"?t.maxDepth:Hi;this.forceChown=t.forceChown===true;this.win32=!!t.win32||Bi;this.newer=!!t.newer;this.keep=!!t.keep;this.noMtime=!!t.noMtime;this.preservePaths=!!t.preservePaths;this.unlink=!!t.unlink;this.cwd=fr(S.resolve(t.cwd||process.cwd()));this.strip=Number(t.strip)||0;this.processUmask=!this.chmod?0:typeof t.processUmask==="number"?t.processUmask: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[mi](t)))}warn(t,r,i={}){if(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT"){i.recoverable=false}return super.warn(t,r,i)}[Ni](){if(this[Ii]&&this[Ti]===0){this.emit("prefinish");this.emit("finish");this.emit("end")}}[Oi](t){const r=fr(t.path);const i=r.split("/");if(this.strip){if(i.length=this.strip){t.linkpath=r.slice(this.strip).join("/")}else{return false}}i.splice(0,this.strip);t.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth){this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:r,depth:i.length,maxDepth:this.maxDepth});return false}if(!this.preservePaths){if(i.includes("..")||Bi&&/^[a-z]:\.\.$/i.test(i[0]??"")){this.warn("TAR_ENTRY_ERROR",`path contains '..'`,{entry:t,path:r});return false}const[o,a]=stripAbsolutePath(r);if(o){t.path=String(a);this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:t,path:r})}}if(S.isAbsolute(t.path)){t.absolute=fr(S.resolve(t.path))}else{t.absolute=fr(S.resolve(this.cwd,t.path))}if(!this.preservePaths&&typeof t.absolute==="string"&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd){this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:fr(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}=S.win32.parse(String(t.absolute));t.absolute=r+winchars_encode(String(t.absolute).slice(r.length));const{root:i}=S.win32.parse(t.path);t.path=i+winchars_encode(t.path.slice(i.length))}return true}[mi](t){if(!this[Oi](t)){return t.resume()}x.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[gi](t);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ri](t)}}[Ai](t,r){if(t.name==="CwdError"){this.emit("error",t)}else{this.warn("TAR_ENTRY_ERROR",t,{entry:r});this[ki]();r.resume()}}[Pi](t,r,i){mkdir(fr(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},i)}[Li](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}[Mi](t){return uint32(this.uid,t.uid,this.processUid)}[ji](t){return uint32(this.gid,t.gid,this.processGid)}[wi](t,r){const i=typeof t.mode==="number"?t.mode&4095:this.fmode;const o=new WriteStream(String(t.absolute),{flags:Zs(t.size),mode:i,autoClose:false});o.on("error",(i=>{if(o.fd){E.close(o.fd,(()=>{}))}o.write=()=>true;this[Ai](i,t);r()}));let a=1;const done=i=>{if(i){if(o.fd){E.close(o.fd,(()=>{}))}this[Ai](i,t);r();return}if(--a===0){if(o.fd!==undefined){E.close(o.fd,(i=>{if(i){this[Ai](i,t)}else{this[ki]()}r()}))}}};o.on("finish",(()=>{const r=String(t.absolute);const i=o.fd;if(typeof i==="number"&&t.mtime&&!this.noMtime){a++;const o=t.atime||new Date;const c=t.mtime;E.futimes(i,o,c,(t=>t?E.utimes(r,o,c,(r=>done(r&&t))):done()))}if(typeof i==="number"&&this[Li](t)){a++;const o=this[Mi](t);const c=this[ji](t);if(typeof o==="number"&&typeof c==="number"){E.fchown(i,o,c,(t=>t?E.chown(r,o,c,(r=>done(r&&t))):done()))}}done()}));const c=this.transform?this.transform(t)||t:t;if(c!==t){c.on("error",(i=>{this[Ai](i,t);r()}));t.pipe(c)}c.pipe(o)}[Ei](t,r){const i=typeof t.mode==="number"?t.mode&4095:this.dmode;this[Pi](String(t.absolute),i,(i=>{if(i){this[Ai](i,t);r();return}let o=1;const done=()=>{if(--o===0){r();this[ki]();t.resume()}};if(t.mtime&&!this.noMtime){o++;E.utimes(String(t.absolute),t.atime||new Date,t.mtime,done)}if(this[Li](t)){o++;E.chown(String(t.absolute),Number(this[Mi](t)),Number(this[ji](t)),done)}done()}))}[Ri](t){t.unsupported=true;this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t});t.resume()}[$i](t,r){this[Si](t,String(t.linkpath),"symlink",r)}[xi](t,r){const i=fr(S.resolve(this.cwd,String(t.linkpath)));this[Si](t,i,"link",r)}[Ci](){this[Ti]++}[ki](){this[Ti]--;this[Ni]()}[Di](t){this[ki]();t.resume()}[bi](t,r){return t.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!Bi}[gi](t){this[Ci]();const r=[t.path];if(t.linkpath){r.push(t.linkpath)}this.reservations.reserve(r,(r=>this[yi](t,r)))}[vi](t){if(t.type==="SymbolicLink"){dropCache(this.dirCache)}else if(t.type!=="Directory"){pruneCache(this.dirCache,String(t.absolute))}}[yi](t,r){this[vi](t);const done=i=>{this[vi](t);r(i)};const checkCwd=()=>{this[Pi](this.cwd,this.dmode,(r=>{if(r){this[Ai](r,t);done();return}this[Fi]=true;start()}))};const start=()=>{if(t.absolute!==this.cwd){const r=fr(S.dirname(String(t.absolute)));if(r!==this.cwd){return this[Pi](r,this.dmode,(r=>{if(r){this[Ai](r,t);done();return}afterMakeParent()}))}}afterMakeParent()};const afterMakeParent=()=>{E.lstat(String(t.absolute),((r,i)=>{if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime))){this[Di](t);done();return}if(r||this[bi](t,i)){return this[_i](null,t,done)}if(i.isDirectory()){if(t.type==="Directory"){const r=this.chmod&&t.mode&&(i.mode&4095)!==t.mode;const afterChmod=r=>this[_i](r??null,t,done);if(!r){return afterChmod()}return E.chmod(String(t.absolute),Number(t.mode),afterChmod)}if(t.absolute!==this.cwd){return E.rmdir(String(t.absolute),(r=>this[_i](r??null,t,done)))}}if(t.absolute===this.cwd){return this[_i](null,t,done)}unlinkFile(String(t.absolute),(r=>this[_i](r??null,t,done)))}))};if(this[Fi]){start()}else{checkCwd()}}[_i](t,r,i){if(t){this[Ai](t,r);i();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[wi](r,i);case"Link":return this[xi](r,i);case"SymbolicLink":return this[$i](r,i);case"Directory":case"GNUDumpDir":return this[Ei](r,i)}}[Si](t,r,i,o){E[i](r,String(t.absolute),(r=>{if(r){this[Ai](r,t)}else{this[ki]();t.resume()}o()}))}}const callSync=t=>{try{return[null,t()]}catch(t){return[t,null]}};class UnpackSync extends Unpack{sync=true;[_i](t,r){return super[_i](t,r,(()=>{}))}[gi](t){this[vi](t);if(!this[Fi]){const r=this[Pi](this.cwd,this.dmode);if(r){return this[Ai](r,t)}this[Fi]=true}if(t.absolute!==this.cwd){const r=fr(S.dirname(String(t.absolute)));if(r!==this.cwd){const i=this[Pi](r,this.dmode);if(i){return this[Ai](i,t)}}}const[r,i]=callSync((()=>E.lstatSync(String(t.absolute))));if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime))){return this[Di](t)}if(r||this[bi](t,i)){return this[_i](null,t)}if(i.isDirectory()){if(t.type==="Directory"){const r=this.chmod&&t.mode&&(i.mode&4095)!==t.mode;const[o]=r?callSync((()=>{E.chmodSync(String(t.absolute),Number(t.mode))})):[];return this[_i](o,t)}const[r]=callSync((()=>E.rmdirSync(String(t.absolute))));this[_i](r,t)}const[o]=t.absolute===this.cwd?[]:callSync((()=>unlinkFileSync(String(t.absolute))));this[_i](o,t)}[wi](t,r){const i=typeof t.mode==="number"?t.mode&4095:this.fmode;const oner=i=>{let a;try{E.closeSync(o)}catch(t){a=t}if(i||a){this[Ai](i||a,t)}r()};let o;try{o=E.openSync(String(t.absolute),Zs(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[Ai](r,t)));t.pipe(a)}a.on("data",(t=>{try{E.writeSync(o,t,0,t.length)}catch(t){oner(t)}}));a.on("end",(()=>{let r=null;if(t.mtime&&!this.noMtime){const i=t.atime||new Date;const a=t.mtime;try{E.futimesSync(o,i,a)}catch(o){try{E.utimesSync(String(t.absolute),i,a)}catch(t){r=o}}}if(this[Li](t)){const i=this[Mi](t);const a=this[ji](t);try{E.fchownSync(o,Number(i),Number(a))}catch(o){try{E.chownSync(String(t.absolute),Number(i),Number(a))}catch(t){r=r||o}}}oner(r)}))}[Ei](t,r){const i=typeof t.mode==="number"?t.mode&4095:this.dmode;const o=this[Pi](String(t.absolute),i);if(o){this[Ai](o,t);r();return}if(t.mtime&&!this.noMtime){try{E.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch(o){}}if(this[Li](t)){try{E.chownSync(String(t.absolute),Number(this[Mi](t)),Number(this[ji](t)))}catch(o){}}r();t.resume()}[Pi](t,r){try{return mkdirSync(fr(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}}[Si](t,r,i,o){const a=`${i}Sync`;try{E[a](r,String(t.absolute));o();t.resume()}catch(r){return this[Ai](r,t)}}}const extractFileSync=t=>{const r=new UnpackSync(t);const i=t.file;const o=E.statSync(i);const a=t.maxReadSize||16*1024*1024;const c=new ReadStreamSync(i,{readSize:a,size:o.size});c.pipe(r)};const extractFile=(t,r)=>{const i=new Unpack(t);const o=t.maxReadSize||16*1024*1024;const a=t.file;const c=new Promise(((t,r)=>{i.on("error",r);i.on("close",t);E.stat(a,((t,c)=>{if(t){r(t)}else{const t=new ReadStream(a,{readSize:o,size:c.size});t.on("error",r);t.pipe(i)}}))}));return c};const Vi=makeCommand(extractFileSync,extractFile,(t=>new UnpackSync(t)),(t=>new Unpack(t)),((t,r)=>{if(r?.length)filesFilter(t,r)}));const replaceSync=(t,r)=>{const i=new PackSync(t);let o=true;let a;let c;try{try{a=E.openSync(t.file,"r+")}catch(r){if(r?.code==="ENOENT"){a=E.openSync(t.file,"w+")}else{throw r}}const l=E.fstatSync(a);const u=Buffer.alloc(512);e:for(c=0;cl.size){break}c+=i;if(t.mtimeCache&&r.mtime){t.mtimeCache.set(String(r.path),r.mtime)}}o=false;streamSync(t,i,c,a,r)}finally{if(o){try{E.closeSync(a)}catch(t){}}}};const streamSync=(t,r,i,o,a)=>{const c=new WriteStreamSync(t.file,{fd:o,start:i});r.pipe(c);replace_addFilesSync(r,a)};const replaceAsync=(t,r)=>{r=Array.from(r);const i=new Pack(t);const getPos=(r,i,o)=>{const cb=(t,i)=>{if(t){E.close(r,(r=>o(t)))}else{o(null,i)}};let a=0;if(i===0){return cb(null,0)}let c=0;const l=Buffer.alloc(512);const onread=(o,u)=>{if(o||typeof u==="undefined"){return cb(o)}c+=u;if(c<512&&u){return E.read(r,l,c,l.length-c,a+c,onread)}if(a===0&&l[0]===31&&l[1]===139){return cb(new Error("cannot append to compressed archives"))}if(c<512){return cb(null,a)}const h=new Header(l);if(!h.cksumValid){return cb(null,a)}const d=512*Math.ceil((h.size??0)/512);if(a+d+512>i){return cb(null,a)}a+=d+512;if(a>=i){return cb(null,a)}if(t.mtimeCache&&h.mtime){t.mtimeCache.set(String(h.path),h.mtime)}c=0;E.read(r,l,0,512,a,onread)};E.read(r,l,0,512,a,onread)};const o=new Promise(((o,a)=>{i.on("error",a);let c="r+";const onopen=(l,u)=>{if(l&&l.code==="ENOENT"&&c==="r+"){c="w+";return E.open(t.file,c,onopen)}if(l||!u){return a(l)}E.fstat(u,((c,l)=>{if(c){return E.close(u,(()=>a(c)))}getPos(u,l.size,((c,l)=>{if(c){return a(c)}const h=new WriteStream(t.file,{fd:u,start:l});i.pipe(h);h.on("error",a);h.on("close",o);replace_addFilesAsync(i,r)}))}))};E.open(t.file,c,onopen)}));return o};const replace_addFilesSync=(t,r)=>{r.forEach((r=>{if(r.charAt(0)==="@"){qr({file:S.resolve(t.cwd,r.slice(1)),sync:true,noResume:true,onReadEntry:r=>t.add(r)})}else{t.add(r)}}));t.end()};const replace_addFilesAsync=async(t,r)=>{for(let i=0;it.add(r)})}else{t.add(o)}}t.end()};const zi=makeCommand(replaceSync,replaceAsync,(()=>{throw new TypeError("file is required")}),(()=>{throw new TypeError("file is required")}),((t,r)=>{if(!isFile(t)){throw new TypeError("file is required")}if(t.gzip||t.brotli||t.file.endsWith(".br")||t.file.endsWith(".tbr")){throw new TypeError("cannot append to compressed archives")}if(!r?.length){throw new TypeError("no paths specified to add/replace")}}));const Gi=makeCommand(zi.syncFile,zi.asyncFile,zi.syncNoFile,zi.asyncNoFile,((t,r=[])=>{zi.validate?.(t,r);mtimeFilter(t)}));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??0)>(o.mtime??0)):(r,i)=>!((t.mtimeCache?.get(r)??i.mtime??0)>(i.mtime??0))};async function isUrlOk(t){try{const r=await fetch(t,{method:"HEAD"});return r.status===200}catch{return false}}async function getRepoInfo(t,r){const[,i,o,a,c,...l]=t.pathname.split("/");const u=r?r.replace(/^\//,""):l.join("/");if(a===undefined||a===""&&c===undefined){try{const t=await fetch(`https://api.github.com/repos/${i}/${o}`);if(t.status!==200){return}const r=await t.json();return{username:i,name:o,branch:r["default_branch"],filePath:u}}catch{return}}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 existsInRepo(t){try{const r=new URL(t);return isUrlOk(r.href)}catch{return isUrlOk(`https://api.github.com/repos/vercel/next.js/contents/examples/${encodeURIComponent(t)}`)}}async function downloadTarStream(t){const r=await fetch(t);if(!r.body){throw new Error(`Failed to download: ${t}`)}return De.Readable.fromWeb(r.body)}async function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){let c=null;await(0,Le.pipeline)(await downloadTarStream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),Vi({cwd:t,strip:a?a.split("/").length+1:1,filter:t=>{const r=t.split(S.sep).join(S.posix.sep);if(c===null){const t=r.split(S.posix.sep);c=t.length?t[0]:null}return r.startsWith(`${c}${a?`/${a}/`:"/"}`)}}))}async function downloadAndExtractExample(t,r){if(r==="__internal-testing-retry"){throw new Error("This is an internal example for testing the CLI.")}await(0,Le.pipeline)(await downloadTarStream("https://codeload.github.com/vercel/next.js/tar.gz/canary"),Vi({cwd:t,strip:2+r.split("/").length,filter:t=>t.includes(`next.js-canary/examples/${r}/`)}))}var qi=__nccwpck_require__(7718);function isInGitRepository(){try{(0,qi.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,qi.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function isDefaultBranchSet(){try{(0,qi.execSync)("git config init.defaultBranch",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,qi.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,qi.execSync)("git init",{stdio:"ignore"});r=true;if(!isDefaultBranchSet()){(0,qi.execSync)("git checkout -b main",{stdio:"ignore"})}(0,qi.execSync)("git add -A",{stdio:"ignore"});(0,qi.execSync)('git commit -m "Initial commit from Create Next App"',{stdio:"ignore"});return true}catch(i){if(r){try{(0,E.rmSync)((0,S.join)(t,".git"),{recursive:true,force:true})}catch(t){}}return false}}var Wi=__nccwpck_require__(1405);var Ki=__nccwpck_require__.n(Wi);async function install(t,r){const i=["install"];if(!r){console.log((0,Pe.yellow)("You appear to be offline.\nFalling back to the local cache."));i.push("--offline")}return new Promise(((r,o)=>{const a=Ki()(t,i,{stdio:"inherit",env:{...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){o({command:`${t} ${i.join(" ")}`});return}r()}))}))}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","yarnrc.yml",".yarn"];const o=(0,E.readdirSync)(t).filter((t=>!i.includes(t)&&!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${(0,Pe.green)(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=(0,E.lstatSync)((0,S.join)(t,r));if(i.isDirectory()){console.log(` ${(0,Pe.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}const Yi=require("node:dns/promises");const Zi=require("node:url");var Xi=__nccwpck_require__.n(Zi);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,qi.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}async function getOnline(){try{await(0,Yi.lookup)("registry.yarnpkg.com");return true}catch{const t=getProxy();if(!t){return false}const{hostname:r}=Xi().parse(t);if(!r){return false}try{await(0,Yi.lookup)(r);return true}catch{return false}}}const Ji=require("node:constants");const Qi=require("node:fs/promises");async function isWriteable(t){try{await(0,Qi.access)(t,Ji.W_OK);return true}catch(t){return false}}async function runTypegen(t){return new Promise(((r,i)=>{let o;let a;switch(t){case"npm":o="npm";a=["exec","next","--","typegen"];break;case"yarn":o="yarn";a=["exec","next","--","typegen"];break;case"pnpm":o="pnpm";a=["exec","next","--","typegen"];break;case"bun":o="bun";a=["next","typegen"];break;default:t;throw new Error(`Unsupported package manager: ${t}`)}const c=Ki()(o,a,{stdio:"inherit",env:{...process.env}});c.on("close",(t=>{if(t!==0){i(new Error(`next typegen exited with code ${t}`));return}r()}))}))}var en=__nccwpck_require__(9453);const identity=t=>t;const copy=async(t,r,{cwd:i,rename:o=identity,parents:a=true}={})=>{const c=typeof t==="string"?[t]:t;if(c.length===0||!r){throw new TypeError("`src` and `dest` are required")}const l=await(0,en.async)(c,{cwd:i,dot:true,absolute:false,stats:false});const u=i?(0,S.resolve)(i,r):r;return Promise.all(l.map((async t=>{const r=(0,S.dirname)(t);const c=o((0,S.basename)(t));const l=i?(0,S.resolve)(i,t):t;const h=a?(0,S.join)(u,r,c):(0,S.join)(u,c);await(0,Qi.mkdir)((0,S.dirname)(h),{recursive:true});return(0,Qi.copyFile)(l,h)})))};var tn=__nccwpck_require__(2081);function getPkgManager(){const t=process.env.npm_config_user_agent||"";if(t.startsWith("yarn")){return"yarn"}if(t.startsWith("pnpm")){return"pnpm"}if(t.startsWith("bun")){return"bun"}return"npm"}function getPnpmMajorVersion(){const t=process.env.npm_config_user_agent||"";const r=t.match(/pnpm\/(\d+)/);if(r){return parseInt(r[1],10)}try{const t=(0,tn.execSync)("pnpm --version --silent",{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim();const r=parseInt(t.split(".")[0],10);if(!Number.isNaN(r)){return r}}catch{}return null}var rn=__nccwpck_require__(2037);var sn=__nccwpck_require__.n(rn);const nn=require("fs/promises");var on=__nccwpck_require__.n(nn);var an=__nccwpck_require__(833);const cn=JSON.parse('{"name":"create-next-app","version":"16.1.6","keywords":["react","next","next.js"],"description":"Create Next.js-powered React apps with one command","repository":{"type":"git","url":"https://github.com/vercel/next.js","directory":"packages/create-next-app"},"author":"Next.js Team ","license":"MIT","bin":{"create-next-app":"./dist/index.js"},"files":["dist"],"scripts":{"dev":"ncc build ./index.ts -w -o dist/","prebuild":"node ../../scripts/rm.mjs dist","build":"ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register","prepublishOnly":"cd ../../ && turbo run build","lint-fix":"pnpm prettier -w --plugin prettier-plugin-tailwindcss \'templates/*-tw/{ts,js}/{app,pages}/**/*.{js,ts,tsx}\'"},"devDependencies":{"@types/async-retry":"1.4.2","@types/cross-spawn":"6.0.0","@types/node":"20.14.2","@types/prompts":"2.4.2","@types/tar":"6.1.13","@types/validate-npm-package-name":"4.0.2","@vercel/ncc":"0.38.1","async-retry":"1.3.1","ci-info":"4.0.0","commander":"12.1.0","conf":"13.0.1","cross-spawn":"7.0.3","fast-glob":"3.3.1","picocolors":"1.0.0","prettier-plugin-tailwindcss":"0.6.2","prompts":"2.4.2","tar":"7.4.3","update-check":"1.5.4","validate-npm-package-name":"5.0.1"},"engines":{"node":">=20.9.0"}}');var ln;(function(t){t["Turbopack"]="turbopack";t["Webpack"]="webpack";t["Rspack"]="rspack"})(ln||(ln={}));const un="19.2.3";function sorted(t){return Object.keys(t).sort().reduce(((r,i)=>{r[i]=t[i];return r}),{})}const getTemplateFile=({template:t,mode:r,file:i})=>__nccwpck_require__.ab+"templates/"+t+"/"+r+"/"+i;const hn=["app","pages","styles"];const installTemplate=async({appName:t,root:r,packageManager:i,isOnline:o,template:a,mode:c,tailwind:l,eslint:u,biome:h,srcDir:d,importAlias:p,skipInstall:m,bundler:g,reactCompiler:y})=>{var v;console.log((0,Pe.bold)(`Using ${i}.`));console.log("\nInitializing project with template:",a,"\n");const b=a==="app-api";const w=__nccwpck_require__.ab+"templates/"+a+"/"+c;const E=["**"];if(!u)E.push("!eslint.config.mjs");if(!h)E.push("!biome.json");if(!l)E.push("!postcss.config.mjs");await copy(E,r,{parents:true,cwd:w,rename(t){switch(t){case"gitignore":{return`.${t}`}case"README-template.md":{return"README.md"}default:{return t}}}});if(g===ln.Rspack){const t=Xt().join(r,c==="js"?"next.config.mjs":"next.config.ts");await on().writeFile(t,`import withRspack from "next-rspack";\n\n`+(await on().readFile(t,"utf8")).replace("export default nextConfig;","export default withRspack(nextConfig);"))}if(y){const t=Xt().join(r,c==="js"?"next.config.mjs":"next.config.ts");let i=await on().readFile(t,"utf8");i=i.replace("/* config options here */\n","/* config options here */\n reactCompiler: true,\n");await on().writeFile(t,i)}const S=Xt().join(r,c==="js"?"jsconfig.json":"tsconfig.json");await on().writeFile(S,(await on().readFile(S,"utf8")).replace(`"@/*": ["./*"]`,d?`"@/*": ["./src/*"]`:`"@/*": ["./*"]`).replace(`"@/*":`,`"${p}":`));if(p!=="@/*"){const t=await(0,en.async)("**/*",{cwd:r,dot:true,stats:false,ignore:["tsconfig.json","jsconfig.json",".git/**/*","**/fonts/**","**/favicon.ico"]});const i=new an.Sema(8,{capacity:t.length});await Promise.all(t.map((async t=>{await i.acquire();const o=Xt().join(r,t);if((await on().stat(o)).isFile()){await on().writeFile(o,(await on().readFile(o,"utf8")).replace(`@/`,`${p.replace(/\*/g,"")}`))}i.release()})))}if(d){await on().mkdir(Xt().join(r,"src"),{recursive:true});await Promise.all(hn.map((async t=>{await on().rename(Xt().join(r,t),Xt().join(r,"src",t)).catch((t=>{if(t.code!=="ENOENT"){throw t}}))})));if(!b){const t=a.startsWith("app");const r=Xt().join("src",t?"app":"pages",`${t?"page":"index"}.${c==="ts"?"tsx":"js"}`);await on().writeFile(r,(await on().readFile(r,"utf8")).replace(t?"app/page":"pages/index",t?"src/app/page":"src/pages/index"))}}const $=(v=process.env.NEXT_PRIVATE_TEST_VERSION)!==null&&v!==void 0?v:cn.version;const x=g===ln.Webpack?" --webpack":"";const R={name:t,version:"0.1.0",private:true,scripts:{dev:`next dev${x}`,build:`next build${x}`,start:"next start",...u&&{lint:"eslint"},...h&&{lint:"biome check",format:"biome format --write"}},dependencies:{react:un,"react-dom":un,next:$},devDependencies:{}};if(g===ln.Rspack){const t=process.env.NEXT_PRIVATE_TEST_VERSION;if(t&&Xt().isAbsolute(t)){R.dependencies["next-rspack"]=Xt().resolve(Xt().dirname(t),"../next-rspack/next-rspack-packed.tgz")}else{R.dependencies["next-rspack"]=$}}if(y){R.devDependencies["babel-plugin-react-compiler"]="1.0.0"}if(c==="ts"){R.devDependencies={...R.devDependencies,typescript:"^5","@types/node":"^20","@types/react":"^19","@types/react-dom":"^19"}}if(l){R.devDependencies={...R.devDependencies,"@tailwindcss/postcss":"^4",tailwindcss:"^4"}}if(u){R.devDependencies={...R.devDependencies,eslint:"^9","eslint-config-next":$}}if(h){R.devDependencies={...R.devDependencies,"@biomejs/biome":"2.2.0"}}if(b){delete R.dependencies.react;delete R.dependencies["react-dom"];delete R.devDependencies["@types/react-dom"];delete R.scripts.lint;delete R.scripts.format}const O=Object.keys(R.devDependencies).length;if(!O)delete R.devDependencies;if(R.dependencies){R.dependencies=sorted(R.dependencies)}if(R.devDependencies){R.devDependencies=sorted(R.devDependencies)}if(i==="pnpm"){const t=getPnpmMajorVersion();if(t===null||t>=10){const t=["ignoredBuiltDependencies:"," - sharp"," - unrs-resolver",""].join(sn().EOL);await on().writeFile(Xt().join(r,"pnpm-workspace.yaml"),t)}}if(i==="bun"){R.ignoreScripts=["sharp","unrs-resolver"];R.trustedDependencies=["sharp","unrs-resolver"]}await on().writeFile(Xt().join(r,"package.json"),JSON.stringify(R,null,2)+sn().EOL);if(m)return;console.log("\nInstalling dependencies:");for(const t in R.dependencies)console.log(`- ${(0,Pe.cyan)(t)}`);if(O){console.log("\nInstalling devDependencies:");for(const t in R.devDependencies)console.log(`- ${(0,Pe.cyan)(t)}`)}console.log();await install(i,o);try{console.log();await runTypegen(i);console.log()}catch(t){console.error("Error running typegen:",t)}};class DownloadError extends Error{}async function createApp({appPath:t,packageManager:r,example:i,examplePath:o,typescript:a,tailwind:c,eslint:l,biome:u,app:h,srcDir:d,importAlias:p,skipInstall:m,empty:g,api:y,bundler:v,disableGit:b,reactCompiler:w}){let $;const x=a?"ts":"js";const R=`${h?"app":"default"}${c?"-tw":""}${g?"-empty":""}`;if(i){let D;try{D=new URL(i)}catch(L){const M=L;if(!(M instanceof TypeError)){console.error(L);process.exit(1)}}if(D){if(D.origin!=="https://github.com"){console.error(`Invalid URL: ${(0,Pe.red)(`"${i}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}$=await getRepoInfo(D,o);if(!$){console.error(`Found invalid GitHub URL: ${(0,Pe.red)(`"${i}"`)}. Please fix the URL and try again.`);process.exit(1)}const j=await hasRepo($);if(!j){console.error(`Could not locate the repository for ${(0,Pe.red)(`"${i}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(i!=="__internal-testing-retry"){const U=await existsInRepo(i);if(!U){console.error(`Could not locate an example named ${(0,Pe.red)(`"${i}"`)}. It could be due to the following:\n`,`1. Your spelling of example ${(0,Pe.red)(`"${i}"`)} might be incorrect.\n`,`2. You might not be connected to the internet or you are behind a proxy.`);process.exit(1)}}}const O=(0,S.resolve)(t);if(!await isWriteable((0,S.dirname)(O))){console.error("The application 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 P=(0,S.basename)(O);(0,E.mkdirSync)(O,{recursive:true});if(!isFolderEmpty(O,P)){process.exit(1)}const A=r==="yarn";const T=!A||await getOnline();const C=process.cwd();console.log(`Creating a new Next.js app in ${(0,Pe.green)(O)}.`);console.log();process.chdir(O);const k=(0,S.join)(O,"package.json");let I=false;if(i){try{if($){const V=$;console.log(`Downloading files from repo ${(0,Pe.cyan)(i)}. This might take a moment.`);console.log();await Ne()((()=>downloadAndExtractRepo(O,V)),{retries:3})}else{console.log(`Downloading files for example ${(0,Pe.cyan)(i)}. This might take a moment.`);console.log();await Ne()((()=>downloadAndExtractExample(O,i)),{retries:3})}}catch(z){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(z)?z.message:z+"")}const B=(0,S.join)(O,".gitignore");if(!(0,E.existsSync)(B)){(0,E.copyFileSync)(getTemplateFile({template:R,mode:x,file:"gitignore"}),B)}const H=(0,S.join)(O,"tsconfig.json");if((0,E.existsSync)(H)){(0,E.copyFileSync)(getTemplateFile({template:R,mode:"ts",file:"next-env.d.ts"}),(0,S.join)(O,"next-env.d.ts"))}I=(0,E.existsSync)(k);if(!m&&I){console.log("Installing packages. This might take a couple of minutes.");console.log();await install(r,T);console.log();try{console.log();await runTypegen(r);console.log()}catch(G){console.error("Error running typegen:",G)}}}else{await installTemplate({appName:P,root:O,template:y?"app-api":R,mode:x,packageManager:r,isOnline:T,tailwind:c,eslint:l,biome:u,srcDir:d,importAlias:p,skipInstall:m,bundler:v,reactCompiler:w})}if(b){console.log("Skipping git initialization.");console.log()}else if(tryGitInit(O)){console.log("Initialized a git repository.");console.log()}let N;if((0,S.join)(C,P)===t){N=P}else{N=t}console.log(`${(0,Pe.green)("Success!")} Created ${P} at ${t}`);if(I){console.log("Inside that directory, you can run several commands:");console.log();console.log((0,Pe.cyan)(` ${r} ${A?"":"run "}dev`));console.log(" Starts the development server.");console.log();console.log((0,Pe.cyan)(` ${r} ${A?"":"run "}build`));console.log(" Builds the app for production.");console.log();console.log((0,Pe.cyan)(` ${r} start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log((0,Pe.cyan)(" cd"),N);console.log(` ${(0,Pe.cyan)(`${r} ${A?"":"run "}dev`)}`)}console.log()}var dn=__nccwpck_require__(6982);var fn=__nccwpck_require__.n(dn);function validateNpmName(t){const r=fn()(t);if(r.validForNewPackages){return{valid:true}}return{valid:false,problems:[...r.errors||[],...r.warnings||[]]}}let pn="";const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);const onPromptState=t=>{if(t.aborted){process.stdout.write("[?25h");process.stdout.write("\n");process.exit(1)}};const mn=new m(cn.name).version(cn.version,"-v, --version","Output the current version of create-next-app.").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","Display this help message.").option("--ts, --typescript","Initialize as a TypeScript project. (default)").option("--js, --javascript","Initialize as a JavaScript project.").option("--tailwind","Initialize with Tailwind CSS config. (default)").option("--react-compiler","Initialize with React Compiler enabled.").option("--eslint","Initialize with ESLint config.").option("--biome","Initialize with Biome config.").option("--app","Initialize as an App Router project.").option("--src-dir","Initialize inside a 'src/' directory.").option("--turbopack","Enable Turbopack as the bundler.").option("--webpack","Enable Webpack as the bundler.").option("--rspack","Enable Rspack as the bundler").option("--import-alias ",'Specify import alias to use (default "@/*").').option("--api","Initialize a headless API using the App Router.").option("--empty","Initialize an empty project.").option("--use-npm","Explicitly tell the CLI to bootstrap the application using npm.").option("--use-pnpm","Explicitly tell the CLI to bootstrap the application using pnpm.").option("--use-yarn","Explicitly tell the CLI to bootstrap the application using Yarn.").option("--use-bun","Explicitly tell the CLI to bootstrap the application using Bun.").option("--reset, --reset-preferences","Reset the preferences saved for create-next-app.").option("--skip-install","Explicitly tell the CLI to skip installing packages.").option("--yes","Use saved preferences or defaults for unprovided options.").option("-e, --example ",`\n\n An example to bootstrap the app with. You can use an example name\n from the official Next.js repo or a public GitHub URL. The URL can use\n any branch and/or subdirectory.\n`).option("--example-path ",`\n\n In a rare case, your GitHub URL might contain a branch name with\n a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).\n In this case, you must specify the path to the example separately:\n --example-path foo/bar\n`).option("--disable-git",`Skip initializing a git repository.`).action((t=>{if(t&&!t.startsWith("--no-")){pn=t}})).allowUnknownOption().parse(process.argv);const gn=mn.opts();const{args:yn}=mn;const vn=!!gn.useNpm?"npm":!!gn.usePnpm?"pnpm":!!gn.useYarn?"yarn":!!gn.useBun?"bun":getPkgManager();async function run(){const t=new Conf({projectName:"create-next-app"});if(gn.resetPreferences){const{resetPreferences:r}=await Te()({onState:onPromptState,type:"toggle",name:"resetPreferences",message:"Would you like to reset the saved preferences?",initial:false,active:"Yes",inactive:"No"});if(r){t.clear();console.log("The preferences have been reset successfully!")}process.exit(0)}if(typeof pn==="string"){pn=pn.trim()}if(!pn){const t=await Te()({onState:onPromptState,type:"text",name:"path",message:"What is your project named?",initial:"my-app",validate:t=>{const r=validateNpmName((0,S.basename)((0,S.resolve)(t)));if(r.valid){return true}return"Invalid project name: "+r.problems[0]}});if(typeof t.path==="string"){pn=t.path.trim()}}if(!pn){console.log("\nPlease specify the project directory:\n"+` ${(0,Pe.cyan)(gn.name())} ${(0,Pe.green)("")}\n`+"For example:\n"+` ${(0,Pe.cyan)(gn.name())} ${(0,Pe.green)("my-next-app")}\n\n`+`Run ${(0,Pe.cyan)(`${gn.name()} --help`)} to see all options.`);process.exit(1)}const i=(0,S.resolve)(pn);const o=(0,S.basename)(i);const a=validateNpmName(o);if(!a.valid){console.error(`Could not create a project called ${(0,Pe.red)(`"${o}"`)} because of npm naming restrictions:`);a.problems.forEach((t=>console.error(` ${(0,Pe.red)((0,Pe.bold)("*"))} ${t}`)));process.exit(1)}if(gn.example===true){console.error("Please provide an example name or url, otherwise remove the example option.");process.exit(1)}if((0,E.existsSync)(i)&&!isFolderEmpty(i,o)){process.exit(1)}const c=typeof gn.example==="string"&&gn.example.trim();const l=t.get("preferences")||{};let u=r().isCI||gn.yes;let h=false;if(!c){const t={typescript:true,eslint:false,linter:"eslint",tailwind:true,app:true,srcDir:false,importAlias:"@/*",customizeImportAlias:false,empty:false,disableGit:false,reactCompiler:false};const r=[{key:"typescript",values:{true:"TypeScript",false:"JavaScript"}},{key:"linter",values:{eslint:"ESLint",biome:"Biome"}},{key:"reactCompiler",values:{true:"React Compiler"}},{key:"tailwind",values:{true:"Tailwind CSS"}},{key:"srcDir",values:{true:"src/ dir"}},{key:"app",values:{true:"App Router",false:"Pages Router"}}];const formatSettingsDescription=t=>{const i=[];for(const o of r){const r=t[o.key];if(o.values){const t=o.values[String(r)];if(t){i.push(t)}}}return i.join(", ")};const i=Object.keys(l).length>0;const o=process.argv.some((t=>t.startsWith("--")));if(!u&&!o){const r=[{title:"Yes, use recommended defaults",value:"recommended",description:formatSettingsDescription(t)},{title:"No, customize settings",value:"customize",description:"Choose your own preferences"}];if(i){const t=formatSettingsDescription(l);r.splice(1,0,{title:"No, reuse previous settings",value:"reuse",description:t})}const{setupChoice:o}=await Te()({type:"select",name:"setupChoice",message:"Would you like to use the recommended Next.js defaults?",choices:r,initial:0},{onCancel:()=>{console.error("Exiting.");process.exit(1)}});if(o==="recommended"){h=true;u=true}else if(o==="reuse"){u=true}}if(h){Object.assign(l,t)}const getPrefOrDefault=r=>{var i;if(h){return t[r]}return(i=l[r])!==null&&i!==void 0?i:t[r]};if(!gn.typescript&&!gn.javascript){if(u){gn.typescript=getPrefOrDefault("typescript")}else{const t=(0,Pe.blue)("TypeScript");const{typescript:r}=await Te()({type:"toggle",name:"typescript",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("typescript"),active:"Yes",inactive:"No"},{onCancel:()=>{console.error("Exiting.");process.exit(1)}});gn.typescript=Boolean(r);gn.javascript=!r;l.typescript=Boolean(r)}}const a=yn.includes("--no-linter")||yn.includes("--no-eslint");if(!gn.eslint&&!gn.biome&&!a&&!gn.api){if(u){const t=getPrefOrDefault("linter");gn.eslint=t==="eslint";gn.biome=t==="biome"}else{const t={eslint:0,biome:1,none:2};const{linter:r}=await Te()({onState:onPromptState,type:"select",name:"linter",message:"Which linter would you like to use?",choices:[{title:"ESLint",value:"eslint",description:"More comprehensive lint rules"},{title:"Biome",value:"biome",description:"Fast formatter and linter (fewer rules)"},{title:"None",value:"none",description:"Skip linter configuration"}],initial:t[getPrefOrDefault("linter")]});gn.eslint=r==="eslint";gn.biome=r==="biome";l.linter=r;l.eslint=r==="eslint"}}else if(gn.eslint){gn.biome=false;l.linter="eslint";l.eslint=true}else if(gn.biome){gn.eslint=false;l.linter="biome";l.eslint=false}else if(a){gn.eslint=false;gn.biome=false;l.linter="none";l.eslint=false}if(!gn.reactCompiler&&!yn.includes("--no-react-compiler")&&!gn.api){if(u){gn.reactCompiler=getPrefOrDefault("reactCompiler")}else{const t=(0,Pe.blue)("React Compiler");const{reactCompiler:r}=await Te()({onState:onPromptState,type:"toggle",name:"reactCompiler",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("reactCompiler"),active:"Yes",inactive:"No"});gn.reactCompiler=Boolean(r);l.reactCompiler=Boolean(r)}}if(!gn.tailwind&&!yn.includes("--no-tailwind")&&!gn.api){if(u){gn.tailwind=getPrefOrDefault("tailwind")}else{const t=(0,Pe.blue)("Tailwind CSS");const{tailwind:r}=await Te()({onState:onPromptState,type:"toggle",name:"tailwind",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("tailwind"),active:"Yes",inactive:"No"});gn.tailwind=Boolean(r);l.tailwind=Boolean(r)}}if(!gn.srcDir&&!yn.includes("--no-src-dir")){if(u){gn.srcDir=getPrefOrDefault("srcDir")}else{const t=(0,Pe.blue)("`src/` directory");const{srcDir:r}=await Te()({onState:onPromptState,type:"toggle",name:"srcDir",message:`Would you like your code inside a ${t}?`,initial:getPrefOrDefault("srcDir"),active:"Yes",inactive:"No"});gn.srcDir=Boolean(r);l.srcDir=Boolean(r)}}if(!gn.app&&!yn.includes("--no-app")&&!gn.api){if(u){gn.app=getPrefOrDefault("app")}else{const t=(0,Pe.blue)("App Router");const{app:r}=await Te()({onState:onPromptState,type:"toggle",name:"app",message:`Would you like to use ${t}? (recommended)`,initial:getPrefOrDefault("app"),active:"Yes",inactive:"No"});gn.app=Boolean(r);l.app=Boolean(r)}}const c=/^[^*"]+\/\*\s*$/;if(typeof gn.importAlias!=="string"||!c.test(gn.importAlias)){if(u){gn.importAlias=t.importAlias}else if(yn.includes("--no-import-alias")){gn.importAlias=t.importAlias}else{const r=(0,Pe.blue)("import alias");const{customizeImportAlias:i}=await Te()({onState:onPromptState,type:"toggle",name:"customizeImportAlias",message:`Would you like to customize the ${r} (\`${t.importAlias}\` by default)?`,initial:getPrefOrDefault("customizeImportAlias"),active:"Yes",inactive:"No"});if(!i){gn.importAlias=t.importAlias}else{const{importAlias:t}=await Te()({onState:onPromptState,type:"text",name:"importAlias",message:`What ${r} would you like configured?`,initial:getPrefOrDefault("importAlias"),validate:t=>c.test(t)?true:"Import alias must follow the pattern /*"});gn.importAlias=t;l.importAlias=t}}}}const d=gn.turbopack?ln.Turbopack:gn.webpack?ln.Webpack:gn.rspack?ln.Rspack:ln.Turbopack;try{await createApp({appPath:i,packageManager:vn,example:c&&c!=="default"?c:undefined,examplePath:gn.examplePath,typescript:gn.typescript,tailwind:gn.tailwind,eslint:gn.eslint,biome:gn.biome,app:gn.app,srcDir:gn.srcDir,importAlias:gn.importAlias,skipInstall:gn.skipInstall,empty:gn.empty,api:gn.api,bundler:d,disableGit:gn.disableGit,reactCompiler:gn.reactCompiler})}catch(t){if(!(t instanceof DownloadError)){throw t}const r=await Te()({onState:onPromptState,type:"confirm",name:"builtin",message:`Could not download "${c}" because of a connectivity issue between your machine and GitHub.\n`+`Do you want to use the default template instead?`,initial:true});if(!r.builtin){throw t}await createApp({appPath:i,packageManager:vn,typescript:gn.typescript,eslint:gn.eslint,biome:gn.biome,tailwind:gn.tailwind,app:gn.app,srcDir:gn.srcDir,importAlias:gn.importAlias,skipInstall:gn.skipInstall,empty:gn.empty,bundler:d,disableGit:gn.disableGit,reactCompiler:gn.reactCompiler})}t.set("preferences",l)}const bn=ke()(cn).catch((()=>null));async function notifyUpdate(){var t;try{if((t=await bn)===null||t===void 0?void 0:t.latest){const t={npm:"npm i -g",yarn:"yarn global add",pnpm:"pnpm add -g",bun:"bun add -g"};const r=`${t[vn]} create-next-app`;console.log((0,Pe.yellow)((0,Pe.bold)("A new version of `create-next-app` is available!"))+"\n"+"You can update by running: "+(0,Pe.cyan)(r)+"\n")}process.exit(0)}catch{}}async function exit(t){console.log();console.log("Aborting installation.");if(t.command){console.log(` ${(0,Pe.cyan)(t.command)} has failed.`)}else{console.log((0,Pe.red)("Unexpected error. Please report it as a bug:")+"\n",t)}console.log();await notifyUpdate();process.exit(1)}run().then(notifyUpdate).catch(exit)})();module.exports=i})();