@turbo/gen 2.11.5-canary.5 → 2.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -3
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -119,7 +119,7 @@ ${e.format(t)}
|
|
|
119
119
|
`;function n(e,i){var a=[],s=``;typeof i==`string`?i={section:i,whitespace:!1}:(i||={},i.whitespace=i.whitespace===!0);var c=i.whitespace?` = `:`=`;return Object.keys(e).forEach(function(n,r,i){var l=e[n];l&&Array.isArray(l)?l.forEach(function(e){s+=o(n+`[]`)+c+o(e)+`
|
|
120
120
|
`}):l&&typeof l==`object`?a.push(n):s+=o(n)+c+o(l)+t}),i.section&&s.length&&(s=`[`+o(i.section)+`]`+t+s),a.forEach(function(a,o,c){var l=r(a).join(`\\.`),u=(i.section?i.section+`.`:``)+l,d=n(e[a],{section:u,whitespace:i.whitespace});s.length&&d.length&&(s+=t),s+=d}),s}function r(e){return e.replace(/\1/g,`LITERAL\\1LITERAL`).replace(/\\\./g,``).split(/\./).map(function(e){return e.replace(/\1/g,`\\.`).replace(/\2LITERAL\\1LITERAL\2/g,``)})}function i(e){var t={},n=t,i=null,a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g);return o.forEach(function(e,r,o){if(!(!e||e.match(/^\s*[;#]/))){var c=e.match(a);if(c){if(c[1]!==void 0){if(i=s(c[1]),i===`__proto__`){n={};return}n=t[i]=t[i]||{};return}var l=s(c[2]);if(l!==`__proto__`){var u=c[3]?s(c[4]):!0;switch(u){case`true`:case`false`:case`null`:u=JSON.parse(u)}if(l.length>2&&l.slice(-2)===`[]`){if(l=l.substring(0,l.length-2),l===`__proto__`)return;n[l]?Array.isArray(n[l])||(n[l]=[n[l]]):n[l]=[]}Array.isArray(n[l])?n[l].push(u):n[l]=u}}}}),Object.keys(t).filter(function(e,n,i){if(!t[e]||typeof t[e]!=`object`||Array.isArray(t[e]))return!1;var a=r(e),o=t,s=a.pop(),c=s.replace(/\\\./g,`.`);return a.forEach(function(e,t,n){e!==`__proto__`&&((!o[e]||typeof o[e]!=`object`)&&(o[e]={}),o=o[e])}),o===t&&c===s?!1:(o[c]=t[e],!0)}).forEach(function(e,n,r){delete t[e]}),t}function a(e){return e.charAt(0)===`"`&&e.slice(-1)===`"`||e.charAt(0)===`'`&&e.slice(-1)===`'`}function o(e){return typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&a(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,`\\;`).replace(/#/g,`\\#`)}function s(e,t){if(e=(e||``).trim(),a(e)){e.charAt(0)===`'`&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{for(var n=!1,r=``,i=0,o=e.length;i<o;i++){var s=e.charAt(i);if(n)`\\;#`.indexOf(s)===-1?r+=`\\`+s:r+=s,n=!1;else if(`;#`.indexOf(s)!==-1)break;else s===`\\`?n=!0:r+=s}return n&&(r+=`\\`),r.trim()}return e}}),lg=e.__commonJSMin((exports,t)=>{var n=1,r=2;function i(){return``}function a(e,t,n){return e.slice(t,n).replace(/\S/g,` `)}t.exports=function(e,t){t||={};for(var o,s,c=!1,l=!1,u=0,d=``,f=t.whitespace===!1?i:a,p=0;p<e.length;p++){if(o=e[p],s=e[p+1],!l&&o===`"`){var m=e[p-1]===`\\`&&e[p-2]!==`\\`;m||(c=!c)}if(!c){if(!l&&o+s===`//`)d+=e.slice(u,p),u=p,l=n,p++;else if(l===n&&o+s===`\r
|
|
121
121
|
`){p++,l=!1,d+=f(e,u,p),u=p;continue}else if(l===n&&o===`
|
|
122
|
-
`)l=!1,d+=f(e,u,p),u=p;else if(!l&&o+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&o+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}}return d+(l?f(e.substr(u)):e.substr(u))}}),ug=e.__commonJSMin(exports=>{var t=require(`fs`),n=cg(),r=require(`path`),i=lg(),a=exports.parse=function(e){return/^\s*{/.test(e)?JSON.parse(i(e)):n.parse(e)},o=exports.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var i=r.join.apply(null,e),a;try{return t.readFileSync(i,`utf-8`)}catch{return}},s=exports.json=function(){var e=o.apply(null,arguments);return e?a(e):null},c=exports.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var a=i.substring(r).split(`__`),o;(o=a.indexOf(``))>-1;)a.splice(o,1);var s=n;a.forEach(function(e,n){!e||typeof s!=`object`||(n===a.length-1&&(s[e]=t[i]),s[e]===void 0&&(s[e]={}),s=s[e])})}return n},l=exports.find=function(){var e=r.join.apply(null,[].slice.call(arguments));function n(e,i){var a=r.join(e,i);try{return t.statSync(a),a}catch{if(r.dirname(e)!==e)return n(r.dirname(e),i)}}return n(process.cwd(),e)}}),dg=e.__commonJSMin((exports,t)=>{function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}function a(e,t){return t===`__proto__`?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),s,c,l;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=a(e,l),s=a(t,l),s!==e)if(typeof s!=`object`||!s){e[l]=s;return}else if(Array.isArray(s)){e[l]=i(s);return}else if(n(s)){e[l]=r(s);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=o({},s);return}else{e[l]=o(c,s);return}})}),e}}),fg=e.__commonJSMin((exports,t)=>{function n(e,t){var n=e;t.slice(0,-1).forEach(function(e){n=n[e]||{}});var r=t[t.length-1];return r in n}function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}t.exports=function(e,t){t||={};var a={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(a.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?a.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){a.bools[e]=!0});var o={};function s(e){return o[e].some(function(e){return a.bools[e]})}Object.keys(t.alias||{}).forEach(function(e){o[e]=[].concat(t.alias[e]),o[e].forEach(function(t){o[t]=[e].concat(o[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){a.strings[e]=!0,o[e]&&[].concat(o[e]).forEach(function(e){a.strings[e]=!0})});var c=t.default||{},l={_:[]};function u(e,t){return a.allBools&&/^--[^=]+$/.test(t)||a.strings[e]||a.bools[e]||o[e]}function d(e,t,n){for(var r=e,o=0;o<t.length-1;o++){var s=t[o];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var c=t[t.length-1];i(r,c)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[c]===void 0||a.bools[c]||typeof r[c]==`boolean`?r[c]=n:Array.isArray(r[c])?r[c].push(n):r[c]=[r[c],n])}function f(e,t,n){if(!(n&&a.unknownFn&&!u(e,n)&&a.unknownFn(n)===!1)){var i=!a.strings[e]&&r(t)?Number(t):t;d(l,e.split(`.`),i),(o[e]||[]).forEach(function(e){d(l,e.split(`.`),i)})}}Object.keys(a.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var p=[];e.indexOf(`--`)!==-1&&(p=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));for(var m=0;m<e.length;m++){var h=e[m],g,_;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var y=v[2];a.bools[g]&&(y=y!==`false`),f(g,y,h)}else if(/^--no-.+/.test(h))g=h.match(/^--no-(.+)/)[1],f(g,!1,h);else if(/^--.+/.test(h))g=h.match(/^--(.+)/)[1],_=e[m+1],_!==void 0&&!/^(-|--)[^-]/.test(_)&&!a.bools[g]&&!a.allBools&&(!o[g]||!s(g))?(f(g,_,h),m+=1):/^(true|false)$/.test(_)?(f(g,_===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h);else if(/^-[^-]+/.test(h)){for(var b=h.slice(1,-1).split(``),x=!1,S=0;S<b.length;S++){if(_=h.slice(S+2),_===`-`){f(b[S],_,h);continue}if(/[A-Za-z]/.test(b[S])&&_[0]===`=`){f(b[S],_.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(_)){f(b[S],_,h),x=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){f(b[S],h.slice(S+2),h),x=!0;break}else f(b[S],a.strings[b[S]]?``:!0,h)}g=h.slice(-1)[0],!x&&g!==`-`&&(e[m+1]&&!/^(-|--)[^-]/.test(e[m+1])&&!a.bools[g]&&(!o[g]||!s(g))?(f(g,e[m+1],h),m+=1):e[m+1]&&/^(true|false)$/.test(e[m+1])?(f(g,e[m+1]===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h))}else if((!a.unknownFn||a.unknownFn(h)!==!1)&&l._.push(a.strings._||!r(h)?h:Number(h)),t.stopEarly){l._.push.apply(l._,e.slice(m+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(d(l,e.split(`.`),c[e]),(o[e]||[]).forEach(function(t){d(l,t.split(`.`),c[e])}))}),t[`--`]?l[`--`]=p.slice():p.forEach(function(e){l._.push(e)}),l}}),pg=e.__commonJSMin((exports,t)=>{var n=ug(),r=require(`path`).join,i=dg(),a=`/etc`,o=process.platform===`win32`,s=o?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,c,l){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);c||=fg()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},l||=n.parse;var u=n.env(e+`_`),d=[t],f=[];function p(e){if(!(f.indexOf(e)>=0)){var t=n.file(e);t&&(d.push(l(t)),f.push(e))}}return o||[r(a,e,`config`),r(a,e+`rc`)].forEach(p),s&&[r(s,`.config`,e,`config`),r(s,`.config`,e),r(s,`.`+e,`config`),r(s,`.`+e+`rc`)].forEach(p),p(n.find(`.`+e+`rc`)),u.config&&p(u.config),c.config&&p(c.config),i.apply(null,d.concat([u,c,f.length?{configs:f,config:f[f.length-1]}:void 0]))}}),mg=e.__commonJSMin((exports,t)=>{t.exports=function(e){var t=pg()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}),hg=e.__commonJSMin((exports,t)=>{var n=require(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,exports),exports.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),gg=e.__commonJSMin((exports,t)=>{let n=hg().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}function i(e){return n.from(e,`utf8`).toString(`base64`)}t.exports={decodeBase64:r,encodeBase64:i}}),_g=e.__commonJSMin((exports,t)=>{var n=require(`url`),r=gg(),i=r.decodeBase64,a=r.encodeBase64,o=`:_authToken`,s=`:username`,c=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||pg()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,l(e,t)||u(t.npmrc)};function l(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=`//`+r.host+i.replace(/\/$/,``),o=f(a,t.npmrc);if(o)return o;if(!t.recursive)return/\/$/.test(e)?void 0:l(n.resolve(e,`.`),t);r.pathname=n.resolve(d(i),`..`)||`/`}}function u(e){if(e._auth)return{token:e._auth,type:`Basic`}}function d(e){return e[e.length-1]===`/`?e:e+`/`}function f(e,t){var n=p(t[e+o]||t[e+`/`+o]);if(n)return n;var r=t[e+s]||t[e+`/`+s],i=t[e+c]||t[e+`/`+c],a=m(r,i);if(a)return a}function p(e){if(e){var t=e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]});return{token:t,type:`Bearer`}}}function m(e,t){if(!(!e||!t)){var n=i(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]})),r=a(e+`:`+n);return{token:r,type:`Basic`,password:n,username:e}}}}),vg=e.__commonJSMin((exports,t)=>{let{URL:n}=require(`url`),{join:r}=require(`path`),i=require(`fs`),{promisify:a}=require(`util`),{tmpdir:o}=require(`os`),s=mg(),c=a(i.writeFile),l=a(i.mkdir),u=a(i.readFile),d=(e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),f=e=>encodeURIComponent(e).replace(/^%40/,`@`),p=async(e,t)=>{let n=o(),a=r(n,`update-check`);i.existsSync(a)||await l(a);let s=`${e.name}-${t}.json`;return e.scope&&(s=`${e.scope}-${s}`),r(a,s)},m=async(e,t,n)=>{if(i.existsSync(e)){let r=await u(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r),o=i+n;if(o>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},h=async(e,t,n)=>{let r=JSON.stringify({latest:t,lastUpdate:n});await c(e,r,`utf8`)},g=(e,t)=>new Promise((n,r)=>{let i={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(i.headers.authorization=`${t.type} ${t.token}`);let{get:a}=e.protocol===`https:`?require(`https`):require(`http`);a(i,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,r(n),e.resume();return}let i=``;e.setEncoding(`utf8`),e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let e=JSON.parse(i);n(e)}catch(e){r(e)}})}).on(`error`,r).on(`timeout`,r)}),_=async({full:e,scope:t},r)=>{let i=s(t),a=new n(e,i),o=null;try{o=await g(a)}catch(e){if(e.code&&String(e.code).startsWith(4)){let e=_g(),t=e(i,{recursive:!0});o=await g(a,t)}else throw e}let c=o[`dist-tags`][r];if(!c)throw Error(`Distribution tag ${r} is not available`);return c},v={interval:36e5,distTag:`latest`},y=e=>{let t={full:f(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t};t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=y(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},v,t),o=await p(n,i),s=null,c=!0;({shouldCheck:c,latest:s}=await m(o,r,a)),c&&(s=await _(n,i),await h(o,s,r));let l=d(e.version,s);return l===-1?{latest:s,fromCache:!c}:null}}),yg=e.__toESM(M()),bg=e.__toESM(vg());function xg(e){let{packageInfo:t,upgradeCommand:n}=e,r=(0,bg.default)(t).catch(()=>null);return async function(e=0){try{let i=await r;if(i?.latest){Fa(),Fa(yg.default.yellow(yg.default.bold(`A new version of \`${t.name}\` is available!`)));let e=typeof n==`function`?await n():n;e&&Fa(`You can update by running: ${yg.default.cyan(e)}`),Fa()}process.exit(e)}catch(t){process.env.DEBUG&&La(`Update check failed:`,t),process.exit(e)}}}const Sg=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Cg=typeof AbortController==`function`,wg=Cg?AbortController:class{constructor(){this.signal=new Dg}abort(e=Error(`This operation was aborted`)){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:`abort`,target:this.signal})}},Tg=typeof AbortSignal==`function`,Eg=typeof wg.AbortSignal==`function`,Dg=Tg?AbortSignal:Eg?wg.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e===`abort`&&this._listeners.push(t)}removeEventListener(e,t){e===`abort`&&(this._listeners=this._listeners.filter(e=>e!==t))}},Og=new Set,kg=(e,t)=>{let n=`LRU_CACHE_OPTION_${e}`;Ng(n)&&Pg(n,`${e} option`,`options.${t}`,zg)},Ag=(e,t)=>{let n=`LRU_CACHE_METHOD_${e}`;if(Ng(n)){let{prototype:r}=zg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Pg(n,`${e} method`,`cache.${t}()`,i)}},jg=(e,t)=>{let n=`LRU_CACHE_PROPERTY_${e}`;if(Ng(n)){let{prototype:r}=zg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Pg(n,`${e} property`,`cache.${t}`,i)}},Mg=(...e)=>{typeof process==`object`&&process&&typeof process.emitWarning==`function`?process.emitWarning(...e):console.error(...e)},Ng=e=>!Og.has(e),Pg=(e,t,n,r)=>{Og.add(e);let i=`The ${t} is deprecated. Please use ${n} instead.`;Mg(i,`DeprecationWarning`,e,r)},Fg=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Ig=e=>Fg(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?Lg:null:null;var Lg=class extends Array{constructor(e){super(e),this.fill(0)}},Rg=class{constructor(e){if(e===0)return[];let t=Ig(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},zg=class e{constructor(t={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,fetchContext:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:x,ignoreFetchAbort:S}=t,{length:C,maxAge:w,stale:T}=t instanceof e?{}:t;if(n!==0&&!Fg(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?Ig(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.max=n,this.maxSize=p,this.maxEntrySize=m||this.maxSize,this.sizeCalculation=h||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(this.fetchMethod=g||null,this.fetchMethod&&typeof this.fetchMethod!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw TypeError(`cannot set fetchContext without fetchMethod`);if(this.keyMap=new Map,this.keyList=Array(n).fill(null),this.valList=Array(n).fill(null),this.next=new E(n),this.prev=new E(n),this.head=0,this.tail=0,this.free=new Rg(n),this.initialFill=1,this.size=0,typeof l==`function`&&(this.dispose=l),typeof u==`function`?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.maxSize!==0&&!Fg(this.maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!Fg(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.initializeSizeTracking()}if(this.allowStale=!!c||!!T,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Fg(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||w||0,this.ttl){if(!Fg(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let t=`LRU_CACHE_UNBOUNDED`;if(Ng(t)){Og.add(t);let n=`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`;Mg(n,`UnboundedCacheWarning`,t,e)}}T&&kg(`stale`,`allowStale`),w&&kg(`maxAge`,`ttl`),C&&kg(`length`,`sizeCalculation`)}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Lg(this.max),this.starts=new Lg(this.max),this.setItemTTL=(e,t,n=Sg.now())=>{if(this.starts[e]=t===0?0:n,this.ttls[e]=t,t!==0&&this.ttlAutopurge){let n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=this.ttls[e]===0?0:Sg.now()},this.statusTTL=(n,r)=>{n&&(n.ttl=this.ttls[r],n.start=this.starts[r],n.now=e||t(),n.remainingTTL=n.now+n.ttl-n.start)};let e=0,t=()=>{let t=Sg.now();if(this.ttlResolution>0){e=t;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{let r=this.keyMap.get(n);return r===void 0?0:this.ttls[r]===0||this.starts[r]===0?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Lg(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!Fg(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Fg(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.addItemSize=(e,t,n)=>{if(this.sizes[e]=t,this.maxSize){let t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e],n&&(n.entrySize=t,n.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`)}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;if(e(i,this.keyList[n],this))return this.get(this.keyList[n],t)}}forEach(e,t=this){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}rforEach(e,t=this){for(let n of this.rindexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}get prune(){return Ag(`prune`,`purgeStale`),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let n=this.keyList[t],r=this.valList[t],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;let a={value:i};if(this.ttls){a.ttl=this.ttls[t];let e=Sg.now()-this.starts[t];a.start=Math.floor(Date.now()-e)}this.sizes&&(a.size=this.sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=Sg.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:s=this.noUpdateTTL,status:c}={}){if(a=this.requireSize(e,t,a,o),this.maxEntrySize&&a>this.maxEntrySize)return c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,a,c),c&&(c.set=`add`),s=!1;else{this.moveToTail(l);let n=this.valList[l];if(t!==n){if(this.isBackgroundFetch(n)?n.__abortController.abort(Error(`replaced`)):i||(this.dispose(n,e,`set`),this.disposeAfter&&this.disposed.push([n,e,`set`])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,a,c),c){c.set=`replace`;let e=n&&this.isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(c.oldValue=e)}}else c&&(c.set=`update`)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),s||this.setItemTTL(l,n,r),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length===0?this.initialFill++:this.free.pop()}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.dispose(r,n,`evict`),this.disposeAfter&&this.disposed.push([r,n,`evict`])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:n}={}){let r=this.keyMap.get(e);if(r!==void 0)if(this.isStale(r))n&&(n.has=`stale`,this.statusTTL(n,r));else return t&&this.updateItemAge(r),n&&(n.has=`hit`),this.statusTTL(n,r),!0;else n&&(n.has=`miss`);return!1}peek(e,{allowStale:t=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(t||!this.isStale(n))){let e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){let i=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;let a=new wg;n.signal&&n.signal.addEventListener(`abort`,()=>a.abort(n.signal.reason));let o={signal:a.signal,options:n,context:r},s=(r,i=!1)=>{let{aborted:s}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;return n.status&&(s&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!i?l(a.signal.reason):(this.valList[t]===d&&(r===void 0?d.__staleWhileFetching?this.valList[t]=d.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,o.options))),r)},c=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)),l=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection;if(this.valList[t]===d){let n=!c||d.__staleWhileFetching===void 0;n?this.delete(e):o||(this.valList[t]=d.__staleWhileFetching)}if(s)return n.status&&d.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw r},u=(t,r)=>{this.fetchMethod(e,i,o).then(e=>t(e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(),n.allowStaleOnFetchAbort&&(t=e=>s(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(u).then(s,c);return d.__abortController=a,d.__staleWhileFetching=i,d.__returned=null,t===void 0?(this.set(e,d,{...o.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=d,d}isBackgroundFetch(e){return e&&typeof e==`object`&&typeof e.then==`function`&&Object.prototype.hasOwnProperty.call(e,`__staleWhileFetching`)&&Object.prototype.hasOwnProperty.call(e,`__returned`)&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,fetchContext:p=this.fetchContext,forceRefresh:m=!1,status:h,signal:g}={}){if(!this.fetchMethod)return h&&(h.fetch=`get`),this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:h});let _={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:a,size:o,sizeCalculation:s,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:h,signal:g},v=this.keyMap.get(e);if(v===void 0){h&&(h.fetch=`miss`);let t=this.backgroundFetch(e,v,_,p);return t.__returned=t}else{let r=this.valList[v];if(this.isBackgroundFetch(r)){let e=t&&r.__staleWhileFetching!==void 0;return h&&(h.fetch=`inflight`,e&&(h.returnedStale=!0)),e?r.__staleWhileFetching:r.__returned=r}let i=this.isStale(v);if(!m&&!i)return h&&(h.fetch=`hit`),this.moveToTail(v),n&&this.updateItemAge(v),this.statusTTL(h,v),r;let a=this.backgroundFetch(e,v,_,p),o=a.__staleWhileFetching!==void 0,s=o&&t;return h&&(h.fetch=o&&i?`stale`:`refresh`,s&&i&&(h.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:i}={}){let a=this.keyMap.get(e);if(a!==void 0){let o=this.valList[a],s=this.isBackgroundFetch(o);return this.statusTTL(i,a),this.isStale(a)?(i&&(i.get=`stale`),s?(i&&(i.returnedStale=t&&o.__staleWhileFetching!==void 0),t?o.__staleWhileFetching:void 0):(r||this.delete(e),i&&(i.returnedStale=t),t?o:void 0)):(i&&(i.get=`hit`),s?o.__staleWhileFetching:(this.moveToTail(a),n&&this.updateItemAge(a),o))}else i&&(i.get=`miss`)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Ag(`del`,`delete`),this.delete}delete(e){let t=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(n);let t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort(Error(`deleted`)):(this.dispose(t,e,`delete`),this.disposeAfter&&this.disposed.push([t,e,`delete`])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(Error(`deleted`));else{let n=this.keyList[e];this.dispose(t,n,`delete`),this.disposeAfter&&this.disposed.push([t,n,`delete`])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Ag(`reset`,`clear`),this.clear}get length(){return jg(`length`,`size`),this.size}static get AbortController(){return wg}static get AbortSignal(){return Dg}},Bg=zg,Vg={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Hg(e){try{return new URL(e)}catch{return null}}function Ug(e){var t=(typeof e==`string`?Hg(e):e)||{},n=t.protocol,r=t.host,i=t.port;if(typeof r!=`string`||!r||typeof n!=`string`||(n=n.split(`:`,1)[0],r=r.replace(/:\d*$/,``),i=parseInt(i)||Vg[n]||0,!Wg(r,i)))return``;var a=Gg(n+`_proxy`)||Gg(`all_proxy`);return a&&a.indexOf(`://`)===-1&&(a=n+`://`+a),a}function Wg(e,t){var n=Gg(`no_proxy`).toLowerCase();return n?n===`*`?!1:n.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,a=r?parseInt(r[2]):0;return a&&a!==t?!0:/^[.*]/.test(i)?(i.charAt(0)===`*`&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function Gg(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||``}var Kg=e.__toESM(e.require_src(),1);const qg=(0,Kg.default)(`proxy-agent`),Jg={http:async()=>(await Promise.resolve().then(function(){return require(`./dist-DdkgzNUT.js`)})).HttpProxyAgent,https:async()=>(await Promise.resolve().then(function(){return require(`./dist-CvKgiajH.js`)})).HttpsProxyAgent,socks:async()=>(await Promise.resolve().then(function(){return require(`./dist-DP1ccezE.js`)})).SocksProxyAgent,pac:async()=>(await Promise.resolve().then(function(){return require(`./dist-yjYO-BJe.js`)})).PacProxyAgent},Yg={http:[Jg.http,Jg.https],https:[Jg.http,Jg.https],socks:[Jg.socks,Jg.socks],socks4:[Jg.socks,Jg.socks],socks4a:[Jg.socks,Jg.socks],socks5:[Jg.socks,Jg.socks],socks5h:[Jg.socks,Jg.socks],"pac+data":[Jg.pac,Jg.pac],"pac+file":[Jg.pac,Jg.pac],"pac+ftp":[Jg.pac,Jg.pac],"pac+http":[Jg.pac,Jg.pac],"pac+https":[Jg.pac,Jg.pac]};function Xg(e){return Object.keys(Yg).includes(e)}var Zg=class extends e.Agent{constructor(e){super(e),this.cache=new Bg({max:20,dispose:e=>e.destroy()}),qg(`Creating new ProxyAgent instance: %o`,e),this.connectOpts=e,this.httpAgent=e?.httpAgent||new T.Agent(e),this.httpsAgent=e?.httpsAgent||new w.Agent(e),this.getProxyForUrl=e?.getProxyForUrl||Ug}async connect(e,t){let{secureEndpoint:n}=t,r=e.getHeader(`upgrade`)===`websocket`,i=n?r?`wss:`:`https:`:r?`ws:`:`http:`,a=e.getHeader(`host`),o=new C.URL(e.path,`${i}//${a}`).href,s=await this.getProxyForUrl(o,e);if(!s)return qg(`Proxy not enabled for URL: %o`,o),n?this.httpsAgent:this.httpAgent;qg(`Request URL: %o`,o),qg(`Proxy URL: %o`,s);let c=`${i}+${s}`,l=this.cache.get(c);if(l)qg(`Cache hit for proxy URL: %o`,s);else{let e=new C.URL(s),t=e.protocol.replace(`:`,``);if(!Xg(t))throw Error(`Unsupported protocol for proxy URL: ${s}`);let i=await Yg[t][n||r?1:0]();l=new i(s,this.connectOpts),this.cache.set(c,l)}return l}destroy(){for(let e of this.cache.values())e.destroy();super.destroy()}},Qg=`@turbo/gen`,$g=`2.11.5-canary.5`,e_=`Extend a Turborepo`,t_=`https://turborepo.dev`,n_={url:`https://github.com/vercel/turborepo/issues`},r_=`MIT`,i_={type:`git`,url:`git+https://github.com/vercel/turborepo.git`,directory:`packages/turbo-gen`},a_=`dist/cli.js`,o_=[`dist`],s_=`dist/types.d.ts`,c_={access:`public`},l_={build:`tsdown && tsc -p tsconfig.build.json`},u_={"@inquirer/prompts":`^7.10.1`,esbuild:`^0.28.1`},d_={"@arethetypeswrong/cli":`0.18.2`,"@jest/globals":`30.3.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/fs-extra":`9.0.13`,"@types/node":`18.17.4`,"@types/validate-npm-package-name":`4.0.0`,"brace-expansion":`5.0.9`,commander:`10.0.0`,"fs-extra":`10.1.0`,handlebars:`4.7.9`,jest:`30.3.0`,minimatch:`9.0.7`,"node-plop":`0.32.3`,picocolors:`1.0.1`,"proxy-agent":`8.0.2`,tsdown:`0.12.0`,typescript:`npm:@typescript/typescript6@^6.0.2`,"typescript-7":`npm:typescript@7.0.2`,"update-check":`1.5.4`,"validate-npm-package-name":`5.0.0`},f_={name:Qg,version:$g,description:e_,homepage:t_,bugs:n_,license:r_,repository:i_,bin:a_,files:o_,types:s_,publishConfig:c_,scripts:l_,dependencies:u_,devDependencies:d_},p_=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}function o(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),m_=e.__commonJSMin((exports,t)=>{function n(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
122
|
+
`)l=!1,d+=f(e,u,p),u=p;else if(!l&&o+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&o+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}}return d+(l?f(e.substr(u)):e.substr(u))}}),ug=e.__commonJSMin(exports=>{var t=require(`fs`),n=cg(),r=require(`path`),i=lg(),a=exports.parse=function(e){return/^\s*{/.test(e)?JSON.parse(i(e)):n.parse(e)},o=exports.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var i=r.join.apply(null,e),a;try{return t.readFileSync(i,`utf-8`)}catch{return}},s=exports.json=function(){var e=o.apply(null,arguments);return e?a(e):null},c=exports.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var a=i.substring(r).split(`__`),o;(o=a.indexOf(``))>-1;)a.splice(o,1);var s=n;a.forEach(function(e,n){!e||typeof s!=`object`||(n===a.length-1&&(s[e]=t[i]),s[e]===void 0&&(s[e]={}),s=s[e])})}return n},l=exports.find=function(){var e=r.join.apply(null,[].slice.call(arguments));function n(e,i){var a=r.join(e,i);try{return t.statSync(a),a}catch{if(r.dirname(e)!==e)return n(r.dirname(e),i)}}return n(process.cwd(),e)}}),dg=e.__commonJSMin((exports,t)=>{function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}function a(e,t){return t===`__proto__`?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),s,c,l;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=a(e,l),s=a(t,l),s!==e)if(typeof s!=`object`||!s){e[l]=s;return}else if(Array.isArray(s)){e[l]=i(s);return}else if(n(s)){e[l]=r(s);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=o({},s);return}else{e[l]=o(c,s);return}})}),e}}),fg=e.__commonJSMin((exports,t)=>{function n(e,t){var n=e;t.slice(0,-1).forEach(function(e){n=n[e]||{}});var r=t[t.length-1];return r in n}function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}t.exports=function(e,t){t||={};var a={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(a.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?a.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){a.bools[e]=!0});var o={};function s(e){return o[e].some(function(e){return a.bools[e]})}Object.keys(t.alias||{}).forEach(function(e){o[e]=[].concat(t.alias[e]),o[e].forEach(function(t){o[t]=[e].concat(o[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){a.strings[e]=!0,o[e]&&[].concat(o[e]).forEach(function(e){a.strings[e]=!0})});var c=t.default||{},l={_:[]};function u(e,t){return a.allBools&&/^--[^=]+$/.test(t)||a.strings[e]||a.bools[e]||o[e]}function d(e,t,n){for(var r=e,o=0;o<t.length-1;o++){var s=t[o];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var c=t[t.length-1];i(r,c)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[c]===void 0||a.bools[c]||typeof r[c]==`boolean`?r[c]=n:Array.isArray(r[c])?r[c].push(n):r[c]=[r[c],n])}function f(e,t,n){if(!(n&&a.unknownFn&&!u(e,n)&&a.unknownFn(n)===!1)){var i=!a.strings[e]&&r(t)?Number(t):t;d(l,e.split(`.`),i),(o[e]||[]).forEach(function(e){d(l,e.split(`.`),i)})}}Object.keys(a.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var p=[];e.indexOf(`--`)!==-1&&(p=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));for(var m=0;m<e.length;m++){var h=e[m],g,_;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var y=v[2];a.bools[g]&&(y=y!==`false`),f(g,y,h)}else if(/^--no-.+/.test(h))g=h.match(/^--no-(.+)/)[1],f(g,!1,h);else if(/^--.+/.test(h))g=h.match(/^--(.+)/)[1],_=e[m+1],_!==void 0&&!/^(-|--)[^-]/.test(_)&&!a.bools[g]&&!a.allBools&&(!o[g]||!s(g))?(f(g,_,h),m+=1):/^(true|false)$/.test(_)?(f(g,_===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h);else if(/^-[^-]+/.test(h)){for(var b=h.slice(1,-1).split(``),x=!1,S=0;S<b.length;S++){if(_=h.slice(S+2),_===`-`){f(b[S],_,h);continue}if(/[A-Za-z]/.test(b[S])&&_[0]===`=`){f(b[S],_.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(_)){f(b[S],_,h),x=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){f(b[S],h.slice(S+2),h),x=!0;break}else f(b[S],a.strings[b[S]]?``:!0,h)}g=h.slice(-1)[0],!x&&g!==`-`&&(e[m+1]&&!/^(-|--)[^-]/.test(e[m+1])&&!a.bools[g]&&(!o[g]||!s(g))?(f(g,e[m+1],h),m+=1):e[m+1]&&/^(true|false)$/.test(e[m+1])?(f(g,e[m+1]===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h))}else if((!a.unknownFn||a.unknownFn(h)!==!1)&&l._.push(a.strings._||!r(h)?h:Number(h)),t.stopEarly){l._.push.apply(l._,e.slice(m+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(d(l,e.split(`.`),c[e]),(o[e]||[]).forEach(function(t){d(l,t.split(`.`),c[e])}))}),t[`--`]?l[`--`]=p.slice():p.forEach(function(e){l._.push(e)}),l}}),pg=e.__commonJSMin((exports,t)=>{var n=ug(),r=require(`path`).join,i=dg(),a=`/etc`,o=process.platform===`win32`,s=o?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,c,l){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);c||=fg()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},l||=n.parse;var u=n.env(e+`_`),d=[t],f=[];function p(e){if(!(f.indexOf(e)>=0)){var t=n.file(e);t&&(d.push(l(t)),f.push(e))}}return o||[r(a,e,`config`),r(a,e+`rc`)].forEach(p),s&&[r(s,`.config`,e,`config`),r(s,`.config`,e),r(s,`.`+e,`config`),r(s,`.`+e+`rc`)].forEach(p),p(n.find(`.`+e+`rc`)),u.config&&p(u.config),c.config&&p(c.config),i.apply(null,d.concat([u,c,f.length?{configs:f,config:f[f.length-1]}:void 0]))}}),mg=e.__commonJSMin((exports,t)=>{t.exports=function(e){var t=pg()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}),hg=e.__commonJSMin((exports,t)=>{var n=require(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,exports),exports.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),gg=e.__commonJSMin((exports,t)=>{let n=hg().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}function i(e){return n.from(e,`utf8`).toString(`base64`)}t.exports={decodeBase64:r,encodeBase64:i}}),_g=e.__commonJSMin((exports,t)=>{var n=require(`url`),r=gg(),i=r.decodeBase64,a=r.encodeBase64,o=`:_authToken`,s=`:username`,c=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||pg()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,l(e,t)||u(t.npmrc)};function l(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=`//`+r.host+i.replace(/\/$/,``),o=f(a,t.npmrc);if(o)return o;if(!t.recursive)return/\/$/.test(e)?void 0:l(n.resolve(e,`.`),t);r.pathname=n.resolve(d(i),`..`)||`/`}}function u(e){if(e._auth)return{token:e._auth,type:`Basic`}}function d(e){return e[e.length-1]===`/`?e:e+`/`}function f(e,t){var n=p(t[e+o]||t[e+`/`+o]);if(n)return n;var r=t[e+s]||t[e+`/`+s],i=t[e+c]||t[e+`/`+c],a=m(r,i);if(a)return a}function p(e){if(e){var t=e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]});return{token:t,type:`Bearer`}}}function m(e,t){if(!(!e||!t)){var n=i(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]})),r=a(e+`:`+n);return{token:r,type:`Basic`,password:n,username:e}}}}),vg=e.__commonJSMin((exports,t)=>{let{URL:n}=require(`url`),{join:r}=require(`path`),i=require(`fs`),{promisify:a}=require(`util`),{tmpdir:o}=require(`os`),s=mg(),c=a(i.writeFile),l=a(i.mkdir),u=a(i.readFile),d=(e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),f=e=>encodeURIComponent(e).replace(/^%40/,`@`),p=async(e,t)=>{let n=o(),a=r(n,`update-check`);i.existsSync(a)||await l(a);let s=`${e.name}-${t}.json`;return e.scope&&(s=`${e.scope}-${s}`),r(a,s)},m=async(e,t,n)=>{if(i.existsSync(e)){let r=await u(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r),o=i+n;if(o>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},h=async(e,t,n)=>{let r=JSON.stringify({latest:t,lastUpdate:n});await c(e,r,`utf8`)},g=(e,t)=>new Promise((n,r)=>{let i={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(i.headers.authorization=`${t.type} ${t.token}`);let{get:a}=e.protocol===`https:`?require(`https`):require(`http`);a(i,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,r(n),e.resume();return}let i=``;e.setEncoding(`utf8`),e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let e=JSON.parse(i);n(e)}catch(e){r(e)}})}).on(`error`,r).on(`timeout`,r)}),_=async({full:e,scope:t},r)=>{let i=s(t),a=new n(e,i),o=null;try{o=await g(a)}catch(e){if(e.code&&String(e.code).startsWith(4)){let e=_g(),t=e(i,{recursive:!0});o=await g(a,t)}else throw e}let c=o[`dist-tags`][r];if(!c)throw Error(`Distribution tag ${r} is not available`);return c},v={interval:36e5,distTag:`latest`},y=e=>{let t={full:f(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t};t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=y(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},v,t),o=await p(n,i),s=null,c=!0;({shouldCheck:c,latest:s}=await m(o,r,a)),c&&(s=await _(n,i),await h(o,s,r));let l=d(e.version,s);return l===-1?{latest:s,fromCache:!c}:null}}),yg=e.__toESM(M()),bg=e.__toESM(vg());function xg(e){let{packageInfo:t,upgradeCommand:n}=e,r=(0,bg.default)(t).catch(()=>null);return async function(e=0){try{let i=await r;if(i?.latest){Fa(),Fa(yg.default.yellow(yg.default.bold(`A new version of \`${t.name}\` is available!`)));let e=typeof n==`function`?await n():n;e&&Fa(`You can update by running: ${yg.default.cyan(e)}`),Fa()}process.exit(e)}catch(t){process.env.DEBUG&&La(`Update check failed:`,t),process.exit(e)}}}const Sg=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Cg=typeof AbortController==`function`,wg=Cg?AbortController:class{constructor(){this.signal=new Dg}abort(e=Error(`This operation was aborted`)){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:`abort`,target:this.signal})}},Tg=typeof AbortSignal==`function`,Eg=typeof wg.AbortSignal==`function`,Dg=Tg?AbortSignal:Eg?wg.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e===`abort`&&this._listeners.push(t)}removeEventListener(e,t){e===`abort`&&(this._listeners=this._listeners.filter(e=>e!==t))}},Og=new Set,kg=(e,t)=>{let n=`LRU_CACHE_OPTION_${e}`;Ng(n)&&Pg(n,`${e} option`,`options.${t}`,zg)},Ag=(e,t)=>{let n=`LRU_CACHE_METHOD_${e}`;if(Ng(n)){let{prototype:r}=zg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Pg(n,`${e} method`,`cache.${t}()`,i)}},jg=(e,t)=>{let n=`LRU_CACHE_PROPERTY_${e}`;if(Ng(n)){let{prototype:r}=zg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Pg(n,`${e} property`,`cache.${t}`,i)}},Mg=(...e)=>{typeof process==`object`&&process&&typeof process.emitWarning==`function`?process.emitWarning(...e):console.error(...e)},Ng=e=>!Og.has(e),Pg=(e,t,n,r)=>{Og.add(e);let i=`The ${t} is deprecated. Please use ${n} instead.`;Mg(i,`DeprecationWarning`,e,r)},Fg=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Ig=e=>Fg(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?Lg:null:null;var Lg=class extends Array{constructor(e){super(e),this.fill(0)}},Rg=class{constructor(e){if(e===0)return[];let t=Ig(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},zg=class e{constructor(t={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,fetchContext:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:x,ignoreFetchAbort:S}=t,{length:C,maxAge:w,stale:T}=t instanceof e?{}:t;if(n!==0&&!Fg(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?Ig(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.max=n,this.maxSize=p,this.maxEntrySize=m||this.maxSize,this.sizeCalculation=h||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(this.fetchMethod=g||null,this.fetchMethod&&typeof this.fetchMethod!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw TypeError(`cannot set fetchContext without fetchMethod`);if(this.keyMap=new Map,this.keyList=Array(n).fill(null),this.valList=Array(n).fill(null),this.next=new E(n),this.prev=new E(n),this.head=0,this.tail=0,this.free=new Rg(n),this.initialFill=1,this.size=0,typeof l==`function`&&(this.dispose=l),typeof u==`function`?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.maxSize!==0&&!Fg(this.maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!Fg(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.initializeSizeTracking()}if(this.allowStale=!!c||!!T,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Fg(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||w||0,this.ttl){if(!Fg(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let t=`LRU_CACHE_UNBOUNDED`;if(Ng(t)){Og.add(t);let n=`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`;Mg(n,`UnboundedCacheWarning`,t,e)}}T&&kg(`stale`,`allowStale`),w&&kg(`maxAge`,`ttl`),C&&kg(`length`,`sizeCalculation`)}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Lg(this.max),this.starts=new Lg(this.max),this.setItemTTL=(e,t,n=Sg.now())=>{if(this.starts[e]=t===0?0:n,this.ttls[e]=t,t!==0&&this.ttlAutopurge){let n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=this.ttls[e]===0?0:Sg.now()},this.statusTTL=(n,r)=>{n&&(n.ttl=this.ttls[r],n.start=this.starts[r],n.now=e||t(),n.remainingTTL=n.now+n.ttl-n.start)};let e=0,t=()=>{let t=Sg.now();if(this.ttlResolution>0){e=t;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{let r=this.keyMap.get(n);return r===void 0?0:this.ttls[r]===0||this.starts[r]===0?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Lg(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!Fg(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Fg(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.addItemSize=(e,t,n)=>{if(this.sizes[e]=t,this.maxSize){let t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e],n&&(n.entrySize=t,n.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`)}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;if(e(i,this.keyList[n],this))return this.get(this.keyList[n],t)}}forEach(e,t=this){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}rforEach(e,t=this){for(let n of this.rindexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}get prune(){return Ag(`prune`,`purgeStale`),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let n=this.keyList[t],r=this.valList[t],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;let a={value:i};if(this.ttls){a.ttl=this.ttls[t];let e=Sg.now()-this.starts[t];a.start=Math.floor(Date.now()-e)}this.sizes&&(a.size=this.sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=Sg.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:s=this.noUpdateTTL,status:c}={}){if(a=this.requireSize(e,t,a,o),this.maxEntrySize&&a>this.maxEntrySize)return c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,a,c),c&&(c.set=`add`),s=!1;else{this.moveToTail(l);let n=this.valList[l];if(t!==n){if(this.isBackgroundFetch(n)?n.__abortController.abort(Error(`replaced`)):i||(this.dispose(n,e,`set`),this.disposeAfter&&this.disposed.push([n,e,`set`])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,a,c),c){c.set=`replace`;let e=n&&this.isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(c.oldValue=e)}}else c&&(c.set=`update`)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),s||this.setItemTTL(l,n,r),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length===0?this.initialFill++:this.free.pop()}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.dispose(r,n,`evict`),this.disposeAfter&&this.disposed.push([r,n,`evict`])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:n}={}){let r=this.keyMap.get(e);if(r!==void 0)if(this.isStale(r))n&&(n.has=`stale`,this.statusTTL(n,r));else return t&&this.updateItemAge(r),n&&(n.has=`hit`),this.statusTTL(n,r),!0;else n&&(n.has=`miss`);return!1}peek(e,{allowStale:t=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(t||!this.isStale(n))){let e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){let i=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;let a=new wg;n.signal&&n.signal.addEventListener(`abort`,()=>a.abort(n.signal.reason));let o={signal:a.signal,options:n,context:r},s=(r,i=!1)=>{let{aborted:s}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;return n.status&&(s&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!i?l(a.signal.reason):(this.valList[t]===d&&(r===void 0?d.__staleWhileFetching?this.valList[t]=d.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,o.options))),r)},c=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)),l=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection;if(this.valList[t]===d){let n=!c||d.__staleWhileFetching===void 0;n?this.delete(e):o||(this.valList[t]=d.__staleWhileFetching)}if(s)return n.status&&d.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw r},u=(t,r)=>{this.fetchMethod(e,i,o).then(e=>t(e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(),n.allowStaleOnFetchAbort&&(t=e=>s(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(u).then(s,c);return d.__abortController=a,d.__staleWhileFetching=i,d.__returned=null,t===void 0?(this.set(e,d,{...o.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=d,d}isBackgroundFetch(e){return e&&typeof e==`object`&&typeof e.then==`function`&&Object.prototype.hasOwnProperty.call(e,`__staleWhileFetching`)&&Object.prototype.hasOwnProperty.call(e,`__returned`)&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,fetchContext:p=this.fetchContext,forceRefresh:m=!1,status:h,signal:g}={}){if(!this.fetchMethod)return h&&(h.fetch=`get`),this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:h});let _={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:a,size:o,sizeCalculation:s,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:h,signal:g},v=this.keyMap.get(e);if(v===void 0){h&&(h.fetch=`miss`);let t=this.backgroundFetch(e,v,_,p);return t.__returned=t}else{let r=this.valList[v];if(this.isBackgroundFetch(r)){let e=t&&r.__staleWhileFetching!==void 0;return h&&(h.fetch=`inflight`,e&&(h.returnedStale=!0)),e?r.__staleWhileFetching:r.__returned=r}let i=this.isStale(v);if(!m&&!i)return h&&(h.fetch=`hit`),this.moveToTail(v),n&&this.updateItemAge(v),this.statusTTL(h,v),r;let a=this.backgroundFetch(e,v,_,p),o=a.__staleWhileFetching!==void 0,s=o&&t;return h&&(h.fetch=o&&i?`stale`:`refresh`,s&&i&&(h.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:i}={}){let a=this.keyMap.get(e);if(a!==void 0){let o=this.valList[a],s=this.isBackgroundFetch(o);return this.statusTTL(i,a),this.isStale(a)?(i&&(i.get=`stale`),s?(i&&(i.returnedStale=t&&o.__staleWhileFetching!==void 0),t?o.__staleWhileFetching:void 0):(r||this.delete(e),i&&(i.returnedStale=t),t?o:void 0)):(i&&(i.get=`hit`),s?o.__staleWhileFetching:(this.moveToTail(a),n&&this.updateItemAge(a),o))}else i&&(i.get=`miss`)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Ag(`del`,`delete`),this.delete}delete(e){let t=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(n);let t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort(Error(`deleted`)):(this.dispose(t,e,`delete`),this.disposeAfter&&this.disposed.push([t,e,`delete`])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(Error(`deleted`));else{let n=this.keyList[e];this.dispose(t,n,`delete`),this.disposeAfter&&this.disposed.push([t,n,`delete`])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Ag(`reset`,`clear`),this.clear}get length(){return jg(`length`,`size`),this.size}static get AbortController(){return wg}static get AbortSignal(){return Dg}},Bg=zg,Vg={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Hg(e){try{return new URL(e)}catch{return null}}function Ug(e){var t=(typeof e==`string`?Hg(e):e)||{},n=t.protocol,r=t.host,i=t.port;if(typeof r!=`string`||!r||typeof n!=`string`||(n=n.split(`:`,1)[0],r=r.replace(/:\d*$/,``),i=parseInt(i)||Vg[n]||0,!Wg(r,i)))return``;var a=Gg(n+`_proxy`)||Gg(`all_proxy`);return a&&a.indexOf(`://`)===-1&&(a=n+`://`+a),a}function Wg(e,t){var n=Gg(`no_proxy`).toLowerCase();return n?n===`*`?!1:n.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,a=r?parseInt(r[2]):0;return a&&a!==t?!0:/^[.*]/.test(i)?(i.charAt(0)===`*`&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function Gg(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||``}var Kg=e.__toESM(e.require_src(),1);const qg=(0,Kg.default)(`proxy-agent`),Jg={http:async()=>(await Promise.resolve().then(function(){return require(`./dist-DdkgzNUT.js`)})).HttpProxyAgent,https:async()=>(await Promise.resolve().then(function(){return require(`./dist-CvKgiajH.js`)})).HttpsProxyAgent,socks:async()=>(await Promise.resolve().then(function(){return require(`./dist-DP1ccezE.js`)})).SocksProxyAgent,pac:async()=>(await Promise.resolve().then(function(){return require(`./dist-yjYO-BJe.js`)})).PacProxyAgent},Yg={http:[Jg.http,Jg.https],https:[Jg.http,Jg.https],socks:[Jg.socks,Jg.socks],socks4:[Jg.socks,Jg.socks],socks4a:[Jg.socks,Jg.socks],socks5:[Jg.socks,Jg.socks],socks5h:[Jg.socks,Jg.socks],"pac+data":[Jg.pac,Jg.pac],"pac+file":[Jg.pac,Jg.pac],"pac+ftp":[Jg.pac,Jg.pac],"pac+http":[Jg.pac,Jg.pac],"pac+https":[Jg.pac,Jg.pac]};function Xg(e){return Object.keys(Yg).includes(e)}var Zg=class extends e.Agent{constructor(e){super(e),this.cache=new Bg({max:20,dispose:e=>e.destroy()}),qg(`Creating new ProxyAgent instance: %o`,e),this.connectOpts=e,this.httpAgent=e?.httpAgent||new T.Agent(e),this.httpsAgent=e?.httpsAgent||new w.Agent(e),this.getProxyForUrl=e?.getProxyForUrl||Ug}async connect(e,t){let{secureEndpoint:n}=t,r=e.getHeader(`upgrade`)===`websocket`,i=n?r?`wss:`:`https:`:r?`ws:`:`http:`,a=e.getHeader(`host`),o=new C.URL(e.path,`${i}//${a}`).href,s=await this.getProxyForUrl(o,e);if(!s)return qg(`Proxy not enabled for URL: %o`,o),n?this.httpsAgent:this.httpAgent;qg(`Request URL: %o`,o),qg(`Proxy URL: %o`,s);let c=`${i}+${s}`,l=this.cache.get(c);if(l)qg(`Cache hit for proxy URL: %o`,s);else{let e=new C.URL(s),t=e.protocol.replace(`:`,``);if(!Xg(t))throw Error(`Unsupported protocol for proxy URL: ${s}`);let i=await Yg[t][n||r?1:0]();l=new i(s,this.connectOpts),this.cache.set(c,l)}return l}destroy(){for(let e of this.cache.values())e.destroy();super.destroy()}},Qg=`@turbo/gen`,$g=`2.11.6`,e_=`Extend a Turborepo`,t_=`https://turborepo.dev`,n_={url:`https://github.com/vercel/turborepo/issues`},r_=`MIT`,i_={type:`git`,url:`git+https://github.com/vercel/turborepo.git`,directory:`packages/turbo-gen`},a_=`dist/cli.js`,o_=[`dist`],s_=`dist/types.d.ts`,c_={access:`public`},l_={build:`tsdown && tsc -p tsconfig.build.json`},u_={"@inquirer/prompts":`^7.10.1`,esbuild:`^0.28.1`},d_={"@arethetypeswrong/cli":`0.18.2`,"@jest/globals":`30.3.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/fs-extra":`9.0.13`,"@types/node":`18.17.4`,"@types/validate-npm-package-name":`4.0.0`,"brace-expansion":`5.0.12`,commander:`10.0.0`,"fs-extra":`10.1.0`,handlebars:`4.7.9`,jest:`30.3.0`,minimatch:`9.0.7`,"node-plop":`0.32.3`,picocolors:`1.0.1`,"proxy-agent":`8.0.2`,tsdown:`0.12.0`,typescript:`npm:@typescript/typescript6@^6.0.2`,"typescript-7":`npm:typescript@7.0.2`,"update-check":`1.5.4`,"validate-npm-package-name":`5.0.0`},f_={name:Qg,version:$g,description:e_,homepage:t_,bugs:n_,license:r_,repository:i_,bin:a_,files:o_,types:s_,publishConfig:c_,scripts:l_,dependencies:u_,devDependencies:d_},p_=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}function o(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),m_=e.__commonJSMin((exports,t)=>{function n(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
123
123
|
|
|
124
124
|
`+e.mark.snippet),r+` `+n):r}function r(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){return this.name+`: `+n(this,e)},t.exports=r}),h_=e.__commonJSMin((exports,t)=>{let n=p_();function r(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function i(e,t){return n.repeat(` `,t-e.length)+e}function a(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);let a=/\r?\n|\r|\0/g,o=[0],s=[],c,l=-1;for(;c=a.exec(e.buffer);)s.push(c.index),o.push(c.index+c[0].length),e.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);let u=``,d=Math.min(e.line+t.linesAfter,s.length).toString().length,f=t.maxLength-(t.indent+d+3);for(let a=1;a<=t.linesBefore&&!(l-a<0);a++){let c=r(e.buffer,o[l-a],s[l-a],e.position-(o[l]-o[l-a]),f);u=n.repeat(` `,t.indent)+i((e.line-a+1).toString(),d)+` | `+c.str+`
|
|
125
125
|
`+u}let p=r(e.buffer,o[l],s[l],e.position,f);u+=n.repeat(` `,t.indent)+i((e.line+1).toString(),d)+` | `+p.str+`
|
|
@@ -369,10 +369,10 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
|
|
|
369
369
|
### Created with Turborepo Generators
|
|
370
370
|
|
|
371
371
|
Read the docs at [turborepo.dev](https://turborepo.dev/docs/guides/generating-code).
|
|
372
|
-
`}]}};var $A=e.__toESM(oy());async function ej({project:e,template:t}){let n=l.default.join(e.paths.root,`turbo`,`generators`),r=`simple-${t}`,i=QA[r];if(!i)throw new AA(`Unknown template "${r}"`,{type:`config_directory_already_exists`});if(await $A.default.pathExists(n))throw new AA(`Generator config directory already exists at ${n}`,{type:`config_directory_already_exists`});for(let e of i.files){let t=l.default.join(n,e.relativePath);await $A.default.outputFile(t,e.content)}}async function tj({generator:e,project:t,opts:n}){let r=!1,i=await RA({project:t,configPath:n.config});if(!i.length){La(`No generators found.`),Fa();let{answer:e}=await ZA({message:`Would you like to add a config with a sample custom generator to ${t.name}?`});if(e){r=!0;let{answer:e}=await XA();try{await ej({project:t,template:e})}catch(e){throw e instanceof AA||La(`Failed to create generator config`),e}if(Fa(),ja(`Generator config successfully created!`),ja(`Loading generator config...`),Fa(),i=await RA({project:t,configPath:n.config}),!i.length){La(`Error loading generator`);return}}else{Fa(),Na(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`);return}}let{selectedGenerator:a}=await YA({generators:i,generator:e});try{await qA({project:t,generator:a,bypassArgs:n.args,configPath:n.config})}catch(e){if(e instanceof AA)throw e;let t=`Failed to run generator`;throw e instanceof Error&&(t=e.message),new AA(t,{type:`plop_error_running_generator`})}finally{r&&(Fa(),ja(`Congrats! You just ran your first Turborepo generator`),Na(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`))}Fa(),Ma(Ea(`>>> Success!`))}const nj=(e,t,n)=>{let r=e instanceof RegExp?rj(e,n):e,i=t instanceof RegExp?rj(t,n):t,a=r!==null&&i!=null&&ij(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},rj=(e,t)=>{let n=t.match(e);return n?n[0]:null},ij=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},aj=`\0SLASH`+Math.random()+`\0`,oj=`\0OPEN`+Math.random()+`\0`,sj=`\0CLOSE`+Math.random()+`\0`,cj=`\0COMMA`+Math.random()+`\0`,lj=`\0PERIOD`+Math.random()+`\0`,uj=new RegExp(aj,`g`),dj=new RegExp(oj,`g`),fj=new RegExp(sj,`g`),pj=new RegExp(cj,`g`),mj=new RegExp(lj,`g`),hj=/\\\\/g,gj=/\\{/g,_j=/\\}/g,vj=/\\,/g,yj=/\\\./g,bj=1e5,xj=4e6;function Sj(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Cj(e){return e.replace(hj,aj).replace(gj,oj).replace(_j,sj).replace(vj,cj).replace(yj,lj)}function wj(e){return e.replace(uj,`\\`).replace(dj,`{`).replace(fj,`}`).replace(pj,`,`).replace(mj,`.`)}function Tj(e){if(!e)return[``];let t=[],n=nj(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=Tj(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function Ej(e,t={}){if(!e)return[];let{max:n=bj,maxLength:r=xj}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),Nj(Cj(e),n,r,!0).map(wj)}function Dj(e){return`{`+e+`}`}function Oj(e){return/^-?0\d/.test(e)}function kj(e,t){return e<=t}function Aj(e,t){return e>=t}function jj(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function Mj(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=Sj(i[0]),s=Sj(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Sj(i[2])),1):1,u=kj,d=s<o;d&&(l*=-1,u=Aj);let f=i.some(Oj),p=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),f){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(p+n.length>r)break;a.push(n),p+=n.length}return a}function Nj(e,t,n,r){let i=[``],a=!1,o=!0;for(;;){let s=nj(`{`,`}`,e);if(!s)return jj(i,e,[``],t,n,a);let c=s.pre;if(/\$$/.test(c)){if(i=jj(i,c+`{`+s.body+`}`,[``],t,n,a&&!s.post.length),o=!1,!s.post.length)break;e=s.post;continue}let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=l||u,f=s.body.indexOf(`,`)>=0;if(!d&&!f){if(s.post.match(/,(?!,).*\}/)){e=s.pre+`{`+s.body+sj+s.post,r=!0;continue}return jj(i,c+`{`+s.body+`}`+s.post,[``],t,n,a)}o&&(a=r&&!d,o=!1);let p;if(d)p=Mj(s.body,u,t,n);else{let r=Tj(s.body);if(r.length===1&&r[0]!==void 0&&(r=Nj(r[0],t,n,!1).map(Dj),r.length===1)){if(i=jj(i,c+r[0],[``],t,n,a&&!s.post.length),!s.post.length)break;e=s.post;continue}let o=a&&!s.post.length&&!c;for(let e=0;o&&e<i.length;e++)i[e]&&(o=!1);p=[];let l=0;outer:for(let e=0;e<r.length;e++){let i=Nj(r[e],t,n,!1);for(let e=0;e<i.length;e++){let r=i[e];if(!(o&&!r)){if(p.length>=t||l+r.length>n)break outer;p.push(r),l+=r.length}}}}if(i=jj(i,c,p,t,n,a&&!s.post.length),!s.post.length)break;e=s.post}return i}const Pj=1024*64,Fj=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>Pj)throw TypeError(`pattern is too long`)},Ij={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},Lj=e=>e.replace(/[[\]\\-]/g,`\\$&`),Rj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),zj=e=>e.join(``),Bj=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(Ij))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(Lj(d)+`-`+Lj(t)):t===d&&r.push(Lj(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(Lj(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(Lj(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[Rj(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+zj(r)+`]`,p=`[`+(l?``:`^`)+zj(i)+`]`,m=r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p;return[m,s,u-n,!0]},Vj=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`);var Hj;const Uj=new Set([`!`,`?`,`+`,`*`,`@`]),Wj=e=>Uj.has(e),Gj=e=>Wj(e.type),Kj=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),qj=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Jj=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Yj=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),Xj=`(?!(?:^|/)\\.\\.?(?:$|/))`,Zj=`(?!\\.)`,Qj=new Set([`[`,`.`]),$j=new Set([`..`,`.`]),eM=new Set(`().*{}+?[]^$\\!`),tM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),nM=`[^/]`,rM=nM+`*?`,iM=nM+`+?`;var aM=class{type;#root;#hasMagic;#uflag=!1;#parts=[];#parent;#parentIndex;#negs;#filledNegs=!1;#options;#toString;#emptyExt=!1;constructor(e,t,n={}){this.type=e,e&&(this.#hasMagic=!0),this.#parent=t,this.#root=this.#parent?this.#parent.#root:this,this.#options=this.#root===this?n:this.#root.#options,this.#negs=this.#root===this?[]:this.#root.#negs,e===`!`&&!this.#root.#filledNegs&&this.#negs.push(this),this.#parentIndex=this.#parent?this.#parent.#parts.length:0}get hasMagic(){if(this.#hasMagic!==void 0)return this.#hasMagic;for(let e of this.#parts){if(typeof e==`string`)continue;if(e.type||e.hasMagic)return this.#hasMagic=!0}return this.#hasMagic}toString(){return this.#toString===void 0?this.type?this.#toString=this.type+`(`+this.#parts.map(e=>String(e)).join(`|`)+`)`:this.#toString=this.#parts.map(e=>String(e)).join(``):this.#toString}#fillNegs(){if(this!==this.#root)throw Error(`should only call on root`);if(this.#filledNegs)return this;this.toString(),this.#filledNegs=!0;let e;for(;e=this.#negs.pop();){if(e.type!==`!`)continue;let t=e,n=t.#parent;for(;n;){for(let r=t.#parentIndex+1;!n.type&&r<n.#parts.length;r++)for(let t of e.#parts){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#parts[r])}t=n,n=t.#parent}}return this}push(...e){for(let t of e){if(t===``)continue;if(typeof t!=`string`&&!(t instanceof Hj&&t.#parent===this))throw Error(`invalid part: `+t);this.#parts.push(t)}}toJSON(){let e=this.type===null?this.#parts.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#parts.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#root||this.#root.#filledNegs&&this.#parent?.type===`!`)&&e.push({}),e}isStart(){if(this.#root===this)return!0;if(!this.#parent?.isStart())return!1;if(this.#parentIndex===0)return!0;let e=this.#parent;for(let t=0;t<this.#parentIndex;t++){let n=e.#parts[t];if(!(n instanceof Hj&&n.type===`!`))return!1}return!0}isEnd(){if(this.#root===this||this.#parent?.type===`!`)return!0;if(!this.#parent?.isEnd())return!1;if(!this.type)return this.#parent?.isEnd();let e=this.#parent?this.#parent.#parts.length:0;return this.#parentIndex===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Hj(this.type,e);for(let e of this.#parts)t.copyIn(e);return t}static#parseAST(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}let f=!r.noext&&Wj(n)&&e.charAt(u)===`(`&&i<=a;if(f){t.push(d),d=``;let a=new Hj(n,t);u=Hj.#parseAST(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Hj(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}let m=Wj(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#canAdoptType(n));if(m){let a=t&&t.#canAdoptType(n)?0:1;d.push(p),p=``;let o=new Hj(n,d);d.push(o),u=Hj.#parseAST(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Hj(null,t);continue}if(n===`)`)return p===``&&t.#parts.length===0&&(t.#emptyExt=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#hasMagic=void 0,t.#parts=[e.substring(n-1)],u}#canAdoptWithSpace(e){return this.#canAdopt(e,qj)}#canAdopt(e,t=Kj){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null)return!1;let n=e.#parts[0];return!n||typeof n!=`object`||n.type===null?!1:this.#canAdoptType(n.type,t)}#canAdoptType(e,t=Jj){return!!t.get(this.type)?.includes(e)}#adoptWithSpace(e,t){let n=e.#parts[0],r=new Hj(null,n,this.options);r.#parts.push(``),n.push(r),this.#adopt(e,t)}#adopt(e,t){let n=e.#parts[0];this.#parts.splice(t,1,...n.#parts);for(let e of n.#parts)typeof e==`object`&&(e.#parent=this);this.#toString=void 0}#canUsurpType(e){let t=Yj.get(this.type);return!!t?.has(e)}#canUsurp(e){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null||this.#parts.length!==1)return!1;let t=e.#parts[0];return!t||typeof t!=`object`||t.type===null?!1:this.#canUsurpType(t.type)}#usurp(e){let t=Yj.get(this.type),n=e.#parts[0],r=t?.get(n.type);if(!r)return!1;this.#parts=n.#parts;for(let e of this.#parts)typeof e==`object`&&(e.#parent=this);this.type=r,this.#toString=void 0,this.#emptyExt=!1}#flatten(){if(Gj(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#parts.length;e++){let n=this.#parts[e];typeof n==`object`&&(n.#flatten(),this.#canAdopt(n)?(t=!1,this.#adopt(n,e)):this.#canAdoptWithSpace(n)?(t=!1,this.#adoptWithSpace(n,e)):this.#canUsurp(n)&&(t=!1,this.#usurp(n)))}}while(!t&&++e<10)}else for(let e of this.#parts)typeof e==`object`&&e.#flatten();this.#toString=void 0}static fromGlob(e,t={}){let n=new Hj(null,void 0,t);return Hj.#parseAST(e,n,0,t,0),n}toMMPattern(){if(this!==this.#root)return this.#root.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource(),a=r||this.#hasMagic||this.#options.nocase&&!this.#options.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase();if(!a)return n;let o=(this.#options.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,o),{_src:t,_glob:e})}get options(){return this.#options}toRegExpSource(e){let t=e??!!this.#options.dot;if(this.#root===this&&(this.#flatten(),this.#fillNegs()),!Gj(this)){let n=this.isStart()&&this.isEnd(),r=this.#parts.map(t=>{let[r,i,a,o]=typeof t==`string`?Hj.#parseGlob(t,this.#hasMagic,n):t.toRegExpSource(e);return this.#hasMagic=this.#hasMagic||a,this.#uflag=this.#uflag||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#parts[0]==`string`){let n=this.#parts.length===1&&$j.has(this.#parts[0]);if(!n){let n=Qj,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?Xj:o?Zj:``}}let a=``;this.isEnd()&&this.#root.#filledNegs&&this.#parent?.type===`!`&&(a=`(?:$|\\/)`);let o=i+r+a;return[o,Vj(r),this.#hasMagic=!!this.#hasMagic,this.#uflag]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#partsToRegExp(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#parts=[e],t.type=null,t.#hasMagic=void 0,[e,Vj(this.toString()),!1,!1]}let a=!n||e||t||!Zj?``:this.#partsToRegExp(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#emptyExt)o=(this.isStart()&&!t?Zj:``)+iM;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Zj:``)+rM+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Vj(i),this.#hasMagic=!!this.#hasMagic,this.#uflag]}#partsToRegExp(e){return this.#parts.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#uflag=this.#uflag||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#parseGlob(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(eM.has(c)?`\\`:``)+c,o=!1;continue}if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,c,l]=Bj(e,s);if(c){i+=n,a||=r,s+=c-1,t||=l,o=!1;continue}}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?iM:rM,t=!0;continue}else o=!1;if(c===`?`){i+=nM,t=!0;continue}i+=tM(c)}return[i,Vj(e),!!t,a]}};Hj=aM;const oM=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),sM=(e,t,n={})=>(Fj(t),!n.nocomment&&t.charAt(0)===`#`?!1:new WM(t,n).match(e)),cM=/^\*+([^+@!?\*\[\(]*)$/,lM=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),uM=e=>t=>t.endsWith(e),dM=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),fM=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),pM=/^\*+\.\*+$/,mM=e=>!e.startsWith(`.`)&&e.includes(`.`),hM=e=>e!==`.`&&e!==`..`&&e.includes(`.`),gM=/^\.\*+$/,_M=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),vM=/^\*+$/,yM=e=>e.length!==0&&!e.startsWith(`.`),bM=e=>e.length!==0&&e!==`.`&&e!==`..`,xM=/^\?+([^+@!?\*\[\(]*)?$/,SM=([e,t=``])=>{let n=EM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},CM=([e,t=``])=>{let n=DM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},wM=([e,t=``])=>{let n=DM([e]);return t?e=>n(e)&&e.endsWith(t):n},TM=([e,t=``])=>{let n=EM([e]);return t?e=>n(e)&&e.endsWith(t):n},EM=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},DM=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},OM=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,kM={win32:{sep:`\\`},posix:{sep:`/`}},AM=OM===`win32`?kM.win32.sep:kM.posix.sep;sM.sep=AM;const jM=Symbol(`globstar **`);sM.GLOBSTAR=jM;const MM=`[^/]`,NM=MM+`*?`,PM=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,FM=`(?:(?!(?:\\/|^)\\.).)*?`,IM=(e,t={})=>n=>sM(n,e,t);sM.filter=IM;const LM=(e,t={})=>Object.assign({},e,t),RM=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return sM;let t=sM,n=(n,r,i={})=>t(n,r,LM(e,i));return Object.assign(n,{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,LM(e,n))}static defaults(n){return t.defaults(LM(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,LM(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,LM(e,r))}},unescape:(n,r={})=>t.unescape(n,LM(e,r)),escape:(n,r={})=>t.escape(n,LM(e,r)),filter:(n,r={})=>t.filter(n,LM(e,r)),defaults:n=>t.defaults(LM(e,n)),makeRe:(n,r={})=>t.makeRe(n,LM(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,LM(e,r)),match:(n,r,i={})=>t.match(n,r,LM(e,i)),sep:t.sep,GLOBSTAR:jM})};sM.defaults=RM;const zM=(e,t={})=>(Fj(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ej(e));sM.braceExpand=zM;const BM=(e,t={})=>new WM(e,t).makeRe();sM.makeRe=BM;const VM=(e,t,n={})=>{let r=new WM(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};sM.match=VM;const HM=/[?*]|[+@!]\(.*?\)|\[|\]/,UM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var WM=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Fj(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||OM,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!HM.test(e[2]))&&!HM.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`,r=e?[`.`]:[];n.splice(i-1,2,...r),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(jM)?this.#matchGlobstar(e,t,n,r,i):this.#matchOne(e,t,n,r,i)}#matchGlobstar(e,t,n,r,i){let a=t.indexOf(jM,i),o=t.lastIndexOf(jM),[s,c,l]=[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#matchOne(t,s,n,0,0))return!1;r+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#matchOne(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#matchOne(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===jM?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#matchGlobStarBodySections(e,d,r,0,n,0,!!u)}#matchGlobStarBodySections(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){let s=this.#matchOne(e.slice(0,n+c.length),c,i,n,0);if(s&&a<this.maxGlobstarRecursion){let s=this.#matchGlobStarBodySections(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let l=e[n];if(l===`.`||l===`..`||!this.options.dot&&l.startsWith(`.`))return!1;n++}return null}#matchOne(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===jM)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return zM(this.pattern,this.options)}parse(e){Fj(e);let t=this.options;if(e===`**`)return jM;if(e===``)return``;let n,r=null;(n=e.match(vM))?r=t.dot?bM:yM:(n=e.match(cM))?r=(t.nocase?t.dot?fM:dM:t.dot?uM:lM)(n[1]):(n=e.match(xM))?r=(t.nocase?t.dot?CM:SM:t.dot?wM:TM)(n):(n=e.match(pM))?r=t.dot?hM:mM:(n=e.match(gM))&&(r=_M);let i=aM.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?NM:t.dot?PM:FM,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?UM(e):e===jM?jM:e._src});return t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==jM||a===jM||(a===void 0?i!==void 0&&i!==jM?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==jM&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=jM))}),t.filter(e=>e!==jM).join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;n.matchBase&&o.length===1&&(s=[a]);let c=this.matchOne(s,o,t);if(c)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return sM.defaults(e).Minimatch}};sM.AST=aM,sM.Minimatch=WM,sM.escape=oM,sM.unescape=Vj;var GM=e.__commonJSMin((exports,t)=>{var n=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){let n=this.delete(e);if(!n&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};t.exports=n}),KM=e.__commonJSMin((exports,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({}),i=e=>e?typeof e==`object`?e:n:r;t.exports=i}),qM=e.__commonJSMin((exports,t)=>{let n=`2.0.0`,r=256,i=2**53-1||9007199254740991,a=16,o=r-6,s=[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`];t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:i,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),JM=e.__commonJSMin((exports,t)=>{let n=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{};t.exports=n}),YM=e.__commonJSMin((exports,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=qM(),a=JM();exports=t.exports={};let o=exports.re=[],s=exports.safeRe=[],c=exports.src=[],l=exports.safeSrc=[],u=exports.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),exports.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),exports.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),exports.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)}),XM=e.__commonJSMin((exports,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},i=(e,t)=>r(t,e);t.exports={compareIdentifiers:r,rcompareIdentifiers:i}}),ZM=e.__commonJSMin((exports,t)=>{let n=JM(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=qM(),{safeRe:a,t:o}=YM(),s=KM(),{compareIdentifiers:c}=XM();var l=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};t.exports=l}),QM=e.__commonJSMin((exports,t)=>{let n=ZM(),r=(e,t,r)=>new n(e,r).compare(new n(t,r));t.exports=r}),$M=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>n(e,t,r)===0;t.exports=r}),eN=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>n(e,t,r)!==0;t.exports=r}),tN=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>n(e,t,r)>0;t.exports=r}),nN=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>n(e,t,r)>=0;t.exports=r}),rN=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>n(e,t,r)<0;t.exports=r}),iN=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>n(e,t,r)<=0;t.exports=r}),aN=e.__commonJSMin((exports,t)=>{let n=$M(),r=eN(),i=tN(),a=nN(),o=rN(),s=iN(),c=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}};t.exports=c}),oN=e.__commonJSMin((exports,t)=>{let n=Symbol(`SemVer ANY`);var r=class e{static get ANY(){return n}constructor(t,r){if(r=i(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),c(`comparator`,t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,c(`comp`,this)}parse(e){let t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new u(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new u(this.value,n).test(t.semver):(n=i(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||s(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||s(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};t.exports=r;let i=KM(),{safeRe:a,t:o}=YM(),s=aN(),c=JM(),l=ZM(),u=sN()}),sN=e.__commonJSMin((exports,t)=>{let n=/\s+/g;var r=class e{constructor(t,r){if(r=o(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof s)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!_(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=(this.options.includePrerelease&&h)|(this.options.loose&&g),n=t+`:`+e,r=a.get(n);if(r)return r;let i=this.options.loose,o=i?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease)),c(`hyphen replace`,e),e=e.replace(u[d.COMPARATORTRIM],f),c(`comparator trim`,e),e=e.replace(u[d.TILDETRIM],p),c(`tilde trim`,e),e=e.replace(u[d.CARETTRIM],m),c(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>k(e,this.options));i&&(l=l.filter(e=>(c(`loose invalid filter`,e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c(`range list`,l);let v=new Map,y=l.map(e=>new s(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return a.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}};t.exports=r;let i=GM(),a=new i,o=KM(),s=oN(),c=JM(),l=ZM(),{safeRe:u,t:d,comparatorTrimReplace:f,tildeTrimReplace:p,caretTrimReplace:m}=YM(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=qM(),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(u[d.BUILD],``),c(`comp`,e,t),e=w(e,t),c(`caret`,e),e=S(e,t),c(`tildes`,e),e=E(e,t),c(`xrange`,e),e=O(e,t),c(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{let n=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(n,(t,n,r,i,a)=>{c(`tilde`,e,t,n,r,i,a);let o;return x(n)?o=``:x(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:x(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(c(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,c(`tilde return`,o),o})},w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{c(`caret`,e,t);let n=t.loose?u[d.CARETLOOSE]:u[d.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{c(`caret`,e,t,n,i,a,o);let s;return x(n)?s=``:x(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(c(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(c(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),c(`caret return`,s),s})},E=(e,t)=>(c(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>D(e,t)).join(` `)),D=(e,t)=>{e=e.trim();let n=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{c(`xRange`,e,n,r,i,a,o,s);let l=x(i),u=l||x(a),d=u||x(o),f=d;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),o=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),c(`xRange return`,n),n})},O=(e,t)=>(c(`replaceStars`,e,t),e.trim().replace(u[d.STAR],``)),k=(e,t)=>(c(`replaceGTE0`,e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],``)),A=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),j=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(c(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}}),cN=e.__commonJSMin((exports,t)=>{let n=sN(),r=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)};t.exports=r}),lN=e.__commonJSMin((exports,t)=>{let n=cN(),r=`assert.buffer.child_process.cluster.console.constants.crypto.dgram.dns.domain.events.fs.http.https.module.net.os.path.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.tty.url.util.vm.zlib`.split(`.`),i={freelist:`<6.0.0`,v8:`>=1.0.0`,process:`>=1.1.0`,inspector:`>=8.0.0`,async_hooks:`>=8.1.0`,http2:`>=8.4.0`,perf_hooks:`>=8.5.0`,trace_events:`>=10.0.0`,worker_threads:`>=12.0.0`,"node:test":`>=18.0.0`},a={worker_threads:`>=10.5.0`,wasi:`>=12.16.0`,diagnostics_channel:`^14.17.0 || >=15.1.0`};t.exports=({version:e=process.version,experimental:t=!1}={})=>{let o=[...r];for(let[t,r]of Object.entries(i))(e===`*`||n(e,r))&&o.push(t);if(t)for(let[t,r]of Object.entries(a))!o.includes(t)&&(e===`*`||n(e,r))&&o.push(t);return o}}),uN=e.__commonJSMin((exports,t)=>{var n=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),r=lN(),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.match(/^\./)&&a.push(`name cannot start with a period`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.push(t+` is a blacklisted name`)}),r({version:`*`}).forEach(function(n){e.toLowerCase()===n&&t.push(n+` is a core module name`)}),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(n);if(s){var c=s[1],l=s[2];if(encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=a});function dN({project:e}){let t=e.workspaceData.workspaces,n=t.map(t=>l.default.relative(e.paths.root,t.paths.root)),r=new Set;for(let t of e.workspaceData.globs)if(!n.includes(t)&&!t.startsWith(`!`)){let e=t.split(`/`),n=e[0];r.add(n)}return Array.from(r)}function fN({project:e,workspace:t}){return l.default.relative(e.paths.root,t.paths.root).split(l.default.sep)[0]}function pN({project:e}){let t=dN({project:e}),n=t.includes(`apps`),r=t.includes(`packages`),i={},a=[];for(let t of e.workspaceData.workspaces){let n=fN({project:e,workspace:t});n!==`apps`&&a.push(t),n in i||(i[n]=[]),i[n].push(t)}return{hasRootApps:n,hasRootPackages:r,workspacesByGroup:i,nonAppWorkspaces:a}}function mN({project:e,type:t,showAllDependencies:n}){let r=pN({project:e}),i=[],a=e.workspaceData.workspaces;n||(t===`app`&&r.hasRootApps?a=r.workspacesByGroup.apps:t===`package`&&r.nonAppWorkspaces.length>0&&(a=r.nonAppWorkspaces));let o;for(let t of a){let n=fN({project:e,workspace:t});n!==o&&i.push(new A.Separator(n)),o=n,i.push(t)}return i}var hN=e.__toESM(oy()),gN=e.__toESM(uN());async function _N({override:e,suggestion:t,workspaceType:n}){let{validForNewPackages:r}=(0,gN.default)(e||``);if(e&&r)return{answer:e};let i=await(0,A.input)({message:`What is the name of the ${n}?`,default:t,validate:e=>{let{validForNewPackages:t}=(0,gN.default)(e);return t||`Invalid ${n} name`}});return{answer:i}}async function vN({override:e,message:t}){if(e)return{answer:e};let n=await(0,A.select)({message:t??`What type of workspace should be added?`,choices:[{name:`app`,value:`app`},{name:`package`,value:`package`}]});return{answer:n}}async function yN({workspaceType:e,workspaceName:t,destination:n,project:r}){let i=t.includes(`/`)?t.split(`/`)[1]:t;if(n){let{valid:e,root:t}=hs(n);if(e)return{absolute:t,relative:l.default.relative(r.paths.root,t)}}let a,o=pN({project:r});e===`app`&&o.hasRootApps?a=`${r.paths.root}/apps/${i}`:e===`package`&&o.hasRootPackages&&(a=`${r.paths.root}/packages/${i}`);let s=await(0,A.input)({message:`Where should "${t}" be added?`,default:a?l.default.relative(r.paths.root,a):void 0,validate:e=>{let t=l.default.join(r.paths.root,e),{valid:n,error:i}=hs(t),a=r.workspaceData.globs.some(t=>sM(e,t));return n&&a?!0:a?i??`Invalid directory`:`${e} is not a valid workspace location`}});return{absolute:l.default.join(r.paths.root,s),relative:s}}async function bN({override:e,workspaces:t,workspaceName:n}){if(e){let n=t.find(t=>t instanceof A.Separator?!1:t.name===e);if(n)return{answer:n};Ia(`Workspace "${e}" not found`),Fa()}let r=await(0,A.select)({message:`Which workspace should "${n}" start from?`,loop:!1,pageSize:25,choices:t.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e})});return{answer:r}}async function xN({workspaceName:e,project:t,workspaceSource:n,showAllDependencies:r}){let i={dependencies:{},devDependencies:{},peerDependencies:{},optionalDependencies:{}},{answer:a}=await SN({message:`Add workspace dependencies to "${e}"?`});if(!a)return i;let o=await(0,A.checkbox)({message:`Select all dependencies types to modify for "${e}"`,loop:!1,choices:[{name:`dependencies`,value:`dependencies`},{name:`devDependencies`,value:`devDependencies`},{name:`peerDependencies`,value:`peerDependencies`},{name:`optionalDependencies`,value:`optionalDependencies`}]}),s=mN({project:t,type:`package`,showAllDependencies:r}),c=n?hN.default.readJsonSync(n.paths.packageJson):void 0;for(let n of o){let r=await(0,A.checkbox)({message:`Which packages should be added as ${n} to "${e}?`,pageSize:15,loop:!1,choices:s.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e.name})}),a=c?.[n]||{};if(Object.keys(a).length){let e=new Set(Object.keys(a));for(let n of r)e.has(n)||(a[n]=t.packageManager===`pnpm`?`workspace:*`:`*`);i[n]=a}else i[n]=r.reduce((e,n)=>({...e,[n]:t.packageManager===`pnpm`?`workspace:*`:`*`}),{})}return i}async function SN({message:e}){let t=await(0,A.confirm)({message:e});return{answer:t}}async function CN({project:e,opts:t}){let n,r=t.method===`copy`&&t.copy.type===`external`?t.examplePath?.split(`/`).pop()||t.copy.source.split(`/`).pop():void 0,{answer:i}=await vN({override:t.type,message:t.method===`copy`&&t.copy.source===`external`&&r?`What type of workspace should "${r}" be created as?`:void 0}),{answer:a}=await _N({override:t.name,workspaceType:i,suggestion:r});if(t.method===`copy`&&t.copy.type===`internal`){let{answer:r}=await bN({override:t.copy.source,workspaces:mN({project:e,type:i}),workspaceName:a});n=r}let o=await yN({workspaceType:i,workspaceName:a,project:e,destination:t.destination}),s=await xN({workspaceName:a,project:e,workspaceSource:n,showAllDependencies:t.showAllDependencies});return{type:i,name:a,location:o,source:n,dependencies:s}}var wN=e.__toESM(oy()),TN=e.__toESM(M());async function EN({project:e,opts:t}){let{name:n,location:r,dependencies:i}=await CN({project:e,opts:t}),a={name:n,version:`0.0.0`,private:!0,scripts:{dev:`echo 'Add dev script here'`,build:`echo 'Add build script here'`,test:`echo 'Add test script here'`,lint:`echo 'Add lint script here'`}};for(let e of Object.keys(i)){let t=i[e];t&&Object.keys(t).length>0&&(a[e]={...a[e],...t})}wN.default.mkdirSync(r.absolute,{recursive:!0}),wN.default.writeFileSync(l.default.join(r.absolute,`package.json`),JSON.stringify(a,null,2)),wN.default.writeFileSync(l.default.join(r.absolute,`README.md`),`# \`${n}\``),Fa(),Fa(`${TN.default.bold(Ea(`>>> Success!`))} Created ${n} at "${r.relative}"`)}var DN=e.__toESM(oy()),ON=e.__toESM(M());async function kN({project:e,opts:t}){let{name:n,type:r,location:i,source:a,dependencies:o}=await CN({project:e,opts:t}),s=l.default.join(i.absolute,`package.json`);if(t.copy.type===`external`){Fa(),Ia(`Some manual modifications may be required.`),Na(`This ${r} may require local dependencies or a different package manager than what is available in this repo`),await og({appPath:i.absolute,example:t.copy.source,examplePath:t.examplePath});try{if(DN.default.existsSync(s)){let e=await DN.default.readJSON(s);if(e.workspaces)throw Error(`New workspace root detected - unexpected 'workspaces' field in package.json`)}else throw Error(`New workspace is missing a package.json file`);if(DN.default.existsSync(l.default.join(i.absolute,`pnpm-workspace.yaml`)))throw Error(`New workspace root detected - unexpected pnpm-workspace.yaml`)}catch(e){let t=`UNKNOWN_ERROR`;e instanceof Error&&(t=e.message),La(t),await DN.default.rm(i.absolute,{recursive:!0,force:!0});return}}else if(a){let e=async e=>!e.includes(`node_modules`),t=Aa(`Creating "${n}" from "${a.name}"...`);t.start(),await DN.default.copy(a.paths.root,i.absolute,{filter:e}),t.stop()}let c=await DN.default.readJSON(s);c.name=n;for(let e of Object.keys(o)){let t=o[e];t&&Object.keys(t).length>0&&(c[e]={...c[e],...t})}await DN.default.writeJSON(s,c,{spaces:2}),Fa(),Fa(`${ON.default.bold(Ea(`>>> Success!`))} Created ${n} at "${i.relative}"`)}function AN(e){let{copy:t,...n}=e,r=t===!0||typeof t==`string`?`copy`:`empty`,i=typeof t==`string`?t:``,a=typeof t==`string`&&t.startsWith(`https://`)?`external`:`internal`;return{method:r,copy:{type:a,source:i},...n}}async function jN(e){let t=await Mv(e),n=AN(e);Fa();let r={project:t,opts:n};n.method===`copy`?(n.copy.type===`external`?ja(`Copy a remote workspace from ${n.copy.source}`):ja(`Copy an existing workspace from "${t.name}"`),Fa(),await kN(r)):(ja(`Add an empty workspace to "${t.name}"`),Fa(),await EN(r))}async function MN(e,t){let n=await Mv(t);Fa(),ja(`Modify "${n.name}" using custom generators`),Fa(),await tj({generator:e,project:n,opts:t})}function NN(e){try{let t=JSON.parse(e),n={};for(let e in t){let r=sg(e,{to:`camel`});n[r]=t[e]}return n}catch(e){La(`Error parsing arguments`,e),process.exit(1)}}async function PN(e,t){if(e===`workspace`){let e=NN(t.json);e.showAllDependencies=e.showAllDependencies??!1;let n=!1,r=e.empty||!0;e.copy===``||e.copy===!0?(n=!0,r=!1):e.copy&&e.copy.length>0&&(n=e.copy,r=!1),e.copy=n,e.empty=r,await jN(e)}else if(e===`run`){let e=NN(t.json),{generatorName:n,...r}=e;await MN(n,r)}else La(`Received unknown command - "${e}" (must be one of "workspace" | "run")`),process.exit(1)}var FN=e.__toESM(M());const IN=xg({packageInfo:f_}),LN=new Zg;n.default.globalAgent=LN,r.default.globalAgent=LN;const RN=new J;RN.name(FN.default.bold(Ea(`@turbo/gen`))).description(`Extend your Turborepo`).version(f_.version,`-v, --version`,`Output the current version`).helpOption(`-h, --help`,`Display help for command`).showHelpAfterError(!1),RN.command(`run`,{isDefault:!0}).alias(`r`).description(`Run custom generators`).addArgument(new ee(`[generator-name]`,`The name of the generator to run`)).addOption(new Y(`-c, --config <config>`,`Generator configuration file (default: turbo/generators/config.js`)).addOption(new Y(`-r, --root <dir>`,`The root of your repository (default: directory with root turbo.json)`)).addOption(new Y(`-a, --args <args...>`,`Arguments passed directly to generator`).default([])).action(MN),RN.command(`workspace`).aliases([`w`]).description(`Add a new package or app to your project`).addOption(new Y(`-n, --name <workspace-name>`,`Name for the new workspace`)).addOption(new Y(`-b, --empty`,`Generate an empty workspace`).conflicts(`copy`).default(!0)).addOption(new Y(`-c, --copy [source]`,`Generate a workspace using an existing workspace as a template. Can be the name of a local workspace
|
|
372
|
+
`}]}};var $A=e.__toESM(oy());async function ej({project:e,template:t}){let n=l.default.join(e.paths.root,`turbo`,`generators`),r=`simple-${t}`,i=QA[r];if(!i)throw new AA(`Unknown template "${r}"`,{type:`config_directory_already_exists`});if(await $A.default.pathExists(n))throw new AA(`Generator config directory already exists at ${n}`,{type:`config_directory_already_exists`});for(let e of i.files){let t=l.default.join(n,e.relativePath);await $A.default.outputFile(t,e.content)}}async function tj({generator:e,project:t,opts:n}){let r=!1,i=await RA({project:t,configPath:n.config});if(!i.length){La(`No generators found.`),Fa();let{answer:e}=await ZA({message:`Would you like to add a config with a sample custom generator to ${t.name}?`});if(e){r=!0;let{answer:e}=await XA();try{await ej({project:t,template:e})}catch(e){throw e instanceof AA||La(`Failed to create generator config`),e}if(Fa(),ja(`Generator config successfully created!`),ja(`Loading generator config...`),Fa(),i=await RA({project:t,configPath:n.config}),!i.length){La(`Error loading generator`);return}}else{Fa(),Na(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`);return}}let{selectedGenerator:a}=await YA({generators:i,generator:e});try{await qA({project:t,generator:a,bypassArgs:n.args,configPath:n.config})}catch(e){if(e instanceof AA)throw e;let t=`Failed to run generator`;throw e instanceof Error&&(t=e.message),new AA(t,{type:`plop_error_running_generator`})}finally{r&&(Fa(),ja(`Congrats! You just ran your first Turborepo generator`),Na(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`))}Fa(),Ma(Ea(`>>> Success!`))}const nj=(e,t,n)=>{let r=e instanceof RegExp?rj(e,n):e,i=t instanceof RegExp?rj(t,n):t,a=r!==null&&i!=null&&ij(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},rj=(e,t)=>{let n=t.match(e);return n?n[0]:null},ij=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},aj=`\0SLASH`+Math.random()+`\0`,oj=`\0OPEN`+Math.random()+`\0`,sj=`\0CLOSE`+Math.random()+`\0`,cj=`\0COMMA`+Math.random()+`\0`,lj=`\0PERIOD`+Math.random()+`\0`,uj=new RegExp(aj,`g`),dj=new RegExp(oj,`g`),fj=new RegExp(sj,`g`),pj=new RegExp(cj,`g`),mj=new RegExp(lj,`g`),hj=/\\\\/g,gj=/\\{/g,_j=/\\}/g,vj=/\\,/g,yj=/\\\./g,bj=1e5,xj=4e6,Sj=1e3,Cj=1e3;function wj(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Tj(e){return e.replace(hj,aj).replace(gj,oj).replace(_j,sj).replace(vj,cj).replace(yj,lj)}function Ej(e){return e.replace(uj,`\\`).replace(dj,`{`).replace(fj,`}`).replace(pj,`,`).replace(mj,`.`)}function Dj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Oj(e){let t=[],n=``;for(;;){let r=nj(`{`,`}`,e);if(!r){let r=e.split(`,`);return r[0]=n+r[0],Dj(t,r),t}let{pre:i,body:a,post:o}=r,s=i.split(`,`);if(s[0]=n+s[0],s[s.length-1]+=`{`+a+`}`,!o.length)return Dj(t,s),t;n=s.pop(),Dj(t,s),e=o}}function kj(e,t={}){if(!e)return[];let{max:n=bj,maxLength:r=xj,maxDepth:i=Sj,maxRewrites:a=Cj}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),Ij(Tj(e),n,r,i,0,a,!0).map(Ej)}function Aj(e){return`{`+e+`}`}function jj(e){return/^-?0\d/.test(e)}function Mj(e,t){return e<=t}function Nj(e,t){return e>=t}function Pj(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function Fj(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=wj(i[0]),s=wj(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(wj(i[2])),1):1,u=Mj,d=s<o;d&&(l*=-1,u=Nj);let f=i.some(jj),p=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),f){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(p+n.length>r)break;a.push(n),p+=n.length}return a}function Ij(e,t,n,r,i,a,o){if(i>r)return[e];let s=[``],c=0,l=!1,u=!0;for(;;){let d=nj(`{`,`}`,e);if(!d)return Pj(s,e,[``],t,n,l);let f=d.pre;if(/\$$/.test(f)){if(s=Pj(s,f+`{`+d.body+`}`,[``],t,n,l&&!d.post.length),u=!1,!d.post.length)break;e=d.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),m=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),h=p||m,g=d.body.indexOf(`,`)>=0;if(!h&&!g){if(c<a&&d.post.match(/,(?!,).*\}/)){c++,e=d.pre+`{`+d.body+sj+d.post,o=!0;continue}return Pj(s,f+`{`+d.body+`}`+d.post,[``],t,n,l)}u&&(l=o&&!h,u=!1);let _;if(h)_=Fj(d.body,m,t,n);else{let o=Oj(d.body);if(o.length===1&&o[0]!==void 0&&(o=Ij(o[0],t,n,r,i+1,a,!1).map(Aj),o.length===1)){if(s=Pj(s,f+o[0],[``],t,n,l&&!d.post.length),!d.post.length)break;e=d.post;continue}let c=l&&!d.post.length&&!f;for(let e=0;c&&e<s.length;e++)s[e]&&(c=!1);_=[];let u=0;outer:for(let e=0;e<o.length;e++){let s=Ij(o[e],t,n,r,i+1,a,!1);for(let e=0;e<s.length;e++){let r=s[e];if(!(c&&!r)){if(_.length>=t||u+r.length>n)break outer;_.push(r),u+=r.length}}}}if(s=Pj(s,f,_,t,n,l&&!d.post.length),!d.post.length)break;e=d.post}return s}const Lj=1024*64,Rj=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>Lj)throw TypeError(`pattern is too long`)},zj={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},Bj=e=>e.replace(/[[\]\\-]/g,`\\$&`),Vj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Hj=e=>e.join(``),Uj=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(zj))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(Bj(d)+`-`+Bj(t)):t===d&&r.push(Bj(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(Bj(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(Bj(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[Vj(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+Hj(r)+`]`,p=`[`+(l?``:`^`)+Hj(i)+`]`,m=r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p;return[m,s,u-n,!0]},Wj=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`);var Gj;const Kj=new Set([`!`,`?`,`+`,`*`,`@`]),qj=e=>Kj.has(e),Jj=e=>qj(e.type),Yj=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Xj=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Zj=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Qj=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),$j=`(?!(?:^|/)\\.\\.?(?:$|/))`,eM=`(?!\\.)`,tM=new Set([`[`,`.`]),nM=new Set([`..`,`.`]),rM=new Set(`().*{}+?[]^$\\!`),iM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),aM=`[^/]`,oM=aM+`*?`,sM=aM+`+?`;var cM=class{type;#root;#hasMagic;#uflag=!1;#parts=[];#parent;#parentIndex;#negs;#filledNegs=!1;#options;#toString;#emptyExt=!1;constructor(e,t,n={}){this.type=e,e&&(this.#hasMagic=!0),this.#parent=t,this.#root=this.#parent?this.#parent.#root:this,this.#options=this.#root===this?n:this.#root.#options,this.#negs=this.#root===this?[]:this.#root.#negs,e===`!`&&!this.#root.#filledNegs&&this.#negs.push(this),this.#parentIndex=this.#parent?this.#parent.#parts.length:0}get hasMagic(){if(this.#hasMagic!==void 0)return this.#hasMagic;for(let e of this.#parts){if(typeof e==`string`)continue;if(e.type||e.hasMagic)return this.#hasMagic=!0}return this.#hasMagic}toString(){return this.#toString===void 0?this.type?this.#toString=this.type+`(`+this.#parts.map(e=>String(e)).join(`|`)+`)`:this.#toString=this.#parts.map(e=>String(e)).join(``):this.#toString}#fillNegs(){if(this!==this.#root)throw Error(`should only call on root`);if(this.#filledNegs)return this;this.toString(),this.#filledNegs=!0;let e;for(;e=this.#negs.pop();){if(e.type!==`!`)continue;let t=e,n=t.#parent;for(;n;){for(let r=t.#parentIndex+1;!n.type&&r<n.#parts.length;r++)for(let t of e.#parts){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#parts[r])}t=n,n=t.#parent}}return this}push(...e){for(let t of e){if(t===``)continue;if(typeof t!=`string`&&!(t instanceof Gj&&t.#parent===this))throw Error(`invalid part: `+t);this.#parts.push(t)}}toJSON(){let e=this.type===null?this.#parts.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#parts.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#root||this.#root.#filledNegs&&this.#parent?.type===`!`)&&e.push({}),e}isStart(){if(this.#root===this)return!0;if(!this.#parent?.isStart())return!1;if(this.#parentIndex===0)return!0;let e=this.#parent;for(let t=0;t<this.#parentIndex;t++){let n=e.#parts[t];if(!(n instanceof Gj&&n.type===`!`))return!1}return!0}isEnd(){if(this.#root===this||this.#parent?.type===`!`)return!0;if(!this.#parent?.isEnd())return!1;if(!this.type)return this.#parent?.isEnd();let e=this.#parent?this.#parent.#parts.length:0;return this.#parentIndex===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Gj(this.type,e);for(let e of this.#parts)t.copyIn(e);return t}static#parseAST(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}let f=!r.noext&&qj(n)&&e.charAt(u)===`(`&&i<=a;if(f){t.push(d),d=``;let a=new Gj(n,t);u=Gj.#parseAST(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Gj(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}let m=qj(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#canAdoptType(n));if(m){let a=t&&t.#canAdoptType(n)?0:1;d.push(p),p=``;let o=new Gj(n,d);d.push(o),u=Gj.#parseAST(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Gj(null,t);continue}if(n===`)`)return p===``&&t.#parts.length===0&&(t.#emptyExt=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#hasMagic=void 0,t.#parts=[e.substring(n-1)],u}#canAdoptWithSpace(e){return this.#canAdopt(e,Xj)}#canAdopt(e,t=Yj){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null)return!1;let n=e.#parts[0];return!n||typeof n!=`object`||n.type===null?!1:this.#canAdoptType(n.type,t)}#canAdoptType(e,t=Zj){return!!t.get(this.type)?.includes(e)}#adoptWithSpace(e,t){let n=e.#parts[0],r=new Gj(null,n,this.options);r.#parts.push(``),n.push(r),this.#adopt(e,t)}#adopt(e,t){let n=e.#parts[0];this.#parts.splice(t,1,...n.#parts);for(let e of n.#parts)typeof e==`object`&&(e.#parent=this);this.#toString=void 0}#canUsurpType(e){let t=Qj.get(this.type);return!!t?.has(e)}#canUsurp(e){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null||this.#parts.length!==1)return!1;let t=e.#parts[0];return!t||typeof t!=`object`||t.type===null?!1:this.#canUsurpType(t.type)}#usurp(e){let t=Qj.get(this.type),n=e.#parts[0],r=t?.get(n.type);if(!r)return!1;this.#parts=n.#parts;for(let e of this.#parts)typeof e==`object`&&(e.#parent=this);this.type=r,this.#toString=void 0,this.#emptyExt=!1}#flatten(){if(Jj(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#parts.length;e++){let n=this.#parts[e];typeof n==`object`&&(n.#flatten(),this.#canAdopt(n)?(t=!1,this.#adopt(n,e)):this.#canAdoptWithSpace(n)?(t=!1,this.#adoptWithSpace(n,e)):this.#canUsurp(n)&&(t=!1,this.#usurp(n)))}}while(!t&&++e<10)}else for(let e of this.#parts)typeof e==`object`&&e.#flatten();this.#toString=void 0}static fromGlob(e,t={}){let n=new Gj(null,void 0,t);return Gj.#parseAST(e,n,0,t,0),n}toMMPattern(){if(this!==this.#root)return this.#root.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource(),a=r||this.#hasMagic||this.#options.nocase&&!this.#options.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase();if(!a)return n;let o=(this.#options.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,o),{_src:t,_glob:e})}get options(){return this.#options}toRegExpSource(e){let t=e??!!this.#options.dot;if(this.#root===this&&(this.#flatten(),this.#fillNegs()),!Jj(this)){let n=this.isStart()&&this.isEnd(),r=this.#parts.map(t=>{let[r,i,a,o]=typeof t==`string`?Gj.#parseGlob(t,this.#hasMagic,n):t.toRegExpSource(e);return this.#hasMagic=this.#hasMagic||a,this.#uflag=this.#uflag||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#parts[0]==`string`){let n=this.#parts.length===1&&nM.has(this.#parts[0]);if(!n){let n=tM,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?$j:o?eM:``}}let a=``;this.isEnd()&&this.#root.#filledNegs&&this.#parent?.type===`!`&&(a=`(?:$|\\/)`);let o=i+r+a;return[o,Wj(r),this.#hasMagic=!!this.#hasMagic,this.#uflag]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#partsToRegExp(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#parts=[e],t.type=null,t.#hasMagic=void 0,[e,Wj(this.toString()),!1,!1]}let a=!n||e||t||!eM?``:this.#partsToRegExp(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#emptyExt)o=(this.isStart()&&!t?eM:``)+sM;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?eM:``)+oM+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Wj(i),this.#hasMagic=!!this.#hasMagic,this.#uflag]}#partsToRegExp(e){return this.#parts.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#uflag=this.#uflag||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#parseGlob(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(rM.has(c)?`\\`:``)+c,o=!1;continue}if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,c,l]=Uj(e,s);if(c){i+=n,a||=r,s+=c-1,t||=l,o=!1;continue}}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?sM:oM,t=!0;continue}else o=!1;if(c===`?`){i+=aM,t=!0;continue}i+=iM(c)}return[i,Wj(e),!!t,a]}};Gj=cM;const lM=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),uM=(e,t,n={})=>(Rj(t),!n.nocomment&&t.charAt(0)===`#`?!1:new qM(t,n).match(e)),dM=/^\*+([^+@!?\*\[\(]*)$/,fM=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),pM=e=>t=>t.endsWith(e),mM=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),hM=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),gM=/^\*+\.\*+$/,_M=e=>!e.startsWith(`.`)&&e.includes(`.`),vM=e=>e!==`.`&&e!==`..`&&e.includes(`.`),yM=/^\.\*+$/,bM=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),xM=/^\*+$/,SM=e=>e.length!==0&&!e.startsWith(`.`),CM=e=>e.length!==0&&e!==`.`&&e!==`..`,wM=/^\?+([^+@!?\*\[\(]*)?$/,TM=([e,t=``])=>{let n=kM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},EM=([e,t=``])=>{let n=AM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},DM=([e,t=``])=>{let n=AM([e]);return t?e=>n(e)&&e.endsWith(t):n},OM=([e,t=``])=>{let n=kM([e]);return t?e=>n(e)&&e.endsWith(t):n},kM=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},AM=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},jM=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,MM={win32:{sep:`\\`},posix:{sep:`/`}},NM=jM===`win32`?MM.win32.sep:MM.posix.sep;uM.sep=NM;const PM=Symbol(`globstar **`);uM.GLOBSTAR=PM;const FM=`[^/]`,IM=FM+`*?`,LM=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,RM=`(?:(?!(?:\\/|^)\\.).)*?`,zM=(e,t={})=>n=>uM(n,e,t);uM.filter=zM;const BM=(e,t={})=>Object.assign({},e,t),VM=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return uM;let t=uM,n=(n,r,i={})=>t(n,r,BM(e,i));return Object.assign(n,{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,BM(e,n))}static defaults(n){return t.defaults(BM(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,BM(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,BM(e,r))}},unescape:(n,r={})=>t.unescape(n,BM(e,r)),escape:(n,r={})=>t.escape(n,BM(e,r)),filter:(n,r={})=>t.filter(n,BM(e,r)),defaults:n=>t.defaults(BM(e,n)),makeRe:(n,r={})=>t.makeRe(n,BM(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,BM(e,r)),match:(n,r,i={})=>t.match(n,r,BM(e,i)),sep:t.sep,GLOBSTAR:PM})};uM.defaults=VM;const HM=(e,t={})=>(Rj(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:kj(e));uM.braceExpand=HM;const UM=(e,t={})=>new qM(e,t).makeRe();uM.makeRe=UM;const WM=(e,t,n={})=>{let r=new qM(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};uM.match=WM;const GM=/[?*]|[+@!]\(.*?\)|\[|\]/,KM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var qM=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Rj(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||jM,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!GM.test(e[2]))&&!GM.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`,r=e?[`.`]:[];n.splice(i-1,2,...r),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(PM)?this.#matchGlobstar(e,t,n,r,i):this.#matchOne(e,t,n,r,i)}#matchGlobstar(e,t,n,r,i){let a=t.indexOf(PM,i),o=t.lastIndexOf(PM),[s,c,l]=[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#matchOne(t,s,n,0,0))return!1;r+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#matchOne(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#matchOne(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===PM?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#matchGlobStarBodySections(e,d,r,0,n,0,!!u)}#matchGlobStarBodySections(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){let s=this.#matchOne(e.slice(0,n+c.length),c,i,n,0);if(s&&a<this.maxGlobstarRecursion){let s=this.#matchGlobStarBodySections(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let l=e[n];if(l===`.`||l===`..`||!this.options.dot&&l.startsWith(`.`))return!1;n++}return null}#matchOne(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===PM)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return HM(this.pattern,this.options)}parse(e){Rj(e);let t=this.options;if(e===`**`)return PM;if(e===``)return``;let n,r=null;(n=e.match(xM))?r=t.dot?CM:SM:(n=e.match(dM))?r=(t.nocase?t.dot?hM:mM:t.dot?pM:fM)(n[1]):(n=e.match(wM))?r=(t.nocase?t.dot?EM:TM:t.dot?DM:OM)(n):(n=e.match(gM))?r=t.dot?vM:_M:(n=e.match(yM))&&(r=bM);let i=cM.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?IM:t.dot?LM:RM,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?KM(e):e===PM?PM:e._src});return t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==PM||a===PM||(a===void 0?i!==void 0&&i!==PM?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==PM&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=PM))}),t.filter(e=>e!==PM).join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;n.matchBase&&o.length===1&&(s=[a]);let c=this.matchOne(s,o,t);if(c)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return uM.defaults(e).Minimatch}};uM.AST=cM,uM.Minimatch=qM,uM.escape=lM,uM.unescape=Wj;var JM=e.__commonJSMin((exports,t)=>{var n=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){let n=this.delete(e);if(!n&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};t.exports=n}),YM=e.__commonJSMin((exports,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({}),i=e=>e?typeof e==`object`?e:n:r;t.exports=i}),XM=e.__commonJSMin((exports,t)=>{let n=`2.0.0`,r=256,i=2**53-1||9007199254740991,a=16,o=r-6,s=[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`];t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:i,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),ZM=e.__commonJSMin((exports,t)=>{let n=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{};t.exports=n}),QM=e.__commonJSMin((exports,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=XM(),a=ZM();exports=t.exports={};let o=exports.re=[],s=exports.safeRe=[],c=exports.src=[],l=exports.safeSrc=[],u=exports.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),exports.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),exports.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),exports.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)}),$M=e.__commonJSMin((exports,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},i=(e,t)=>r(t,e);t.exports={compareIdentifiers:r,rcompareIdentifiers:i}}),eN=e.__commonJSMin((exports,t)=>{let n=ZM(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=XM(),{safeRe:a,t:o}=QM(),s=YM(),{compareIdentifiers:c}=$M();var l=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};t.exports=l}),tN=e.__commonJSMin((exports,t)=>{let n=eN(),r=(e,t,r)=>new n(e,r).compare(new n(t,r));t.exports=r}),nN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)===0;t.exports=r}),rN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)!==0;t.exports=r}),iN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)>0;t.exports=r}),aN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)>=0;t.exports=r}),oN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)<0;t.exports=r}),sN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)<=0;t.exports=r}),cN=e.__commonJSMin((exports,t)=>{let n=nN(),r=rN(),i=iN(),a=aN(),o=oN(),s=sN(),c=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}};t.exports=c}),lN=e.__commonJSMin((exports,t)=>{let n=Symbol(`SemVer ANY`);var r=class e{static get ANY(){return n}constructor(t,r){if(r=i(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),c(`comparator`,t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,c(`comp`,this)}parse(e){let t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new u(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new u(this.value,n).test(t.semver):(n=i(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||s(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||s(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};t.exports=r;let i=YM(),{safeRe:a,t:o}=QM(),s=cN(),c=ZM(),l=eN(),u=uN()}),uN=e.__commonJSMin((exports,t)=>{let n=/\s+/g;var r=class e{constructor(t,r){if(r=o(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof s)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!_(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=(this.options.includePrerelease&&h)|(this.options.loose&&g),n=t+`:`+e,r=a.get(n);if(r)return r;let i=this.options.loose,o=i?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease)),c(`hyphen replace`,e),e=e.replace(u[d.COMPARATORTRIM],f),c(`comparator trim`,e),e=e.replace(u[d.TILDETRIM],p),c(`tilde trim`,e),e=e.replace(u[d.CARETTRIM],m),c(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>k(e,this.options));i&&(l=l.filter(e=>(c(`loose invalid filter`,e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c(`range list`,l);let v=new Map,y=l.map(e=>new s(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return a.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}};t.exports=r;let i=JM(),a=new i,o=YM(),s=lN(),c=ZM(),l=eN(),{safeRe:u,t:d,comparatorTrimReplace:f,tildeTrimReplace:p,caretTrimReplace:m}=QM(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=XM(),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(u[d.BUILD],``),c(`comp`,e,t),e=w(e,t),c(`caret`,e),e=S(e,t),c(`tildes`,e),e=E(e,t),c(`xrange`,e),e=O(e,t),c(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{let n=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(n,(t,n,r,i,a)=>{c(`tilde`,e,t,n,r,i,a);let o;return x(n)?o=``:x(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:x(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(c(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,c(`tilde return`,o),o})},w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{c(`caret`,e,t);let n=t.loose?u[d.CARETLOOSE]:u[d.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{c(`caret`,e,t,n,i,a,o);let s;return x(n)?s=``:x(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(c(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(c(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),c(`caret return`,s),s})},E=(e,t)=>(c(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>D(e,t)).join(` `)),D=(e,t)=>{e=e.trim();let n=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{c(`xRange`,e,n,r,i,a,o,s);let l=x(i),u=l||x(a),d=u||x(o),f=d;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),o=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),c(`xRange return`,n),n})},O=(e,t)=>(c(`replaceStars`,e,t),e.trim().replace(u[d.STAR],``)),k=(e,t)=>(c(`replaceGTE0`,e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],``)),A=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),j=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(c(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}}),dN=e.__commonJSMin((exports,t)=>{let n=uN(),r=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)};t.exports=r}),fN=e.__commonJSMin((exports,t)=>{let n=dN(),r=`assert.buffer.child_process.cluster.console.constants.crypto.dgram.dns.domain.events.fs.http.https.module.net.os.path.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.tty.url.util.vm.zlib`.split(`.`),i={freelist:`<6.0.0`,v8:`>=1.0.0`,process:`>=1.1.0`,inspector:`>=8.0.0`,async_hooks:`>=8.1.0`,http2:`>=8.4.0`,perf_hooks:`>=8.5.0`,trace_events:`>=10.0.0`,worker_threads:`>=12.0.0`,"node:test":`>=18.0.0`},a={worker_threads:`>=10.5.0`,wasi:`>=12.16.0`,diagnostics_channel:`^14.17.0 || >=15.1.0`};t.exports=({version:e=process.version,experimental:t=!1}={})=>{let o=[...r];for(let[t,r]of Object.entries(i))(e===`*`||n(e,r))&&o.push(t);if(t)for(let[t,r]of Object.entries(a))!o.includes(t)&&(e===`*`||n(e,r))&&o.push(t);return o}}),pN=e.__commonJSMin((exports,t)=>{var n=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),r=fN(),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.match(/^\./)&&a.push(`name cannot start with a period`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.push(t+` is a blacklisted name`)}),r({version:`*`}).forEach(function(n){e.toLowerCase()===n&&t.push(n+` is a core module name`)}),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(n);if(s){var c=s[1],l=s[2];if(encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=a});function mN({project:e}){let t=e.workspaceData.workspaces,n=t.map(t=>l.default.relative(e.paths.root,t.paths.root)),r=new Set;for(let t of e.workspaceData.globs)if(!n.includes(t)&&!t.startsWith(`!`)){let e=t.split(`/`),n=e[0];r.add(n)}return Array.from(r)}function hN({project:e,workspace:t}){return l.default.relative(e.paths.root,t.paths.root).split(l.default.sep)[0]}function gN({project:e}){let t=mN({project:e}),n=t.includes(`apps`),r=t.includes(`packages`),i={},a=[];for(let t of e.workspaceData.workspaces){let n=hN({project:e,workspace:t});n!==`apps`&&a.push(t),n in i||(i[n]=[]),i[n].push(t)}return{hasRootApps:n,hasRootPackages:r,workspacesByGroup:i,nonAppWorkspaces:a}}function _N({project:e,type:t,showAllDependencies:n}){let r=gN({project:e}),i=[],a=e.workspaceData.workspaces;n||(t===`app`&&r.hasRootApps?a=r.workspacesByGroup.apps:t===`package`&&r.nonAppWorkspaces.length>0&&(a=r.nonAppWorkspaces));let o;for(let t of a){let n=hN({project:e,workspace:t});n!==o&&i.push(new A.Separator(n)),o=n,i.push(t)}return i}var vN=e.__toESM(oy()),yN=e.__toESM(pN());async function bN({override:e,suggestion:t,workspaceType:n}){let{validForNewPackages:r}=(0,yN.default)(e||``);if(e&&r)return{answer:e};let i=await(0,A.input)({message:`What is the name of the ${n}?`,default:t,validate:e=>{let{validForNewPackages:t}=(0,yN.default)(e);return t||`Invalid ${n} name`}});return{answer:i}}async function xN({override:e,message:t}){if(e)return{answer:e};let n=await(0,A.select)({message:t??`What type of workspace should be added?`,choices:[{name:`app`,value:`app`},{name:`package`,value:`package`}]});return{answer:n}}async function SN({workspaceType:e,workspaceName:t,destination:n,project:r}){let i=t.includes(`/`)?t.split(`/`)[1]:t;if(n){let{valid:e,root:t}=hs(n);if(e)return{absolute:t,relative:l.default.relative(r.paths.root,t)}}let a,o=gN({project:r});e===`app`&&o.hasRootApps?a=`${r.paths.root}/apps/${i}`:e===`package`&&o.hasRootPackages&&(a=`${r.paths.root}/packages/${i}`);let s=await(0,A.input)({message:`Where should "${t}" be added?`,default:a?l.default.relative(r.paths.root,a):void 0,validate:e=>{let t=l.default.join(r.paths.root,e),{valid:n,error:i}=hs(t),a=r.workspaceData.globs.some(t=>uM(e,t));return n&&a?!0:a?i??`Invalid directory`:`${e} is not a valid workspace location`}});return{absolute:l.default.join(r.paths.root,s),relative:s}}async function CN({override:e,workspaces:t,workspaceName:n}){if(e){let n=t.find(t=>t instanceof A.Separator?!1:t.name===e);if(n)return{answer:n};Ia(`Workspace "${e}" not found`),Fa()}let r=await(0,A.select)({message:`Which workspace should "${n}" start from?`,loop:!1,pageSize:25,choices:t.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e})});return{answer:r}}async function wN({workspaceName:e,project:t,workspaceSource:n,showAllDependencies:r}){let i={dependencies:{},devDependencies:{},peerDependencies:{},optionalDependencies:{}},{answer:a}=await TN({message:`Add workspace dependencies to "${e}"?`});if(!a)return i;let o=await(0,A.checkbox)({message:`Select all dependencies types to modify for "${e}"`,loop:!1,choices:[{name:`dependencies`,value:`dependencies`},{name:`devDependencies`,value:`devDependencies`},{name:`peerDependencies`,value:`peerDependencies`},{name:`optionalDependencies`,value:`optionalDependencies`}]}),s=_N({project:t,type:`package`,showAllDependencies:r}),c=n?vN.default.readJsonSync(n.paths.packageJson):void 0;for(let n of o){let r=await(0,A.checkbox)({message:`Which packages should be added as ${n} to "${e}?`,pageSize:15,loop:!1,choices:s.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e.name})}),a=c?.[n]||{};if(Object.keys(a).length){let e=new Set(Object.keys(a));for(let n of r)e.has(n)||(a[n]=t.packageManager===`pnpm`?`workspace:*`:`*`);i[n]=a}else i[n]=r.reduce((e,n)=>({...e,[n]:t.packageManager===`pnpm`?`workspace:*`:`*`}),{})}return i}async function TN({message:e}){let t=await(0,A.confirm)({message:e});return{answer:t}}async function EN({project:e,opts:t}){let n,r=t.method===`copy`&&t.copy.type===`external`?t.examplePath?.split(`/`).pop()||t.copy.source.split(`/`).pop():void 0,{answer:i}=await xN({override:t.type,message:t.method===`copy`&&t.copy.source===`external`&&r?`What type of workspace should "${r}" be created as?`:void 0}),{answer:a}=await bN({override:t.name,workspaceType:i,suggestion:r});if(t.method===`copy`&&t.copy.type===`internal`){let{answer:r}=await CN({override:t.copy.source,workspaces:_N({project:e,type:i}),workspaceName:a});n=r}let o=await SN({workspaceType:i,workspaceName:a,project:e,destination:t.destination}),s=await wN({workspaceName:a,project:e,workspaceSource:n,showAllDependencies:t.showAllDependencies});return{type:i,name:a,location:o,source:n,dependencies:s}}var DN=e.__toESM(oy()),ON=e.__toESM(M());async function kN({project:e,opts:t}){let{name:n,location:r,dependencies:i}=await EN({project:e,opts:t}),a={name:n,version:`0.0.0`,private:!0,scripts:{dev:`echo 'Add dev script here'`,build:`echo 'Add build script here'`,test:`echo 'Add test script here'`,lint:`echo 'Add lint script here'`}};for(let e of Object.keys(i)){let t=i[e];t&&Object.keys(t).length>0&&(a[e]={...a[e],...t})}DN.default.mkdirSync(r.absolute,{recursive:!0}),DN.default.writeFileSync(l.default.join(r.absolute,`package.json`),JSON.stringify(a,null,2)),DN.default.writeFileSync(l.default.join(r.absolute,`README.md`),`# \`${n}\``),Fa(),Fa(`${ON.default.bold(Ea(`>>> Success!`))} Created ${n} at "${r.relative}"`)}var AN=e.__toESM(oy()),jN=e.__toESM(M());async function MN({project:e,opts:t}){let{name:n,type:r,location:i,source:a,dependencies:o}=await EN({project:e,opts:t}),s=l.default.join(i.absolute,`package.json`);if(t.copy.type===`external`){Fa(),Ia(`Some manual modifications may be required.`),Na(`This ${r} may require local dependencies or a different package manager than what is available in this repo`),await og({appPath:i.absolute,example:t.copy.source,examplePath:t.examplePath});try{if(AN.default.existsSync(s)){let e=await AN.default.readJSON(s);if(e.workspaces)throw Error(`New workspace root detected - unexpected 'workspaces' field in package.json`)}else throw Error(`New workspace is missing a package.json file`);if(AN.default.existsSync(l.default.join(i.absolute,`pnpm-workspace.yaml`)))throw Error(`New workspace root detected - unexpected pnpm-workspace.yaml`)}catch(e){let t=`UNKNOWN_ERROR`;e instanceof Error&&(t=e.message),La(t),await AN.default.rm(i.absolute,{recursive:!0,force:!0});return}}else if(a){let e=async e=>!e.includes(`node_modules`),t=Aa(`Creating "${n}" from "${a.name}"...`);t.start(),await AN.default.copy(a.paths.root,i.absolute,{filter:e}),t.stop()}let c=await AN.default.readJSON(s);c.name=n;for(let e of Object.keys(o)){let t=o[e];t&&Object.keys(t).length>0&&(c[e]={...c[e],...t})}await AN.default.writeJSON(s,c,{spaces:2}),Fa(),Fa(`${jN.default.bold(Ea(`>>> Success!`))} Created ${n} at "${i.relative}"`)}function NN(e){let{copy:t,...n}=e,r=t===!0||typeof t==`string`?`copy`:`empty`,i=typeof t==`string`?t:``,a=typeof t==`string`&&t.startsWith(`https://`)?`external`:`internal`;return{method:r,copy:{type:a,source:i},...n}}async function PN(e){let t=await Mv(e),n=NN(e);Fa();let r={project:t,opts:n};n.method===`copy`?(n.copy.type===`external`?ja(`Copy a remote workspace from ${n.copy.source}`):ja(`Copy an existing workspace from "${t.name}"`),Fa(),await MN(r)):(ja(`Add an empty workspace to "${t.name}"`),Fa(),await kN(r))}async function FN(e,t){let n=await Mv(t);Fa(),ja(`Modify "${n.name}" using custom generators`),Fa(),await tj({generator:e,project:n,opts:t})}function IN(e){try{let t=JSON.parse(e),n={};for(let e in t){let r=sg(e,{to:`camel`});n[r]=t[e]}return n}catch(e){La(`Error parsing arguments`,e),process.exit(1)}}async function LN(e,t){if(e===`workspace`){let e=IN(t.json);e.showAllDependencies=e.showAllDependencies??!1;let n=!1,r=e.empty||!0;e.copy===``||e.copy===!0?(n=!0,r=!1):e.copy&&e.copy.length>0&&(n=e.copy,r=!1),e.copy=n,e.empty=r,await PN(e)}else if(e===`run`){let e=IN(t.json),{generatorName:n,...r}=e;await FN(n,r)}else La(`Received unknown command - "${e}" (must be one of "workspace" | "run")`),process.exit(1)}var RN=e.__toESM(M());const zN=xg({packageInfo:f_}),BN=new Zg;n.default.globalAgent=BN,r.default.globalAgent=BN;const VN=new J;VN.name(RN.default.bold(Ea(`@turbo/gen`))).description(`Extend your Turborepo`).version(f_.version,`-v, --version`,`Output the current version`).helpOption(`-h, --help`,`Display help for command`).showHelpAfterError(!1),VN.command(`run`,{isDefault:!0}).alias(`r`).description(`Run custom generators`).addArgument(new ee(`[generator-name]`,`The name of the generator to run`)).addOption(new Y(`-c, --config <config>`,`Generator configuration file (default: turbo/generators/config.js`)).addOption(new Y(`-r, --root <dir>`,`The root of your repository (default: directory with root turbo.json)`)).addOption(new Y(`-a, --args <args...>`,`Arguments passed directly to generator`).default([])).action(FN),VN.command(`workspace`).aliases([`w`]).description(`Add a new package or app to your project`).addOption(new Y(`-n, --name <workspace-name>`,`Name for the new workspace`)).addOption(new Y(`-b, --empty`,`Generate an empty workspace`).conflicts(`copy`).default(!0)).addOption(new Y(`-c, --copy [source]`,`Generate a workspace using an existing workspace as a template. Can be the name of a local workspace
|
|
373
373
|
within your monorepo, or a fully qualified GitHub URL with any branch and/or subdirectory.
|
|
374
374
|
`).conflicts(`empty`)).addOption(new Y(`-d, --destination <dir>`,`Where the new workspace should be created`)).addOption(new Y(`-t, --type <type>`,`The type of workspace to create`).choices([`app`,`package`])).addOption(new Y(`-r, --root <dir>`,`The root of your repository (default: directory with root turbo.json)`)).addOption(new Y(`-p, --example-path <path-to-example>`,`In a rare case, your GitHub URL might contain a branch name with
|
|
375
375
|
a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).
|
|
376
376
|
In this case, you must specify the path to the example separately:
|
|
377
377
|
--example-path foo/bar
|
|
378
|
-
`).implies({copy:!0})).addOption(new Y(`--show-all-dependencies`,`Do not filter available dependencies by the workspace type`).default(!1)).action(
|
|
378
|
+
`).implies({copy:!0})).addOption(new Y(`--show-all-dependencies`,`Do not filter available dependencies by the workspace type`).default(!1)).action(PN),VN.command(`raw`,{hidden:!0}).argument(`<type>`,`The type of generator to run`).addOption(new Y(`--json <arguments>`,`Arguments as raw JSON`)).action(LN),VN.parseAsync().then(()=>zN()).catch(async e=>{e?.name===`ExitPromptError`&&process.exit(0),Fa(),e instanceof AA?La(e.message):(La(`Unexpected error. Please report it as a bug:`),Fa(e)),Fa(),await zN(1)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turbo/gen",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.6",
|
|
4
4
|
"description": "Extend a Turborepo",
|
|
5
5
|
"homepage": "https://turborepo.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@turbo/test-utils": "0.0.0",
|
|
33
33
|
"@turbo/tsconfig": "0.0.0",
|
|
34
34
|
"@turbo/utils": "0.0.0",
|
|
35
|
-
"@turbo/workspaces": "2.11.
|
|
35
|
+
"@turbo/workspaces": "2.11.6",
|
|
36
36
|
"@types/fs-extra": "9.0.13",
|
|
37
37
|
"@types/node": "18.17.4",
|
|
38
38
|
"@types/validate-npm-package-name": "4.0.0",
|
|
39
|
-
"brace-expansion": "5.0.
|
|
39
|
+
"brace-expansion": "5.0.12",
|
|
40
40
|
"commander": "10.0.0",
|
|
41
41
|
"fs-extra": "10.1.0",
|
|
42
42
|
"handlebars": "4.7.9",
|