@promakeai/cli 0.2.4 → 0.2.5

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -398,7 +398,7 @@ export default Index;
398
398
  };
399
399
  `,Z}async function cx(D){try{let X=await R4(D);if(X?.route)return{path:X.route.path,componentName:X.route.componentName,moduleName:D}}catch{}return null}async function eQ(D,X,Z){let J=bx.join(D,X);await FM.default.ensureDir(bx.dirname(J)),await FM.default.writeFile(J,Z,"utf-8")}var dx=new $5("create").argument("[name]","Project name or path").option("--pm <manager>","Package manager (npm, bun, yarn, pnpm)","npm").option("--path <path>","Directory to create project in (default: current directory)").option("--preset <name>","Use a project preset (ecommerce, blog, portfolio, empty)").option("--header <module>","Header module to use (e.g., header-mega, header-simple)").option("--footer <module>","Footer module to use (e.g., footer, footer-minimal)").option("--sections <modules>","Comma-separated section modules for home page").option("--pages <modules>","Comma-separated page modules to install").option("--empty","Create project without header, footer, or sections").option("--minimal","Create project with only built-in modules (no header/footer/sections)").option("--add <modules>","Comma-separated additional modules to install").option("--theme <preset>","Theme preset (blue, green, orange, etc.)").option("--radius <size>","Border radius (none, small, medium, large)").option("--shadow <size>","Shadow intensity (none, subtle, small, medium, large, xl)").option("--font <name>","Font family (inter, figtree, poppins, etc.)").option("--mono <name>","Monospace font (jetbrains-mono, fira-code, etc.)").option("--maxWidth <size>","Container max width (3xl-7xl, full, screen-xl, screen-2xl)").option("-i, --install","Install npm/bun dependencies").option("--list-presets","List available project presets").description("Create a new React project with Vite, Tailwind, shadcn/ui").action(async(D,X)=>{if(X.listPresets){console.log(P.bold(`
400
400
  Available Project Presets:
