@jsrepo/migrate 0.0.1-beta.8 → 0.0.2

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/README.md CHANGED
@@ -15,5 +15,5 @@ pnpm dlx @jsrepo/migrate v3
15
15
  ```
16
16
 
17
17
  - Migrates your `jsrepo-build-config.json` and `jsrepo.json` files into the new `jsrepo.config.ts` file.
18
- - Installs `jsrepo@beta` and the correct formatting transform (if you were using one)
18
+ - Installs `jsrepo` and the correct formatting transform (if you were using one)
19
19
  - Builds your registry using both v2 and v3 to ensure compatibility
package/dist/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Command as e,Option as t,program as n}from"commander";import r,{existsSync as i,lstatSync as a,readdirSync as o}from"node:fs";import s,{cwd as c,stdin as l,stdout as u}from"node:process";import*as d from"node:readline";import f from"node:readline";import{ReadStream as p}from"node:tty";import m,{delimiter as h,dirname as g,join as _,normalize as v,resolve as y}from"node:path";import{stripVTControlCharacters as b}from"node:util";import{DEFAULT_PROVIDERS as x}from"jsrepo/providers";import{resolveRegistries as S}from"jsrepo/utils";import C from"node:fs/promises";import w from"node:os";import{createRequire as ee}from"module";import{spawn as T}from"node:child_process";import{PassThrough as te}from"node:stream";var ne=Object.create,re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyNames,oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ae(t),a=0,o=i.length,s;a<o;a++)s=i[a],!se.call(e,s)&&s!==n&&re(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ie(t,s))||r.enumerable});return e},D=(e,t,n)=>(n=e==null?{}:ne(oe(e)),ce(t||!e||!e.__esModule?re(n,`default`,{value:e,enumerable:!0}):n,e)),le=`@jsrepo/migrate`,O=`Automatically migrate your jsrepo project to the newest version of jsrepo.`,ue=`0.0.1-beta.8`,de=E(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),fe=E(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),pe=D(de(),1),k=D(fe(),1);const me=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,he=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ge=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,_e=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ve=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ye=/\t{1,1000}/y,be=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,xe=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Se=/\p{M}+/gu,Ce={limit:1/0,ellipsis:``},we=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?we(i,Ce,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(Se,``)){let t=e.codePointAt(0)||0;if(w=he(t)?d:ge(t)?p:l!==f&&me(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(xe.lastIndex=h,xe.test(e)){if(_=xe.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=xe.lastIndex;continue}if(_e.lastIndex=h,_e.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=_e.lastIndex;continue}if(ve.lastIndex=h,ve.test(e)){if(_=ve.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ve.lastIndex;continue}if(ye.lastIndex=h,ye.test(e)){if(_=ye.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ye.lastIndex;continue}if(be.lastIndex=h,be.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=be.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},Te={limit:1/0,ellipsis:``,ellipsisWidth:0},Ee=(e,t={})=>we(e,Te,t).width,De=`]8;;`,Oe=RegExp(`(?:\\[(?<code>\\d+)m|\\${De}(?<uri>.*))`,`y`),ke=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ae=e=>`[${e}m`,je=e=>`${De}${e}`,Me=e=>e.map(e=>Ee(e)),Ne=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:Ee(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=Ee(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(De,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Pe=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Ee(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Fe=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=Me(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=Ee(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),Ne(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){Ne(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){Ne(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Pe(e)));let l=c.join(`
2
+ import{Command as e,Option as t,program as n}from"commander";import r,{existsSync as i,lstatSync as a,readdirSync as o}from"node:fs";import s,{cwd as c,stdin as l,stdout as u}from"node:process";import*as d from"node:readline";import f from"node:readline";import{ReadStream as p}from"node:tty";import m,{delimiter as h,dirname as g,join as _,normalize as v,resolve as y}from"node:path";import{stripVTControlCharacters as b}from"node:util";import{DEFAULT_PROVIDERS as x}from"jsrepo/providers";import{resolveRegistries as S}from"jsrepo/utils";import C from"node:fs/promises";import w from"node:os";import{createRequire as ee}from"module";import{spawn as T}from"node:child_process";import{PassThrough as te}from"node:stream";var ne=Object.create,re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,ae=Object.getOwnPropertyNames,oe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ae(t),a=0,o=i.length,s;a<o;a++)s=i[a],!se.call(e,s)&&s!==n&&re(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ie(t,s))||r.enumerable});return e},D=(e,t,n)=>(n=e==null?{}:ne(oe(e)),ce(t||!e||!e.__esModule?re(n,`default`,{value:e,enumerable:!0}):n,e)),le=`@jsrepo/migrate`,O=`Automatically migrate your jsrepo project to the newest version of jsrepo.`,ue=`0.0.2`,de=E(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),fe=E(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),pe=D(de(),1),k=D(fe(),1);const me=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,he=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ge=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,_e=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ve=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ye=/\t{1,1000}/y,be=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,xe=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Se=/\p{M}+/gu,Ce={limit:1/0,ellipsis:``},we=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?we(i,Ce,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(Se,``)){let t=e.codePointAt(0)||0;if(w=he(t)?d:ge(t)?p:l!==f&&me(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(xe.lastIndex=h,xe.test(e)){if(_=xe.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=xe.lastIndex;continue}if(_e.lastIndex=h,_e.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=_e.lastIndex;continue}if(ve.lastIndex=h,ve.test(e)){if(_=ve.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ve.lastIndex;continue}if(ye.lastIndex=h,ye.test(e)){if(_=ye.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ye.lastIndex;continue}if(be.lastIndex=h,be.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=be.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},Te={limit:1/0,ellipsis:``,ellipsisWidth:0},Ee=(e,t={})=>we(e,Te,t).width,De=`]8;;`,Oe=RegExp(`(?:\\[(?<code>\\d+)m|\\${De}(?<uri>.*))`,`y`),ke=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ae=e=>`[${e}m`,je=e=>`${De}${e}`,Me=e=>e.map(e=>Ee(e)),Ne=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:Ee(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=Ee(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(De,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Pe=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Ee(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Fe=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=Me(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=Ee(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),Ne(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){Ne(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){Ne(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Pe(e)));let l=c.join(`
3
3
  `),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===`›`){Oe.lastIndex=p+1;let e=Oe.exec(l)?.groups;if(e?.code!==void 0){let t=Number.parseFloat(e.code);i=t===39?void 0:t}else e?.uri!==void 0&&(a=e.uri.length===0?void 0:e.uri)}let n=i?ke(i):void 0;t===`
4
4
  `?(a&&(r+=je(``)),i&&n&&(r+=Ae(n))):e===`
5
5
  `&&(i&&n&&(r+=Ae(i)),a&&(r+=je(a))),p+=e.length,d=f,f=u.next()}return r};function Ie(e,t,n){return String(e).normalize().replaceAll(`\r
@@ -75,8 +75,8 @@ ${A.default.cyan(it)}
75
75
 
76
76
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Gn,s=!Mn.jitless,c=s&&Kn.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?ca([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function da(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!sr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ur(e,r,Nn())))}),t)}const fa=P(`$ZodUnion`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),F(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),F(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),F(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Rn(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>da(t,i,e,a)):da(s,i,e,a)}}),pa=P(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ha(e,t,n)):ha(e,i,a)}});function ma(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qn(e)&&qn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ma(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ma(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ha(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),sr(e))return e;let r=ma(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const ga=P(`$ZodTuple`,(e,t)=>{R.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length},input:o,inst:e,origin:`array`}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>_a(e,i,c))):_a(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>_a(e,i,c))):_a(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function _a(e,t,n){e.issues.length&&t.issues.push(...cr(n,e.issues)),t.value[n]=e.value}const va=P(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!qn(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...cr(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...cr(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ur(e,r,Nn())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...cr(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...cr(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),ya=P(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=Pn(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Yn.has(typeof e)).map(e=>typeof e==`string`?Xn(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ba=P(`$ZodLiteral`,(e,t)=>{if(R.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Xn(e):e?Xn(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),xa=P(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jn(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new An;return n.value=i,n}});function Sa(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ca=P(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Rn(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Sa(t,e.value)):Sa(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),wa=P(`$ZodNullable`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),F(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Rn(e.source)}|null)$`):void 0}),F(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ta=P(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ea(e,t)):Ea(r,t)}});function Ea(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Da=P(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Oa=P(`$ZodNonOptional`,(e,t)=>{R.init(e,t),F(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ka(t,e)):ka(i,e)}});function ka(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Aa=P(`$ZodCatch`,(e,t)=>{R.init(e,t),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),F(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ur(e,n,Nn()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ur(e,n,Nn()))},input:e.value}),e.issues=[]),e)}}),ja=P(`$ZodPipe`,(e,t)=>{R.init(e,t),F(e._zod,`values`,()=>t.in._zod.values),F(e._zod,`optin`,()=>t.in._zod.optin),F(e._zod,`optout`,()=>t.out._zod.optout),F(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ma(e,t.in,n)):Ma(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ma(e,t.out,n)):Ma(r,t.out,n)}});function Ma(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Na=P(`$ZodReadonly`,(e,t)=>{R.init(e,t),F(e._zod,`propValues`,()=>t.innerType._zod.propValues),F(e._zod,`values`,()=>t.innerType._zod.values),F(e._zod,`optin`,()=>t.innerType._zod.optin),F(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Pa):Pa(r)}});function Pa(e){return e.value=Object.freeze(e.value),e}const Fa=P(`$ZodCustom`,(e,t)=>{L.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ia(t,n,r,e));Ia(i,n,r,e)}});function Ia(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(fr(e))}}var La=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ra(){return new La}const za=Ra();function Ba(e,t){return new e({type:`string`,...I(t)})}function Va(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function Ha(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Ua(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function Wa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Ga(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function Ka(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function qa(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function Ja(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function Ya(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function Xa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function Za(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function Qa(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function $a(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function eo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function to(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function no(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function ro(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function io(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function ao(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function oo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function so(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function co(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function lo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function uo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function fo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function po(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function mo(e,t){return new e({type:`number`,checks:[],...I(t)})}function ho(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function go(e,t){return new e({type:`boolean`,...I(t)})}function _o(e){return new e({type:`unknown`})}function vo(e,t){return new e({type:`never`,...I(t)})}function yo(e,t){return new li({check:`less_than`,...I(t),value:e,inclusive:!1})}function bo(e,t){return new li({check:`less_than`,...I(t),value:e,inclusive:!0})}function xo(e,t){return new ui({check:`greater_than`,...I(t),value:e,inclusive:!1})}function So(e,t){return new ui({check:`greater_than`,...I(t),value:e,inclusive:!0})}function Co(e,t){return new di({check:`multiple_of`,...I(t),value:e})}function wo(e,t){return new pi({check:`max_length`,...I(t),maximum:e})}function To(e,t){return new mi({check:`min_length`,...I(t),minimum:e})}function Eo(e,t){return new hi({check:`length_equals`,...I(t),length:e})}function Do(e,t){return new _i({check:`string_format`,format:`regex`,...I(t),pattern:e})}function Oo(e){return new vi({check:`string_format`,format:`lowercase`,...I(e)})}function ko(e){return new yi({check:`string_format`,format:`uppercase`,...I(e)})}function Ao(e,t){return new bi({check:`string_format`,format:`includes`,...I(t),includes:e})}function jo(e,t){return new xi({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function Mo(e,t){return new Si({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function No(e){return new Ci({check:`overwrite`,tx:e})}function Po(e){return No(t=>t.normalize(e))}function Fo(){return No(e=>e.trim())}function Io(){return No(e=>e.toLowerCase())}function Lo(){return No(e=>e.toUpperCase())}function Ro(e,t,n){return new e({type:`array`,element:t,...I(n)})}function zo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function Bo(e){let t=Vo(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(fr(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(fr(r))}},e(n.value,n)));return t}function Vo(e,t){let n=new L({check:`custom`,...I(t)});return n._zod.check=e,n}const Ho=P(`ZodISODateTime`,(e,t)=>{Ri.init(e,t),U.init(e,t)});function Uo(e){return lo(Ho,e)}const Wo=P(`ZodISODate`,(e,t)=>{zi.init(e,t),U.init(e,t)});function Go(e){return uo(Wo,e)}const Ko=P(`ZodISOTime`,(e,t)=>{Bi.init(e,t),U.init(e,t)});function qo(e){return fo(Ko,e)}const Jo=P(`ZodISODuration`,(e,t)=>{Vi.init(e,t),U.init(e,t)});function Yo(e){return po(Jo,e)}const Xo=(e,t)=>{mr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_r(e,t)},flatten:{value:t=>gr(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fn,2)}},isEmpty:{get(){return e.issues.length===0}}})};P(`ZodError`,Xo);const B=P(`ZodError`,Xo,{Parent:Error}),Zo=vr(B),Qo=yr(B),$o=br(B),es=Sr(B),ts=wr(B),ns=Tr(B),rs=Er(B),is=Dr(B),as=Or(B),os=kr(B),ss=Ar(B),cs=jr(B),V=P(`ZodType`,(e,t)=>(R.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Hn(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>Zn(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Zo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>$o(e,t,n),e.parseAsync=async(t,n)=>Qo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>es(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ts(e,t,n),e.decode=(t,n)=>ns(e,t,n),e.encodeAsync=async(t,n)=>rs(e,t,n),e.decodeAsync=async(t,n)=>is(e,t,n),e.safeEncode=(t,n)=>as(e,t,n),e.safeDecode=(t,n)=>os(e,t,n),e.safeEncodeAsync=async(t,n)=>ss(e,t,n),e.safeDecodeAsync=async(t,n)=>cs(e,t,n),e.refine=(t,n)=>e.check(vc(t,n)),e.superRefine=t=>e.check(yc(t)),e.overwrite=t=>e.check(No(t)),e.optional=()=>nc(e),e.nullable=()=>ic(e),e.nullish=()=>nc(ic(e)),e.nonoptional=t=>uc(e,t),e.array=()=>G(e),e.or=t=>Hs([e,t]),e.and=t=>Ws(e,t),e.transform=t=>mc(e,ec(t)),e.default=t=>oc(e,t),e.prefault=t=>cc(e,t),e.catch=t=>fc(e,t),e.pipe=t=>mc(e,t),e.readonly=()=>gc(e),e.describe=t=>{let n=e.clone();return za.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return za.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return za.get(e);let n=e.clone();return za.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ls=P(`_ZodString`,(e,t)=>{Ei.init(e,t),V.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Do(...t)),e.includes=(...t)=>e.check(Ao(...t)),e.startsWith=(...t)=>e.check(jo(...t)),e.endsWith=(...t)=>e.check(Mo(...t)),e.min=(...t)=>e.check(To(...t)),e.max=(...t)=>e.check(wo(...t)),e.length=(...t)=>e.check(Eo(...t)),e.nonempty=(...t)=>e.check(To(1,...t)),e.lowercase=t=>e.check(Oo(t)),e.uppercase=t=>e.check(ko(t)),e.trim=()=>e.check(Fo()),e.normalize=(...t)=>e.check(Po(...t)),e.toLowerCase=()=>e.check(Io()),e.toUpperCase=()=>e.check(Lo())}),us=P(`ZodString`,(e,t)=>{Ei.init(e,t),ls.init(e,t),e.email=t=>e.check(Va(ds,t)),e.url=t=>e.check(qa(ms,t)),e.jwt=t=>e.check(co(ks,t)),e.emoji=t=>e.check(Ja(hs,t)),e.guid=t=>e.check(Ha(fs,t)),e.uuid=t=>e.check(Ua(ps,t)),e.uuidv4=t=>e.check(Wa(ps,t)),e.uuidv6=t=>e.check(Ga(ps,t)),e.uuidv7=t=>e.check(Ka(ps,t)),e.nanoid=t=>e.check(Ya(gs,t)),e.guid=t=>e.check(Ha(fs,t)),e.cuid=t=>e.check(Xa(_s,t)),e.cuid2=t=>e.check(Za(vs,t)),e.ulid=t=>e.check(Qa(ys,t)),e.base64=t=>e.check(ao(Es,t)),e.base64url=t=>e.check(oo(Ds,t)),e.xid=t=>e.check($a(bs,t)),e.ksuid=t=>e.check(eo(xs,t)),e.ipv4=t=>e.check(to(Ss,t)),e.ipv6=t=>e.check(no(Cs,t)),e.cidrv4=t=>e.check(ro(ws,t)),e.cidrv6=t=>e.check(io(Ts,t)),e.e164=t=>e.check(so(Os,t)),e.datetime=t=>e.check(Uo(t)),e.date=t=>e.check(Go(t)),e.time=t=>e.check(qo(t)),e.duration=t=>e.check(Yo(t))});function H(e){return Ba(us,e)}const U=P(`ZodStringFormat`,(e,t)=>{z.init(e,t),ls.init(e,t)}),ds=P(`ZodEmail`,(e,t)=>{ki.init(e,t),U.init(e,t)}),fs=P(`ZodGUID`,(e,t)=>{Di.init(e,t),U.init(e,t)}),ps=P(`ZodUUID`,(e,t)=>{Oi.init(e,t),U.init(e,t)}),ms=P(`ZodURL`,(e,t)=>{Ai.init(e,t),U.init(e,t)}),hs=P(`ZodEmoji`,(e,t)=>{ji.init(e,t),U.init(e,t)}),gs=P(`ZodNanoID`,(e,t)=>{Mi.init(e,t),U.init(e,t)}),_s=P(`ZodCUID`,(e,t)=>{Ni.init(e,t),U.init(e,t)}),vs=P(`ZodCUID2`,(e,t)=>{Pi.init(e,t),U.init(e,t)}),ys=P(`ZodULID`,(e,t)=>{Fi.init(e,t),U.init(e,t)}),bs=P(`ZodXID`,(e,t)=>{Ii.init(e,t),U.init(e,t)}),xs=P(`ZodKSUID`,(e,t)=>{Li.init(e,t),U.init(e,t)}),Ss=P(`ZodIPv4`,(e,t)=>{Hi.init(e,t),U.init(e,t)}),Cs=P(`ZodIPv6`,(e,t)=>{Ui.init(e,t),U.init(e,t)}),ws=P(`ZodCIDRv4`,(e,t)=>{Wi.init(e,t),U.init(e,t)}),Ts=P(`ZodCIDRv6`,(e,t)=>{Gi.init(e,t),U.init(e,t)}),Es=P(`ZodBase64`,(e,t)=>{qi.init(e,t),U.init(e,t)}),Ds=P(`ZodBase64URL`,(e,t)=>{Yi.init(e,t),U.init(e,t)}),Os=P(`ZodE164`,(e,t)=>{Xi.init(e,t),U.init(e,t)}),ks=P(`ZodJWT`,(e,t)=>{Qi.init(e,t),U.init(e,t)}),As=P(`ZodNumber`,(e,t)=>{$i.init(e,t),V.init(e,t),e.gt=(t,n)=>e.check(xo(t,n)),e.gte=(t,n)=>e.check(So(t,n)),e.min=(t,n)=>e.check(So(t,n)),e.lt=(t,n)=>e.check(yo(t,n)),e.lte=(t,n)=>e.check(bo(t,n)),e.max=(t,n)=>e.check(bo(t,n)),e.int=t=>e.check(Ns(t)),e.safe=t=>e.check(Ns(t)),e.positive=t=>e.check(xo(0,t)),e.nonnegative=t=>e.check(So(0,t)),e.negative=t=>e.check(yo(0,t)),e.nonpositive=t=>e.check(bo(0,t)),e.multipleOf=(t,n)=>e.check(Co(t,n)),e.step=(t,n)=>e.check(Co(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function js(e){return mo(As,e)}const Ms=P(`ZodNumberFormat`,(e,t)=>{ea.init(e,t),As.init(e,t)});function Ns(e){return ho(Ms,e)}const Ps=P(`ZodBoolean`,(e,t)=>{ta.init(e,t),V.init(e,t)});function W(e){return go(Ps,e)}const Fs=P(`ZodUnknown`,(e,t)=>{na.init(e,t),V.init(e,t)});function Is(){return _o(Fs)}const Ls=P(`ZodNever`,(e,t)=>{ra.init(e,t),V.init(e,t)});function Rs(e){return vo(Ls,e)}const zs=P(`ZodArray`,(e,t)=>{aa.init(e,t),V.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(To(t,n)),e.nonempty=t=>e.check(To(1,t)),e.max=(t,n)=>e.check(wo(t,n)),e.length=(t,n)=>e.check(Eo(t,n)),e.unwrap=()=>e.element});function G(e,t){return Ro(zs,e,t)}const Bs=P(`ZodObject`,(e,t)=>{ua.init(e,t),V.init(e,t),F(e,`shape`,()=>t.shape),e.keyof=()=>Xs(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Is()}),e.loose=()=>e.clone({...e._zod.def,catchall:Is()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rs()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>nr(e,t),e.safeExtend=t=>rr(e,t),e.merge=t=>ir(e,t),e.pick=t=>er(e,t),e.omit=t=>tr(e,t),e.partial=(...t)=>ar(tc,e,t[0]),e.required=(...t)=>or(lc,e,t[0])});function K(e,t){return new Bs({type:`object`,shape:e??{},...I(t)})}const Vs=P(`ZodUnion`,(e,t)=>{fa.init(e,t),V.init(e,t),e.options=t.options});function Hs(e,t){return new Vs({type:`union`,options:e,...I(t)})}const Us=P(`ZodIntersection`,(e,t)=>{pa.init(e,t),V.init(e,t)});function Ws(e,t){return new Us({type:`intersection`,left:e,right:t})}const Gs=P(`ZodTuple`,(e,t)=>{ga.init(e,t),V.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Ks(e,t,n){let r=t instanceof R;return new Gs({type:`tuple`,items:e,rest:r?t:null,...I(r?n:t)})}const qs=P(`ZodRecord`,(e,t)=>{va.init(e,t),V.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Js(e,t,n){return new qs({type:`record`,keyType:e,valueType:t,...I(n)})}const Ys=P(`ZodEnum`,(e,t)=>{ya.init(e,t),V.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ys({...t,checks:[],...I(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ys({...t,checks:[],...I(r),entries:i})}});function Xs(e,t){return new Ys({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}const Zs=P(`ZodLiteral`,(e,t)=>{ba.init(e,t),V.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qs(e,t){return new Zs({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}const $s=P(`ZodTransform`,(e,t)=>{xa.init(e,t),V.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(fr(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(fr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ec(e){return new $s({type:`transform`,transform:e})}const tc=P(`ZodOptional`,(e,t)=>{Ca.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nc(e){return new tc({type:`optional`,innerType:e})}const rc=P(`ZodNullable`,(e,t)=>{wa.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ic(e){return new rc({type:`nullable`,innerType:e})}const ac=P(`ZodDefault`,(e,t)=>{Ta.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oc(e,t){return new ac({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Jn(t)}})}const sc=P(`ZodPrefault`,(e,t)=>{Da.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cc(e,t){return new sc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Jn(t)}})}const lc=P(`ZodNonOptional`,(e,t)=>{Oa.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType});function uc(e,t){return new lc({type:`nonoptional`,innerType:e,...I(t)})}const dc=P(`ZodCatch`,(e,t)=>{Aa.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fc(e,t){return new dc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const pc=P(`ZodPipe`,(e,t)=>{ja.init(e,t),V.init(e,t),e.in=t.in,e.out=t.out});function mc(e,t){return new pc({type:`pipe`,in:e,out:t})}const hc=P(`ZodReadonly`,(e,t)=>{Na.init(e,t),V.init(e,t),e.unwrap=()=>e._zod.def.innerType});function gc(e){return new hc({type:`readonly`,innerType:e})}const _c=P(`ZodCustom`,(e,t)=>{Fa.init(e,t),V.init(e,t)});function vc(e,t={}){return zo(_c,e,t)}function yc(e){return Bo(e)}var bc=D(de(),1),q=class extends Error{suggestion;docsLink;constructor(e,t){super(e),this.suggestion=t.suggestion,this.docsLink=t.docsLink}toString(){return`${this.message} ${this.suggestion}${bc.default.gray(this.docsLink?`\n See: ${this.docsLink}`:``)}`}},xc=class extends q{constructor(){super(`No package.json found.`,{suggestion:`Please run create a package.json first before initializing a jsrepo project.`})}},Sc=class extends q{constructor({path:e}){super(`Manifest not found at ${bc.default.bold(e)}.`,{suggestion:`This is a bug, please report it here: https://github.com/jsrepojs/jsrepo/issues`})}},Cc=class extends q{constructor(e){super(`Invalid options: ${e.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `)}`,{suggestion:`Please check the options and try again.`})}},wc=class extends q{zodError;constructor(e){super(`Zod error: ${e.message}`,{suggestion:`Check the input schema and try again.`}),this.zodError=e}},Tc=class extends q{constructor(e){super(`Invalid JSON: ${e instanceof Error?e.stack??e.message:`${e}`}`,{suggestion:`Check the input JSON and try again.`})}};function Ec(e,t){let n=e.safeParse(t);return n.success?(0,$t.ok)(n.data):(0,$t.err)(new wc(n.error))}function Dc(e,t){try{let n=e.safeParse(JSON.parse(t));return n.success?(0,$t.ok)(n.data):(0,$t.err)(new wc(n.error))}catch(e){return(0,$t.err)(new Tc(e))}}var Oc=D(de(),1);const kc=K({cwd:H().transform(e=>e)}),Ac={yes:new t(`--yes`,`Skip the confirmation prompt.`).default(!1),cwd:new t(`--cwd <path>`,`The current working directory.`).default(process.cwd())};function jc(e,t){return Ec(e,t).match(e=>e,e=>Nc(new Cc(e.zodError)))}async function Mc(e){try{let t=await e;return t.isErr()?Nc(t.error):t.value}catch(e){e instanceof q&&Nc(e),Nc(new q(e instanceof Error?e.message:String(e),{suggestion:`Please try again.`}))}}function Nc(e){return Pc(e)}function Pc(e){N.message(),process.env.JSREPO_TRACE===`1`?(console.trace(e),process.exit(1)):(wt(Oc.default.red(e.toString())),process.exit(1))}function Fc(e,...t){return On.join(e,...t)}function Ic(e){return On.dirname(e)}var J=D(jt(),1);function Lc(e){try{return(0,J.ok)(r.readFileSync(e,`utf-8`))}catch(t){return(0,J.err)(new q(`Failed to read file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function Rc(e,t){try{let n=zc(Ic(e));return n.isErr()?(0,J.err)(n.error):(r.writeFileSync(e,t),(0,J.ok)())}catch(t){return(0,J.err)(new q(`Failed to write file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function zc(e){try{return r.mkdirSync(e,{recursive:!0}),(0,J.ok)()}catch(t){return(0,J.err)(new q(`Failed to create directory ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function Bc(e){try{return Vc(e)&&r.rmSync(e),(0,J.ok)()}catch(t){return(0,J.err)(new q(`Failed to remove file ${e}: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`}))}}function Vc(e){return r.existsSync(e)}function Hc(e,t={}){return JSON.stringify(e,null,t.format?` `:void 0)}var Uc=E(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Wc=E(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Gc=E(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Uc(),a=Wc();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.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),e.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),e.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),e.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*$`)})),Kc=E(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),qc=E(((e,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};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Y=E(((e,t)=>{let n=Wc(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Uc(),{safeRe:a,t:o}=Gc(),s=Kc(),{compareIdentifiers:c}=qc();t.exports=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}}})),Jc=E(((e,t)=>{let n=Y();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Yc=E(((e,t)=>{let n=Jc();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Xc=E(((e,t)=>{let n=Jc();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),Zc=E(((e,t)=>{let n=Y();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Qc=E(((e,t)=>{let n=Jc();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),$c=E(((e,t)=>{let n=Y();t.exports=(e,t)=>new n(e,t).major})),el=E(((e,t)=>{let n=Y();t.exports=(e,t)=>new n(e,t).minor})),tl=E(((e,t)=>{let n=Y();t.exports=(e,t)=>new n(e,t).patch})),nl=E(((e,t)=>{let n=Jc();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),X=E(((e,t)=>{let n=Y();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),rl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(t,e,r)})),il=E(((e,t)=>{let n=X();t.exports=(e,t)=>n(e,t,!0)})),al=E(((e,t)=>{let n=Y();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),ol=E(((e,t)=>{let n=al();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),sl=E(((e,t)=>{let n=al();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),cl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(e,t,r)>0})),ll=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(e,t,r)<0})),ul=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(e,t,r)===0})),dl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(e,t,r)!==0})),fl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(e,t,r)>=0})),pl=E(((e,t)=>{let n=X();t.exports=(e,t,r)=>n(e,t,r)<=0})),ml=E(((e,t)=>{let n=ul(),r=dl(),i=cl(),a=fl(),o=ll(),s=pl();t.exports=(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}`)}}})),hl=E(((e,t)=>{let n=Y(),r=Jc(),{safeRe:i,t:a}=Gc();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),gl=E(((e,t)=>{t.exports=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){if(!this.delete(e)&&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}}})),Z=E(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)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=>!h(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&&g(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&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,ne(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>te(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(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 s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(re(this.set[t],e,this.options))return!0;return!1}};let r=new(gl()),i=Kc(),a=_l(),o=Wc(),s=Y(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=Gc(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=Uc(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(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},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=T(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=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`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},T=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),te=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),ne=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),re=(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(o(e[n].semver),e[n].semver!==a.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}})),_l=E(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.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 c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(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 l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(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(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=Kc(),{safeRe:i,t:a}=Gc(),o=ml(),s=Wc(),c=Y(),l=Z()})),vl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),yl=E(((e,t)=>{let n=Z();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),bl=E(((e,t)=>{let n=Y(),r=Z();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),xl=E(((e,t)=>{let n=Y(),r=Z();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Sl=E(((e,t)=>{let n=Y(),r=Z(),i=cl();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),Cl=E(((e,t)=>{let n=Z();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),wl=E(((e,t)=>{let n=Y(),r=_l(),{ANY:i}=r,a=Z(),o=vl(),s=cl(),c=ll(),l=pl(),u=fl();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),Tl=E(((e,t)=>{let n=wl();t.exports=(e,t,r)=>n(e,t,`>`,r)})),El=E(((e,t)=>{let n=wl();t.exports=(e,t,r)=>n(e,t,`<`,r)})),Dl=E(((e,t)=>{let n=Z();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Ol=E(((e,t)=>{let n=vl(),r=X();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),kl=E(((e,t)=>{let n=Z(),r=_l(),{ANY:i}=r,a=vl(),o=X(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Al=D(E(((e,t)=>{let n=Gc(),r=Uc(),i=Y(),a=qc();t.exports={parse:Jc(),valid:Yc(),clean:Xc(),inc:Zc(),diff:Qc(),major:$c(),minor:el(),patch:tl(),prerelease:nl(),compare:X(),rcompare:rl(),compareLoose:il(),compareBuild:al(),sort:ol(),rsort:sl(),gt:cl(),lt:ll(),eq:ul(),neq:dl(),gte:fl(),lte:pl(),cmp:ml(),coerce:hl(),Comparator:_l(),Range:Z(),satisfies:vl(),toComparators:yl(),maxSatisfying:bl(),minSatisfying:xl(),minVersion:Sl(),validRange:Cl(),outside:wl(),gtr:Tl(),ltr:El(),intersects:Dl(),simplifyRange:Ol(),subset:kl(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1),jl=D(jt(),1);const Ml=/^(@[^/]+\/[^@/]+)(?:@([^/]+))?(\/.*)?$/,Nl=/^([^@/]+)(?:@([^/]+))?(\/.*)?$/;function Pl(e){let t=Ml.exec(e)||Nl.exec(e);return t?(0,jl.ok)({name:t[1]||``,version:t[2]||void 0,path:t[3]||``}):(0,jl.err)(`invalid package name: ${e}`)}var Fl=D(jt(),1);function Il(e){if(e===w.homedir()||e===On.parse(e).root)return;let t=Fc(e,`package.json`);return Vc(t)?{path:t,package:Rl(t)}:Il(Ic(e))}function Ll(e){try{return(0,Fl.ok)(Rl(e))}catch(t){return(0,Fl.err)(`Error while trying to get package.json at ${e}: ${t}`)}}function Rl(e){return JSON.parse(Lc(e)._unsafeUnwrap().toString())}function zl(e){return e[0]===`^`?e.slice(1):e}function Bl(e,{pkg:t}){function n(e,t){let n=t?.[e.name];return!(e.version===void 0&&n||n&&(e.version===void 0||Al.default.satisfies(zl(n),e.version)))}let r=new Set;for(let i of e.dependencies)n(Pl(i)._unsafeUnwrap(),t.dependencies)&&r.add(i);let i=new Set;for(let r of e.devDependencies)n(Pl(r)._unsafeUnwrap(),t.devDependencies)&&i.add(r);return{dependencies:Array.from(r.values()),devDependencies:Array.from(i.values())}}var Vl=Object.create,Hl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,Wl=Object.getOwnPropertyNames,Gl=Object.getPrototypeOf,Kl=Object.prototype.hasOwnProperty,Q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ql=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Wl(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Kl.call(e,s)&&s!==n&&Hl(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ul(t,s))||r.enumerable});return e},Jl=(e,t,n)=>(n=e==null?{}:Vl(Gl(e)),ql(t||!e||!e.__esModule?Hl(n,`default`,{value:e,enumerable:!0}):n,e)),Yl=ee(import.meta.url);const Xl=/^path$/i,Zl={key:`PATH`,value:``};function Ql(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!Xl.test(t))continue;let n=e[t];return n?{key:t,value:n}:Zl}return Zl}function $l(e,t){let n=t.value.split(h),r=e,i;do n.push(y(r,`node_modules`,`.bin`)),i=r,r=g(r);while(r!==i);return{key:t.key,value:n.join(h)}}function eu(e,t){let n={...process.env,...t},r=$l(e,Ql(n));return n[r.key]=r.value,n}const tu=e=>{let t=e.length,n=new te,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n};var nu=Q((e,t)=>{t.exports=a,a.sync=o;var n=Yl(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),ru=Q((e,t)=>{t.exports=r,r.sync=i;var n=Yl(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),iu=Q((e,t)=>{Yl(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?nu():ru();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),au=Q((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=Yl(`path`),i=n?`;`:`:`,a=iu(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),ou=Q((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),su=Q((e,t)=>{let n=Yl(`path`),r=au(),i=ou();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),cu=Q((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),lu=Q((e,t)=>{t.exports=/^#!(.*)/}),uu=Q((e,t)=>{let n=lu();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),du=Q((e,t)=>{let n=Yl(`fs`),r=uu();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),fu=Q((e,t)=>{let n=Yl(`path`),r=su(),i=cu(),a=du(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),pu=Q((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),mu=Jl(Q((e,t)=>{let n=Yl(`child_process`),r=fu(),i=pu();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})(),1),hu=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const gu={timeout:void 0,persist:!1},_u={windowsHide:!0};function vu(e,t){return{command:v(e),args:t??[]}}function yu(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}async function bu(e){let t=``;for await(let n of e)t+=n.toString();return t}var xu=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...gu,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Cu(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=tu(t),r=f.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new hu(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let[t,n]=await Promise.all([this._streamOut?bu(this._streamOut):``,this._streamErr?bu(this._streamErr):``]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new hu(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=c(),t=this._options,n={..._u,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=yu(r)),n.env=eu(e,n.env);let{command:i,args:a}=vu(this._command,this._args),o=(0,mu._parse)(i,a,n),s=T(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const Su=(e,t,n)=>{let r=new xu(e,t,n);return r.spawn(),r},Cu=Su;var wu=D(de(),1);function Tu(){console.clear(),Tt(`${wu.default.bgYellow(wu.default.black(` ${le} `))}${wu.default.gray(` v${ue} `)}`)}async function Eu({title:e,commands:t,cwd:n,messages:r}){let i=kt({title:e,limit:Math.ceil(process.stdout.rows/2),spacing:0,retainLog:!0}),a=async e=>{let t=Su(e.command,[...e.args],{nodeOptions:{cwd:n}});for await(let e of t)i.message(e)};try{for(let e of t)await a(e);i.success(r.success())}catch(e){i.error(r.error(e)),process.exit(1)}}async function Du(e,{cwd:t}){let n=Il(t);if(!n)return;let r=(await Yt({cwd:t}))?.agent??`npm`;if(e.dependencies.length===0&&e.devDependencies.length===0){let e=Vt(r,`install`,[]);if(e===null)return;await Eu({title:`Installing dependencies with ${r}...`,commands:[e],cwd:t,messages:{success:()=>`Installed dependencies`,error:e=>`Failed to install dependencies: ${e instanceof Error?e.message:e}`}});return}let{dependencies:i,devDependencies:a}=Bl(e,{pkg:n.package});if(i.length===0&&a.length===0)return;let o=Vt(r,`add`,[...i]),s=Vt(r,`add`,[`-D`,...a]);await Eu({title:`Installing dependencies with ${r}...`,commands:[...o&&i.length>0?[o]:[],...s&&a.length>0?[s]:[]],cwd:t,messages:{success:()=>`Installed ${wu.default.cyan([...i,...a].join(`, `))}`,error:e=>`Failed to install dependencies: ${e instanceof Error?e.message:e}`}})}function Ou(e,t){for(let n of t)if(e.endsWith(n))return n}const ku=`jsrepo-manifest.json`,Au=K({authors:G(H()).optional(),bugs:H().optional(),description:H().optional(),homepage:H().optional(),repository:H().optional(),tags:G(H()).optional()}),ju=Hs([Qs(`public`),Qs(`private`),Qs(`marketplace`)]),Mu=K({name:H(),path:H(),expectedPath:H().optional(),optional:W().optional().default(!1)}),Nu=Js(H(),Hs([H(),Ks([H(),Hs([H(),js()])],Hs([H(),js()]))])),Pu=Js(H(),Hs([H(),K({version:H(),message:H()})])),Fu=K({$schema:H(),name:H().optional(),version:H().optional(),readme:H().optional(),access:ju.optional(),meta:Au.optional(),defaultPaths:Js(H(),H()).optional(),peerDependencies:Pu.optional(),configFiles:G(Mu).optional(),dirs:G(H()),outputDir:H().optional(),includeBlocks:G(H()).optional().default([]),includeCategories:G(H()).optional().default([]),includeFiles:G(H()).optional().default([]),excludeBlocks:G(H()).optional().default([]),excludeCategories:G(H()).optional().default([]),doNotListBlocks:G(H()).optional().default([]),doNotListCategories:G(H()).optional().default([]),listBlocks:G(H()).optional().default([]),listCategories:G(H()).optional().default([]),excludeDeps:G(H()).optional().default([]),allowSubdirectories:W().optional(),preview:W().optional(),includeDocs:W().optional().default(!1),rules:Nu.optional()}),Iu=Mu.extend({dependencies:G(H()).optional(),devDependencies:G(H()).optional()}),Lu=K({name:H(),category:H(),localDependencies:G(H()),dependencies:G(H()),devDependencies:G(H()),tests:W(),docs:W().optional().default(!1),list:W().optional().default(!0),directory:H(),subdirectory:W(),files:G(H()),_imports_:Js(H(),H())}),Ru=K({name:H(),blocks:G(Lu)}),zu=K({name:H().optional(),version:H().optional(),meta:Au.optional(),access:ju.optional(),defaultPaths:Js(H(),H()).optional(),configFiles:G(Iu).optional(),categories:G(Ru)}),Bu=Hs([Qs(`prettier`),Qs(`biome`)]),Vu=K({$schema:H(),repos:G(H()).optional().default([]),includeTests:W().optional().default(!1),includeDocs:W().optional().default(!1),paths:Js(H(),H()).optional(),configFiles:Js(H(),H()).optional(),watermark:nc(W()).default(!0),formatter:nc(Bu)}),Hu=[`.test.ts`,`_test.ts`,`.test.js`,`_test.js`,`.spec.ts`,`_spec.ts`,`.spec.js`,`_spec.js`,`.stories.jsx`,`_stories.jsx`,`.stories.tsx`,`_stories.tsx`],Uu=[`.mdx`,`.md`];function Wu(e){return Ou(e,Hu)!==void 0}function Gu(e){return Ou(e,Uu)!==void 0}var $=D(jt(),1),Ku=D(de(),1);const qu=kc.extend({yes:W()}),Ju=new e(`v3`).description(`Migrate your jsrepo config to v3.`).addOption(Ac.cwd).addOption(Ac.yes).action(async e=>{let t=jc(qu,e);Tu();let n=await Mc(Yu(t));Et(`Successfully migrated to jsrepo v3.`),n.migratedConfigs.registry!==null&&(process.stdout.write(Ku.default.green(` Next steps:
77
77
 
78
- `)),process.stdout.write(` ${Ku.default.gray(`1.`)} Update documentation for the \`jsrepo add\` command ${Ku.default.gray("`jsrepo add <category>/<item>`")} -> ${Ku.default.cyan("`jsrepo add <item>`")}\n`),process.stdout.write(` ${Ku.default.gray(`2.`)} Add descriptions to registry items (optional)\n`),process.stdout.write(` ${Ku.default.gray(`3.`)} Checkout the new docs to learn more! ${Ku.default.cyan(`https://v3.jsrepo.dev`)}\n`),process.stdout.write(`
79
- `))});async function Yu(e){let t=Ll(Fc(e.cwd,`package.json`));if(t.isErr())return(0,$.err)(new xc);let n=t.value,r=Fc(e.cwd,`jsrepo-build-config.json`),a;if(i(r)){let e=Lc(r);if(e.isErr())return(0,$.err)(e.error);let t=Dc(Fu,e.value);if(t.isErr())return(0,$.err)(new Tc(t.error));a=t.value}else a=null;let o=Fc(e.cwd,`jsrepo.json`),s;if(i(o)){let e=Lc(o);if(e.isErr())return(0,$.err)(e.error);let t=Dc(Vu,e.value);if(t.isErr())return(0,$.err)(new Tc(t.error));s=t.value}else s=null;if(a===null&&s===null)return(0,$.err)(new q(`No configs to migrate at ${On.resolve(e.cwd)}!`,{suggestion:`Please ensure you are running this command in the root of your jsrepo project.`}));let c=null;if(a!==null){let t=await Qu({packageJson:n,oldConfigPath:r,oldConfig:a,options:e});if(t.isErr())return(0,$.err)(t.error);c=t.value}let l=null;if(s!==null){let t=await Zu({oldConfig:s,options:e});if(t.isErr())return(0,$.err)(t.error);l=t.value}let u=[`jsrepo@beta`,...s?.formatter?[`@jsrepo/transform-${s.formatter}`]:[]],d=`import { defineConfig } from "jsrepo";${c?`\nimport { ${a?.outputDir?`distributed`:`repository`} } from "jsrepo/outputs";`:``}${s?.formatter?`\nimport ${s.formatter} from "@jsrepo/transform-${s.formatter}";`:``}
78
+ `)),process.stdout.write(` ${Ku.default.gray(`1.`)} Update documentation for the \`jsrepo add\` command ${Ku.default.gray("`jsrepo add <category>/<item>`")} -> ${Ku.default.cyan("`jsrepo add <item>`")}\n`),process.stdout.write(` ${Ku.default.gray(`2.`)} Add descriptions to registry items (optional)\n`),process.stdout.write(` ${Ku.default.gray(`3.`)} Checkout the new docs to learn more! ${Ku.default.cyan(`https://jsrepo.dev`)}\n`),process.stdout.write(`
79
+ `))});async function Yu(e){let t=Ll(Fc(e.cwd,`package.json`));if(t.isErr())return(0,$.err)(new xc);let n=t.value,r=Fc(e.cwd,`jsrepo-build-config.json`),a;if(i(r)){let e=Lc(r);if(e.isErr())return(0,$.err)(e.error);let t=Dc(Fu,e.value);if(t.isErr())return(0,$.err)(new Tc(t.error));a=t.value}else a=null;let o=Fc(e.cwd,`jsrepo.json`),s;if(i(o)){let e=Lc(o);if(e.isErr())return(0,$.err)(e.error);let t=Dc(Vu,e.value);if(t.isErr())return(0,$.err)(new Tc(t.error));s=t.value}else s=null;if(a===null&&s===null)return(0,$.err)(new q(`No configs to migrate at ${On.resolve(e.cwd)}!`,{suggestion:`Please ensure you are running this command in the root of your jsrepo project.`}));let c=null;if(a!==null){let t=await Qu({packageJson:n,oldConfigPath:r,oldConfig:a,options:e});if(t.isErr())return(0,$.err)(t.error);c=t.value}let l=null;if(s!==null){let t=await Zu({oldConfig:s,options:e});if(t.isErr())return(0,$.err)(t.error);l=t.value}let u=[`jsrepo@latest`,...s?.formatter?[`@jsrepo/transform-${s.formatter}`]:[]],d=`import { defineConfig } from "jsrepo";${c?`\nimport { ${a?.outputDir?`distributed`:`repository`} } from "jsrepo/outputs";`:``}${s?.formatter?`\nimport ${s.formatter} from "@jsrepo/transform-${s.formatter}";`:``}
80
80
 
81
81
  export default defineConfig({${c?`\n\tregistry: {
82
82
  name: "${c.name}",
@@ -93,5 +93,5 @@ export default defineConfig({${c?`\n\tregistry: {
93
93
  outputs: [${a?.outputDir?`distributed({ dir: "${a.outputDir}" })`:`repository({ format: true })`}],
94
94
  items: ${Hc(c.items,{format:!0})}
95
95
  },`:``}${l?`\n\tregistries: ${Hc(l.registries,{format:!0})},\n\tpaths: ${Hc(l.paths,{format:!0})},${s?.formatter?`\n\ttransforms: [${s.formatter}()],`:``}`:``}
96
- });`,f=Fc(e.cwd,n.type===`module`?`jsrepo.config.ts`:`jsrepo.config.cjs`),p=Rc(f,d);if(p.isErr())return(0,$.err)(p.error);if(a!==null){let t=Vt((await Yt({cwd:e.cwd}))?.agent??`npm`,`execute`,[`jsrepo@beta`,`build`]);if(t===null)return(0,$.err)(new q("Failed to resolve `jsrepo build` command",{suggestion:"Please ensure you can build your registry with the `jsrepo build` command."}));await Eu({title:"Running `jsrepo build`",cwd:e.cwd,commands:[t],messages:{success:()=>`v3 Build completed successfully`,error:()=>{throw new q(`Failed to build registry`,{suggestion:`The migration was successful, but the build failed. Please try again.`})}}})}await Du({dependencies:[],devDependencies:u},{cwd:e.cwd});let m=e.yes;if(!e.yes){let e=await Ct({message:`Remove old config files?`,initialValue:!0});Ve(e)&&(wt(`Canceled!`),process.exit(0)),m=e}return m&&(a&&(Bc(r),Bc(Fc(e.cwd,ku))),s&&Bc(o),N.success(`Removed old config files.`)),(0,$.ok)({configPath:On.relative(e.cwd,f),migratedConfigs:{registry:!a||!c?null:{oldConfig:a,newConfig:c},project:!s||!l?null:{oldConfig:s,newConfig:l}}})}function Xu(e){if(Wu(e))return`test`;if(Gu(e))return`doc`}async function Zu({oldConfig:e,options:t}){return e.repos.length>0&&(await S(e.repos,{cwd:t.cwd,providers:x})).isErr()&&N.warn(`There was an error resolving one or more of the registries in your project config. v2 registries are not compatible with jsrepo v3. Please ensure all the registries referenced by your config have upgraded to v3.`),(0,$.ok)({registries:e.repos,paths:e.paths??{}})}async function Qu({packageJson:e,oldConfigPath:t,oldConfig:n,options:r}){let i=Rc(t,Hc({...n,outputDir:void 0},{format:!0}));if(i.isErr())return(0,$.err)(i.error);let a=Vt((await Yt({cwd:r.cwd}))?.agent??`npm`,`execute`,[`jsrepo@2`,`build`]);if(a===null)return(0,$.err)(new q("Failed to resolve `jsrepo build` command",{suggestion:"Please ensure you can build your registry with the `jsrepo build` command."}));await Eu({title:"Running `jsrepo build`",cwd:r.cwd,commands:[a],messages:{success:()=>`v2 Build completed successfully`,error:()=>{throw new q(`Failed to build registry`,{suggestion:"Please ensure you can build your registry with the `jsrepo build` command."})}}});let o=Fc(r.cwd,ku),s=Lc(o);if(s.isErr())return(0,$.err)(new Sc({path:o}));let c=Dc(zu,s.value);if(c.isErr())return(0,$.err)(new Tc(c.error));let l=c.value;if(l.name===void 0){let t=await At({message:`Enter the name of your registry`,validate(e){if(!e||e.trim()===``)return`Please provide a value`},initialValue:e.name,defaultValue:e.name,placeholder:e.name});Ve(t)&&(wt(`Canceled!`),process.exit(0)),l.name=t}let u=[];for(let e of l.categories)for(let t of e.blocks){let n={name:t.name,add:t.list?`when-added`:`when-needed`,type:e.name,files:t.subdirectory?[{path:t.directory,files:t.files.map(e=>({path:e,role:Xu(e)}))}]:t.files.map(e=>({path:On.join(t.directory,e),role:Xu(e)}))};u.push(n)}for(let e of l.configFiles??[]){let t={name:e.name,title:e.name,add:e.optional?`optionally-on-init`:`on-init`,type:`config`,files:[{path:e.path,target:e.expectedPath}]};u.push(t)}return(0,$.ok)({name:l.name,description:l.meta?.description,homepage:l.meta?.homepage,authors:l.meta?.authors,bugs:l.meta?.bugs,repository:l.meta?.repository,tags:l.meta?.tags,version:l.version,access:l.access,defaultPaths:l.defaultPaths,excludeDeps:n.excludeDeps,items:u})}n.name(le).description(O).version(ue).addCommand(Ju).parse();export{};
96
+ });`,f=Fc(e.cwd,n.type===`module`?`jsrepo.config.ts`:`jsrepo.config.cjs`),p=Rc(f,d);if(p.isErr())return(0,$.err)(p.error);if(a!==null){let t=Vt((await Yt({cwd:e.cwd}))?.agent??`npm`,`execute`,[`jsrepo@latest`,`build`]);if(t===null)return(0,$.err)(new q("Failed to resolve `jsrepo build` command",{suggestion:"Please ensure you can build your registry with the `jsrepo build` command."}));await Eu({title:"Running `jsrepo build`",cwd:e.cwd,commands:[t],messages:{success:()=>`v3 Build completed successfully`,error:()=>{throw new q(`Failed to build registry`,{suggestion:`The migration was successful, but the build failed. Please try again.`})}}})}await Du({dependencies:[],devDependencies:u},{cwd:e.cwd});let m=e.yes;if(!e.yes){let e=await Ct({message:`Remove old config files?`,initialValue:!0});Ve(e)&&(wt(`Canceled!`),process.exit(0)),m=e}return m&&(a&&(Bc(r),Bc(Fc(e.cwd,ku))),s&&Bc(o),N.success(`Removed old config files.`)),(0,$.ok)({configPath:On.relative(e.cwd,f),migratedConfigs:{registry:!a||!c?null:{oldConfig:a,newConfig:c},project:!s||!l?null:{oldConfig:s,newConfig:l}}})}function Xu(e){if(Wu(e))return`test`;if(Gu(e))return`doc`}async function Zu({oldConfig:e,options:t}){return e.repos.length>0&&(await S(e.repos,{cwd:t.cwd,providers:x})).isErr()&&N.warn(`There was an error resolving one or more of the registries in your project config. v2 registries are not compatible with jsrepo v3. Please ensure all the registries referenced by your config have upgraded to v3.`),(0,$.ok)({registries:e.repos,paths:e.paths??{}})}async function Qu({packageJson:e,oldConfigPath:t,oldConfig:n,options:r}){let i=Rc(t,Hc({...n,outputDir:void 0},{format:!0}));if(i.isErr())return(0,$.err)(i.error);let a=Vt((await Yt({cwd:r.cwd}))?.agent??`npm`,`execute`,[`jsrepo@2`,`build`]);if(a===null)return(0,$.err)(new q("Failed to resolve `jsrepo build` command",{suggestion:"Please ensure you can build your registry with the `jsrepo build` command."}));await Eu({title:"Running `jsrepo build`",cwd:r.cwd,commands:[a],messages:{success:()=>`v2 Build completed successfully`,error:()=>{throw new q(`Failed to build registry`,{suggestion:"Please ensure you can build your registry with the `jsrepo build` command."})}}});let o=Fc(r.cwd,ku),s=Lc(o);if(s.isErr())return(0,$.err)(new Sc({path:o}));let c=Dc(zu,s.value);if(c.isErr())return(0,$.err)(new Tc(c.error));let l=c.value;if(l.name===void 0){let t=await At({message:`Enter the name of your registry`,validate(e){if(!e||e.trim()===``)return`Please provide a value`},initialValue:e.name,defaultValue:e.name,placeholder:e.name});Ve(t)&&(wt(`Canceled!`),process.exit(0)),l.name=t}let u=[];for(let e of l.categories)for(let t of e.blocks){let n={name:t.name,add:t.list?`when-added`:`when-needed`,type:e.name,files:t.subdirectory?[{path:t.directory,files:t.files.map(e=>({path:e,role:Xu(e)}))}]:t.files.map(e=>({path:On.join(t.directory,e),role:Xu(e)}))};u.push(n)}for(let e of l.configFiles??[]){let t={name:e.name,title:e.name,add:e.optional?`optionally-on-init`:`on-init`,type:`config`,files:[{path:e.path,target:e.expectedPath}]};u.push(t)}return(0,$.ok)({name:l.name,description:l.meta?.description,homepage:l.meta?.homepage,authors:l.meta?.authors,bugs:l.meta?.bugs,repository:l.meta?.repository,tags:l.meta?.tags,version:l.version,access:l.access,defaultPaths:l.defaultPaths,excludeDeps:n.excludeDeps,items:u})}n.name(le).description(O).version(ue).addCommand(Ju).parse();export{};
97
97
  //# sourceMappingURL=bin.js.map
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@jsrepo/migrate",
3
3
  "description": "Automatically migrate your jsrepo project to the newest version of jsrepo.",
4
- "version": "0.0.1-beta.8",
4
+ "version": "0.0.2",
5
5
  "license": "MIT",
6
- "homepage": "https://v3.jsrepo.dev",
6
+ "homepage": "https://jsrepo.dev",
7
7
  "author": {
8
8
  "name": "Aidan Bleser",
9
9
  "url": "https://github.com/ieedan"
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "commander": "^14.0.2",
33
- "jsrepo": "3.0.0-beta.29"
33
+ "jsrepo": "3.0.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@clack/prompts": "1.0.0-alpha.6",