401
- `));for(let F of E4){if(console.log(` ${P.cyan(F.name)} - ${F.description}`),F.header||F.footer){let z=[];if(F.header)z.push(`header: ${F.header}`);if(F.footer)z.push(`footer: ${F.footer}`);console.log(P.dim(` Layout: ${z.join(", ")}`))}if(F.indexSections?.length)console.log(P.dim(` Sections: ${F.indexSections.join(", ")}`));if(F.modules.length>0)console.log(P.dim(` Modules: ${F.modules.slice(0,4).join(", ")}${F.modules.length>4?`, +${F.modules.length-4} more`:""}`));if(F.theme){let z=[];if(F.theme.preset)z.push(`theme: ${F.theme.preset}`);if(F.theme.radius)z.push(`radius: ${F.theme.radius}`);if(F.theme.shadow)z.push(`shadow: ${F.theme.shadow}`);console.log(P.dim(` Theme: ${z.join(", ")}`))}console.log("")}console.log(P.dim("Usage: promake create myapp --preset ecommerce")),console.log(P.dim(" promake create myapp --header header-mega --footer footer --sections hero-cta"));return}if(!D)console.log(P.red("Project name is required")),console.log(P.dim("Usage: promake create <name> [options]")),console.log(P.dim(" promake create --list-presets")),process.exit(1);let Z=X.path||process.cwd(),J=D$.isAbsolute(D)?D:D$.join(Z,D),Y=D$.basename(J),Q=await X$.default.pathExists(J);if(X.path)await X$.default.ensureDir(Z);let $=null;if(X.preset){if($=E4.find((F)=>F.name.toLowerCase()===X.preset.toLowerCase()),!$)console.log(P.red(`Unknown preset: ${X.preset}`)),console.log(P.dim(`Available: ${E4.map((F)=>F.name).join(", ")}`)),process.exit(1)}let K,G,V=[];if(!X.empty&&!X.minimal){if($)K=$.header,G=$.footer,V=$.indexSections||[];if(X.header)K=X.header;if(X.footer)G=X.footer;if(X.sections)V=X.sections.split(",").map((F)=>F.trim())}let W=E2("Creating project...").start();try{await qx(J),W.text="Base template copied",await Ux(J,Y),W.text="Updated package.json",await m9(J,FD()),W.text="Created promake.json";let F=X.pm;if(X.install){W.text="Installing dependencies...";let j=F==="bun"?"bun install":`${F} install`;FF0(j,{cwd:J,stdio:"pipe"})}W.succeed(P.green("Project created!")),console.log(""),console.log(P.bold("Installing built-in modules..."));let z=await T2(J)||FD(),H=z.modulesPath||"src/modules",q=new Set;for(let j of vV)try{await I4(j,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q)}catch(I){console.log(P.yellow(` Warning: Could not install ${j}`))}if(K){console.log(""),console.log(P.bold(`Installing header: ${K}`));try{await I4(K,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q)}catch(j){console.log(P.yellow(` Warning: Could not install ${K}`)),K=void 0}}if(G){console.log(""),console.log(P.bold(`Installing footer: ${G}`));try{await I4(G,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q)}catch(j){console.log(P.yellow(` Warning: Could not install ${G}`)),G=void 0}}let U=[];if(V.length>0){console.log(""),console.log(P.bold(`Installing ${V.length} sections...`));for(let j of V)try{await I4(j,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q),U.push(j)}catch(I){console.log(P.yellow(` Warning: Could not install ${j}`))}}let B=[],O=[];if($?.modules)O.push(...$.modules);if(X.pages){let j=X.pages.split(",").map((I)=>I.trim());for(let I of j)if(!O.includes(I))O.push(I)}if(X.add){let j=X.add.split(",").map((I)=>I.trim());for(let I of j)if(!O.includes(I))O.push(I)}if(O.length>0){console.log(""),console.log(P.bold(`Installing ${O.length} modules...`));for(let j of O)try{await I4(j,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q);let I=await cx(j);if(I)B.push(I)}catch(I){console.log(P.yellow(` Warning: Could not install ${j}`))}}console.log(""),console.log(P.bold("Generating project files..."));let L=fx({hasDb:q.has("db"),hasApi:q.has("api")});await eQ(J,"src/App.tsx",L),console.log(` ${P.cyan("✓")} Generated App.tsx`);let M=gx({header:K,footer:G,modulesPath:H});await eQ(J,"src/components/Layout.tsx",M),console.log(` ${P.cyan("✓")} Generated Layout.tsx`);let A=ux({sections:U,modulesPath:H});await eQ(J,"src/pages/Index.tsx",A),console.log(` ${P.cyan("✓")} Generated Index.tsx`);let E=mx({routes:B,modulesPath:H});await eQ(J,"src/router.tsx",E),console.log(` ${P.cyan("✓")} Generated router.tsx with ${B.length} routes`);let C={};if($?.theme){if($.theme.preset)C.preset=$.theme.preset;if($.theme.radius)C.radius=$.theme.radius;if($.theme.shadow)C.shadow=$.theme.shadow;if($.theme.font)C.font=$.theme.font;if($.theme.mono)C.mono=$.theme.mono;if($.theme.maxWidth)C.maxWidth=$.theme.maxWidth}if(X.theme)C.preset=X.theme;if(X.radius)C.radius=X.radius;if(X.shadow)C.shadow=X.shadow;if(X.font)C.font=X.font;if(X.mono)C.mono=X.mono;if(X.maxWidth)C.maxWidth=X.maxWidth;if(Object.keys(C).length>0){console.log(""),console.log(P.bold("Applying theme settings..."));let j=await cV(J,C);if(j.success&&j.changes.length>0){j.changes.forEach((g)=>console.log(` ${P.cyan("✓")} ${g}`));let I=await T2(J)||FD();I.theme={...I.theme,...C},await m9(J,I)}}console.log(""),console.log(P.bold("Next steps:"));let T=D$.isAbsolute(D)?J:X.path?D$.relative(process.cwd(),J):Y;if(console.log(P.cyan(` cd ${T}`)),!X.install)console.log(P.cyan(` ${F} install`));if(console.log(P.cyan(` ${F} run dev`)),O.length===0&&!K&&!G)console.log(""),console.log("Add modules:"),console.log(P.cyan(" npx promake add <module-name>"))}catch(F){if(W.fail("Failed to create project"),!Q&&await X$.default.pathExists(J))await X$.default.remove(J);if(F instanceof Error)console.log(P.red(F.message));process.exit(1)}});var HF0={"registry:module":"Modules","registry:component":"Components","registry:page":"Pages","registry:hook":"Hooks","registry:context":"Contexts","registry:type":"Types","registry:lang":"Language Files","registry:lib":"Libraries","registry:block":"Blocks","registry:ui":"UI Components","registry:store":"Stores","registry:service":"Services","registry:style":"Styles","registry:file":"Files"},qF0={module:"registry:module",component:"registry:component",page:"registry:page",hook:"registry:hook",context:"registry:context",type:"registry:type",lang:"registry:lang",lib:"registry:lib",block:"registry:block",ui:"registry:ui",store:"registry:store",service:"registry:service",style:"registry:style",file:"registry:file"},lx=["registry:module","registry:component","registry:page","registry:block","registry:lib","registry:hook","registry:context","registry:type","registry:lang"],px=new $5("list").alias("ls").argument("[type]","Filter by type (module, component, page, block, preset, etc.)").argument("[name]","Filter by specific name (for presets)").option("-s, --search <term>","Search by name or description").option("--json","Output as JSON").option("-d, --detailed","Show detailed information").description("List available modules in registry").action(async(D,X,Z)=>{let J=Z||{};if(D==="preset"||D==="presets"){UF0(J,X);return}let Y=E2("Fetching registry...").start();try{let Q=await Fx(),$=[];for(let W of Q)try{let F=await R4(W);$.push(F)}catch{}Y.stop();let K=$;if(J.search){let W=J.search.toLowerCase();K=K.filter((F)=>F.name.toLowerCase().includes(W)||F.title?.toLowerCase().includes(W)||F.description?.toLowerCase().includes(W))}if(!D){zF0(K,J);return}let G=qF0[D.toLowerCase()]||`registry:${D.toLowerCase()}`;if(K=K.filter((W)=>W.type===G),J.json){if(J.detailed)console.log(JSON.stringify(K,null,2));else console.log(JSON.stringify(K.map((W)=>W.name),null,2));return}let V=HF0[G]||D;if(K.length===0){console.log(P.yellow(`No ${V.toLowerCase()} found`));return}if(console.log(P.bold(`${V} (${K.length})`)),J.detailed)for(let W of K){let F=W.title?` - ${W.title}`:"",z=W.description?P.dim(` ${BF0(W.description,50)}`):"";if(console.log(` ${P.green(W.name)}${F}${z}`),W.registryDependencies?.length)console.log(` ${P.dim("deps:")} ${W.registryDependencies.join(", ")}`)}else{let W=K.map((F)=>F.name);if(W.join(", ").length<80)console.log(` ${W.join(", ")}`);else for(let F of W)console.log(` ${F}`)}}catch(Q){if(Y.fail("Failed to fetch registry"),Q instanceof Error)console.log(P.red(Q.message));process.exit(1)}});function zF0(D,X){let Z=new Map;for(let Y of D){let Q=Y.type;Z.set(Q,(Z.get(Q)||0)+1)}let J=Array.from(Z.keys()).sort((Y,Q)=>{let $=lx.indexOf(Y),K=lx.indexOf(Q);if($===-1&&K===-1)return Y.localeCompare(Q);if($===-1)return 1;if(K===-1)return-1;return $-K});if(X.json){let Y={};for(let Q of J){let $=Q.replace("registry:","");Y[$]=Z.get(Q)||0}Y.preset=E4.length,console.log(JSON.stringify(Y,null,2));return}console.log(P.bold(`Registry (${D.length} items)`));for(let Y of J){let Q=Z.get(Y)||0,$=Y.replace("registry:","");console.log(` ${P.cyan($.padEnd(10))} ${P.yellow(Q)}`)}console.log(` ${P.cyan("preset".padEnd(10))} ${P.yellow(E4.length)}`)}function UF0(D,X){let Z=E4;if(X){let J=Z.find((Y)=>Y.name.toLowerCase()===X.toLowerCase());if(!J){console.log(P.yellow(`Preset "${X}" not found.`)),console.log(P.gray(`Available presets: ${Z.map((Y)=>Y.name).join(", ")}`));return}Z=[J]}if(D.json){if(D.detailed)console.log(JSON.stringify(Z,null,2));else console.log(JSON.stringify(Z.map((J)=>J.name),null,2));return}if(X){let J=Z[0];if(console.log(P.bold(J.name)+P.dim(` - ${J.description}`)),console.log(` ${P.dim("modules:")} ${J.modules.join(", ")}`),J.theme){let Y=Object.entries(J.theme).map(([Q,$])=>`${Q}: ${$}`).join(", ");console.log(` ${P.dim("theme:")} ${Y}`)}}else if(D.detailed){console.log(P.bold(`Presets (${Z.length})`));for(let J of Z)if(console.log(` ${P.cyan(J.name)} - ${J.description}`),console.log(` ${P.dim("modules:")} ${J.modules.join(", ")}`),J.theme){let Y=Object.entries(J.theme).map(([Q,$])=>`${Q}: ${$}`).join(", ");console.log(` ${P.dim("theme:")} ${Y}`)}}else console.log(P.bold(`Presets (${Z.length})`)),console.log(` ${Z.map((J)=>J.name).join(", ")}`)}function BF0(D,X){if(D.length<=X)return D;return D.slice(0,X-3)+"..."}import uy from"path";var HM=(D,X,Z)=>{let J=D instanceof RegExp?ix(D,Z):D,Y=X instanceof RegExp?ix(X,Z):X,Q=J!==null&&Y!=null&&OF0(J,Y,Z);return Q&&{start:Q[0],end:Q[1],pre:Z.slice(0,Q[0]),body:Z.slice(Q[0]+J.length,Q[1]),post:Z.slice(Q[1]+Y.length)}},ix=(D,X)=>{let Z=X.match(D);return Z?Z[0]:null},OF0=(D,X,Z)=>{let J,Y,Q,$=void 0,K,G=Z.indexOf(D),V=Z.indexOf(X,G+1),W=G;if(G>=0&&V>0){if(D===X)return[G,V];J=[],Q=Z.length;while(W>=0&&!K){if(W===G)J.push(W),G=Z.indexOf(D,W+1);else if(J.length===1){let F=J.pop();if(F!==void 0)K=[F,V]}else{if(Y=J.pop(),Y!==void 0&&Y<Q)Q=Y,$=V;V=Z.indexOf(X,W+1)}W=G<V&&G>=0?G:V}if(J.length&&$!==void 0)K=[Q,$]}return K};var nx="\x00SLASH"+Math.random()+"\x00",ox="\x00OPEN"+Math.random()+"\x00",zM="\x00CLOSE"+Math.random()+"\x00",rx="\x00COMMA"+Math.random()+"\x00",sx="\x00PERIOD"+Math.random()+"\x00",LF0=new RegExp(nx,"g"),MF0=new RegExp(ox,"g"),AF0=new RegExp(zM,"g"),NF0=new RegExp(rx,"g"),RF0=new RegExp(sx,"g"),EF0=/\\\\/g,TF0=/\\{/g,IF0=/\\}/g,jF0=/\\,/g,PF0=/\\./g;function qM(D){return!isNaN(D)?parseInt(D,10):D.charCodeAt(0)}function CF0(D){return D.replace(EF0,nx).replace(TF0,ox).replace(IF0,zM).replace(jF0,rx).replace(PF0,sx)}function wF0(D){return D.replace(LF0,"\\").replace(MF0,"{").replace(AF0,"}").replace(NF0,",").replace(RF0,".")}function ax(D){if(!D)return[""];let X=[],Z=HM("{","}",D);if(!Z)return D.split(",");let{pre:J,body:Y,post:Q}=Z,$=J.split(",");$[$.length-1]+="{"+Y+"}";let K=ax(Q);if(Q.length)$[$.length-1]+=K.shift(),$.push.apply($,K);return X.push.apply(X,$),X}function tx(D){if(!D)return[];if(D.slice(0,2)==="{}")D="\\{\\}"+D.slice(2);return Z$(CF0(D),!0).map(wF0)}function SF0(D){return"{"+D+"}"}function _F0(D){return/^-?0\d/.test(D)}function kF0(D,X){return D<=X}function hF0(D,X){return D>=X}function Z$(D,X){let Z=[],J=HM("{","}",D);if(!J)return[D];let Y=J.pre,Q=J.post.length?Z$(J.post,!1):[""];if(/\$$/.test(J.pre))for(let $=0;$<Q.length;$++){let K=Y+"{"+J.body+"}"+Q[$];Z.push(K)}else{let $=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(J.body),K=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(J.body),G=$||K,V=J.body.indexOf(",")>=0;if(!G&&!V){if(J.post.match(/,(?!,).*\}/))return D=J.pre+"{"+J.body+zM+J.post,Z$(D);return[D]}let W;if(G)W=J.body.split(/\.\./);else if(W=ax(J.body),W.length===1&&W[0]!==void 0){if(W=Z$(W[0],!1).map(SF0),W.length===1)return Q.map((z)=>J.pre+W[0]+z)}let F;if(G&&W[0]!==void 0&&W[1]!==void 0){let z=qM(W[0]),H=qM(W[1]),q=Math.max(W[0].length,W[1].length),U=W.length===3&&W[2]!==void 0?Math.abs(qM(W[2])):1,B=kF0;if(H<z)U*=-1,B=hF0;let L=W.some(_F0);F=[];for(let M=z;B(M,H);M+=U){let A;if(K){if(A=String.fromCharCode(M),A==="\\")A=""}else if(A=String(M),L){let E=q-A.length;if(E>0){let C=Array(E+1).join("0");if(M<0)A="-"+C+A.slice(1);else A=C+A}}F.push(A)}}else{F=[];for(let z=0;z<W.length;z++)F.push.apply(F,Z$(W[z],!1))}for(let z=0;z<F.length;z++)for(let H=0;H<Q.length;H++){let q=Y+F[z]+Q[H];if(!X||G||q)Z.push(q)}}return Z}var J$=(D)=>{if(typeof D!=="string")throw TypeError("invalid pattern");if(D.length>65536)throw TypeError("pattern is too long")};var xF0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Y$=(D)=>D.replace(/[[\]\\-]/g,"\\$&"),yF0=(D)=>D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ex=(D)=>D.join(""),Dy=(D,X)=>{let Z=X;if(D.charAt(Z)!=="[")throw Error("not in a brace expression");let J=[],Y=[],Q=Z+1,$=!1,K=!1,G=!1,V=!1,W=Z,F="";D:while(Q<D.length){let U=D.charAt(Q);if((U==="!"||U==="^")&&Q===Z+1){V=!0,Q++;continue}if(U==="]"&&$&&!G){W=Q+1;break}if($=!0,U==="\\"){if(!G){G=!0,Q++;continue}}if(U==="["&&!G){for(let[B,[O,L,M]]of Object.entries(xF0))if(D.startsWith(B,Q)){if(F)return["$.",!1,D.length-Z,!0];if(Q+=B.length,M)Y.push(O);else J.push(O);K=K||L;continue D}}if(G=!1,F){if(U>F)J.push(Y$(F)+"-"+Y$(U));else if(U===F)J.push(Y$(U));F="",Q++;continue}if(D.startsWith("-]",Q+1)){J.push(Y$(U+"-")),Q+=2;continue}if(D.startsWith("-",Q+1)){F=U,Q+=2;continue}J.push(Y$(U)),Q++}if(W<Q)return["",!1,0,!1];if(!J.length&&!Y.length)return["$.",!1,D.length-Z,!0];if(Y.length===0&&J.length===1&&/^\\?.$/.test(J[0])&&!V){let U=J[0].length===2?J[0].slice(-1):J[0];return[yF0(U),!1,W-Z,!1]}let z="["+(V?"^":"")+ex(J)+"]",H="["+(V?"":"^")+ex(Y)+"]";return[J.length&&Y.length?"("+z+"|"+H+")":J.length?z:H,K,W-Z,!0]};var P4=(D,{windowsPathsNoEscape:X=!1,magicalBraces:Z=!0}={})=>{if(Z)return X?D.replace(/\[([^\/\\])\]/g,"$1"):D.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return X?D.replace(/\[([^\/\\{}])\]/g,"$1"):D.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};var vF0=new Set(["!","?","+","*","@"]),Xy=(D)=>vF0.has(D),bF0="(?!(?:^|/)\\.\\.?(?:$|/))",lV="(?!\\.)",fF0=new Set(["[","."]),gF0=new Set(["..","."]),uF0=new Set("().*{}+?[]^$\\!"),mF0=(D)=>D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),UM="[^/]",Zy=UM+"*?",Jy=UM+"+?";class X8{type;#D;#X;#Z=!1;#J=[];#Q;#Y;#$;#G=!1;#K;#W;#F=!1;constructor(D,X,Z={}){if(this.type=D,D)this.#X=!0;if(this.#Q=X,this.#D=this.#Q?this.#Q.#D:this,this.#K=this.#D===this?Z:this.#D.#K,this.#$=this.#D===this?[]:this.#D.#$,D==="!"&&!this.#D.#G)this.#$.push(this);this.#Y=this.#Q?this.#Q.#J.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let D of this.#J){if(typeof D==="string")continue;if(D.type||D.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#J.map((D)=>String(D)).join("");else return this.#W=this.type+"("+this.#J.map((D)=>String(D)).join("|")+")"}#q(){if(this!==this.#D)throw Error("should only call on root");if(this.#G)return this;this.toString(),this.#G=!0;let D;while(D=this.#$.pop()){if(D.type!=="!")continue;let X=D,Z=X.#Q;while(Z){for(let J=X.#Y+1;!Z.type&&J<Z.#J.length;J++)for(let Y of D.#J){if(typeof Y==="string")throw Error("string part in extglob AST??");Y.copyIn(Z.#J[J])}X=Z,Z=X.#Q}}return this}push(...D){for(let X of D){if(X==="")continue;if(typeof X!=="string"&&!(X instanceof X8&&X.#Q===this))throw Error("invalid part: "+X);this.#J.push(X)}}toJSON(){let D=this.type===null?this.#J.slice().map((X)=>typeof X==="string"?X:X.toJSON()):[this.type,...this.#J.map((X)=>X.toJSON())];if(this.isStart()&&!this.type)D.unshift([]);if(this.isEnd()&&(this===this.#D||this.#D.#G&&this.#Q?.type==="!"))D.push({});return D}isStart(){if(this.#D===this)return!0;if(!this.#Q?.isStart())return!1;if(this.#Y===0)return!0;let D=this.#Q;for(let X=0;X<this.#Y;X++){let Z=D.#J[X];if(!(Z instanceof X8&&Z.type==="!"))return!1}return!0}isEnd(){if(this.#D===this)return!0;if(this.#Q?.type==="!")return!0;if(!this.#Q?.isEnd())return!1;if(!this.type)return this.#Q?.isEnd();let D=this.#Q?this.#Q.#J.length:0;return this.#Y===D-1}copyIn(D){if(typeof D==="string")this.push(D);else this.push(D.clone(this))}clone(D){let X=new X8(this.type,D);for(let Z of this.#J)X.copyIn(Z);return X}static#H(D,X,Z,J){let Y=!1,Q=!1,$=-1,K=!1;if(X.type===null){let z=Z,H="";while(z<D.length){let q=D.charAt(z++);if(Y||q==="\\"){Y=!Y,H+=q;continue}if(Q){if(z===$+1){if(q==="^"||q==="!")K=!0}else if(q==="]"&&!(z===$+2&&K))Q=!1;H+=q;continue}else if(q==="["){Q=!0,$=z,K=!1,H+=q;continue}if(!J.noext&&Xy(q)&&D.charAt(z)==="("){X.push(H),H="";let U=new X8(q,X);z=X8.#H(D,U,z,J),X.push(U);continue}H+=q}return X.push(H),z}let G=Z+1,V=new X8(null,X),W=[],F="";while(G<D.length){let z=D.charAt(G++);if(Y||z==="\\"){Y=!Y,F+=z;continue}if(Q){if(G===$+1){if(z==="^"||z==="!")K=!0}else if(z==="]"&&!(G===$+2&&K))Q=!1;F+=z;continue}else if(z==="["){Q=!0,$=G,K=!1,F+=z;continue}if(Xy(z)&&D.charAt(G)==="("){V.push(F),F="";let H=new X8(z,V);V.push(H),G=X8.#H(D,H,G,J);continue}if(z==="|"){V.push(F),F="",W.push(V),V=new X8(null,X);continue}if(z===")"){if(F===""&&X.#J.length===0)X.#F=!0;return V.push(F),F="",X.push(...W,V),G}F+=z}return X.type=null,X.#X=void 0,X.#J=[D.substring(Z-1)],G}static fromGlob(D,X={}){let Z=new X8(null,void 0,X);return X8.#H(D,Z,0,X),Z}toMMPattern(){if(this!==this.#D)return this.#D.toMMPattern();let D=this.toString(),[X,Z,J,Y]=this.toRegExpSource();if(!(J||this.#X||this.#K.nocase&&!this.#K.nocaseMagicOnly&&D.toUpperCase()!==D.toLowerCase()))return Z;let $=(this.#K.nocase?"i":"")+(Y?"u":"");return Object.assign(new RegExp(`^${X}$`,$),{_src:X,_glob:D})}get options(){return this.#K}toRegExpSource(D){let X=D??!!this.#K.dot;if(this.#D===this)this.#q();if(!this.type){let K=this.isStart()&&this.isEnd()&&!this.#J.some((z)=>typeof z!=="string"),G=this.#J.map((z)=>{let[H,q,U,B]=typeof z==="string"?X8.#U(z,this.#X,K):z.toRegExpSource(D);return this.#X=this.#X||U,this.#Z=this.#Z||B,H}).join(""),V="";if(this.isStart()){if(typeof this.#J[0]==="string"){if(!(this.#J.length===1&&gF0.has(this.#J[0]))){let H=fF0,q=X&&H.has(G.charAt(0))||G.startsWith("\\.")&&H.has(G.charAt(2))||G.startsWith("\\.\\.")&&H.has(G.charAt(4)),U=!X&&!D&&H.has(G.charAt(0));V=q?bF0:U?lV:""}}}let W="";if(this.isEnd()&&this.#D.#G&&this.#Q?.type==="!")W="(?:$|\\/)";return[V+G+W,P4(G),this.#X=!!this.#X,this.#Z]}let Z=this.type==="*"||this.type==="+",J=this.type==="!"?"(?:(?!(?:":"(?:",Y=this.#V(X);if(this.isStart()&&this.isEnd()&&!Y&&this.type!=="!"){let K=this.toString();return this.#J=[K],this.type=null,this.#X=void 0,[K,P4(this.toString()),!1,!1]}let Q=!Z||D||X||!lV?"":this.#V(!0);if(Q===Y)Q="";if(Q)Y=`(?:${Y})(?:${Q})*?`;let $="";if(this.type==="!"&&this.#F)$=(this.isStart()&&!X?lV:"")+Jy;else{let K=this.type==="!"?"))"+(this.isStart()&&!X&&!D?lV:"")+Zy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&Q?")":this.type==="*"&&Q?")?":`)${this.type}`;$=J+Y+K}return[$,P4(Y),this.#X=!!this.#X,this.#Z]}#V(D){return this.#J.map((X)=>{if(typeof X==="string")throw Error("string type in extglob ast??");let[Z,J,Y,Q]=X.toRegExpSource(D);return this.#Z=this.#Z||Q,Z}).filter((X)=>!(this.isStart()&&this.isEnd())||!!X).join("|")}static#U(D,X,Z=!1){let J=!1,Y="",Q=!1;for(let $=0;$<D.length;$++){let K=D.charAt($);if(J){J=!1,Y+=(uF0.has(K)?"\\":"")+K;continue}if(K==="\\"){if($===D.length-1)Y+="\\\\";else J=!0;continue}if(K==="["){let[G,V,W,F]=Dy(D,$);if(W){Y+=G,Q=Q||V,$+=W-1,X=X||F;continue}}if(K==="*"){Y+=Z&&D==="*"?Jy:Zy,X=!0;continue}if(K==="?"){Y+=UM,X=!0;continue}Y+=mF0(K)}return[Y,P4(D),!!X,Q]}}var RZ=(D,{windowsPathsNoEscape:X=!1,magicalBraces:Z=!1}={})=>{if(Z)return X?D.replace(/[?*()[\]{}]/g,"[$&]"):D.replace(/[?*()[\]\\{}]/g,"\\$&");return X?D.replace(/[?*()[\]]/g,"[$&]"):D.replace(/[?*()[\]\\]/g,"\\$&")};var k8=(D,X,Z={})=>{if(J$(X),!Z.nocomment&&X.charAt(0)==="#")return!1;return new f6(X,Z).match(D)},cF0=/^\*+([^+@!?\*\[\(]*)$/,dF0=(D)=>(X)=>!X.startsWith(".")&&X.endsWith(D),lF0=(D)=>(X)=>X.endsWith(D),pF0=(D)=>{return D=D.toLowerCase(),(X)=>!X.startsWith(".")&&X.toLowerCase().endsWith(D)},iF0=(D)=>{return D=D.toLowerCase(),(X)=>X.toLowerCase().endsWith(D)},nF0=/^\*+\.\*+$/,oF0=(D)=>!D.startsWith(".")&&D.includes("."),rF0=(D)=>D!=="."&&D!==".."&&D.includes("."),sF0=/^\.\*+$/,aF0=(D)=>D!=="."&&D!==".."&&D.startsWith("."),tF0=/^\*+$/,eF0=(D)=>D.length!==0&&!D.startsWith("."),DH0=(D)=>D.length!==0&&D!=="."&&D!=="..",XH0=/^\?+([^+@!?\*\[\(]*)?$/,ZH0=([D,X=""])=>{let Z=$y([D]);if(!X)return Z;return X=X.toLowerCase(),(J)=>Z(J)&&J.toLowerCase().endsWith(X)},JH0=([D,X=""])=>{let Z=Ky([D]);if(!X)return Z;return X=X.toLowerCase(),(J)=>Z(J)&&J.toLowerCase().endsWith(X)},YH0=([D,X=""])=>{let Z=Ky([D]);return!X?Z:(J)=>Z(J)&&J.endsWith(X)},QH0=([D,X=""])=>{let Z=$y([D]);return!X?Z:(J)=>Z(J)&&J.endsWith(X)},$y=([D])=>{let X=D.length;return(Z)=>Z.length===X&&!Z.startsWith(".")},Ky=([D])=>{let X=D.length;return(Z)=>Z.length===X&&Z!=="."&&Z!==".."},Gy=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Yy={win32:{sep:"\\"},posix:{sep:"/"}},$H0=Gy==="win32"?Yy.win32.sep:Yy.posix.sep;k8.sep=$H0;var Z8=Symbol("globstar **");k8.GLOBSTAR=Z8;var KH0="[^/]",GH0=KH0+"*?",WH0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VH0="(?:(?!(?:\\/|^)\\.).)*?",FH0=(D,X={})=>(Z)=>k8(Z,D,X);k8.filter=FH0;var b6=(D,X={})=>Object.assign({},D,X),HH0=(D)=>{if(!D||typeof D!=="object"||!Object.keys(D).length)return k8;let X=k8;return Object.assign((J,Y,Q={})=>X(J,Y,b6(D,Q)),{Minimatch:class extends X.Minimatch{constructor(Y,Q={}){super(Y,b6(D,Q))}static defaults(Y){return X.defaults(b6(D,Y)).Minimatch}},AST:class extends X.AST{constructor(Y,Q,$={}){super(Y,Q,b6(D,$))}static fromGlob(Y,Q={}){return X.AST.fromGlob(Y,b6(D,Q))}},unescape:(J,Y={})=>X.unescape(J,b6(D,Y)),escape:(J,Y={})=>X.escape(J,b6(D,Y)),filter:(J,Y={})=>X.filter(J,b6(D,Y)),defaults:(J)=>X.defaults(b6(D,J)),makeRe:(J,Y={})=>X.makeRe(J,b6(D,Y)),braceExpand:(J,Y={})=>X.braceExpand(J,b6(D,Y)),match:(J,Y,Q={})=>X.match(J,Y,b6(D,Q)),sep:X.sep,GLOBSTAR:Z8})};k8.defaults=HH0;var Wy=(D,X={})=>{if(J$(D),X.nobrace||!/\{(?:(?!\{).)*\}/.test(D))return[D];return tx(D)};k8.braceExpand=Wy;var qH0=(D,X={})=>new f6(D,X).makeRe();k8.makeRe=qH0;var zH0=(D,X,Z={})=>{let J=new f6(X,Z);if(D=D.filter((Y)=>J.match(Y)),J.options.nonull&&!D.length)D.push(X);return D};k8.match=zH0;var Qy=/[?*]|[+@!]\(.*?\)|\[|\]/,UH0=(D)=>D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class f6{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(D,X={}){if(J$(D),X=X||{},this.options=X,this.pattern=D,this.platform=X.platform||Gy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!X.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!X.nonegate,this.comment=!1,this.empty=!1,this.partial=!!X.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=X.windowsNoMagicRoot!==void 0?X.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let D of this.set)for(let X of D)if(typeof X!=="string")return!0;return!1}debug(...D){}make(){let D=this.pattern,X=this.options;if(!X.nocomment&&D.charAt(0)==="#"){this.comment=!0;return}if(!D){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],X.debug)this.debug=(...Y)=>console.error(...Y);this.debug(this.pattern,this.globSet);let Z=this.globSet.map((Y)=>this.slashSplit(Y));this.globParts=this.preprocess(Z),this.debug(this.pattern,this.globParts);let J=this.globParts.map((Y,Q,$)=>{if(this.isWindows&&this.windowsNoMagicRoot){let K=Y[0]===""&&Y[1]===""&&(Y[2]==="?"||!Qy.test(Y[2]))&&!Qy.test(Y[3]),G=/^[a-z]:/i.test(Y[0]);if(K)return[...Y.slice(0,4),...Y.slice(4).map((V)=>this.parse(V))];else if(G)return[Y[0],...Y.slice(1).map((V)=>this.parse(V))]}return Y.map((K)=>this.parse(K))});if(this.debug(this.pattern,J),this.set=J.filter((Y)=>Y.indexOf(!1)===-1),this.isWindows)for(let Y=0;Y<this.set.length;Y++){let Q=this.set[Y];if(Q[0]===""&&Q[1]===""&&this.globParts[Y][2]==="?"&&typeof Q[3]==="string"&&/^[a-z]:$/i.test(Q[3]))Q[2]="?"}this.debug(this.pattern,this.set)}preprocess(D){if(this.options.noglobstar){for(let Z=0;Z<D.length;Z++)for(let J=0;J<D[Z].length;J++)if(D[Z][J]==="**")D[Z][J]="*"}let{optimizationLevel:X=1}=this.options;if(X>=2)D=this.firstPhasePreProcess(D),D=this.secondPhasePreProcess(D);else if(X>=1)D=this.levelOneOptimize(D);else D=this.adjascentGlobstarOptimize(D);return D}adjascentGlobstarOptimize(D){return D.map((X)=>{let Z=-1;while((Z=X.indexOf("**",Z+1))!==-1){let J=Z;while(X[J+1]==="**")J++;if(J!==Z)X.splice(Z,J-Z)}return X})}levelOneOptimize(D){return D.map((X)=>{return X=X.reduce((Z,J)=>{let Y=Z[Z.length-1];if(J==="**"&&Y==="**")return Z;if(J===".."){if(Y&&Y!==".."&&Y!=="."&&Y!=="**")return Z.pop(),Z}return Z.push(J),Z},[]),X.length===0?[""]:X})}levelTwoFileOptimize(D){if(!Array.isArray(D))D=this.slashSplit(D);let X=!1;do{if(X=!1,!this.preserveMultipleSlashes){for(let J=1;J<D.length-1;J++){let Y=D[J];if(J===1&&Y===""&&D[0]==="")continue;if(Y==="."||Y==="")X=!0,D.splice(J,1),J--}if(D[0]==="."&&D.length===2&&(D[1]==="."||D[1]===""))X=!0,D.pop()}let Z=0;while((Z=D.indexOf("..",Z+1))!==-1){let J=D[Z-1];if(J&&J!=="."&&J!==".."&&J!=="**")X=!0,D.splice(Z-1,2),Z-=2}}while(X);return D.length===0?[""]:D}firstPhasePreProcess(D){let X=!1;do{X=!1;for(let Z of D){let J=-1;while((J=Z.indexOf("**",J+1))!==-1){let Q=J;while(Z[Q+1]==="**")Q++;if(Q>J)Z.splice(J+1,Q-J);let $=Z[J+1],K=Z[J+2],G=Z[J+3];if($!=="..")continue;if(!K||K==="."||K===".."||!G||G==="."||G==="..")continue;X=!0,Z.splice(J,1);let V=Z.slice(0);V[J]="**",D.push(V),J--}if(!this.preserveMultipleSlashes){for(let Q=1;Q<Z.length-1;Q++){let $=Z[Q];if(Q===1&&$===""&&Z[0]==="")continue;if($==="."||$==="")X=!0,Z.splice(Q,1),Q--}if(Z[0]==="."&&Z.length===2&&(Z[1]==="."||Z[1]===""))X=!0,Z.pop()}let Y=0;while((Y=Z.indexOf("..",Y+1))!==-1){let Q=Z[Y-1];if(Q&&Q!=="."&&Q!==".."&&Q!=="**"){X=!0;let K=Y===1&&Z[Y+1]==="**"?["."]:[];if(Z.splice(Y-1,2,...K),Z.length===0)Z.push("");Y-=2}}}}while(X);return D}secondPhasePreProcess(D){for(let X=0;X<D.length-1;X++)for(let Z=X+1;Z<D.length;Z++){let J=this.partsMatch(D[X],D[Z],!this.preserveMultipleSlashes);if(J){D[X]=[],D[Z]=J;break}}return D.filter((X)=>X.length)}partsMatch(D,X,Z=!1){let J=0,Y=0,Q=[],$="";while(J<D.length&&Y<X.length)if(D[J]===X[Y])Q.push($==="b"?X[Y]:D[J]),J++,Y++;else if(Z&&D[J]==="**"&&X[Y]===D[J+1])Q.push(D[J]),J++;else if(Z&&X[Y]==="**"&&D[J]===X[Y+1])Q.push(X[Y]),Y++;else if(D[J]==="*"&&X[Y]&&(this.options.dot||!X[Y].startsWith("."))&&X[Y]!=="**"){if($==="b")return!1;$="a",Q.push(D[J]),J++,Y++}else if(X[Y]==="*"&&D[J]&&(this.options.dot||!D[J].startsWith("."))&&D[J]!=="**"){if($==="a")return!1;$="b",Q.push(X[Y]),J++,Y++}else return!1;return D.length===X.length&&Q}parseNegate(){if(this.nonegate)return;let D=this.pattern,X=!1,Z=0;for(let J=0;J<D.length&&D.charAt(J)==="!";J++)X=!X,Z++;if(Z)this.pattern=D.slice(Z);this.negate=X}matchOne(D,X,Z=!1){let J=this.options;if(this.isWindows){let q=typeof D[0]==="string"&&/^[a-z]:$/i.test(D[0]),U=!q&&D[0]===""&&D[1]===""&&D[2]==="?"&&/^[a-z]:$/i.test(D[3]),B=typeof X[0]==="string"&&/^[a-z]:$/i.test(X[0]),O=!B&&X[0]===""&&X[1]===""&&X[2]==="?"&&typeof X[3]==="string"&&/^[a-z]:$/i.test(X[3]),L=U?3:q?0:void 0,M=O?3:B?0:void 0;if(typeof L==="number"&&typeof M==="number"){let[A,E]=[D[L],X[M]];if(A.toLowerCase()===E.toLowerCase()){if(X[M]=A,M>L)X=X.slice(M);else if(L>M)D=D.slice(L)}}}let{optimizationLevel:Y=1}=this.options;if(Y>=2)D=this.levelTwoFileOptimize(D);this.debug("matchOne",this,{file:D,pattern:X}),this.debug("matchOne",D.length,X.length);for(var Q=0,$=0,K=D.length,G=X.length;Q<K&&$<G;Q++,$++){this.debug("matchOne loop");var V=X[$],W=D[Q];if(this.debug(X,V,W),V===!1)return!1;if(V===Z8){this.debug("GLOBSTAR",[X,V,W]);var F=Q,z=$+1;if(z===G){this.debug("** at the end");for(;Q<K;Q++)if(D[Q]==="."||D[Q]===".."||!J.dot&&D[Q].charAt(0)===".")return!1;return!0}while(F<K){var H=D[F];if(this.debug(`
401
+ `));for(let F of E4){if(console.log(` ${P.cyan(F.name)} - ${F.description}`),F.header||F.footer){let z=[];if(F.header)z.push(`header: ${F.header}`);if(F.footer)z.push(`footer: ${F.footer}`);console.log(P.dim(` Layout: ${z.join(", ")}`))}if(F.indexSections?.length)console.log(P.dim(` Sections: ${F.indexSections.join(", ")}`));if(F.modules.length>0)console.log(P.dim(` Modules: ${F.modules.slice(0,4).join(", ")}${F.modules.length>4?`, +${F.modules.length-4} more`:""}`));if(F.theme){let z=[];if(F.theme.preset)z.push(`theme: ${F.theme.preset}`);if(F.theme.radius)z.push(`radius: ${F.theme.radius}`);if(F.theme.shadow)z.push(`shadow: ${F.theme.shadow}`);console.log(P.dim(` Theme: ${z.join(", ")}`))}console.log("")}console.log(P.dim("Usage: promake create myapp --preset ecommerce")),console.log(P.dim(" promake create myapp --header header-mega --footer footer --sections hero-cta"));return}if(!D)console.log(P.red("Project name is required")),console.log(P.dim("Usage: promake create <name> [options]")),console.log(P.dim(" promake create --list-presets")),process.exit(1);let Z=X.path||process.cwd(),J=D$.isAbsolute(D)?D:D$.join(Z,D),Y=D$.basename(J),Q=await X$.default.pathExists(J);if(Q)console.log(P.dim(`Directory "${Y}" exists, creating project inside it...`));if(X.path)await X$.default.ensureDir(Z);let $=null;if(X.preset){if($=E4.find((F)=>F.name.toLowerCase()===X.preset.toLowerCase()),!$)console.log(P.red(`Unknown preset: ${X.preset}`)),console.log(P.dim(`Available: ${E4.map((F)=>F.name).join(", ")}`)),process.exit(1)}let K,G,V=[];if(!X.empty&&!X.minimal){if($)K=$.header,G=$.footer,V=$.indexSections||[];if(X.header)K=X.header;if(X.footer)G=X.footer;if(X.sections)V=X.sections.split(",").map((F)=>F.trim())}let W=E2("Creating project...").start();try{await qx(J),W.text="Base template copied",await Ux(J,Y),W.text="Updated package.json",await m9(J,FD()),W.text="Created promake.json";let F=X.pm;if(X.install){W.text="Installing dependencies...";let j=F==="bun"?"bun install":`${F} install`;FF0(j,{cwd:J,stdio:"pipe"})}W.succeed(P.green("Project created!")),console.log(""),console.log(P.bold("Installing built-in modules..."));let z=await T2(J)||FD(),H=z.modulesPath||"src/modules",q=new Set;for(let j of vV)try{await I4(j,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q)}catch(I){console.log(P.yellow(` Warning: Could not install ${j}`))}if(K){console.log(""),console.log(P.bold(`Installing header: ${K}`));try{await I4(K,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q)}catch(j){console.log(P.yellow(` Warning: Could not install ${K}`)),K=void 0}}if(G){console.log(""),console.log(P.bold(`Installing footer: ${G}`));try{await I4(G,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q)}catch(j){console.log(P.yellow(` Warning: Could not install ${G}`)),G=void 0}}let U=[];if(V.length>0){console.log(""),console.log(P.bold(`Installing ${V.length} sections...`));for(let j of V)try{await I4(j,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q),U.push(j)}catch(I){console.log(P.yellow(` Warning: Could not install ${j}`))}}let B=[],O=[];if($?.modules)O.push(...$.modules);if(X.pages){let j=X.pages.split(",").map((I)=>I.trim());for(let I of j)if(!O.includes(I))O.push(I)}if(X.add){let j=X.add.split(",").map((I)=>I.trim());for(let I of j)if(!O.includes(I))O.push(I)}if(O.length>0){console.log(""),console.log(P.bold(`Installing ${O.length} modules...`));for(let j of O)try{await I4(j,J,z,{force:!1,dryRun:!1,route:!1,skipInstall:!X.install},q);let I=await cx(j);if(I)B.push(I)}catch(I){console.log(P.yellow(` Warning: Could not install ${j}`))}}console.log(""),console.log(P.bold("Generating project files..."));let L=fx({hasDb:q.has("db"),hasApi:q.has("api")});await eQ(J,"src/App.tsx",L),console.log(` ${P.cyan("✓")} Generated App.tsx`);let M=gx({header:K,footer:G,modulesPath:H});await eQ(J,"src/components/Layout.tsx",M),console.log(` ${P.cyan("✓")} Generated Layout.tsx`);let A=ux({sections:U,modulesPath:H});await eQ(J,"src/pages/Index.tsx",A),console.log(` ${P.cyan("✓")} Generated Index.tsx`);let E=mx({routes:B,modulesPath:H});await eQ(J,"src/router.tsx",E),console.log(` ${P.cyan("✓")} Generated router.tsx with ${B.length} routes`);let C={};if($?.theme){if($.theme.preset)C.preset=$.theme.preset;if($.theme.radius)C.radius=$.theme.radius;if($.theme.shadow)C.shadow=$.theme.shadow;if($.theme.font)C.font=$.theme.font;if($.theme.mono)C.mono=$.theme.mono;if($.theme.maxWidth)C.maxWidth=$.theme.maxWidth}if(X.theme)C.preset=X.theme;if(X.radius)C.radius=X.radius;if(X.shadow)C.shadow=X.shadow;if(X.font)C.font=X.font;if(X.mono)C.mono=X.mono;if(X.maxWidth)C.maxWidth=X.maxWidth;if(Object.keys(C).length>0){console.log(""),console.log(P.bold("Applying theme settings..."));let j=await cV(J,C);if(j.success&&j.changes.length>0){j.changes.forEach((g)=>console.log(` ${P.cyan("✓")} ${g}`));let I=await T2(J)||FD();I.theme={...I.theme,...C},await m9(J,I)}}console.log(""),console.log(P.bold("Next steps:"));let T=D$.isAbsolute(D)?J:X.path?D$.relative(process.cwd(),J):Y;if(console.log(P.cyan(` cd ${T}`)),!X.install)console.log(P.cyan(` ${F} install`));if(console.log(P.cyan(` ${F} run dev`)),O.length===0&&!K&&!G)console.log(""),console.log("Add modules:"),console.log(P.cyan(" npx promake add <module-name>"))}catch(F){if(W.fail("Failed to create project"),!Q&&await X$.default.pathExists(J))await X$.default.remove(J);if(F instanceof Error)console.log(P.red(F.message));process.exit(1)}});var HF0={"registry:module":"Modules","registry:component":"Components","registry:page":"Pages","registry:hook":"Hooks","registry:context":"Contexts","registry:type":"Types","registry:lang":"Language Files","registry:lib":"Libraries","registry:block":"Blocks","registry:ui":"UI Components","registry:store":"Stores","registry:service":"Services","registry:style":"Styles","registry:file":"Files"},qF0={module:"registry:module",component:"registry:component",page:"registry:page",hook:"registry:hook",context:"registry:context",type:"registry:type",lang:"registry:lang",lib:"registry:lib",block:"registry:block",ui:"registry:ui",store:"registry:store",service:"registry:service",style:"registry:style",file:"registry:file"},lx=["registry:module","registry:component","registry:page","registry:block","registry:lib","registry:hook","registry:context","registry:type","registry:lang"],px=new $5("list").alias("ls").argument("[type]","Filter by type (module, component, page, block, preset, etc.)").argument("[name]","Filter by specific name (for presets)").option("-s, --search <term>","Search by name or description").option("--json","Output as JSON").option("-d, --detailed","Show detailed information").description("List available modules in registry").action(async(D,X,Z)=>{let J=Z||{};if(D==="preset"||D==="presets"){UF0(J,X);return}let Y=E2("Fetching registry...").start();try{let Q=await Fx(),$=[];for(let W of Q)try{let F=await R4(W);$.push(F)}catch{}Y.stop();let K=$;if(J.search){let W=J.search.toLowerCase();K=K.filter((F)=>F.name.toLowerCase().includes(W)||F.title?.toLowerCase().includes(W)||F.description?.toLowerCase().includes(W))}if(!D){zF0(K,J);return}let G=qF0[D.toLowerCase()]||`registry:${D.toLowerCase()}`;if(K=K.filter((W)=>W.type===G),J.json){if(J.detailed)console.log(JSON.stringify(K,null,2));else console.log(JSON.stringify(K.map((W)=>W.name),null,2));return}let V=HF0[G]||D;if(K.length===0){console.log(P.yellow(`No ${V.toLowerCase()} found`));return}if(console.log(P.bold(`${V} (${K.length})`)),J.detailed)for(let W of K){let F=W.title?` - ${W.title}`:"",z=W.description?P.dim(` ${BF0(W.description,50)}`):"";if(console.log(` ${P.green(W.name)}${F}${z}`),W.registryDependencies?.length)console.log(` ${P.dim("deps:")} ${W.registryDependencies.join(", ")}`)}else{let W=K.map((F)=>F.name);if(W.join(", ").length<80)console.log(` ${W.join(", ")}`);else for(let F of W)console.log(` ${F}`)}}catch(Q){if(Y.fail("Failed to fetch registry"),Q instanceof Error)console.log(P.red(Q.message));process.exit(1)}});function zF0(D,X){let Z=new Map;for(let Y of D){let Q=Y.type;Z.set(Q,(Z.get(Q)||0)+1)}let J=Array.from(Z.keys()).sort((Y,Q)=>{let $=lx.indexOf(Y),K=lx.indexOf(Q);if($===-1&&K===-1)return Y.localeCompare(Q);if($===-1)return 1;if(K===-1)return-1;return $-K});if(X.json){let Y={};for(let Q of J){let $=Q.replace("registry:","");Y[$]=Z.get(Q)||0}Y.preset=E4.length,console.log(JSON.stringify(Y,null,2));return}console.log(P.bold(`Registry (${D.length} items)`));for(let Y of J){let Q=Z.get(Y)||0,$=Y.replace("registry:","");console.log(` ${P.cyan($.padEnd(10))} ${P.yellow(Q)}`)}console.log(` ${P.cyan("preset".padEnd(10))} ${P.yellow(E4.length)}`)}function UF0(D,X){let Z=E4;if(X){let J=Z.find((Y)=>Y.name.toLowerCase()===X.toLowerCase());if(!J){console.log(P.yellow(`Preset "${X}" not found.`)),console.log(P.gray(`Available presets: ${Z.map((Y)=>Y.name).join(", ")}`));return}Z=[J]}if(D.json){if(D.detailed)console.log(JSON.stringify(Z,null,2));else console.log(JSON.stringify(Z.map((J)=>J.name),null,2));return}if(X){let J=Z[0];if(console.log(P.bold(J.name)+P.dim(` - ${J.description}`)),console.log(` ${P.dim("modules:")} ${J.modules.join(", ")}`),J.theme){let Y=Object.entries(J.theme).map(([Q,$])=>`${Q}: ${$}`).join(", ");console.log(` ${P.dim("theme:")} ${Y}`)}}else if(D.detailed){console.log(P.bold(`Presets (${Z.length})`));for(let J of Z)if(console.log(` ${P.cyan(J.name)} - ${J.description}`),console.log(` ${P.dim("modules:")} ${J.modules.join(", ")}`),J.theme){let Y=Object.entries(J.theme).map(([Q,$])=>`${Q}: ${$}`).join(", ");console.log(` ${P.dim("theme:")} ${Y}`)}}else console.log(P.bold(`Presets (${Z.length})`)),console.log(` ${Z.map((J)=>J.name).join(", ")}`)}function BF0(D,X){if(D.length<=X)return D;return D.slice(0,X-3)+"..."}import uy from"path";var HM=(D,X,Z)=>{let J=D instanceof RegExp?ix(D,Z):D,Y=X instanceof RegExp?ix(X,Z):X,Q=J!==null&&Y!=null&&OF0(J,Y,Z);return Q&&{start:Q[0],end:Q[1],pre:Z.slice(0,Q[0]),body:Z.slice(Q[0]+J.length,Q[1]),post:Z.slice(Q[1]+Y.length)}},ix=(D,X)=>{let Z=X.match(D);return Z?Z[0]:null},OF0=(D,X,Z)=>{let J,Y,Q,$=void 0,K,G=Z.indexOf(D),V=Z.indexOf(X,G+1),W=G;if(G>=0&&V>0){if(D===X)return[G,V];J=[],Q=Z.length;while(W>=0&&!K){if(W===G)J.push(W),G=Z.indexOf(D,W+1);else if(J.length===1){let F=J.pop();if(F!==void 0)K=[F,V]}else{if(Y=J.pop(),Y!==void 0&&Y<Q)Q=Y,$=V;V=Z.indexOf(X,W+1)}W=G<V&&G>=0?G:V}if(J.length&&$!==void 0)K=[Q,$]}return K};var nx="\x00SLASH"+Math.random()+"\x00",ox="\x00OPEN"+Math.random()+"\x00",zM="\x00CLOSE"+Math.random()+"\x00",rx="\x00COMMA"+Math.random()+"\x00",sx="\x00PERIOD"+Math.random()+"\x00",LF0=new RegExp(nx,"g"),MF0=new RegExp(ox,"g"),AF0=new RegExp(zM,"g"),NF0=new RegExp(rx,"g"),RF0=new RegExp(sx,"g"),EF0=/\\\\/g,TF0=/\\{/g,IF0=/\\}/g,jF0=/\\,/g,PF0=/\\./g;function qM(D){return!isNaN(D)?parseInt(D,10):D.charCodeAt(0)}function CF0(D){return D.replace(EF0,nx).replace(TF0,ox).replace(IF0,zM).replace(jF0,rx).replace(PF0,sx)}function wF0(D){return D.replace(LF0,"\\").replace(MF0,"{").replace(AF0,"}").replace(NF0,",").replace(RF0,".")}function ax(D){if(!D)return[""];let X=[],Z=HM("{","}",D);if(!Z)return D.split(",");let{pre:J,body:Y,post:Q}=Z,$=J.split(",");$[$.length-1]+="{"+Y+"}";let K=ax(Q);if(Q.length)$[$.length-1]+=K.shift(),$.push.apply($,K);return X.push.apply(X,$),X}function tx(D){if(!D)return[];if(D.slice(0,2)==="{}")D="\\{\\}"+D.slice(2);return Z$(CF0(D),!0).map(wF0)}function SF0(D){return"{"+D+"}"}function _F0(D){return/^-?0\d/.test(D)}function kF0(D,X){return D<=X}function hF0(D,X){return D>=X}function Z$(D,X){let Z=[],J=HM("{","}",D);if(!J)return[D];let Y=J.pre,Q=J.post.length?Z$(J.post,!1):[""];if(/\$$/.test(J.pre))for(let $=0;$<Q.length;$++){let K=Y+"{"+J.body+"}"+Q[$];Z.push(K)}else{let $=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(J.body),K=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(J.body),G=$||K,V=J.body.indexOf(",")>=0;if(!G&&!V){if(J.post.match(/,(?!,).*\}/))return D=J.pre+"{"+J.body+zM+J.post,Z$(D);return[D]}let W;if(G)W=J.body.split(/\.\./);else if(W=ax(J.body),W.length===1&&W[0]!==void 0){if(W=Z$(W[0],!1).map(SF0),W.length===1)return Q.map((z)=>J.pre+W[0]+z)}let F;if(G&&W[0]!==void 0&&W[1]!==void 0){let z=qM(W[0]),H=qM(W[1]),q=Math.max(W[0].length,W[1].length),U=W.length===3&&W[2]!==void 0?Math.abs(qM(W[2])):1,B=kF0;if(H<z)U*=-1,B=hF0;let L=W.some(_F0);F=[];for(let M=z;B(M,H);M+=U){let A;if(K){if(A=String.fromCharCode(M),A==="\\")A=""}else if(A=String(M),L){let E=q-A.length;if(E>0){let C=Array(E+1).join("0");if(M<0)A="-"+C+A.slice(1);else A=C+A}}F.push(A)}}else{F=[];for(let z=0;z<W.length;z++)F.push.apply(F,Z$(W[z],!1))}for(let z=0;z<F.length;z++)for(let H=0;H<Q.length;H++){let q=Y+F[z]+Q[H];if(!X||G||q)Z.push(q)}}return Z}var J$=(D)=>{if(typeof D!=="string")throw TypeError("invalid pattern");if(D.length>65536)throw TypeError("pattern is too long")};var xF0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Y$=(D)=>D.replace(/[[\]\\-]/g,"\\$&"),yF0=(D)=>D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ex=(D)=>D.join(""),Dy=(D,X)=>{let Z=X;if(D.charAt(Z)!=="[")throw Error("not in a brace expression");let J=[],Y=[],Q=Z+1,$=!1,K=!1,G=!1,V=!1,W=Z,F="";D:while(Q<D.length){let U=D.charAt(Q);if((U==="!"||U==="^")&&Q===Z+1){V=!0,Q++;continue}if(U==="]"&&$&&!G){W=Q+1;break}if($=!0,U==="\\"){if(!G){G=!0,Q++;continue}}if(U==="["&&!G){for(let[B,[O,L,M]]of Object.entries(xF0))if(D.startsWith(B,Q)){if(F)return["$.",!1,D.length-Z,!0];if(Q+=B.length,M)Y.push(O);else J.push(O);K=K||L;continue D}}if(G=!1,F){if(U>F)J.push(Y$(F)+"-"+Y$(U));else if(U===F)J.push(Y$(U));F="",Q++;continue}if(D.startsWith("-]",Q+1)){J.push(Y$(U+"-")),Q+=2;continue}if(D.startsWith("-",Q+1)){F=U,Q+=2;continue}J.push(Y$(U)),Q++}if(W<Q)return["",!1,0,!1];if(!J.length&&!Y.length)return["$.",!1,D.length-Z,!0];if(Y.length===0&&J.length===1&&/^\\?.$/.test(J[0])&&!V){let U=J[0].length===2?J[0].slice(-1):J[0];return[yF0(U),!1,W-Z,!1]}let z="["+(V?"^":"")+ex(J)+"]",H="["+(V?"":"^")+ex(Y)+"]";return[J.length&&Y.length?"("+z+"|"+H+")":J.length?z:H,K,W-Z,!0]};var P4=(D,{windowsPathsNoEscape:X=!1,magicalBraces:Z=!0}={})=>{if(Z)return X?D.replace(/\[([^\/\\])\]/g,"$1"):D.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return X?D.replace(/\[([^\/\\{}])\]/g,"$1"):D.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};var vF0=new Set(["!","?","+","*","@"]),Xy=(D)=>vF0.has(D),bF0="(?!(?:^|/)\\.\\.?(?:$|/))",lV="(?!\\.)",fF0=new Set(["[","."]),gF0=new Set(["..","."]),uF0=new Set("().*{}+?[]^$\\!"),mF0=(D)=>D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),UM="[^/]",Zy=UM+"*?",Jy=UM+"+?";class X8{type;#D;#X;#Z=!1;#J=[];#Q;#Y;#$;#G=!1;#K;#W;#F=!1;constructor(D,X,Z={}){if(this.type=D,D)this.#X=!0;if(this.#Q=X,this.#D=this.#Q?this.#Q.#D:this,this.#K=this.#D===this?Z:this.#D.#K,this.#$=this.#D===this?[]:this.#D.#$,D==="!"&&!this.#D.#G)this.#$.push(this);this.#Y=this.#Q?this.#Q.#J.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let D of this.#J){if(typeof D==="string")continue;if(D.type||D.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#J.map((D)=>String(D)).join("");else return this.#W=this.type+"("+this.#J.map((D)=>String(D)).join("|")+")"}#q(){if(this!==this.#D)throw Error("should only call on root");if(this.#G)return this;this.toString(),this.#G=!0;let D;while(D=this.#$.pop()){if(D.type!=="!")continue;let X=D,Z=X.#Q;while(Z){for(let J=X.#Y+1;!Z.type&&J<Z.#J.length;J++)for(let Y of D.#J){if(typeof Y==="string")throw Error("string part in extglob AST??");Y.copyIn(Z.#J[J])}X=Z,Z=X.#Q}}return this}push(...D){for(let X of D){if(X==="")continue;if(typeof X!=="string"&&!(X instanceof X8&&X.#Q===this))throw Error("invalid part: "+X);this.#J.push(X)}}toJSON(){let D=this.type===null?this.#J.slice().map((X)=>typeof X==="string"?X:X.toJSON()):[this.type,...this.#J.map((X)=>X.toJSON())];if(this.isStart()&&!this.type)D.unshift([]);if(this.isEnd()&&(this===this.#D||this.#D.#G&&this.#Q?.type==="!"))D.push({});return D}isStart(){if(this.#D===this)return!0;if(!this.#Q?.isStart())return!1;if(this.#Y===0)return!0;let D=this.#Q;for(let X=0;X<this.#Y;X++){let Z=D.#J[X];if(!(Z instanceof X8&&Z.type==="!"))return!1}return!0}isEnd(){if(this.#D===this)return!0;if(this.#Q?.type==="!")return!0;if(!this.#Q?.isEnd())return!1;if(!this.type)return this.#Q?.isEnd();let D=this.#Q?this.#Q.#J.length:0;return this.#Y===D-1}copyIn(D){if(typeof D==="string")this.push(D);else this.push(D.clone(this))}clone(D){let X=new X8(this.type,D);for(let Z of this.#J)X.copyIn(Z);return X}static#H(D,X,Z,J){let Y=!1,Q=!1,$=-1,K=!1;if(X.type===null){let z=Z,H="";while(z<D.length){let q=D.charAt(z++);if(Y||q==="\\"){Y=!Y,H+=q;continue}if(Q){if(z===$+1){if(q==="^"||q==="!")K=!0}else if(q==="]"&&!(z===$+2&&K))Q=!1;H+=q;continue}else if(q==="["){Q=!0,$=z,K=!1,H+=q;continue}if(!J.noext&&Xy(q)&&D.charAt(z)==="("){X.push(H),H="";let U=new X8(q,X);z=X8.#H(D,U,z,J),X.push(U);continue}H+=q}return X.push(H),z}let G=Z+1,V=new X8(null,X),W=[],F="";while(G<D.length){let z=D.charAt(G++);if(Y||z==="\\"){Y=!Y,F+=z;continue}if(Q){if(G===$+1){if(z==="^"||z==="!")K=!0}else if(z==="]"&&!(G===$+2&&K))Q=!1;F+=z;continue}else if(z==="["){Q=!0,$=G,K=!1,F+=z;continue}if(Xy(z)&&D.charAt(G)==="("){V.push(F),F="";let H=new X8(z,V);V.push(H),G=X8.#H(D,H,G,J);continue}if(z==="|"){V.push(F),F="",W.push(V),V=new X8(null,X);continue}if(z===")"){if(F===""&&X.#J.length===0)X.#F=!0;return V.push(F),F="",X.push(...W,V),G}F+=z}return X.type=null,X.#X=void 0,X.#J=[D.substring(Z-1)],G}static fromGlob(D,X={}){let Z=new X8(null,void 0,X);return X8.#H(D,Z,0,X),Z}toMMPattern(){if(this!==this.#D)return this.#D.toMMPattern();let D=this.toString(),[X,Z,J,Y]=this.toRegExpSource();if(!(J||this.#X||this.#K.nocase&&!this.#K.nocaseMagicOnly&&D.toUpperCase()!==D.toLowerCase()))return Z;let $=(this.#K.nocase?"i":"")+(Y?"u":"");return Object.assign(new RegExp(`^${X}$`,$),{_src:X,_glob:D})}get options(){return this.#K}toRegExpSource(D){let X=D??!!this.#K.dot;if(this.#D===this)this.#q();if(!this.type){let K=this.isStart()&&this.isEnd()&&!this.#J.some((z)=>typeof z!=="string"),G=this.#J.map((z)=>{let[H,q,U,B]=typeof z==="string"?X8.#U(z,this.#X,K):z.toRegExpSource(D);return this.#X=this.#X||U,this.#Z=this.#Z||B,H}).join(""),V="";if(this.isStart()){if(typeof this.#J[0]==="string"){if(!(this.#J.length===1&&gF0.has(this.#J[0]))){let H=fF0,q=X&&H.has(G.charAt(0))||G.startsWith("\\.")&&H.has(G.charAt(2))||G.startsWith("\\.\\.")&&H.has(G.charAt(4)),U=!X&&!D&&H.has(G.charAt(0));V=q?bF0:U?lV:""}}}let W="";if(this.isEnd()&&this.#D.#G&&this.#Q?.type==="!")W="(?:$|\\/)";return[V+G+W,P4(G),this.#X=!!this.#X,this.#Z]}let Z=this.type==="*"||this.type==="+",J=this.type==="!"?"(?:(?!(?:":"(?:",Y=this.#V(X);if(this.isStart()&&this.isEnd()&&!Y&&this.type!=="!"){let K=this.toString();return this.#J=[K],this.type=null,this.#X=void 0,[K,P4(this.toString()),!1,!1]}let Q=!Z||D||X||!lV?"":this.#V(!0);if(Q===Y)Q="";if(Q)Y=`(?:${Y})(?:${Q})*?`;let $="";if(this.type==="!"&&this.#F)$=(this.isStart()&&!X?lV:"")+Jy;else{let K=this.type==="!"?"))"+(this.isStart()&&!X&&!D?lV:"")+Zy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&Q?")":this.type==="*"&&Q?")?":`)${this.type}`;$=J+Y+K}return[$,P4(Y),this.#X=!!this.#X,this.#Z]}#V(D){return this.#J.map((X)=>{if(typeof X==="string")throw Error("string type in extglob ast??");let[Z,J,Y,Q]=X.toRegExpSource(D);return this.#Z=this.#Z||Q,Z}).filter((X)=>!(this.isStart()&&this.isEnd())||!!X).join("|")}static#U(D,X,Z=!1){let J=!1,Y="",Q=!1;for(let $=0;$<D.length;$++){let K=D.charAt($);if(J){J=!1,Y+=(uF0.has(K)?"\\":"")+K;continue}if(K==="\\"){if($===D.length-1)Y+="\\\\";else J=!0;continue}if(K==="["){let[G,V,W,F]=Dy(D,$);if(W){Y+=G,Q=Q||V,$+=W-1,X=X||F;continue}}if(K==="*"){Y+=Z&&D==="*"?Jy:Zy,X=!0;continue}if(K==="?"){Y+=UM,X=!0;continue}Y+=mF0(K)}return[Y,P4(D),!!X,Q]}}var RZ=(D,{windowsPathsNoEscape:X=!1,magicalBraces:Z=!1}={})=>{if(Z)return X?D.replace(/[?*()[\]{}]/g,"[$&]"):D.replace(/[?*()[\]\\{}]/g,"\\$&");return X?D.replace(/[?*()[\]]/g,"[$&]"):D.replace(/[?*()[\]\\]/g,"\\$&")};var k8=(D,X,Z={})=>{if(J$(X),!Z.nocomment&&X.charAt(0)==="#")return!1;return new f6(X,Z).match(D)},cF0=/^\*+([^+@!?\*\[\(]*)$/,dF0=(D)=>(X)=>!X.startsWith(".")&&X.endsWith(D),lF0=(D)=>(X)=>X.endsWith(D),pF0=(D)=>{return D=D.toLowerCase(),(X)=>!X.startsWith(".")&&X.toLowerCase().endsWith(D)},iF0=(D)=>{return D=D.toLowerCase(),(X)=>X.toLowerCase().endsWith(D)},nF0=/^\*+\.\*+$/,oF0=(D)=>!D.startsWith(".")&&D.includes("."),rF0=(D)=>D!=="."&&D!==".."&&D.includes("."),sF0=/^\.\*+$/,aF0=(D)=>D!=="."&&D!==".."&&D.startsWith("."),tF0=/^\*+$/,eF0=(D)=>D.length!==0&&!D.startsWith("."),DH0=(D)=>D.length!==0&&D!=="."&&D!=="..",XH0=/^\?+([^+@!?\*\[\(]*)?$/,ZH0=([D,X=""])=>{let Z=$y([D]);if(!X)return Z;return X=X.toLowerCase(),(J)=>Z(J)&&J.toLowerCase().endsWith(X)},JH0=([D,X=""])=>{let Z=Ky([D]);if(!X)return Z;return X=X.toLowerCase(),(J)=>Z(J)&&J.toLowerCase().endsWith(X)},YH0=([D,X=""])=>{let Z=Ky([D]);return!X?Z:(J)=>Z(J)&&J.endsWith(X)},QH0=([D,X=""])=>{let Z=$y([D]);return!X?Z:(J)=>Z(J)&&J.endsWith(X)},$y=([D])=>{let X=D.length;return(Z)=>Z.length===X&&!Z.startsWith(".")},Ky=([D])=>{let X=D.length;return(Z)=>Z.length===X&&Z!=="."&&Z!==".."},Gy=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Yy={win32:{sep:"\\"},posix:{sep:"/"}},$H0=Gy==="win32"?Yy.win32.sep:Yy.posix.sep;k8.sep=$H0;var Z8=Symbol("globstar **");k8.GLOBSTAR=Z8;var KH0="[^/]",GH0=KH0+"*?",WH0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VH0="(?:(?!(?:\\/|^)\\.).)*?",FH0=(D,X={})=>(Z)=>k8(Z,D,X);k8.filter=FH0;var b6=(D,X={})=>Object.assign({},D,X),HH0=(D)=>{if(!D||typeof D!=="object"||!Object.keys(D).length)return k8;let X=k8;return Object.assign((J,Y,Q={})=>X(J,Y,b6(D,Q)),{Minimatch:class extends X.Minimatch{constructor(Y,Q={}){super(Y,b6(D,Q))}static defaults(Y){return X.defaults(b6(D,Y)).Minimatch}},AST:class extends X.AST{constructor(Y,Q,$={}){super(Y,Q,b6(D,$))}static fromGlob(Y,Q={}){return X.AST.fromGlob(Y,b6(D,Q))}},unescape:(J,Y={})=>X.unescape(J,b6(D,Y)),escape:(J,Y={})=>X.escape(J,b6(D,Y)),filter:(J,Y={})=>X.filter(J,b6(D,Y)),defaults:(J)=>X.defaults(b6(D,J)),makeRe:(J,Y={})=>X.makeRe(J,b6(D,Y)),braceExpand:(J,Y={})=>X.braceExpand(J,b6(D,Y)),match:(J,Y,Q={})=>X.match(J,Y,b6(D,Q)),sep:X.sep,GLOBSTAR:Z8})};k8.defaults=HH0;var Wy=(D,X={})=>{if(J$(D),X.nobrace||!/\{(?:(?!\{).)*\}/.test(D))return[D];return tx(D)};k8.braceExpand=Wy;var qH0=(D,X={})=>new f6(D,X).makeRe();k8.makeRe=qH0;var zH0=(D,X,Z={})=>{let J=new f6(X,Z);if(D=D.filter((Y)=>J.match(Y)),J.options.nonull&&!D.length)D.push(X);return D};k8.match=zH0;var Qy=/[?*]|[+@!]\(.*?\)|\[|\]/,UH0=(D)=>D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class f6{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(D,X={}){if(J$(D),X=X||{},this.options=X,this.pattern=D,this.platform=X.platform||Gy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!X.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!X.nonegate,this.comment=!1,this.empty=!1,this.partial=!!X.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=X.windowsNoMagicRoot!==void 0?X.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let D of this.set)for(let X of D)if(typeof X!=="string")return!0;return!1}debug(...D){}make(){let D=this.pattern,X=this.options;if(!X.nocomment&&D.charAt(0)==="#"){this.comment=!0;return}if(!D){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],X.debug)this.debug=(...Y)=>console.error(...Y);this.debug(this.pattern,this.globSet);let Z=this.globSet.map((Y)=>this.slashSplit(Y));this.globParts=this.preprocess(Z),this.debug(this.pattern,this.globParts);let J=this.globParts.map((Y,Q,$)=>{if(this.isWindows&&this.windowsNoMagicRoot){let K=Y[0]===""&&Y[1]===""&&(Y[2]==="?"||!Qy.test(Y[2]))&&!Qy.test(Y[3]),G=/^[a-z]:/i.test(Y[0]);if(K)return[...Y.slice(0,4),...Y.slice(4).map((V)=>this.parse(V))];else if(G)return[Y[0],...Y.slice(1).map((V)=>this.parse(V))]}return Y.map((K)=>this.parse(K))});if(this.debug(this.pattern,J),this.set=J.filter((Y)=>Y.indexOf(!1)===-1),this.isWindows)for(let Y=0;Y<this.set.length;Y++){let Q=this.set[Y];if(Q[0]===""&&Q[1]===""&&this.globParts[Y][2]==="?"&&typeof Q[3]==="string"&&/^[a-z]:$/i.test(Q[3]))Q[2]="?"}this.debug(this.pattern,this.set)}preprocess(D){if(this.options.noglobstar){for(let Z=0;Z<D.length;Z++)for(let J=0;J<D[Z].length;J++)if(D[Z][J]==="**")D[Z][J]="*"}let{optimizationLevel:X=1}=this.options;if(X>=2)D=this.firstPhasePreProcess(D),D=this.secondPhasePreProcess(D);else if(X>=1)D=this.levelOneOptimize(D);else D=this.adjascentGlobstarOptimize(D);return D}adjascentGlobstarOptimize(D){return D.map((X)=>{let Z=-1;while((Z=X.indexOf("**",Z+1))!==-1){let J=Z;while(X[J+1]==="**")J++;if(J!==Z)X.splice(Z,J-Z)}return X})}levelOneOptimize(D){return D.map((X)=>{return X=X.reduce((Z,J)=>{let Y=Z[Z.length-1];if(J==="**"&&Y==="**")return Z;if(J===".."){if(Y&&Y!==".."&&Y!=="."&&Y!=="**")return Z.pop(),Z}return Z.push(J),Z},[]),X.length===0?[""]:X})}levelTwoFileOptimize(D){if(!Array.isArray(D))D=this.slashSplit(D);let X=!1;do{if(X=!1,!this.preserveMultipleSlashes){for(let J=1;J<D.length-1;J++){let Y=D[J];if(J===1&&Y===""&&D[0]==="")continue;if(Y==="."||Y==="")X=!0,D.splice(J,1),J--}if(D[0]==="."&&D.length===2&&(D[1]==="."||D[1]===""))X=!0,D.pop()}let Z=0;while((Z=D.indexOf("..",Z+1))!==-1){let J=D[Z-1];if(J&&J!=="."&&J!==".."&&J!=="**")X=!0,D.splice(Z-1,2),Z-=2}}while(X);return D.length===0?[""]:D}firstPhasePreProcess(D){let X=!1;do{X=!1;for(let Z of D){let J=-1;while((J=Z.indexOf("**",J+1))!==-1){let Q=J;while(Z[Q+1]==="**")Q++;if(Q>J)Z.splice(J+1,Q-J);let $=Z[J+1],K=Z[J+2],G=Z[J+3];if($!=="..")continue;if(!K||K==="."||K===".."||!G||G==="."||G==="..")continue;X=!0,Z.splice(J,1);let V=Z.slice(0);V[J]="**",D.push(V),J--}if(!this.preserveMultipleSlashes){for(let Q=1;Q<Z.length-1;Q++){let $=Z[Q];if(Q===1&&$===""&&Z[0]==="")continue;if($==="."||$==="")X=!0,Z.splice(Q,1),Q--}if(Z[0]==="."&&Z.length===2&&(Z[1]==="."||Z[1]===""))X=!0,Z.pop()}let Y=0;while((Y=Z.indexOf("..",Y+1))!==-1){let Q=Z[Y-1];if(Q&&Q!=="."&&Q!==".."&&Q!=="**"){X=!0;let K=Y===1&&Z[Y+1]==="**"?["."]:[];if(Z.splice(Y-1,2,...K),Z.length===0)Z.push("");Y-=2}}}}while(X);return D}secondPhasePreProcess(D){for(let X=0;X<D.length-1;X++)for(let Z=X+1;Z<D.length;Z++){let J=this.partsMatch(D[X],D[Z],!this.preserveMultipleSlashes);if(J){D[X]=[],D[Z]=J;break}}return D.filter((X)=>X.length)}partsMatch(D,X,Z=!1){let J=0,Y=0,Q=[],$="";while(J<D.length&&Y<X.length)if(D[J]===X[Y])Q.push($==="b"?X[Y]:D[J]),J++,Y++;else if(Z&&D[J]==="**"&&X[Y]===D[J+1])Q.push(D[J]),J++;else if(Z&&X[Y]==="**"&&D[J]===X[Y+1])Q.push(X[Y]),Y++;else if(D[J]==="*"&&X[Y]&&(this.options.dot||!X[Y].startsWith("."))&&X[Y]!=="**"){if($==="b")return!1;$="a",Q.push(D[J]),J++,Y++}else if(X[Y]==="*"&&D[J]&&(this.options.dot||!D[J].startsWith("."))&&D[J]!=="**"){if($==="a")return!1;$="b",Q.push(X[Y]),J++,Y++}else return!1;return D.length===X.length&&Q}parseNegate(){if(this.nonegate)return;let D=this.pattern,X=!1,Z=0;for(let J=0;J<D.length&&D.charAt(J)==="!";J++)X=!X,Z++;if(Z)this.pattern=D.slice(Z);this.negate=X}matchOne(D,X,Z=!1){let J=this.options;if(this.isWindows){let q=typeof D[0]==="string"&&/^[a-z]:$/i.test(D[0]),U=!q&&D[0]===""&&D[1]===""&&D[2]==="?"&&/^[a-z]:$/i.test(D[3]),B=typeof X[0]==="string"&&/^[a-z]:$/i.test(X[0]),O=!B&&X[0]===""&&X[1]===""&&X[2]==="?"&&typeof X[3]==="string"&&/^[a-z]:$/i.test(X[3]),L=U?3:q?0:void 0,M=O?3:B?0:void 0;if(typeof L==="number"&&typeof M==="number"){let[A,E]=[D[L],X[M]];if(A.toLowerCase()===E.toLowerCase()){if(X[M]=A,M>L)X=X.slice(M);else if(L>M)D=D.slice(L)}}}let{optimizationLevel:Y=1}=this.options;if(Y>=2)D=this.levelTwoFileOptimize(D);this.debug("matchOne",this,{file:D,pattern:X}),this.debug("matchOne",D.length,X.length);for(var Q=0,$=0,K=D.length,G=X.length;Q<K&&$<G;Q++,$++){this.debug("matchOne loop");var V=X[$],W=D[Q];if(this.debug(X,V,W),V===!1)return!1;if(V===Z8){this.debug("GLOBSTAR",[X,V,W]);var F=Q,z=$+1;if(z===G){this.debug("** at the end");for(;Q<K;Q++)if(D[Q]==="."||D[Q]===".."||!J.dot&&D[Q].charAt(0)===".")return!1;return!0}while(F<K){var H=D[F];if(this.debug(`
402
402
  globstar while`,D,F,X,z,H),this.matchOne(D.slice(F),X.slice(z),Z))return this.debug("globstar found match!",F,K,H),!0;else{if(H==="."||H===".."||!J.dot&&H.charAt(0)==="."){this.debug("dot detected!",D,F,X,z);break}this.debug("globstar swallow a segment, and continue"),F++}}if(Z){if(this.debug(`
403
403
  >>> no match, partial?`,D,F,X,z),F===K)return!0}return!1}let q;if(typeof V==="string")q=W===V,this.debug("string match",V,W,q);else q=V.test(W),this.debug("pattern match",V,W,q);if(!q)return!1}if(Q===K&&$===G)return!0;else if(Q===K)return Z;else if($===G)return Q===K-1&&D[Q]==="";else throw Error("wtf?")}braceExpand(){return Wy(this.pattern,this.options)}parse(D){J$(D);let X=this.options;if(D==="**")return Z8;if(D==="")return"";let Z,J=null;if(Z=D.match(tF0))J=X.dot?DH0:eF0;else if(Z=D.match(cF0))J=(X.nocase?X.dot?iF0:pF0:X.dot?lF0:dF0)(Z[1]);else if(Z=D.match(XH0))J=(X.nocase?X.dot?JH0:ZH0:X.dot?YH0:QH0)(Z);else if(Z=D.match(nF0))J=X.dot?rF0:oF0;else if(Z=D.match(sF0))J=aF0;let Y=X8.fromGlob(D,this.options).toMMPattern();if(J&&typeof Y==="object")Reflect.defineProperty(Y,"test",{value:J});return Y}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let D=this.set;if(!D.length)return this.regexp=!1,this.regexp;let X=this.options,Z=X.noglobstar?GH0:X.dot?WH0:VH0,J=new Set(X.nocase?["i"]:[]),Y=D.map((K)=>{let G=K.map((W)=>{if(W instanceof RegExp)for(let F of W.flags.split(""))J.add(F);return typeof W==="string"?UH0(W):W===Z8?Z8:W._src});G.forEach((W,F)=>{let z=G[F+1],H=G[F-1];if(W!==Z8||H===Z8)return;if(H===void 0)if(z!==void 0&&z!==Z8)G[F+1]="(?:\\/|"+Z+"\\/)?"+z;else G[F]=Z;else if(z===void 0)G[F-1]=H+"(?:\\/|\\/"+Z+")?";else if(z!==Z8)G[F-1]=H+"(?:\\/|\\/"+Z+"\\/)"+z,G[F+1]=Z8});let V=G.filter((W)=>W!==Z8);if(this.partial&&V.length>=1){let W=[];for(let F=1;F<=V.length;F++)W.push(V.slice(0,F).join("/"));return"(?:"+W.join("|")+")"}return V.join("/")}).join("|"),[Q,$]=D.length>1?["(?:",")"]:["",""];if(Y="^"+Q+Y+$+"$",this.partial)Y="^(?:\\/|"+Q+Y.slice(1,-1)+$+")$";if(this.negate)Y="^(?!"+Y+").+$";try{this.regexp=new RegExp(Y,[...J].join(""))}catch(K){this.regexp=!1}return this.regexp}slashSplit(D){if(this.preserveMultipleSlashes)return D.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(D))return["",...D.split(/\/+/)];else return D.split(/\/+/)}match(D,X=this.partial){if(this.debug("match",D,this.pattern),this.comment)return!1;if(this.empty)return D==="";if(D==="/"&&X)return!0;let Z=this.options;if(this.isWindows)D=D.split("\\").join("/");let J=this.slashSplit(D);this.debug(this.pattern,"split",J);let Y=this.set;this.debug(this.pattern,"set",Y);let Q=J[J.length-1];if(!Q)for(let $=J.length-2;!Q&&$>=0;$--)Q=J[$];for(let $=0;$<Y.length;$++){let K=Y[$],G=J;if(Z.matchBase&&K.length===1)G=[Q];if(this.matchOne(G,K,X)){if(Z.flipNegate)return!0;return!this.negate}}if(Z.flipNegate)return!1;return this.negate}static defaults(D){return k8.defaults(D).Minimatch}}k8.AST=X8;k8.Minimatch=f6;k8.escape=RZ;k8.unescape=P4;import{fileURLToPath as oH0}from"node:url";var BH0=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Fy=new Set,BM=typeof process==="object"&&!!process?process:{},Hy=(D,X,Z,J)=>{typeof BM.emitWarning==="function"?BM.emitWarning(D,X,Z,J):console.error(`[${Z}] ${X}: ${D}`)},pV=globalThis.AbortController,Vy=globalThis.AbortSignal;if(typeof pV>"u"){Vy=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(J,Y){this._onabort.push(Y)}},pV=class{constructor(){X()}signal=new Vy;abort(J){if(this.signal.aborted)return;this.signal.reason=J,this.signal.aborted=!0;for(let Y of this.signal._onabort)Y(J);this.signal.onabort?.(J)}};let D=BM.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",X=()=>{if(!D)return;D=!1,Hy("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",X)}}var OH0=(D)=>!Fy.has(D),TX1=Symbol("type"),l3=(D)=>D&&D===Math.floor(D)&&D>0&&isFinite(D),qy=(D)=>!l3(D)?null:D<=Math.pow(2,8)?Uint8Array:D<=Math.pow(2,16)?Uint16Array:D<=Math.pow(2,32)?Uint32Array:D<=Number.MAX_SAFE_INTEGER?Q$:null;class Q$ extends Array{constructor(D){super(D);this.fill(0)}}class EZ{heap;length;static#D=!1;static create(D){let X=qy(D);if(!X)return[];EZ.#D=!0;let Z=new EZ(D,X);return EZ.#D=!1,Z}constructor(D,X){if(!EZ.#D)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new X(D),this.length=0}push(D){this.heap[this.length++]=D}pop(){return this.heap[--this.length]}}class qD{#D;#X;#Z;#J;#Q;#Y;#$;#G;get perf(){return this.#G}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#K;#W;#F;#q;#H;#V;#U;#B;#O;#R;#M;#N;#E;#L;#A;#P;#C;#z;#S;static unsafeExposeInternals(D){return{starts:D.#E,ttls:D.#L,autopurgeTimers:D.#A,sizes:D.#N,keyMap:D.#F,keyList:D.#q,valList:D.#H,next:D.#V,prev:D.#U,get head(){return D.#B},get tail(){return D.#O},free:D.#R,isBackgroundFetch:(X)=>D.#k(X),backgroundFetch:(X,Z,J,Y)=>D.#u(X,Z,J,Y),moveToTail:(X)=>D.#d(X),indexes:(X)=>D.#b(X),rindexes:(X)=>D.#T(X),isStale:(X)=>D.#_(X)}}get max(){return this.#D}get maxSize(){return this.#X}get calculatedSize(){return this.#W}get size(){return this.#K}get fetchMethod(){return this.#Y}get memoMethod(){return this.#$}get dispose(){return this.#Z}get onInsert(){return this.#J}get disposeAfter(){return this.#Q}constructor(D){let{max:X=0,ttl:Z,ttlResolution:J=1,ttlAutopurge:Y,updateAgeOnGet:Q,updateAgeOnHas:$,allowStale:K,dispose:G,onInsert:V,disposeAfter:W,noDisposeOnSet:F,noUpdateTTL:z,maxSize:H=0,maxEntrySize:q=0,sizeCalculation:U,fetchMethod:B,memoMethod:O,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:M,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:E,ignoreFetchAbort:C,perf:T}=D;if(T!==void 0){if(typeof T?.now!=="function")throw TypeError("perf option must have a now() method if specified")}if(this.#G=T??BH0,X!==0&&!l3(X))throw TypeError("max option must be a nonnegative integer");let j=X?qy(X):Array;if(!j)throw Error("invalid max value: "+X);if(this.#D=X,this.#X=H,this.maxEntrySize=q||this.#X,this.sizeCalculation=U,this.sizeCalculation){if(!this.#X&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(O!==void 0&&typeof O!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#$=O,B!==void 0&&typeof B!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#Y=B,this.#C=!!B,this.#F=new Map,this.#q=Array(X).fill(void 0),this.#H=Array(X).fill(void 0),this.#V=new j(X),this.#U=new j(X),this.#B=0,this.#O=0,this.#R=EZ.create(X),this.#K=0,this.#W=0,typeof G==="function")this.#Z=G;if(typeof V==="function")this.#J=V;if(typeof W==="function")this.#Q=W,this.#M=[];else this.#Q=void 0,this.#M=void 0;if(this.#P=!!this.#Z,this.#S=!!this.#J,this.#z=!!this.#Q,this.noDisposeOnSet=!!F,this.noUpdateTTL=!!z,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(this.#X!==0){if(!l3(this.#X))throw TypeError("maxSize must be a positive integer if specified")}if(!l3(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#x()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!M,this.updateAgeOnGet=!!Q,this.updateAgeOnHas=!!$,this.ttlResolution=l3(J)||J===0?J:1,this.ttlAutopurge=!!Y,this.ttl=Z||0,this.ttl){if(!l3(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#D===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#D&&!this.#X){if(OH0("LRU_CACHE_UNBOUNDED"))Fy.add("LRU_CACHE_UNBOUNDED"),Hy("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",qD)}}getRemainingTTL(D){return this.#F.has(D)?1/0:0}#I(){let D=new Q$(this.#D),X=new Q$(this.#D);this.#L=D,this.#E=X;let Z=this.ttlAutopurge?Array(this.#D):void 0;this.#A=Z,this.#f=(Q,$,K=this.#G.now())=>{if(X[Q]=$!==0?K:0,D[Q]=$,Z?.[Q])clearTimeout(Z[Q]),Z[Q]=void 0;if($!==0&&Z){let G=setTimeout(()=>{if(this.#_(Q))this.#c(this.#q[Q],"expire")},$+1);if(G.unref)G.unref();Z[Q]=G}},this.#j=(Q)=>{X[Q]=D[Q]!==0?this.#G.now():0},this.#w=(Q,$)=>{if(D[$]){let K=D[$],G=X[$];if(!K||!G)return;Q.ttl=K,Q.start=G,Q.now=J||Y();let V=Q.now-G;Q.remainingTTL=K-V}};let J=0,Y=()=>{let Q=this.#G.now();if(this.ttlResolution>0){J=Q;let $=setTimeout(()=>J=0,this.ttlResolution);if($.unref)$.unref()}return Q};this.getRemainingTTL=(Q)=>{let $=this.#F.get(Q);if($===void 0)return 0;let K=D[$],G=X[$];if(!K||!G)return 1/0;let V=(J||Y())-G;return K-V},this.#_=(Q)=>{let $=X[Q],K=D[Q];return!!K&&!!$&&(J||Y())-$>K}}#j=()=>{};#w=()=>{};#f=()=>{};#_=()=>!1;#x(){let D=new Q$(this.#D);this.#W=0,this.#N=D,this.#h=(X)=>{this.#W-=D[X],D[X]=0},this.#v=(X,Z,J,Y)=>{if(this.#k(Z))return 0;if(!l3(J))if(Y){if(typeof Y!=="function")throw TypeError("sizeCalculation must be a function");if(J=Y(Z,X),!l3(J))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return J},this.#y=(X,Z,J)=>{if(D[X]=Z,this.#X){let Y=this.#X-D[X];while(this.#W>Y)this.#m(!0)}if(this.#W+=D[X],J)J.entrySize=Z,J.totalCalculatedSize=this.#W}}#h=(D)=>{};#y=(D,X,Z)=>{};#v=(D,X,Z,J)=>{if(Z||J)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#b({allowStale:D=this.allowStale}={}){if(this.#K)for(let X=this.#O;;){if(!this.#g(X))break;if(D||!this.#_(X))yield X;if(X===this.#B)break;else X=this.#U[X]}}*#T({allowStale:D=this.allowStale}={}){if(this.#K)for(let X=this.#B;;){if(!this.#g(X))break;if(D||!this.#_(X))yield X;if(X===this.#O)break;else X=this.#V[X]}}#g(D){return D!==void 0&&this.#F.get(this.#q[D])===D}*entries(){for(let D of this.#b())if(this.#H[D]!==void 0&&this.#q[D]!==void 0&&!this.#k(this.#H[D]))yield[this.#q[D],this.#H[D]]}*rentries(){for(let D of this.#T())if(this.#H[D]!==void 0&&this.#q[D]!==void 0&&!this.#k(this.#H[D]))yield[this.#q[D],this.#H[D]]}*keys(){for(let D of this.#b()){let X=this.#q[D];if(X!==void 0&&!this.#k(this.#H[D]))yield X}}*rkeys(){for(let D of this.#T()){let X=this.#q[D];if(X!==void 0&&!this.#k(this.#H[D]))yield X}}*values(){for(let D of this.#b())if(this.#H[D]!==void 0&&!this.#k(this.#H[D]))yield this.#H[D]}*rvalues(){for(let D of this.#T())if(this.#H[D]!==void 0&&!this.#k(this.#H[D]))yield this.#H[D]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(D,X={}){for(let Z of this.#b()){let J=this.#H[Z],Y=this.#k(J)?J.__staleWhileFetching:J;if(Y===void 0)continue;if(D(Y,this.#q[Z],this))return this.get(this.#q[Z],X)}}forEach(D,X=this){for(let Z of this.#b()){let J=this.#H[Z],Y=this.#k(J)?J.__staleWhileFetching:J;if(Y===void 0)continue;D.call(X,Y,this.#q[Z],this)}}rforEach(D,X=this){for(let Z of this.#T()){let J=this.#H[Z],Y=this.#k(J)?J.__staleWhileFetching:J;if(Y===void 0)continue;D.call(X,Y,this.#q[Z],this)}}purgeStale(){let D=!1;for(let X of this.#T({allowStale:!0}))if(this.#_(X))this.#c(this.#q[X],"expire"),D=!0;return D}info(D){let X=this.#F.get(D);if(X===void 0)return;let Z=this.#H[X],J=this.#k(Z)?Z.__staleWhileFetching:Z;if(J===void 0)return;let Y={value:J};if(this.#L&&this.#E){let Q=this.#L[X],$=this.#E[X];if(Q&&$){let K=Q-(this.#G.now()-$);Y.ttl=K,Y.start=Date.now()}}if(this.#N)Y.size=this.#N[X];return Y}dump(){let D=[];for(let X of this.#b({allowStale:!0})){let Z=this.#q[X],J=this.#H[X],Y=this.#k(J)?J.__staleWhileFetching:J;if(Y===void 0||Z===void 0)continue;let Q={value:Y};if(this.#L&&this.#E){Q.ttl=this.#L[X];let $=this.#G.now()-this.#E[X];Q.start=Math.floor(Date.now()-$)}if(this.#N)Q.size=this.#N[X];D.unshift([Z,Q])}return D}load(D){this.clear();for(let[X,Z]of D){if(Z.start){let J=Date.now()-Z.start;Z.start=this.#G.now()-J}this.set(X,Z.value,Z)}}set(D,X,Z={}){if(X===void 0)return this.delete(D),this;let{ttl:J=this.ttl,start:Y,noDisposeOnSet:Q=this.noDisposeOnSet,sizeCalculation:$=this.sizeCalculation,status:K}=Z,{noUpdateTTL:G=this.noUpdateTTL}=Z,V=this.#v(D,X,Z.size||0,$);if(this.maxEntrySize&&V>this.maxEntrySize){if(K)K.set="miss",K.maxEntrySizeExceeded=!0;return this.#c(D,"set"),this}let W=this.#K===0?void 0:this.#F.get(D);if(W===void 0){if(W=this.#K===0?this.#O:this.#R.length!==0?this.#R.pop():this.#K===this.#D?this.#m(!1):this.#K,this.#q[W]=D,this.#H[W]=X,this.#F.set(D,W),this.#V[this.#O]=W,this.#U[W]=this.#O,this.#O=W,this.#K++,this.#y(W,V,K),K)K.set="add";if(G=!1,this.#S)this.#J?.(X,D,"add")}else{this.#d(W);let F=this.#H[W];if(X!==F){if(this.#C&&this.#k(F)){F.__abortController.abort(Error("replaced"));let{__staleWhileFetching:z}=F;if(z!==void 0&&!Q){if(this.#P)this.#Z?.(z,D,"set");if(this.#z)this.#M?.push([z,D,"set"])}}else if(!Q){if(this.#P)this.#Z?.(F,D,"set");if(this.#z)this.#M?.push([F,D,"set"])}if(this.#h(W),this.#y(W,V,K),this.#H[W]=X,K){K.set="replace";let z=F&&this.#k(F)?F.__staleWhileFetching:F;if(z!==void 0)K.oldValue=z}}else if(K)K.set="update";if(this.#S)this.onInsert?.(X,D,X===F?"update":"replace")}if(J!==0&&!this.#L)this.#I();if(this.#L){if(!G)this.#f(W,J,Y);if(K)this.#w(K,W)}if(!Q&&this.#z&&this.#M){let F=this.#M,z;while(z=F?.shift())this.#Q?.(...z)}return this}pop(){try{while(this.#K){let D=this.#H[this.#B];if(this.#m(!0),this.#k(D)){if(D.__staleWhileFetching)return D.__staleWhileFetching}else if(D!==void 0)return D}}finally{if(this.#z&&this.#M){let D=this.#M,X;while(X=D?.shift())this.#Q?.(...X)}}}#m(D){let X=this.#B,Z=this.#q[X],J=this.#H[X];if(this.#C&&this.#k(J))J.__abortController.abort(Error("evicted"));else if(this.#P||this.#z){if(this.#P)this.#Z?.(J,Z,"evict");if(this.#z)this.#M?.push([J,Z,"evict"])}if(this.#h(X),this.#A?.[X])clearTimeout(this.#A[X]),this.#A[X]=void 0;if(D)this.#q[X]=void 0,this.#H[X]=void 0,this.#R.push(X);if(this.#K===1)this.#B=this.#O=0,this.#R.length=0;else this.#B=this.#V[X];return this.#F.delete(Z),this.#K--,X}has(D,X={}){let{updateAgeOnHas:Z=this.updateAgeOnHas,status:J}=X,Y=this.#F.get(D);if(Y!==void 0){let Q=this.#H[Y];if(this.#k(Q)&&Q.__staleWhileFetching===void 0)return!1;if(!this.#_(Y)){if(Z)this.#j(Y);if(J)J.has="hit",this.#w(J,Y);return!0}else if(J)J.has="stale",this.#w(J,Y)}else if(J)J.has="miss";return!1}peek(D,X={}){let{allowStale:Z=this.allowStale}=X,J=this.#F.get(D);if(J===void 0||!Z&&this.#_(J))return;let Y=this.#H[J];return this.#k(Y)?Y.__staleWhileFetching:Y}#u(D,X,Z,J){let Y=X===void 0?void 0:this.#H[X];if(this.#k(Y))return Y;let Q=new pV,{signal:$}=Z;$?.addEventListener("abort",()=>Q.abort($.reason),{signal:Q.signal});let K={signal:Q.signal,options:Z,context:J},G=(q,U=!1)=>{let{aborted:B}=Q.signal,O=Z.ignoreFetchAbort&&q!==void 0;if(Z.status)if(B&&!U){if(Z.status.fetchAborted=!0,Z.status.fetchError=Q.signal.reason,O)Z.status.fetchAbortIgnored=!0}else Z.status.fetchResolved=!0;if(B&&!O&&!U)return W(Q.signal.reason);let L=z,M=this.#H[X];if(M===z||O&&U&&M===void 0)if(q===void 0)if(L.__staleWhileFetching!==void 0)this.#H[X]=L.__staleWhileFetching;else this.#c(D,"fetch");else{if(Z.status)Z.status.fetchUpdated=!0;this.set(D,q,K.options)}return q},V=(q)=>{if(Z.status)Z.status.fetchRejected=!0,Z.status.fetchError=q;return W(q)},W=(q)=>{let{aborted:U}=Q.signal,B=U&&Z.allowStaleOnFetchAbort,O=B||Z.allowStaleOnFetchRejection,L=O||Z.noDeleteOnFetchRejection,M=z;if(this.#H[X]===z){if(!L||M.__staleWhileFetching===void 0)this.#c(D,"fetch");else if(!B)this.#H[X]=M.__staleWhileFetching}if(O){if(Z.status&&M.__staleWhileFetching!==void 0)Z.status.returnedStale=!0;return M.__staleWhileFetching}else if(M.__returned===M)throw q},F=(q,U)=>{let B=this.#Y?.(D,Y,K);if(B&&B instanceof Promise)B.then((O)=>q(O===void 0?void 0:O),U);Q.signal.addEventListener("abort",()=>{if(!Z.ignoreFetchAbort||Z.allowStaleOnFetchAbort){if(q(void 0),Z.allowStaleOnFetchAbort)q=(O)=>G(O,!0)}})};if(Z.status)Z.status.fetchDispatched=!0;let z=new Promise(F).then(G,V),H=Object.assign(z,{__abortController:Q,__staleWhileFetching:Y,__returned:void 0});if(X===void 0)this.set(D,H,{...K.options,status:void 0}),X=this.#F.get(D);else this.#H[X]=H;return H}#k(D){if(!this.#C)return!1;let X=D;return!!X&&X instanceof Promise&&X.hasOwnProperty("__staleWhileFetching")&&X.__abortController instanceof pV}async fetch(D,X={}){let{allowStale:Z=this.allowStale,updateAgeOnGet:J=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,ttl:Q=this.ttl,noDisposeOnSet:$=this.noDisposeOnSet,size:K=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:V=this.noUpdateTTL,noDeleteOnFetchRejection:W=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:F=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:H=this.allowStaleOnFetchAbort,context:q,forceRefresh:U=!1,status:B,signal:O}=X;if(!this.#C){if(B)B.fetch="get";return this.get(D,{allowStale:Z,updateAgeOnGet:J,noDeleteOnStaleGet:Y,status:B})}let L={allowStale:Z,updateAgeOnGet:J,noDeleteOnStaleGet:Y,ttl:Q,noDisposeOnSet:$,size:K,sizeCalculation:G,noUpdateTTL:V,noDeleteOnFetchRejection:W,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:H,ignoreFetchAbort:z,status:B,signal:O},M=this.#F.get(D);if(M===void 0){if(B)B.fetch="miss";let A=this.#u(D,M,L,q);return A.__returned=A}else{let A=this.#H[M];if(this.#k(A)){let I=Z&&A.__staleWhileFetching!==void 0;if(B){if(B.fetch="inflight",I)B.returnedStale=!0}return I?A.__staleWhileFetching:A.__returned=A}let E=this.#_(M);if(!U&&!E){if(B)B.fetch="hit";if(this.#d(M),J)this.#j(M);if(B)this.#w(B,M);return A}let C=this.#u(D,M,L,q),j=C.__staleWhileFetching!==void 0&&Z;if(B){if(B.fetch=E?"stale":"refresh",j&&E)B.returnedStale=!0}return j?C.__staleWhileFetching:C.__returned=C}}async forceFetch(D,X={}){let Z=await this.fetch(D,X);if(Z===void 0)throw Error("fetch() returned undefined");return Z}memo(D,X={}){let Z=this.#$;if(!Z)throw Error("no memoMethod provided to constructor");let{context:J,forceRefresh:Y,...Q}=X,$=this.get(D,Q);if(!Y&&$!==void 0)return $;let K=Z(D,$,{options:Q,context:J});return this.set(D,K,Q),K}get(D,X={}){let{allowStale:Z=this.allowStale,updateAgeOnGet:J=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,status:Q}=X,$=this.#F.get(D);if($!==void 0){let K=this.#H[$],G=this.#k(K);if(Q)this.#w(Q,$);if(this.#_($)){if(Q)Q.get="stale";if(!G){if(!Y)this.#c(D,"expire");if(Q&&Z)Q.returnedStale=!0;return Z?K:void 0}else{if(Q&&Z&&K.__staleWhileFetching!==void 0)Q.returnedStale=!0;return Z?K.__staleWhileFetching:void 0}}else{if(Q)Q.get="hit";if(G)return K.__staleWhileFetching;if(this.#d($),J)this.#j($);return K}}else if(Q)Q.get="miss"}#l(D,X){this.#U[X]=D,this.#V[D]=X}#d(D){if(D!==this.#O){if(D===this.#B)this.#B=this.#V[D];else this.#l(this.#U[D],this.#V[D]);this.#l(this.#O,D),this.#O=D}}delete(D){return this.#c(D,"delete")}#c(D,X){let Z=!1;if(this.#K!==0){let J=this.#F.get(D);if(J!==void 0){if(this.#A?.[J])clearTimeout(this.#A?.[J]),this.#A[J]=void 0;if(Z=!0,this.#K===1)this.#i(X);else{this.#h(J);let Y=this.#H[J];if(this.#k(Y))Y.__abortController.abort(Error("deleted"));else if(this.#P||this.#z){if(this.#P)this.#Z?.(Y,D,X);if(this.#z)this.#M?.push([Y,D,X])}if(this.#F.delete(D),this.#q[J]=void 0,this.#H[J]=void 0,J===this.#O)this.#O=this.#U[J];else if(J===this.#B)this.#B=this.#V[J];else{let Q=this.#U[J];this.#V[Q]=this.#V[J];let $=this.#V[J];this.#U[$]=this.#U[J]}this.#K--,this.#R.push(J)}}}if(this.#z&&this.#M?.length){let J=this.#M,Y;while(Y=J?.shift())this.#Q?.(...Y)}return Z}clear(){return this.#i("delete")}#i(D){for(let X of this.#T({allowStale:!0})){let Z=this.#H[X];if(this.#k(Z))Z.__abortController.abort(Error("deleted"));else{let J=this.#q[X];if(this.#P)this.#Z?.(Z,J,D);if(this.#z)this.#M?.push([Z,J,D])}}if(this.#F.clear(),this.#H.fill(void 0),this.#q.fill(void 0),this.#L&&this.#E){this.#L.fill(0),this.#E.fill(0);for(let X of this.#A??[])if(X!==void 0)clearTimeout(X);this.#A?.fill(void 0)}if(this.#N)this.#N.fill(0);if(this.#B=0,this.#O=0,this.#R.length=0,this.#W=0,this.#K=0,this.#z&&this.#M){let X=this.#M,Z;while(Z=X?.shift())this.#Q?.(...Z)}}}import{posix as CH0,win32 as jM}from"node:path";import{fileURLToPath as wH0}from"node:url";import{lstatSync as SH0,readdir as _H0,readdirSync as kH0,readlinkSync as hH0,realpathSync as xH0}from"fs";import*as yH0 from"node:fs";import{lstat as bH0,readdir as fH0,readlink as gH0,realpath as uH0}from"node:fs/promises";import{EventEmitter as RM}from"node:events";import Ly from"node:stream";import{StringDecoder as LH0}from"node:string_decoder";var zy=typeof process==="object"&&process?process:{stdout:null,stderr:null},MH0=(D)=>!!D&&typeof D==="object"&&(D instanceof UD||D instanceof Ly||AH0(D)||NH0(D)),AH0=(D)=>!!D&&typeof D==="object"&&D instanceof RM&&typeof D.pipe==="function"&&D.pipe!==Ly.Writable.prototype.pipe,NH0=(D)=>!!D&&typeof D==="object"&&D instanceof RM&&typeof D.write==="function"&&typeof D.end==="function",l9=Symbol("EOF"),p9=Symbol("maybeEmitEnd"),p3=Symbol("emittedEnd"),iV=Symbol("emittingEnd"),$$=Symbol("emittedError"),nV=Symbol("closed"),Uy=Symbol("read"),oV=Symbol("flush"),By=Symbol("flushChunk"),C4=Symbol("encoding"),TZ=Symbol("decoder"),b2=Symbol("flowing"),K$=Symbol("paused"),IZ=Symbol("resume"),f2=Symbol("buffer"),h8=Symbol("pipes"),g2=Symbol("bufferLength"),OM=Symbol("bufferPush"),rV=Symbol("bufferShift"),q8=Symbol("objectMode"),$2=Symbol("destroyed"),LM=Symbol("error"),MM=Symbol("emitData"),Oy=Symbol("emitEnd"),AM=Symbol("emitEnd2"),Q9=Symbol("async"),NM=Symbol("abort"),sV=Symbol("aborted"),G$=Symbol("signal"),zD=Symbol("dataListeners"),F6=Symbol("discarded"),W$=(D)=>Promise.resolve().then(D),RH0=(D)=>D(),EH0=(D)=>D==="end"||D==="finish"||D==="prefinish",TH0=(D)=>D instanceof ArrayBuffer||!!D&&typeof D==="object"&&D.constructor&&D.constructor.name==="ArrayBuffer"&&D.byteLength>=0,IH0=(D)=>!Buffer.isBuffer(D)&&ArrayBuffer.isView(D);class EM{src;dest;opts;ondrain;constructor(D,X,Z){this.src=D,this.dest=X,this.opts=Z,this.ondrain=()=>D[IZ](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(D){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class My extends EM{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(D,X,Z){super(D,X,Z);this.proxyErrors=(J)=>X.emit("error",J),D.on("error",this.proxyErrors)}}var jH0=(D)=>!!D.objectMode,PH0=(D)=>!D.objectMode&&!!D.encoding&&D.encoding!=="buffer";class UD extends RM{[b2]=!1;[K$]=!1;[h8]=[];[f2]=[];[q8];[C4];[Q9];[TZ];[l9]=!1;[p3]=!1;[iV]=!1;[nV]=!1;[$$]=null;[g2]=0;[$2]=!1;[G$];[sV]=!1;[zD]=0;[F6]=!1;writable=!0;readable=!0;constructor(...D){let X=D[0]||{};super();if(X.objectMode&&typeof X.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(jH0(X))this[q8]=!0,this[C4]=null;else if(PH0(X))this[C4]=X.encoding,this[q8]=!1;else this[q8]=!1,this[C4]=null;if(this[Q9]=!!X.async,this[TZ]=this[C4]?new LH0(this[C4]):null,X&&X.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[f2]});if(X&&X.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[h8]});let{signal:Z}=X;if(Z)if(this[G$]=Z,Z.aborted)this[NM]();else Z.addEventListener("abort",()=>this[NM]())}get bufferLength(){return this[g2]}get encoding(){return this[C4]}set encoding(D){throw Error("Encoding must be set at instantiation time")}setEncoding(D){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[q8]}set objectMode(D){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[Q9]}set["async"](D){this[Q9]=this[Q9]||!!D}[NM](){this[sV]=!0,this.emit("abort",this[G$]?.reason),this.destroy(this[G$]?.reason)}get aborted(){return this[sV]}set aborted(D){}write(D,X,Z){if(this[sV])return!1;if(this[l9])throw Error("write after end");if(this[$2])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof X==="function")Z=X,X="utf8";if(!X)X="utf8";let J=this[Q9]?W$:RH0;if(!this[q8]&&!Buffer.isBuffer(D)){if(IH0(D))D=Buffer.from(D.buffer,D.byteOffset,D.byteLength);else if(TH0(D))D=Buffer.from(D);else if(typeof D!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[q8]){if(this[b2]&&this[g2]!==0)this[oV](!0);if(this[b2])this.emit("data",D);else this[OM](D);if(this[g2]!==0)this.emit("readable");if(Z)J(Z);return this[b2]}if(!D.length){if(this[g2]!==0)this.emit("readable");if(Z)J(Z);return this[b2]}if(typeof D==="string"&&!(X===this[C4]&&!this[TZ]?.lastNeed))D=Buffer.from(D,X);if(Buffer.isBuffer(D)&&this[C4])D=this[TZ].write(D);if(this[b2]&&this[g2]!==0)this[oV](!0);if(this[b2])this.emit("data",D);else this[OM](D);if(this[g2]!==0)this.emit("readable");if(Z)J(Z);return this[b2]}read(D){if(this[$2])return null;if(this[F6]=!1,this[g2]===0||D===0||D&&D>this[g2])return this[p9](),null;if(this[q8])D=null;if(this[f2].length>1&&!this[q8])this[f2]=[this[C4]?this[f2].join(""):Buffer.concat(this[f2],this[g2])];let X=this[Uy](D||null,this[f2][0]);return this[p9](),X}[Uy](D,X){if(this[q8])this[rV]();else{let Z=X;if(D===Z.length||D===null)this[rV]();else if(typeof Z==="string")this[f2][0]=Z.slice(D),X=Z.slice(0,D),this[g2]-=D;else this[f2][0]=Z.subarray(D),X=Z.subarray(0,D),this[g2]-=D}if(this.emit("data",X),!this[f2].length&&!this[l9])this.emit("drain");return X}end(D,X,Z){if(typeof D==="function")Z=D,D=void 0;if(typeof X==="function")Z=X,X="utf8";if(D!==void 0)this.write(D,X);if(Z)this.once("end",Z);if(this[l9]=!0,this.writable=!1,this[b2]||!this[K$])this[p9]();return this}[IZ](){if(this[$2])return;if(!this[zD]&&!this[h8].length)this[F6]=!0;if(this[K$]=!1,this[b2]=!0,this.emit("resume"),this[f2].length)this[oV]();else if(this[l9])this[p9]();else this.emit("drain")}resume(){return this[IZ]()}pause(){this[b2]=!1,this[K$]=!0,this[F6]=!1}get destroyed(){return this[$2]}get flowing(){return this[b2]}get paused(){return this[K$]}[OM](D){if(this[q8])this[g2]+=1;else this[g2]+=D.length;this[f2].push(D)}[rV](){if(this[q8])this[g2]-=1;else this[g2]-=this[f2][0].length;return this[f2].shift()}[oV](D=!1){do;while(this[By](this[rV]())&&this[f2].length);if(!D&&!this[f2].length&&!this[l9])this.emit("drain")}[By](D){return this.emit("data",D),this[b2]}pipe(D,X){if(this[$2])return D;this[F6]=!1;let Z=this[p3];if(X=X||{},D===zy.stdout||D===zy.stderr)X.end=!1;else X.end=X.end!==!1;if(X.proxyErrors=!!X.proxyErrors,Z){if(X.end)D.end()}else if(this[h8].push(!X.proxyErrors?new EM(this,D,X):new My(this,D,X)),this[Q9])W$(()=>this[IZ]());else this[IZ]();return D}unpipe(D){let X=this[h8].find((Z)=>Z.dest===D);if(X){if(this[h8].length===1){if(this[b2]&&this[zD]===0)this[b2]=!1;this[h8]=[]}else this[h8].splice(this[h8].indexOf(X),1);X.unpipe()}}addListener(D,X){return this.on(D,X)}on(D,X){let Z=super.on(D,X);if(D==="data"){if(this[F6]=!1,this[zD]++,!this[h8].length&&!this[b2])this[IZ]()}else if(D==="readable"&&this[g2]!==0)super.emit("readable");else if(EH0(D)&&this[p3])super.emit(D),this.removeAllListeners(D);else if(D==="error"&&this[$$]){let J=X;if(this[Q9])W$(()=>J.call(this,this[$$]));else J.call(this,this[$$])}return Z}removeListener(D,X){return this.off(D,X)}off(D,X){let Z=super.off(D,X);if(D==="data"){if(this[zD]=this.listeners("data").length,this[zD]===0&&!this[F6]&&!this[h8].length)this[b2]=!1}return Z}removeAllListeners(D){let X=super.removeAllListeners(D);if(D==="data"||D===void 0){if(this[zD]=0,!this[F6]&&!this[h8].length)this[b2]=!1}return X}get emittedEnd(){return this[p3]}[p9](){if(!this[iV]&&!this[p3]&&!this[$2]&&this[f2].length===0&&this[l9]){if(this[iV]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[nV])this.emit("close");this[iV]=!1}}emit(D,...X){let Z=X[0];if(D!=="error"&&D!=="close"&&D!==$2&&this[$2])return!1;else if(D==="data")return!this[q8]&&!Z?!1:this[Q9]?(W$(()=>this[MM](Z)),!0):this[MM](Z);else if(D==="end")return this[Oy]();else if(D==="close"){if(this[nV]=!0,!this[p3]&&!this[$2])return!1;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(D==="error"){this[$$]=Z,super.emit(LM,Z);let Y=!this[G$]||this.listeners("error").length?super.emit("error",Z):!1;return this[p9](),Y}else if(D==="resume"){let Y=super.emit("resume");return this[p9](),Y}else if(D==="finish"||D==="prefinish"){let Y=super.emit(D);return this.removeAllListeners(D),Y}let J=super.emit(D,...X);return this[p9](),J}[MM](D){for(let Z of this[h8])if(Z.dest.write(D)===!1)this.pause();let X=this[F6]?!1:super.emit("data",D);return this[p9](),X}[Oy](){if(this[p3])return!1;return this[p3]=!0,this.readable=!1,this[Q9]?(W$(()=>this[AM]()),!0):this[AM]()}[AM](){if(this[TZ]){let X=this[TZ].end();if(X){for(let Z of this[h8])Z.dest.write(X);if(!this[F6])super.emit("data",X)}}for(let X of this[h8])X.end();let D=super.emit("end");return this.removeAllListeners("end"),D}async collect(){let D=Object.assign([],{dataLength:0});if(!this[q8])D.dataLength=0;let X=this.promise();return this.on("data",(Z)=>{if(D.push(Z),!this[q8])D.dataLength+=Z.length}),await X,D}async concat(){if(this[q8])throw Error("cannot concat in objectMode");let D=await this.collect();return this[C4]?D.join(""):Buffer.concat(D,D.dataLength)}async promise(){return new Promise((D,X)=>{this.on($2,()=>X(Error("stream destroyed"))),this.on("error",(Z)=>X(Z)),this.on("end",()=>D())})}[Symbol.asyncIterator](){this[F6]=!1;let D=!1,X=async()=>{return this.pause(),D=!0,{value:void 0,done:!0}};return{next:()=>{if(D)return X();let J=this.read();if(J!==null)return Promise.resolve({done:!1,value:J});if(this[l9])return X();let Y,Q,$=(W)=>{this.off("data",K),this.off("end",G),this.off($2,V),X(),Q(W)},K=(W)=>{this.off("error",$),this.off("end",G),this.off($2,V),this.pause(),Y({value:W,done:!!this[l9]})},G=()=>{this.off("error",$),this.off("data",K),this.off($2,V),X(),Y({done:!0,value:void 0})},V=()=>$(Error("stream destroyed"));return new Promise((W,F)=>{Q=F,Y=W,this.once($2,V),this.once("error",$),this.once("end",G),this.once("data",K)})},throw:X,return:X,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[F6]=!1;let D=!1,X=()=>{return this.pause(),this.off(LM,X),this.off($2,X),this.off("end",X),D=!0,{done:!0,value:void 0}},Z=()=>{if(D)return X();let J=this.read();return J===null?X():{done:!1,value:J}};return this.once("end",X),this.once(LM,X),this.once($2,X),{next:Z,throw:X,return:X,[Symbol.iterator](){return this}}}destroy(D){if(this[$2]){if(D)this.emit("error",D);else this.emit($2);return this}this[$2]=!0,this[F6]=!0,this[f2].length=0,this[g2]=0;let X=this;if(typeof X.close==="function"&&!this[nV])X.close();if(D)this.emit("error",D);else this.emit($2);return this}static get isStream(){return MH0}}var vH0=xH0.native,F$={lstatSync:SH0,readdir:_H0,readdirSync:kH0,readlinkSync:hH0,realpathSync:vH0,promises:{lstat:bH0,readdir:fH0,readlink:gH0,realpath:uH0}},Ty=(D)=>!D||D===F$||D===yH0?F$:{...F$,...D,promises:{...F$.promises,...D.promises||{}}},Iy=/^\\\\\?\\([a-z]:)\\?$/i,mH0=(D)=>D.replace(/\//g,"\\").replace(Iy,"$1\\"),cH0=/[\\\/]/,u6=0,jy=1,Py=2,$9=4,Cy=6,wy=8,BD=10,Sy=12,g6=15,V$=~g6,TM=16,Ay=32,H$=64,w4=128,aV=256,eV=512,Ny=H$|w4|eV,dH0=1023,IM=(D)=>D.isFile()?wy:D.isDirectory()?$9:D.isSymbolicLink()?BD:D.isCharacterDevice()?Py:D.isBlockDevice()?Cy:D.isSocket()?Sy:D.isFIFO()?jy:u6,Ry=new qD({max:4096}),q$=(D)=>{let X=Ry.get(D);if(X)return X;let Z=D.normalize("NFKD");return Ry.set(D,Z),Z},Ey=new qD({max:4096}),tV=(D)=>{let X=Ey.get(D);if(X)return X;let Z=q$(D.toLowerCase());return Ey.set(D,Z),Z};class PM extends qD{constructor(){super({max:256})}}class _y extends qD{constructor(D=16384){super({maxSize:D,sizeCalculation:(X)=>X.length+1})}}var ky=Symbol("PathScurry setAsCwd");class x8{name;root;roots;parent;nocase;isCWD=!1;#D;#X;get dev(){return this.#X}#Z;get mode(){return this.#Z}#J;get nlink(){return this.#J}#Q;get uid(){return this.#Q}#Y;get gid(){return this.#Y}#$;get rdev(){return this.#$}#G;get blksize(){return this.#G}#K;get ino(){return this.#K}#W;get size(){return this.#W}#F;get blocks(){return this.#F}#q;get atimeMs(){return this.#q}#H;get mtimeMs(){return this.#H}#V;get ctimeMs(){return this.#V}#U;get birthtimeMs(){return this.#U}#B;get atime(){return this.#B}#O;get mtime(){return this.#O}#R;get ctime(){return this.#R}#M;get birthtime(){return this.#M}#N;#E;#L;#A;#P;#C;#z;#S;#I;#j;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(D,X=u6,Z,J,Y,Q,$){if(this.name=D,this.#N=Y?tV(D):q$(D),this.#z=X&dH0,this.nocase=Y,this.roots=J,this.root=Z||this,this.#S=Q,this.#L=$.fullpath,this.#P=$.relative,this.#C=$.relativePosix,this.parent=$.parent,this.parent)this.#D=this.parent.#D;else this.#D=Ty($.fs)}depth(){if(this.#E!==void 0)return this.#E;if(!this.parent)return this.#E=0;return this.#E=this.parent.depth()+1}childrenCache(){return this.#S}resolve(D){if(!D)return this;let X=this.getRootString(D),J=D.substring(X.length).split(this.splitSep);return X?this.getRoot(X).#w(J):this.#w(J)}#w(D){let X=this;for(let Z of D)X=X.child(Z);return X}children(){let D=this.#S.get(this);if(D)return D;let X=Object.assign([],{provisional:0});return this.#S.set(this,X),this.#z&=~TM,X}child(D,X){if(D===""||D===".")return this;if(D==="..")return this.parent||this;let Z=this.children(),J=this.nocase?tV(D):q$(D);for(let K of Z)if(K.#N===J)return K;let Y=this.parent?this.sep:"",Q=this.#L?this.#L+Y+D:void 0,$=this.newChild(D,u6,{...X,parent:this,fullpath:Q});if(!this.canReaddir())$.#z|=w4;return Z.push($),$}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let D=this.name,X=this.parent;if(!X)return this.#P=this.name;let Z=X.relative();return Z+(!Z||!X.parent?"":this.sep)+D}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let D=this.name,X=this.parent;if(!X)return this.#C=this.fullpathPosix();let Z=X.relativePosix();return Z+(!Z||!X.parent?"":"/")+D}fullpath(){if(this.#L!==void 0)return this.#L;let D=this.name,X=this.parent;if(!X)return this.#L=this.name;let J=X.fullpath()+(!X.parent?"":this.sep)+D;return this.#L=J}fullpathPosix(){if(this.#A!==void 0)return this.#A;if(this.sep==="/")return this.#A=this.fullpath();if(!this.parent){let J=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(J))return this.#A=`//?/${J}`;else return this.#A=J}let D=this.parent,X=D.fullpathPosix(),Z=X+(!X||!D.parent?"":"/")+this.name;return this.#A=Z}isUnknown(){return(this.#z&g6)===u6}isType(D){return this[`is${D}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#z&g6)===wy}isDirectory(){return(this.#z&g6)===$9}isCharacterDevice(){return(this.#z&g6)===Py}isBlockDevice(){return(this.#z&g6)===Cy}isFIFO(){return(this.#z&g6)===jy}isSocket(){return(this.#z&g6)===Sy}isSymbolicLink(){return(this.#z&BD)===BD}lstatCached(){return this.#z&Ay?this:void 0}readlinkCached(){return this.#I}realpathCached(){return this.#j}readdirCached(){let D=this.children();return D.slice(0,D.provisional)}canReadlink(){if(this.#I)return!0;if(!this.parent)return!1;let D=this.#z&g6;return!(D!==u6&&D!==BD||this.#z&aV||this.#z&w4)}calledReaddir(){return!!(this.#z&TM)}isENOENT(){return!!(this.#z&w4)}isNamed(D){return!this.nocase?this.#N===q$(D):this.#N===tV(D)}async readlink(){let D=this.#I;if(D)return D;if(!this.canReadlink())return;if(!this.parent)return;try{let X=await this.#D.promises.readlink(this.fullpath()),Z=(await this.parent.realpath())?.resolve(X);if(Z)return this.#I=Z}catch(X){this.#T(X.code);return}}readlinkSync(){let D=this.#I;if(D)return D;if(!this.canReadlink())return;if(!this.parent)return;try{let X=this.#D.readlinkSync(this.fullpath()),Z=this.parent.realpathSync()?.resolve(X);if(Z)return this.#I=Z}catch(X){this.#T(X.code);return}}#f(D){this.#z|=TM;for(let X=D.provisional;X<D.length;X++){let Z=D[X];if(Z)Z.#_()}}#_(){if(this.#z&w4)return;this.#z=(this.#z|w4)&V$,this.#x()}#x(){let D=this.children();D.provisional=0;for(let X of D)X.#_()}#h(){this.#z|=eV,this.#y()}#y(){if(this.#z&H$)return;let D=this.#z;if((D&g6)===$9)D&=V$;this.#z=D|H$,this.#x()}#v(D=""){if(D==="ENOTDIR"||D==="EPERM")this.#y();else if(D==="ENOENT")this.#_();else this.children().provisional=0}#b(D=""){if(D==="ENOTDIR")this.parent.#y();else if(D==="ENOENT")this.#_()}#T(D=""){let X=this.#z;if(X|=aV,D==="ENOENT")X|=w4;if(D==="EINVAL"||D==="UNKNOWN")X&=V$;if(this.#z=X,D==="ENOTDIR"&&this.parent)this.parent.#y()}#g(D,X){return this.#u(D,X)||this.#m(D,X)}#m(D,X){let Z=IM(D),J=this.newChild(D.name,Z,{parent:this}),Y=J.#z&g6;if(Y!==$9&&Y!==BD&&Y!==u6)J.#z|=H$;return X.unshift(J),X.provisional++,J}#u(D,X){for(let Z=X.provisional;Z<X.length;Z++){let J=X[Z];if((this.nocase?tV(D.name):q$(D.name))!==J.#N)continue;return this.#k(D,J,Z,X)}}#k(D,X,Z,J){let Y=X.name;if(X.#z=X.#z&V$|IM(D),Y!==D.name)X.name=D.name;if(Z!==J.provisional){if(Z===J.length-1)J.pop();else J.splice(Z,1);J.unshift(X)}return J.provisional++,X}async lstat(){if((this.#z&w4)===0)try{return this.#l(await this.#D.promises.lstat(this.fullpath())),this}catch(D){this.#b(D.code)}}lstatSync(){if((this.#z&w4)===0)try{return this.#l(this.#D.lstatSync(this.fullpath())),this}catch(D){this.#b(D.code)}}#l(D){let{atime:X,atimeMs:Z,birthtime:J,birthtimeMs:Y,blksize:Q,blocks:$,ctime:K,ctimeMs:G,dev:V,gid:W,ino:F,mode:z,mtime:H,mtimeMs:q,nlink:U,rdev:B,size:O,uid:L}=D;this.#B=X,this.#q=Z,this.#M=J,this.#U=Y,this.#G=Q,this.#F=$,this.#R=K,this.#V=G,this.#X=V,this.#Y=W,this.#K=F,this.#Z=z,this.#O=H,this.#H=q,this.#J=U,this.#$=B,this.#W=O,this.#Q=L;let M=IM(D);if(this.#z=this.#z&V$|M|Ay,M!==u6&&M!==$9&&M!==BD)this.#z|=H$}#d=[];#c=!1;#i(D){this.#c=!1;let X=this.#d.slice();this.#d.length=0,X.forEach((Z)=>Z(null,D))}readdirCB(D,X=!1){if(!this.canReaddir()){if(X)D(null,[]);else queueMicrotask(()=>D(null,[]));return}let Z=this.children();if(this.calledReaddir()){let Y=Z.slice(0,Z.provisional);if(X)D(null,Y);else queueMicrotask(()=>D(null,Y));return}if(this.#d.push(D),this.#c)return;this.#c=!0;let J=this.fullpath();this.#D.readdir(J,{withFileTypes:!0},(Y,Q)=>{if(Y)this.#v(Y.code),Z.provisional=0;else{for(let $ of Q)this.#g($,Z);this.#f(Z)}this.#i(Z.slice(0,Z.provisional));return})}#p;async readdir(){if(!this.canReaddir())return[];let D=this.children();if(this.calledReaddir())return D.slice(0,D.provisional);let X=this.fullpath();if(this.#p)await this.#p;else{let Z=()=>{};this.#p=new Promise((J)=>Z=J);try{for(let J of await this.#D.promises.readdir(X,{withFileTypes:!0}))this.#g(J,D);this.#f(D)}catch(J){this.#v(J.code),D.provisional=0}this.#p=void 0,Z()}return D.slice(0,D.provisional)}readdirSync(){if(!this.canReaddir())return[];let D=this.children();if(this.calledReaddir())return D.slice(0,D.provisional);let X=this.fullpath();try{for(let Z of this.#D.readdirSync(X,{withFileTypes:!0}))this.#g(Z,D);this.#f(D)}catch(Z){this.#v(Z.code),D.provisional=0}return D.slice(0,D.provisional)}canReaddir(){if(this.#z&Ny)return!1;let D=g6&this.#z;if(!(D===u6||D===$9||D===BD))return!1;return!0}shouldWalk(D,X){return(this.#z&$9)===$9&&!(this.#z&Ny)&&!D.has(this)&&(!X||X(this))}async realpath(){if(this.#j)return this.#j;if((eV|aV|w4)&this.#z)return;try{let D=await this.#D.promises.realpath(this.fullpath());return this.#j=this.resolve(D)}catch(D){this.#h()}}realpathSync(){if(this.#j)return this.#j;if((eV|aV|w4)&this.#z)return;try{let D=this.#D.realpathSync(this.fullpath());return this.#j=this.resolve(D)}catch(D){this.#h()}}[ky](D){if(D===this)return;D.isCWD=!1,this.isCWD=!0;let X=new Set([]),Z=[],J=this;while(J&&J.parent)X.add(J),J.#P=Z.join(this.sep),J.#C=Z.join("/"),J=J.parent,Z.push("..");J=D;while(J&&J.parent&&!X.has(J))J.#P=void 0,J.#C=void 0,J=J.parent}}class DF extends x8{sep="\\";splitSep=cH0;constructor(D,X=u6,Z,J,Y,Q,$){super(D,X,Z,J,Y,Q,$)}newChild(D,X=u6,Z={}){return new DF(D,X,this.root,this.roots,this.nocase,this.childrenCache(),Z)}getRootString(D){return jM.parse(D).root}getRoot(D){if(D=mH0(D.toUpperCase()),D===this.root.name)return this.root;for(let[X,Z]of Object.entries(this.roots))if(this.sameRoot(D,X))return this.roots[D]=Z;return this.roots[D]=new z$(D,this).root}sameRoot(D,X=this.root.name){return D=D.toUpperCase().replace(/\//g,"\\").replace(Iy,"$1\\"),D===X}}class XF extends x8{splitSep="/";sep="/";constructor(D,X=u6,Z,J,Y,Q,$){super(D,X,Z,J,Y,Q,$)}getRootString(D){return D.startsWith("/")?"/":""}getRoot(D){return this.root}newChild(D,X=u6,Z={}){return new XF(D,X,this.root,this.roots,this.nocase,this.childrenCache(),Z)}}class CM{root;rootPath;roots;cwd;#D;#X;#Z;nocase;#J;constructor(D=process.cwd(),X,Z,{nocase:J,childrenCacheSize:Y=16384,fs:Q=F$}={}){if(this.#J=Ty(Q),D instanceof URL||D.startsWith("file://"))D=wH0(D);let $=X.resolve(D);this.roots=Object.create(null),this.rootPath=this.parseRootPath($),this.#D=new PM,this.#X=new PM,this.#Z=new _y(Y);let K=$.substring(this.rootPath.length).split(Z);if(K.length===1&&!K[0])K.pop();if(J===void 0)throw TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=J,this.root=this.newRoot(this.#J),this.roots[this.rootPath]=this.root;let G=this.root,V=K.length-1,W=X.sep,F=this.rootPath,z=!1;for(let H of K){let q=V--;G=G.child(H,{relative:Array(q).fill("..").join(W),relativePosix:Array(q).fill("..").join("/"),fullpath:F+=(z?"":W)+H}),z=!0}this.cwd=G}depth(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return D.depth()}childrenCache(){return this.#Z}resolve(...D){let X="";for(let Y=D.length-1;Y>=0;Y--){let Q=D[Y];if(!Q||Q===".")continue;if(X=X?`${Q}/${X}`:Q,this.isAbsolute(Q))break}let Z=this.#D.get(X);if(Z!==void 0)return Z;let J=this.cwd.resolve(X).fullpath();return this.#D.set(X,J),J}resolvePosix(...D){let X="";for(let Y=D.length-1;Y>=0;Y--){let Q=D[Y];if(!Q||Q===".")continue;if(X=X?`${Q}/${X}`:Q,this.isAbsolute(Q))break}let Z=this.#X.get(X);if(Z!==void 0)return Z;let J=this.cwd.resolve(X).fullpathPosix();return this.#X.set(X,J),J}relative(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return D.relative()}relativePosix(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return D.relativePosix()}basename(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return D.name}dirname(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return(D.parent||D).fullpath()}async readdir(D=this.cwd,X={withFileTypes:!0}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z}=X;if(!D.canReaddir())return[];else{let J=await D.readdir();return Z?J:J.map((Y)=>Y.name)}}readdirSync(D=this.cwd,X={withFileTypes:!0}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z=!0}=X;if(!D.canReaddir())return[];else if(Z)return D.readdirSync();else return D.readdirSync().map((J)=>J.name)}async lstat(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return D.lstat()}lstatSync(D=this.cwd){if(typeof D==="string")D=this.cwd.resolve(D);return D.lstatSync()}async readlink(D=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D.withFileTypes,D=this.cwd;let Z=await D.readlink();return X?Z:Z?.fullpath()}readlinkSync(D=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D.withFileTypes,D=this.cwd;let Z=D.readlinkSync();return X?Z:Z?.fullpath()}async realpath(D=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D.withFileTypes,D=this.cwd;let Z=await D.realpath();return X?Z:Z?.fullpath()}realpathSync(D=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D.withFileTypes,D=this.cwd;let Z=D.realpathSync();return X?Z:Z?.fullpath()}async walk(D=this.cwd,X={}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z=!0,follow:J=!1,filter:Y,walkFilter:Q}=X,$=[];if(!Y||Y(D))$.push(Z?D:D.fullpath());let K=new Set,G=(W,F)=>{K.add(W),W.readdirCB((z,H)=>{if(z)return F(z);let q=H.length;if(!q)return F();let U=()=>{if(--q===0)F()};for(let B of H){if(!Y||Y(B))$.push(Z?B:B.fullpath());if(J&&B.isSymbolicLink())B.realpath().then((O)=>O?.isUnknown()?O.lstat():O).then((O)=>O?.shouldWalk(K,Q)?G(O,U):U());else if(B.shouldWalk(K,Q))G(B,U);else U()}},!0)},V=D;return new Promise((W,F)=>{G(V,(z)=>{if(z)return F(z);W($)})})}walkSync(D=this.cwd,X={}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z=!0,follow:J=!1,filter:Y,walkFilter:Q}=X,$=[];if(!Y||Y(D))$.push(Z?D:D.fullpath());let K=new Set([D]);for(let G of K){let V=G.readdirSync();for(let W of V){if(!Y||Y(W))$.push(Z?W:W.fullpath());let F=W;if(W.isSymbolicLink()){if(!(J&&(F=W.realpathSync())))continue;if(F.isUnknown())F.lstatSync()}if(F.shouldWalk(K,Q))K.add(F)}}return $}[Symbol.asyncIterator](){return this.iterate()}iterate(D=this.cwd,X={}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;return this.stream(D,X)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(D=this.cwd,X={}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z=!0,follow:J=!1,filter:Y,walkFilter:Q}=X;if(!Y||Y(D))yield Z?D:D.fullpath();let $=new Set([D]);for(let K of $){let G=K.readdirSync();for(let V of G){if(!Y||Y(V))yield Z?V:V.fullpath();let W=V;if(V.isSymbolicLink()){if(!(J&&(W=V.realpathSync())))continue;if(W.isUnknown())W.lstatSync()}if(W.shouldWalk($,Q))$.add(W)}}}stream(D=this.cwd,X={}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z=!0,follow:J=!1,filter:Y,walkFilter:Q}=X,$=new UD({objectMode:!0});if(!Y||Y(D))$.write(Z?D:D.fullpath());let K=new Set,G=[D],V=0,W=()=>{let F=!1;while(!F){let z=G.shift();if(!z){if(V===0)$.end();return}V++,K.add(z);let H=(U,B,O=!1)=>{if(U)return $.emit("error",U);if(J&&!O){let L=[];for(let M of B)if(M.isSymbolicLink())L.push(M.realpath().then((A)=>A?.isUnknown()?A.lstat():A));if(L.length){Promise.all(L).then(()=>H(null,B,!0));return}}for(let L of B)if(L&&(!Y||Y(L))){if(!$.write(Z?L:L.fullpath()))F=!0}V--;for(let L of B){let M=L.realpathCached()||L;if(M.shouldWalk(K,Q))G.push(M)}if(F&&!$.flowing)$.once("drain",W);else if(!q)W()},q=!0;z.readdirCB(H,!0),q=!1}};return W(),$}streamSync(D=this.cwd,X={}){if(typeof D==="string")D=this.cwd.resolve(D);else if(!(D instanceof x8))X=D,D=this.cwd;let{withFileTypes:Z=!0,follow:J=!1,filter:Y,walkFilter:Q}=X,$=new UD({objectMode:!0}),K=new Set;if(!Y||Y(D))$.write(Z?D:D.fullpath());let G=[D],V=0,W=()=>{let F=!1;while(!F){let z=G.shift();if(!z){if(V===0)$.end();return}V++,K.add(z);let H=z.readdirSync();for(let q of H)if(!Y||Y(q)){if(!$.write(Z?q:q.fullpath()))F=!0}V--;for(let q of H){let U=q;if(q.isSymbolicLink()){if(!(J&&(U=q.realpathSync())))continue;if(U.isUnknown())U.lstatSync()}if(U.shouldWalk(K,Q))G.push(U)}}if(F&&!$.flowing)$.once("drain",W)};return W(),$}chdir(D=this.cwd){let X=this.cwd;this.cwd=typeof D==="string"?this.cwd.resolve(D):D,this.cwd[ky](X)}}class z$ extends CM{sep="\\";constructor(D=process.cwd(),X={}){let{nocase:Z=!0}=X;super(D,jM,"\\",{...X,nocase:Z});this.nocase=Z;for(let J=this.cwd;J;J=J.parent)J.nocase=this.nocase}parseRootPath(D){return jM.parse(D).root.toUpperCase()}newRoot(D){return new DF(this.rootPath,$9,void 0,this.roots,this.nocase,this.childrenCache(),{fs:D})}isAbsolute(D){return D.startsWith("/")||D.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(D)}}class U$ extends CM{sep="/";constructor(D=process.cwd(),X={}){let{nocase:Z=!1}=X;super(D,CH0,"/",{...X,nocase:Z});this.nocase=Z}parseRootPath(D){return"/"}newRoot(D){return new XF(this.rootPath,$9,void 0,this.roots,this.nocase,this.childrenCache(),{fs:D})}isAbsolute(D){return D.startsWith("/")}}class ZF extends U${constructor(D=process.cwd(),X={}){let{nocase:Z=!0}=X;super(D,{...X,nocase:Z})}}var vX1=process.platform==="win32"?DF:XF,hy=process.platform==="win32"?z$:process.platform==="darwin"?ZF:U$;var lH0=(D)=>D.length>=1,pH0=(D)=>D.length>=1;class jZ{#D;#X;#Z;length;#J;#Q;#Y;#$;#G;#K;#W=!0;constructor(D,X,Z,J){if(!lH0(D))throw TypeError("empty pattern list");if(!pH0(X))throw TypeError("empty glob list");if(X.length!==D.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=D.length,Z<0||Z>=this.length)throw TypeError("index out of range");if(this.#D=D,this.#X=X,this.#Z=Z,this.#J=J,this.#Z===0){if(this.isUNC()){let[Y,Q,$,K,...G]=this.#D,[V,W,F,z,...H]=this.#X;if(G[0]==="")G.shift(),H.shift();let q=[Y,Q,$,K,""].join("/"),U=[V,W,F,z,""].join("/");this.#D=[q,...G],this.#X=[U,...H],this.length=this.#D.length}else if(this.isDrive()||this.isAbsolute()){let[Y,...Q]=this.#D,[$,...K]=this.#X;if(Q[0]==="")Q.shift(),K.shift();let G=Y+"/",V=$+"/";this.#D=[G,...Q],this.#X=[V,...K],this.length=this.#D.length}}}pattern(){return this.#D[this.#Z]}isString(){return typeof this.#D[this.#Z]==="string"}isGlobstar(){return this.#D[this.#Z]===Z8}isRegExp(){return this.#D[this.#Z]instanceof RegExp}globString(){return this.#Y=this.#Y||(this.#Z===0?this.isAbsolute()?this.#X[0]+this.#X.slice(1).join("/"):this.#X.join("/"):this.#X.slice(this.#Z).join("/"))}hasMore(){return this.length>this.#Z+1}rest(){if(this.#Q!==void 0)return this.#Q;if(!this.hasMore())return this.#Q=null;return this.#Q=new jZ(this.#D,this.#X,this.#Z+1,this.#J),this.#Q.#K=this.#K,this.#Q.#G=this.#G,this.#Q.#$=this.#$,this.#Q}isUNC(){let D=this.#D;return this.#G!==void 0?this.#G:this.#G=this.#J==="win32"&&this.#Z===0&&D[0]===""&&D[1]===""&&typeof D[2]==="string"&&!!D[2]&&typeof D[3]==="string"&&!!D[3]}isDrive(){let D=this.#D;return this.#$!==void 0?this.#$:this.#$=this.#J==="win32"&&this.#Z===0&&this.length>1&&typeof D[0]==="string"&&/^[a-z]:$/i.test(D[0])}isAbsolute(){let D=this.#D;return this.#K!==void 0?this.#K:this.#K=D[0]===""&&D.length>1||this.isDrive()||this.isUNC()}root(){let D=this.#D[0];return typeof D==="string"&&this.isAbsolute()&&this.#Z===0?D:""}checkFollowGlobstar(){return!(this.#Z===0||!this.isGlobstar()||!this.#W)}markFollowGlobstar(){if(this.#Z===0||!this.isGlobstar()||!this.#W)return!1;return this.#W=!1,!0}}var iH0=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class B${relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(D,{nobrace:X,nocase:Z,noext:J,noglobstar:Y,platform:Q=iH0}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=Q,this.mmopts={dot:!0,nobrace:X,nocase:Z,noext:J,noglobstar:Y,optimizationLevel:2,platform:Q,nocomment:!0,nonegate:!0};for(let $ of D)this.add($)}add(D){let X=new f6(D,this.mmopts);for(let Z=0;Z<X.set.length;Z++){let J=X.set[Z],Y=X.globParts[Z];if(!J||!Y)throw Error("invalid pattern object");while(J[0]==="."&&Y[0]===".")J.shift(),Y.shift();let Q=new jZ(J,Y,0,this.platform),$=new f6(Q.globString(),this.mmopts),K=Y[Y.length-1]==="**",G=Q.isAbsolute();if(G)this.absolute.push($);else this.relative.push($);if(K)if(G)this.absoluteChildren.push($);else this.relativeChildren.push($)}}ignored(D){let X=D.fullpath(),Z=`${X}/`,J=D.relative()||".",Y=`${J}/`;for(let Q of this.relative)if(Q.match(J)||Q.match(Y))return!0;for(let Q of this.absolute)if(Q.match(X)||Q.match(Z))return!0;return!1}childrenIgnored(D){let X=D.fullpath()+"/",Z=(D.relative()||".")+"/";for(let J of this.relativeChildren)if(J.match(Z))return!0;for(let J of this.absoluteChildren)if(J.match(X))return!0;return!1}}class wM{store;constructor(D=new Map){this.store=D}copy(){return new wM(new Map(this.store))}hasWalked(D,X){return this.store.get(D.fullpath())?.has(X.globString())}storeWalked(D,X){let Z=D.fullpath(),J=this.store.get(Z);if(J)J.add(X.globString());else this.store.set(Z,new Set([X.globString()]))}}class xy{store=new Map;add(D,X,Z){let J=(X?2:0)|(Z?1:0),Y=this.store.get(D);this.store.set(D,Y===void 0?J:J&Y)}entries(){return[...this.store.entries()].map(([D,X])=>[D,!!(X&2),!!(X&1)])}}class yy{store=new Map;add(D,X){if(!D.canReaddir())return;let Z=this.store.get(D);if(Z){if(!Z.find((J)=>J.globString()===X.globString()))Z.push(X)}else this.store.set(D,[X])}get(D){let X=this.store.get(D);if(!X)throw Error("attempting to walk unknown path");return X}entries(){return this.keys().map((D)=>[D,this.store.get(D)])}keys(){return[...this.store.keys()].filter((D)=>D.canReaddir())}}class O${hasWalkedCache;matches=new xy;subwalks=new yy;patterns;follow;dot;opts;constructor(D,X){this.opts=D,this.follow=!!D.follow,this.dot=!!D.dot,this.hasWalkedCache=X?X.copy():new wM}processPatterns(D,X){this.patterns=X;let Z=X.map((J)=>[D,J]);for(let[J,Y]of Z){this.hasWalkedCache.storeWalked(J,Y);let Q=Y.root(),$=Y.isAbsolute()&&this.opts.absolute!==!1;if(Q){J=J.resolve(Q==="/"&&this.opts.root!==void 0?this.opts.root:Q);let W=Y.rest();if(!W){this.matches.add(J,!0,!1);continue}else Y=W}if(J.isENOENT())continue;let K,G,V=!1;while(typeof(K=Y.pattern())==="string"&&(G=Y.rest()))J=J.resolve(K),Y=G,V=!0;if(K=Y.pattern(),G=Y.rest(),V){if(this.hasWalkedCache.hasWalked(J,Y))continue;this.hasWalkedCache.storeWalked(J,Y)}if(typeof K==="string"){let W=K===".."||K===""||K===".";this.matches.add(J.resolve(K),$,W);continue}else if(K===Z8){if(!J.isSymbolicLink()||this.follow||Y.checkFollowGlobstar())this.subwalks.add(J,Y);let W=G?.pattern(),F=G?.rest();if(!G||(W===""||W===".")&&!F)this.matches.add(J,$,W===""||W===".");else if(W===".."){let z=J.parent||J;if(!F)this.matches.add(z,$,!0);else if(!this.hasWalkedCache.hasWalked(z,F))this.subwalks.add(z,F)}}else if(K instanceof RegExp)this.subwalks.add(J,Y)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new O$(this.opts,this.hasWalkedCache)}filterEntries(D,X){let Z=this.subwalks.get(D),J=this.child();for(let Y of X)for(let Q of Z){let $=Q.isAbsolute(),K=Q.pattern(),G=Q.rest();if(K===Z8)J.testGlobstar(Y,Q,G,$);else if(K instanceof RegExp)J.testRegExp(Y,K,G,$);else J.testString(Y,K,G,$)}return J}testGlobstar(D,X,Z,J){if(this.dot||!D.name.startsWith(".")){if(!X.hasMore())this.matches.add(D,J,!1);if(D.canReaddir()){if(this.follow||!D.isSymbolicLink())this.subwalks.add(D,X);else if(D.isSymbolicLink()){if(Z&&X.checkFollowGlobstar())this.subwalks.add(D,Z);else if(X.markFollowGlobstar())this.subwalks.add(D,X)}}}if(Z){let Y=Z.pattern();if(typeof Y==="string"&&Y!==".."&&Y!==""&&Y!==".")this.testString(D,Y,Z.rest(),J);else if(Y===".."){let Q=D.parent||D;this.subwalks.add(Q,Z)}else if(Y instanceof RegExp)this.testRegExp(D,Y,Z.rest(),J)}}testRegExp(D,X,Z,J){if(!X.test(D.name))return;if(!Z)this.matches.add(D,J,!1);else this.subwalks.add(D,Z)}testString(D,X,Z,J){if(!D.isNamed(X))return;if(!Z)this.matches.add(D,J,!1);else this.subwalks.add(D,Z)}}var nH0=(D,X)=>typeof D==="string"?new B$([D],X):Array.isArray(D)?new B$(D,X):D;class SM{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#D=[];#X;#Z;signal;maxDepth;includeChildMatches;constructor(D,X,Z){if(this.patterns=D,this.path=X,this.opts=Z,this.#Z=!Z.posix&&Z.platform==="win32"?"\\":"/",this.includeChildMatches=Z.includeChildMatches!==!1,Z.ignore||!this.includeChildMatches){if(this.#X=nH0(Z.ignore??[],Z),!this.includeChildMatches&&typeof this.#X.add!=="function")throw Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=Z.maxDepth||1/0,Z.signal)this.signal=Z.signal,this.signal.addEventListener("abort",()=>{this.#D.length=0})}#J(D){return this.seen.has(D)||!!this.#X?.ignored?.(D)}#Q(D){return!!this.#X?.childrenIgnored?.(D)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let D=void 0;while(!this.paused&&(D=this.#D.shift()))D()}onResume(D){if(this.signal?.aborted)return;if(!this.paused)D();else this.#D.push(D)}async matchCheck(D,X){if(X&&this.opts.nodir)return;let Z;if(this.opts.realpath){if(Z=D.realpathCached()||await D.realpath(),!Z)return;D=Z}let Y=D.isUnknown()||this.opts.stat?await D.lstat():D;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let Q=await Y.realpath();if(Q&&(Q.isUnknown()||this.opts.stat))await Q.lstat()}return this.matchCheckTest(Y,X)}matchCheckTest(D,X){return D&&(this.maxDepth===1/0||D.depth()<=this.maxDepth)&&(!X||D.canReaddir())&&(!this.opts.nodir||!D.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!D.isSymbolicLink()||!D.realpathCached()?.isDirectory())&&!this.#J(D)?D:void 0}matchCheckSync(D,X){if(X&&this.opts.nodir)return;let Z;if(this.opts.realpath){if(Z=D.realpathCached()||D.realpathSync(),!Z)return;D=Z}let Y=D.isUnknown()||this.opts.stat?D.lstatSync():D;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let Q=Y.realpathSync();if(Q&&(Q?.isUnknown()||this.opts.stat))Q.lstatSync()}return this.matchCheckTest(Y,X)}matchFinish(D,X){if(this.#J(D))return;if(!this.includeChildMatches&&this.#X?.add){let Y=`${D.relativePosix()}/**`;this.#X.add(Y)}let Z=this.opts.absolute===void 0?X:this.opts.absolute;this.seen.add(D);let J=this.opts.mark&&D.isDirectory()?this.#Z:"";if(this.opts.withFileTypes)this.matchEmit(D);else if(Z){let Y=this.opts.posix?D.fullpathPosix():D.fullpath();this.matchEmit(Y+J)}else{let Y=this.opts.posix?D.relativePosix():D.relative(),Q=this.opts.dotRelative&&!Y.startsWith(".."+this.#Z)?"."+this.#Z:"";this.matchEmit(!Y?"."+J:Q+Y+J)}}async match(D,X,Z){let J=await this.matchCheck(D,Z);if(J)this.matchFinish(J,X)}matchSync(D,X,Z){let J=this.matchCheckSync(D,Z);if(J)this.matchFinish(J,X)}walkCB(D,X,Z){if(this.signal?.aborted)Z();this.walkCB2(D,X,new O$(this.opts),Z)}walkCB2(D,X,Z,J){if(this.#Q(D))return J();if(this.signal?.aborted)J();if(this.paused){this.onResume(()=>this.walkCB2(D,X,Z,J));return}Z.processPatterns(D,X);let Y=1,Q=()=>{if(--Y===0)J()};for(let[$,K,G]of Z.matches.entries()){if(this.#J($))continue;Y++,this.match($,K,G).then(()=>Q())}for(let $ of Z.subwalkTargets()){if(this.maxDepth!==1/0&&$.depth()>=this.maxDepth)continue;Y++;let K=$.readdirCached();if($.calledReaddir())this.walkCB3($,K,Z,Q);else $.readdirCB((G,V)=>this.walkCB3($,V,Z,Q),!0)}Q()}walkCB3(D,X,Z,J){Z=Z.filterEntries(D,X);let Y=1,Q=()=>{if(--Y===0)J()};for(let[$,K,G]of Z.matches.entries()){if(this.#J($))continue;Y++,this.match($,K,G).then(()=>Q())}for(let[$,K]of Z.subwalks.entries())Y++,this.walkCB2($,K,Z.child(),Q);Q()}walkCBSync(D,X,Z){if(this.signal?.aborted)Z();this.walkCB2Sync(D,X,new O$(this.opts),Z)}walkCB2Sync(D,X,Z,J){if(this.#Q(D))return J();if(this.signal?.aborted)J();if(this.paused){this.onResume(()=>this.walkCB2Sync(D,X,Z,J));return}Z.processPatterns(D,X);let Y=1,Q=()=>{if(--Y===0)J()};for(let[$,K,G]of Z.matches.entries()){if(this.#J($))continue;this.matchSync($,K,G)}for(let $ of Z.subwalkTargets()){if(this.maxDepth!==1/0&&$.depth()>=this.maxDepth)continue;Y++;let K=$.readdirSync();this.walkCB3Sync($,K,Z,Q)}Q()}walkCB3Sync(D,X,Z,J){Z=Z.filterEntries(D,X);let Y=1,Q=()=>{if(--Y===0)J()};for(let[$,K,G]of Z.matches.entries()){if(this.#J($))continue;this.matchSync($,K,G)}for(let[$,K]of Z.subwalks.entries())Y++,this.walkCB2Sync($,K,Z.child(),Q);Q()}}class JF extends SM{matches=new Set;constructor(D,X,Z){super(D,X,Z)}matchEmit(D){this.matches.add(D)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((D,X)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)X(this.signal.reason);else D(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class YF extends SM{results;constructor(D,X,Z){super(D,X,Z);this.results=new UD({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(D){if(this.results.write(D),!this.results.flowing)this.pause()}stream(){let D=this.path;if(D.isUnknown())D.lstat().then(()=>{this.walkCB(D,this.patterns,()=>this.results.end())});else this.walkCB(D,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var rH0=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class K9{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(D,X){if(!X)throw TypeError("glob options required");if(this.withFileTypes=!!X.withFileTypes,this.signal=X.signal,this.follow=!!X.follow,this.dot=!!X.dot,this.dotRelative=!!X.dotRelative,this.nodir=!!X.nodir,this.mark=!!X.mark,!X.cwd)this.cwd="";else if(X.cwd instanceof URL||X.cwd.startsWith("file://"))X.cwd=oH0(X.cwd);if(this.cwd=X.cwd||"",this.root=X.root,this.magicalBraces=!!X.magicalBraces,this.nobrace=!!X.nobrace,this.noext=!!X.noext,this.realpath=!!X.realpath,this.absolute=X.absolute,this.includeChildMatches=X.includeChildMatches!==!1,this.noglobstar=!!X.noglobstar,this.matchBase=!!X.matchBase,this.maxDepth=typeof X.maxDepth==="number"?X.maxDepth:1/0,this.stat=!!X.stat,this.ignore=X.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error("cannot set absolute and withFileTypes:true");if(typeof D==="string")D=[D];if(this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X.allowWindowsEscape===!1,this.windowsPathsNoEscape)D=D.map((K)=>K.replace(/\\/g,"/"));if(this.matchBase){if(X.noglobstar)throw TypeError("base matching requires globstar");D=D.map((K)=>K.includes("/")?K:`./**/${K}`)}if(this.pattern=D,this.platform=X.platform||rH0,this.opts={...X,platform:this.platform},X.scurry){if(this.scurry=X.scurry,X.nocase!==void 0&&X.nocase!==X.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let K=X.platform==="win32"?z$:X.platform==="darwin"?ZF:X.platform?U$:hy;this.scurry=new K(this.cwd,{nocase:X.nocase,fs:X.fs})}this.nocase=this.scurry.nocase;let Z=this.platform==="darwin"||this.platform==="win32",J={...X,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:Z,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Y=this.pattern.map((K)=>new f6(K,J)),[Q,$]=Y.reduce((K,G)=>{return K[0].push(...G.set),K[1].push(...G.globParts),K},[[],[]]);this.patterns=Q.map((K,G)=>{let V=$[G];if(!V)throw Error("invalid pattern object");return new jZ(K,V,0,this.platform)})}async walk(){return[...await new JF(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new JF(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new YF(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new YF(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var _M=(D,X={})=>{if(!Array.isArray(D))D=[D];for(let Z of D)if(new f6(Z,X).hasMagic())return!0;return!1};function $F(D,X={}){return new K9(D,X).streamSync()}function by(D,X={}){return new K9(D,X).stream()}function fy(D,X={}){return new K9(D,X).walkSync()}async function vy(D,X={}){return new K9(D,X).walk()}function KF(D,X={}){return new K9(D,X).iterateSync()}function gy(D,X={}){return new K9(D,X).iterate()}var sH0=$F,aH0=Object.assign(by,{sync:$F}),tH0=KF,eH0=Object.assign(gy,{sync:KF}),Dq0=Object.assign(fy,{stream:$F,iterate:KF}),QF=Object.assign(vy,{glob:vy,globSync:fy,sync:Dq0,globStream:by,stream:aH0,globStreamSync:$F,streamSync:sH0,globIterate:gy,iterate:eH0,globIterateSync:KF,iterateSync:tH0,Glob:K9,hasMagic:_M,escape:RZ,unescape:P4});QF.glob=QF;var my=new $5("remove").alias("rm").argument("<modules...>","Module IDs to remove").option("-f, --force","Remove even if imports are found").option("--cwd <path>","Working directory").description("Remove installed modules from your project").action(async(D,X)=>{let Z=X.cwd||process.cwd(),J=await T2(Z);if(!J)console.log(P.red("No promake.json found. Run promake init first.")),process.exit(1);for(let Y of D)await Xq0(Y,Z,J,X)});async function Xq0(D,X,Z,J){let Y=E2(`Checking ${D}...`).start();if(!Z.modules||!(D in Z.modules)){Y.fail(`Module "${D}" is not tracked in promake.json`);return}let Q=Z.modules[D],$=yV(Z,D,Q),K=uy.join(X,$);if(!await T4(K)){Y.warn(`Module folder not found at ${$}`),await eL(X,D),Y.succeed(`Removed "${D}" from promake.json`);return}Y.text=`Searching for imports of ${D}...`;let G=await Zq0(X,D,$);if(G.length>0&&!J.force){Y.stop(),console.log(P.yellow(`
404
404
  Found ${G.length} import(s) of "${D}":`)),console.log("");for(let H of G.slice(0,10))console.log(P.dim(` ${H.file}:${H.line}`)),console.log(` ${P.cyan(H.content.trim())}`);if(G.length>10)console.log(P.dim(` ... and ${G.length-10} more`));console.log(""),console.log(P.yellow("Module not removed. Use --force to remove anyway."));return}if(G.length>0&&J.force)Y.stop(),console.log(P.yellow(`Warning: Found ${G.length} import(s) of "${D}". Removing anyway...`)),Y.start();Y.text=`Removing ${$}...`,await Ax(K);let V=gV(),W=`@/modules/${D}`,F=await _x({cwd:X,routerFile:V,importPath:W});await eL(X,D);let z=`Removed "${D}" from ${$}`;if(F.success&&F.removedRoute)z+=P.dim(` (route ${F.removedRoute} removed)`);Y.succeed(z)}async function Zq0(D,X,Z){let J=[],Y=await QF("**/*.{ts,tsx,js,jsx}",{cwd:D,ignore:["node_modules/**","dist/**",".git/**",Z+"/**"],absolute:!0}),Q=[new RegExp(`from\\s+['"]@/modules/${X}['"]`,"g"),new RegExp(`from\\s+['"][./]+modules/${X}['"]`,"g"),new RegExp(`from\\s+['"]@/modules/${X}/`,"g"),new RegExp(`from\\s+['"][./]+modules/${X}/`,"g"),new RegExp(`require\\(['"]@/modules/${X}`,"g"),new RegExp(`require\\(['"][./]+modules/${X}`,"g")];if(!Z.includes("modules")){let $=Z.replace(/\\/g,"/");Q.push(new RegExp(`from\\s+['"]@/${$}['"]`,"g")),Q.push(new RegExp(`from\\s+['"][./]+${$}['"]`,"g"))}for(let $ of Y)try{let G=(await Nx($)).split(`
@@ -492,7 +492,7 @@ constants.json (full)`)),console.log(P.dim(JSON.stringify(B.constantsConfig,null
492
492
  `)),e8("promake create <name>","Create new project"),e8("promake add <modules...>","Add modules"),e8("promake add <page> --module-name <name>","Add page with custom name"),e8("promake remove <modules...>","Remove modules"),e8("promake sync","Sync from promake.json"),e8("promake theme --list","List theme options"),e8("promake theme --preset <name>","Apply color preset"),e8("promake list","List available modules"),e8("promake doctor","Check project health"),e8("promake doctor --runtime","Include runtime checks"),e8("promake discover --json","Project info for AI"),e8("promake seo","Sync SEO meta tags"),e8("promake usage","Show this guide"),e8("promake <command> --help","Command-specific help"),console.log()}var Ir=new $5("info").description("Show detailed information about a module").argument("<module>","Module name").option("--json","Output as JSON").action(async(D,X)=>{let Z=E2(`Fetching ${D}...`).start();try{let J=await R4(D);if(Z.stop(),!J)console.error(P.red(`Module not found: ${D}`)),process.exit(1);if(X.json){console.log(JSON.stringify(J,null,2));return}if(console.log(""),console.log(P.bold.cyan(J.name)),console.log(P.dim("─".repeat(J.name.length+4))),J.title)console.log(`${P.gray("Title:")} ${J.title}`);if(console.log(`${P.gray("Type:")} ${J.type.replace("registry:","")}`),J.description)console.log(`${P.gray("Description:")} ${J.description}`);if(J.registryDependencies?.length)console.log(""),console.log(P.gray("Dependencies:")),J.registryDependencies.forEach((Y)=>{let $=!Y.includes("-")||["button","card","input","badge","dialog","sheet","dropdown-menu","accordion","tabs","select","checkbox","slider","separator","avatar","tooltip","popover","navigation-menu","scroll-area"].includes(Y)?P.dim("(shadcn)"):"";console.log(` ${P.yellow("•")} ${Y} ${$}`)});if(J.dependencies?.length)console.log(""),console.log(P.gray("NPM Packages:")),J.dependencies.forEach((Y)=>{console.log(` ${P.blue("•")} ${Y}`)});if(J.files?.length)console.log(""),console.log(P.gray("Files:")),J.files.forEach((Y)=>{console.log(` ${P.dim("•")} ${Y.path}`)});if(J.exports){if(console.log(""),console.log(P.gray("Exports:")),J.exports.types?.length)console.log(` ${P.magenta("Types:")} ${J.exports.types.join(", ")}`);if(J.exports.variables?.length)console.log(` ${P.green("Components:")} ${J.exports.variables.join(", ")}`)}if(J.route)console.log(""),console.log(P.gray("Route:")),console.log(` ${P.cyan("Path:")} ${J.route.path}`),console.log(` ${P.cyan("Component:")} ${J.route.componentName}`);if(J.usage)console.log(""),console.log(P.gray("Usage:")),console.log(P.dim("─".repeat(40))),console.log(J.usage);console.log("")}catch(J){if(Z.fail("Failed to fetch module info"),J instanceof Error)console.error(P.red(J.message));process.exit(1)}});import P91 from"path";var kK=b1(o8(),1);import{execSync as nh0}from"child_process";import wq from"path";async function cE(D,X=!1){let Z=Date.now(),J=[],Y=wq.join(D,"tsconfig.json");if(!await kK.default.pathExists(Y))return{name:"TypeScript",status:"skip",severity:"info",duration:Date.now()-Z,items:[],summary:"No tsconfig.json found"};let Q=wq.join(D,"package.json"),$=!1;if(await kK.default.pathExists(Q))$=!!(await kK.default.readJson(Q)).scripts?.check;let K=aQ(D),G=K==="npm"?"npm run":`${K} run`;try{let V=$?`${G} check 2>&1`:"npx tsc --noEmit 2>&1";if(!X)console.log(P.dim(` $ ${$?`${G} check`:"tsc --noEmit"}`));let W=nh0(V,{cwd:D,encoding:"utf-8",stdio:"pipe"});if(!X&&W.trim())console.log(P.dim(W));return{name:"TypeScript",status:"pass",severity:"error",duration:Date.now()-Z,items:[],summary:"No type errors"}}catch(V){let W=V.stdout||V.stderr||V.message||"";if(W.includes("This is not the tsc command")||W.includes("typescript"))return{name:"TypeScript",status:"skip",severity:"info",duration:Date.now()-Z,items:[],summary:"TypeScript not installed"};if(!X&&W.trim())console.log(P.dim(W));return J.push(...oh0(W,D)),{name:"TypeScript",status:"fail",severity:"error",duration:Date.now()-Z,items:J,summary:`${J.length} type error(s)`}}}function oh0(D,X){let Z=[],J=/^(.+)\((\d+),(\d+)\):\s*(error|warning)\s*(TS\d+):\s*(.+)$/gm,Y=/^(.+):(\d+):(\d+)\s*-\s*(error|warning)\s*(TS\d+):\s*(.+)$/gm;for(let $ of[J,Y]){let K;while((K=$.exec(D))!==null){let G=K[1].trim();Z.push({file:wq.isAbsolute(G)?wq.relative(X,G):G,line:parseInt(K[2]),column:parseInt(K[3]),code:K[5],message:K[6]})}}let Q=new Set;return Z.filter(($)=>{let K=`${$.file}:${$.line}:${$.column}:${$.message}`;if(Q.has(K))return!1;return Q.add(K),!0})}var pD=b1(o8(),1);import{execSync as rh0}from"child_process";import hK from"path";var sh0=["eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc"];async function ah0(D){for(let Z of sh0)if(await pD.default.pathExists(hK.join(D,Z)))return!0;let X=hK.join(D,"package.json");if(await pD.default.pathExists(X))try{if((await pD.default.readJson(X)).eslintConfig)return!0}catch{}return!1}async function dE(D,X=!1,Z=!1){let J=Date.now();if(!await ah0(D))return{name:"ESLint",status:"skip",severity:"warning",duration:Date.now()-J,items:[],summary:"No ESLint config found"};let Y=hK.join(D,"package.json"),Q=!1;if(await pD.default.pathExists(Y))Q=!!(await pD.default.readJson(Y)).scripts?.lint;let $=aQ(D),K=$==="npm"?"npm run":`${$} run`,G=X?" -- --fix":"";try{let V=Q?`${K} lint${G} 2>&1`:`npx eslint .${X?" --fix":""} 2>&1`;if(!Z)console.log(P.dim(` $ ${Q?`${K} lint${G}`:`eslint .${X?" --fix":""}`}`));let W=rh0(V,{cwd:D,encoding:"utf-8",stdio:"pipe",maxBuffer:10485760});if(!Z&&W.trim())console.log(P.dim(W));return{name:"ESLint",status:"pass",severity:"warning",duration:Date.now()-J,items:[],summary:"No linting issues"}}catch(V){let W=V.stdout||V.stderr||V.message||"";if(W.includes("eslint: not found")||W.includes("'eslint' is not recognized"))return{name:"ESLint",status:"skip",severity:"info",duration:Date.now()-J,items:[],summary:"ESLint not installed"};if(!Z&&W.trim())console.log(P.dim(W));let F=th0(W,D);if(F.length===0&&W.includes("error"))return{name:"ESLint",status:"fail",severity:"warning",duration:Date.now()-J,items:[{message:"ESLint encountered an error"}],summary:"ESLint error"};return{name:"ESLint",status:F.length>0?"fail":"pass",severity:"warning",duration:Date.now()-J,items:F,summary:F.length>0?`${F.length} linting issue(s)`:"No linting issues"}}}function th0(D,X){let Z=[],J=/^([^\s].*\.(ts|tsx|js|jsx))$/gm,Y=/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s{2,}(\S+)?$/gm,Q=null,$=D.split(`
493
493
  `);for(let K of $){let G=K.match(/^([^\s].*\.(ts|tsx|js|jsx))$/);if(G){Q=G[1];continue}let V=K.match(/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s{2,}(\S+)?$/);if(V&&Q)Z.push({file:hK.isAbsolute(Q)?hK.relative(X,Q):Q,line:parseInt(V[1]),column:parseInt(V[2]),code:V[5]||void 0,message:V[4].trim()})}return Z}var Sq=b1(o8(),1);import{execSync as eh0}from"child_process";import xK from"path";async function lE(D){let X=Date.now(),Z=["vite.config.ts","vite.config.js","vite.config.mjs"],J=!1;for(let Y of Z)if(await Sq.default.pathExists(xK.join(D,Y))){J=!0;break}if(!J)return{name:"Build",status:"skip",severity:"error",duration:Date.now()-X,items:[],summary:"No vite.config found"};try{eh0("npx vite build 2>&1",{cwd:D,encoding:"utf-8",stdio:"pipe",env:{...process.env,NODE_ENV:"production"}});let Y=xK.join(D,"dist");if(await Sq.default.pathExists(Y))await Sq.default.remove(Y);return{name:"Build",status:"pass",severity:"error",duration:Date.now()-X,items:[],summary:"Build succeeded"}}catch(Y){let Q=Y.stdout||Y.stderr||Y.message||"",$=Dx0(Q,D);return{name:"Build",status:"fail",severity:"error",duration:Date.now()-X,items:$.length>0?$:[{message:"Build failed"}],summary:"Build failed"}}}function Dx0(D,X){let Z=[],J=D.split(`
494
494
  `),Y=[/^(.+):(\d+):(\d+):\s*(.+)$/,/\[vite\]:\s*Error:\s*(.+)/,/Error:\s*(.+?)\s+at\s+(.+):(\d+):(\d+)/,/Could not resolve ["']([^"']+)["']\s+from\s+["']([^"']+)["']/,/RollupError:\s*(.+)/];for(let $=0;$<J.length;$++){let K=J[$].trim();if(!K)continue;if(K.includes("building for production")||K.includes("transforming")||K.includes("rendering chunks")||K.includes("computing gzip")||K.startsWith("✓")||K.startsWith("vite v"))continue;for(let G of Y){let V=K.match(G);if(V){if(G.source.includes("Could not resolve"))Z.push({file:xK.relative(X,V[2]),message:`Cannot find module '${V[1]}'`,suggestion:"Check if the module is installed or the path is correct"});else if(V.length===5)Z.push({file:xK.isAbsolute(V[1]||V[2])?xK.relative(X,V[1]||V[2]):V[1]||V[2],line:parseInt(V[2]||V[3]),column:parseInt(V[3]||V[4]),message:V[4]||V[1]});else Z.push({message:V[1]||K});break}}if(Z.length===0&&(K.toLowerCase().includes("error")||K.toLowerCase().includes("failed")))Z.push({message:K})}let Q=new Set;return Z.filter(($)=>{let K=`${$.file}:${$.line}:${$.message}`;if(Q.has(K))return!1;return Q.add(K),!0})}var uS=b1(o8(),1);import sW from"path";var W91=[process.env["PROGRAMFILES(X86)"]&&sW.join(process.env["PROGRAMFILES(X86)"],"Google","Chrome","Application","chrome.exe"),process.env.PROGRAMFILES&&sW.join(process.env.PROGRAMFILES,"Google","Chrome","Application","chrome.exe"),process.env.LOCALAPPDATA&&sW.join(process.env.LOCALAPPDATA,"Google","Chrome","Application","chrome.exe"),process.env["PROGRAMFILES(X86)"]&&sW.join(process.env["PROGRAMFILES(X86)"],"Microsoft","Edge","Application","msedge.exe"),process.env.PROGRAMFILES&&sW.join(process.env.PROGRAMFILES,"Microsoft","Edge","Application","msedge.exe")].filter(Boolean),V91=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Chromium.app/Contents/MacOS/Chromium"],F91=["/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/usr/bin/chromium-browser","/usr/bin/chromium","/snap/bin/chromium"];async function T$0(){let D=await H91();if(D)return D;let X=await q91();if(X)return X;return null}async function H91(){try{let{lightpanda:D}=await Promise.resolve().then(() => (Cr(),Pr)),X=await Promise.resolve().then(() => (gS(),fS)),Z=9222,J=await D.serve({host:"127.0.0.1",port:9222});return await U91(9222),{type:"lightpanda",browser:await X.default.connect({browserWSEndpoint:"ws://127.0.0.1:9222"}),process:J}}catch{return null}}async function q91(){try{let D=await z91();if(!D)return null;return{type:"chrome",browser:await(await Promise.resolve().then(() => (gS(),fS))).default.launch({executablePath:D,headless:!0,args:["--no-sandbox","--disable-setuid-sandbox","--disable-gpu"]})}}catch{return null}}async function z91(){if(process.env.CHROME_PATH){if(await uS.default.pathExists(process.env.CHROME_PATH))return process.env.CHROME_PATH}let D;switch(process.platform){case"win32":D=W91;break;case"darwin":D=V91;break;default:D=F91}for(let X of D)if(await uS.default.pathExists(X))return X;return null}async function U91(D,X=20){for(let Z=0;Z<X;Z++){try{if((await fetch(`http://127.0.0.1:${D}/json/version`,{signal:AbortSignal.timeout(500)})).ok)return}catch{}await B91(100)}throw Error("CDP server failed to start")}function B91(D){return new Promise((X)=>setTimeout(X,D))}async function I$0(D){try{if(D.browser)await D.browser.close()}catch{}if(D.process)D.process.stdout?.destroy(),D.process.stderr?.destroy(),D.process.kill()}async function mS(D,X,Z="/"){let J=Date.now();if(!await O91(D))return{name:"Runtime",status:"skip",severity:"error",duration:Date.now()-J,items:[{message:`No server running on port ${D}`,suggestion:"Start dev server first: npm run dev (or use --port to specify different port)"}],summary:`Skipped (no server on port ${D})`};let Q=null;try{Q=await T$0()}catch{}if(!Q)return{name:"Runtime",status:"skip",severity:"info",duration:Date.now()-J,items:[{message:"No browser available (Lightpanda or Chrome/Edge not found)",suggestion:"Install Chrome/Edge or run on Linux/macOS for Lightpanda support"}],summary:"Skipped (no browser)"};let $=[],{browser:K,type:G}=Q;try{let W=await K.newPage();W.on("console",async(H)=>{let q=H.type();if(q==="error"||q==="warning"){let U=H.location();$.push({type:q==="warning"?"warning":"console",message:H.text(),fileName:U?.url,lineNumber:U?.lineNumber,columnNumber:U?.columnNumber})}}),W.on("pageerror",(H)=>{$.push({type:"error",message:H.message,stack:H.stack})});let F=Z.startsWith("/")?Z:`/${Z}`;await W.goto(`http://localhost:${D}${F}`,{waitUntil:"networkidle0",timeout:X}),await L91(3000);let z=await W.evaluate(()=>{return window.__earlyErrors||[]});$.push(...z)}catch(W){let F=W.message||"Unknown error";if(F.includes("timeout")||F.includes("Timeout"))$.push({type:"error",message:"Page load timeout - app may have crashed or is unresponsive"});else if(F.includes("net::ERR"))$.push({type:"error",message:`Network error: ${F}`});else $.push({type:"error",message:`Runtime check error: ${F}`})}finally{await I$0(Q)}let V=M91($);return{name:`Runtime (${G})`,status:V.length>0?"fail":"pass",severity:"error",duration:Date.now()-J,items:V,summary:V.length>0?`${V.length} runtime error(s)`:"No runtime errors"}}async function O91(D){try{let X=await fetch(`http://localhost:${D}`,{method:"HEAD",signal:AbortSignal.timeout(3000)});return X.ok||X.status<500}catch{return!1}}function L91(D){return new Promise((X)=>setTimeout(X,D))}function M91(D){return D.map((X)=>{let Z=[];for(let[J,Y]of Object.entries(X))if(Y!==void 0&&Y!==null)Z.push(`${J}: ${Y}`);return{message:Z.join(`
495
- `)}})}function cS(D,X){console.log(""),console.log(P.bold("Health Check")+P.dim(` (${j91(D.duration)})`)),console.log(P.dim("─".repeat(40)));for(let Z of D.checks)A91(Z,X);console.log(P.dim("─".repeat(40))),I91(D)}function A91(D,X){let Z=E91(D.status),J=T91(D.status,D.severity),Y=P.dim(`${D.duration}ms`);console.log(`${Z} ${J(D.name)} ${Y} ${P.dim("·")} ${P.dim(D.summary||"")}`);let Q=D.name.startsWith("Runtime"),$=X||Q?D.items:D.items.slice(0,3),K=D.items.length-$.length;for(let G of $)N91(G,D.severity);if(K>0)console.log(P.dim(` ... +${K} more (--verbose)`))}function N91(D,X){let Z=X==="error"?P.red:P.yellow,J=R91(D),Y=J?P.cyan(J)+" ":"";console.log(` ${Z("›")} ${Y}${D.message}`)}function R91(D){if(!D.file)return"";let X=D.file;if(D.line!==void 0){if(X+=`:${D.line}`,D.column!==void 0)X+=`:${D.column}`}return X}function E91(D){switch(D){case"pass":return P.green("✓");case"fail":return P.red("✗");case"skip":return P.dim("○");default:return P.dim("?")}}function T91(D,X){if(D==="fail")return X==="error"?P.red:P.yellow;if(D==="pass")return P.green;return P.dim}function I91(D){let{summary:X}=D,Z=[];if(X.passed>0)Z.push(P.green(`${X.passed} passed`));if(X.failed>0)Z.push(P.red(`${X.failed} failed`));if(X.skipped>0)Z.push(P.dim(`${X.skipped} skipped`));if(console.log(Z.join(P.dim(" · "))),X.errors>0)console.log(P.red(`${X.errors} error(s) need attention`));else if(X.warnings>0)console.log(P.yellow(`${X.warnings} warning(s) to review`));else console.log(P.green("All good!"))}function j91(D){if(D<1000)return`${D}ms`;return`${(D/1000).toFixed(1)}s`}var j$0=new $5("doctor").description("Analyze project for issues (TypeScript, ESLint, build, runtime)").option("--cwd <path>","Working directory").option("--port <number>","Vite dev server port","5174").option("--fix","Auto-fix ESLint issues where possible").option("--runtime","Run runtime error detection (requires running dev server)").option("--runtime-timeout <ms>","Runtime check timeout in ms","10000").option("--route <path>","Route path for runtime check","/").option("--json","Output as JSON (for CI/CD)").option("-v, --verbose","Show all details including all errors").option("-q, --quiet","Hide command output logs (only show summary)").option("--no-typecheck","Skip TypeScript type checking").option("--no-lint","Skip ESLint checking").option("--no-build","Skip Vite build checking").action(async(D)=>{let X=D.cwd||process.cwd(),Z=parseInt(D.port||"5173"),J=parseInt(D.runtimeTimeout||"10000"),Y=D.route||"/",Q=Date.now(),$=D.quiet||D.json||!1;if(!await T2(X)&&!D.json)console.log(P.yellow("Warning: No promake.json found. Running checks anyway..."));let G=D.json?null:E2("Running health checks...").start(),V=[];if(D.typecheck!==!1)V.push(()=>cE(X,$));if(D.lint!==!1)V.push(()=>dE(X,D.fix,$));if(D.build!==!1)V.push(()=>lE(X));if(D.runtime)V.push(()=>mS(Z,J,Y));let W=[];try{if(W=await C91(V,1),G)G.stop()}catch(z){if(G)G.fail("Health check failed");if(!D.json)console.error(P.red(z.message));process.exit(1)}let F={project:P91.basename(X),timestamp:new Date().toISOString(),duration:Date.now()-Q,checks:W,summary:{passed:W.filter((z)=>z.status==="pass").length,failed:W.filter((z)=>z.status==="fail").length,skipped:W.filter((z)=>z.status==="skip").length,errors:W.filter((z)=>z.status==="fail"&&z.severity==="error").reduce((z,H)=>z+H.items.length,0),warnings:W.filter((z)=>z.status==="fail"&&z.severity==="warning").reduce((z,H)=>z+H.items.length,0)}};if(D.json)console.log(JSON.stringify(F,null,2));else cS(F,D.verbose||!1);if(F.summary.errors>0)process.exit(1)});async function C91(D,X){let Z=[],J=0;async function Y(){let $=J++;if($>=D.length)return;Z[$]=await D[$](),await Y()}let Q=Array(Math.min(X,D.length)).fill(null).map(()=>Y());return await Promise.all(Q),Z}var P$0={name:"@promakeai/cli",version:"0.2.4",type:"module",bin:{promake:"dist/index.js"},files:["dist/index.js","dist/registry","template"],scripts:{dev:"bun run src/index.ts","dev:app":"cd dev && bun run dev","dev:populate":"bun run scripts/populate-dev.ts","dev:fresh":"bun run dev:populate && bun run dev:app","playground:create":"rm -rf playground && bun run dev -- create playground --template empty --pm bun","playground:reset":"bun run playground:create","playground:add":"cd playground && bun run ../src/index.ts add","playground:ecommerce":"rm -rf playground && bun run dev -- create playground --template ecommerce --pm bun",build:"bun run build:cli && bun run build:registry","build:cli":"bun build src/index.ts --outdir dist --target node --minify","build:registry":"bun run scripts/build-registry.ts",typecheck:"tsc --noEmit",prepublishOnly:"bun run build",test:"bun test","test:watch":"bun test --watch","test:coverage":"bun test --coverage",release:"bun run build && npm publish --access public"},dependencies:{"@lightpanda/browser":"^1.0.1","adm-zip":"^0.5.16",archiver:"^7.0.1",chalk:"^5.3.0",commander:"^12.1.0",culori:"^4.0.2","fs-extra":"^11.2.0",glob:"^11.0.0",ora:"^8.1.1",prompts:"^2.4.2","puppeteer-core":"^24.36.0"},devDependencies:{"@types/archiver":"^7.0.0","@types/bun":"^1.1.14","@types/culori":"^4.0.1","@types/fs-extra":"^11.0.4","@types/node":"^22.10.2","@types/prompts":"^2.4.9",typescript:"^5.7.2"}};var P8=new $5;P8.name("promake").description(`Modular React template CLI - Build React apps with pre-built components
495
+ `)}})}function cS(D,X){console.log(""),console.log(P.bold("Health Check")+P.dim(` (${j91(D.duration)})`)),console.log(P.dim("─".repeat(40)));for(let Z of D.checks)A91(Z,X);console.log(P.dim("─".repeat(40))),I91(D)}function A91(D,X){let Z=E91(D.status),J=T91(D.status,D.severity),Y=P.dim(`${D.duration}ms`);console.log(`${Z} ${J(D.name)} ${Y} ${P.dim("·")} ${P.dim(D.summary||"")}`);let Q=D.name.startsWith("Runtime"),$=X||Q?D.items:D.items.slice(0,3),K=D.items.length-$.length;for(let G of $)N91(G,D.severity);if(K>0)console.log(P.dim(` ... +${K} more (--verbose)`))}function N91(D,X){let Z=X==="error"?P.red:P.yellow,J=R91(D),Y=J?P.cyan(J)+" ":"";console.log(` ${Z("›")} ${Y}${D.message}`)}function R91(D){if(!D.file)return"";let X=D.file;if(D.line!==void 0){if(X+=`:${D.line}`,D.column!==void 0)X+=`:${D.column}`}return X}function E91(D){switch(D){case"pass":return P.green("✓");case"fail":return P.red("✗");case"skip":return P.dim("○");default:return P.dim("?")}}function T91(D,X){if(D==="fail")return X==="error"?P.red:P.yellow;if(D==="pass")return P.green;return P.dim}function I91(D){let{summary:X}=D,Z=[];if(X.passed>0)Z.push(P.green(`${X.passed} passed`));if(X.failed>0)Z.push(P.red(`${X.failed} failed`));if(X.skipped>0)Z.push(P.dim(`${X.skipped} skipped`));if(console.log(Z.join(P.dim(" · "))),X.errors>0)console.log(P.red(`${X.errors} error(s) need attention`));else if(X.warnings>0)console.log(P.yellow(`${X.warnings} warning(s) to review`));else console.log(P.green("All good!"))}function j91(D){if(D<1000)return`${D}ms`;return`${(D/1000).toFixed(1)}s`}var j$0=new $5("doctor").description("Analyze project for issues (TypeScript, ESLint, build, runtime)").option("--cwd <path>","Working directory").option("--port <number>","Vite dev server port","5174").option("--fix","Auto-fix ESLint issues where possible").option("--runtime","Run runtime error detection (requires running dev server)").option("--runtime-timeout <ms>","Runtime check timeout in ms","10000").option("--route <path>","Route path for runtime check","/").option("--json","Output as JSON (for CI/CD)").option("-v, --verbose","Show all details including all errors").option("-q, --quiet","Hide command output logs (only show summary)").option("--no-typecheck","Skip TypeScript type checking").option("--no-lint","Skip ESLint checking").option("--no-build","Skip Vite build checking").action(async(D)=>{let X=D.cwd||process.cwd(),Z=parseInt(D.port||"5173"),J=parseInt(D.runtimeTimeout||"10000"),Y=D.route||"/",Q=Date.now(),$=D.quiet||D.json||!1;if(!await T2(X)&&!D.json)console.log(P.yellow("Warning: No promake.json found. Running checks anyway..."));let G=D.json?null:E2("Running health checks...").start(),V=[];if(D.typecheck!==!1)V.push(()=>cE(X,$));if(D.lint!==!1)V.push(()=>dE(X,D.fix,$));if(D.build!==!1)V.push(()=>lE(X));if(D.runtime)V.push(()=>mS(Z,J,Y));let W=[];try{if(W=await C91(V,1),G)G.stop()}catch(z){if(G)G.fail("Health check failed");if(!D.json)console.error(P.red(z.message));process.exit(1)}let F={project:P91.basename(X),timestamp:new Date().toISOString(),duration:Date.now()-Q,checks:W,summary:{passed:W.filter((z)=>z.status==="pass").length,failed:W.filter((z)=>z.status==="fail").length,skipped:W.filter((z)=>z.status==="skip").length,errors:W.filter((z)=>z.status==="fail"&&z.severity==="error").reduce((z,H)=>z+H.items.length,0),warnings:W.filter((z)=>z.status==="fail"&&z.severity==="warning").reduce((z,H)=>z+H.items.length,0)}};if(D.json)console.log(JSON.stringify(F,null,2));else cS(F,D.verbose||!1);if(F.summary.errors>0)process.exit(1)});async function C91(D,X){let Z=[],J=0;async function Y(){let $=J++;if($>=D.length)return;Z[$]=await D[$](),await Y()}let Q=Array(Math.min(X,D.length)).fill(null).map(()=>Y());return await Promise.all(Q),Z}var P$0={name:"@promakeai/cli",version:"0.2.5",type:"module",bin:{promake:"dist/index.js"},files:["dist/index.js","dist/registry","template"],scripts:{dev:"bun run src/index.ts","dev:app":"cd dev && bun run dev","dev:populate":"bun run scripts/populate-dev.ts","dev:fresh":"bun run dev:populate && bun run dev:app","playground:create":"rm -rf playground && bun run dev -- create playground --template empty --pm bun","playground:reset":"bun run playground:create","playground:add":"cd playground && bun run ../src/index.ts add","playground:ecommerce":"rm -rf playground && bun run dev -- create playground --template ecommerce --pm bun",build:"bun run build:cli && bun run build:registry","build:cli":"bun build src/index.ts --outdir dist --target node --minify","build:registry":"bun run scripts/build-registry.ts",typecheck:"tsc --noEmit",prepublishOnly:"bun run build",test:"bun test","test:watch":"bun test --watch","test:coverage":"bun test --coverage",release:"bun run build && npm publish --access public"},dependencies:{"@lightpanda/browser":"^1.0.1","adm-zip":"^0.5.16",archiver:"^7.0.1",chalk:"^5.3.0",commander:"^12.1.0",culori:"^4.0.2","fs-extra":"^11.2.0",glob:"^11.0.0",ora:"^8.1.1",prompts:"^2.4.2","puppeteer-core":"^24.36.0"},devDependencies:{"@types/archiver":"^7.0.0","@types/bun":"^1.1.14","@types/culori":"^4.0.1","@types/fs-extra":"^11.0.4","@types/node":"^22.10.2","@types/prompts":"^2.4.9",typescript:"^5.7.2"}};var P8=new $5;P8.name("promake").description(`Modular React template CLI - Build React apps with pre-built components
496
496
 
497
497
  Quick Start:
498
498
  $ promake create my-app
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promakeai/cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "promake": "dist/index.js"