jiek 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cli.cjs CHANGED
@@ -141,7 +141,7 @@ async function getSelectedProjectsGraph() {
141
141
 
142
142
  var name = "jiek";
143
143
  var type = "module";
144
- var version = "1.0.3";
144
+ var version = "1.0.5";
145
145
  var description = "YiJie's personal kits.";
146
146
  var bin = {
147
147
  jiek: "bin/jiek.js",
@@ -339,9 +339,10 @@ const FILE_TEMPLATE = (manifest) => `
339
339
  module.exports = require('jiek/rollup').template(${JSON.stringify(manifest, null, 2)})
340
340
  `.trimStart();
341
341
  const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)));
342
- commander.program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").action(async ({
342
+ commander.program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").option("-v, --verbose", "Display debug logs.").action(async ({
343
343
  silent,
344
- entries
344
+ entries,
345
+ verbose
345
346
  }) => {
346
347
  actionRestore();
347
348
  const { build } = loadConfig();
@@ -454,6 +455,7 @@ commander.program.command("build").option("-s, --silent", "Don't display logs.")
454
455
  });
455
456
  child.once("exit", (code) => code === 0 ? resolve() : reject(new Error(`rollup build failed:
456
457
  ${errorStr}`)));
458
+ verbose && child.stdout?.pipe(process.stdout);
457
459
  });
458
460
  })
459
461
  ).finally(() => {
package/dist/cli.js CHANGED
@@ -110,7 +110,7 @@ async function getSelectedProjectsGraph() {
110
110
 
111
111
  var name = "jiek";
112
112
  var type = "module";
113
- var version = "1.0.3";
113
+ var version = "1.0.5";
114
114
  var description = "YiJie's personal kits.";
115
115
  var bin = {
116
116
  jiek: "bin/jiek.js",
@@ -308,9 +308,10 @@ const FILE_TEMPLATE = (manifest) => `
308
308
  module.exports = require('jiek/rollup').template(${JSON.stringify(manifest, null, 2)})
309
309
  `.trimStart();
310
310
  const require$1 = createRequire(import.meta.url);
311
- program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").action(async ({
311
+ program.command("build").option("-s, --silent", "Don't display logs.").option("-e, --entries <ENTRIES>", "Specify the entries of the package.json's 'exports' field.(support glob)").option("-v, --verbose", "Display debug logs.").action(async ({
312
312
  silent,
313
- entries
313
+ entries,
314
+ verbose
314
315
  }) => {
315
316
  actionRestore();
316
317
  const { build } = loadConfig();
@@ -423,6 +424,7 @@ program.command("build").option("-s, --silent", "Don't display logs.").option("-
423
424
  });
424
425
  child.once("exit", (code) => code === 0 ? resolve() : reject(new Error(`rollup build failed:
425
426
  ${errorStr}`)));
427
+ verbose && child.stdout?.pipe(process.stdout);
426
428
  });
427
429
  })
428
430
  ).finally(() => {
package/dist/cli.min.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("node:fs"),t=require("node:module"),n=require("node:path"),r=require("@pnpm/filter-workspace-packages"),o=require("commander"),a=require("js-yaml"),s=require("@jiek/utils/getWorkspaceDir"),i=require("cli-progress"),u=require("execa"),l=require("detect-indent"),p=require("inquirer"),c=require("jsonc-parser"),f=require("util"),d=require("path"),g=require("node:child_process"),h=require("@jiek/utils/bumper"),y=require("@jiek/pkger/entrypoints"),A="undefined"!=typeof document?document.currentScript:null;function R(e){return e&&e.__esModule?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var E=R(e),_=R(n),b=R(l),S=R(p),C=R(f),v=R(d),$=m(g);let x,w;function H(){if(x)return x;const e=o.program.getOptionValue("root");return x=e?_.default.isAbsolute(e)?e:_.default.resolve(process.cwd(),e):void 0,x}let k=!1;function O(){if(w)return{wd:w,notWorkspace:k};const e=H();if(void 0!==e){const t=s.isWorkspaceDir(e,T);return k=!t,w=e,{wd:w,notWorkspace:k}}try{w=s.getWorkspaceDir(T)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;w=e,k=!0}return{wd:w,notWorkspace:k}}let T="";try{t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:A&&A.src||new URL("cli.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),T="pnpm"}catch{}async function L(){let e=o.program.getOptionValue("filter");const t=H(),{wd:n,notWorkspace:s}=O();if(!s&&"pnpm"===T){const o=_.default.resolve(n,"pnpm-workspace.yaml"),s=E.default.readFileSync(o,"utf-8"),i=a.load(s);if(t===n&&!e)throw new Error("root path is workspace root, please provide a filter");if(t!==n&&!e){if(!E.default.existsSync(_.default.resolve(t,"package.json")))throw new Error("root path is not workspace root, please provide a filter");const n=JSON.parse(E.default.readFileSync(_.default.resolve(t,"package.json"),"utf-8"));if(!n.name)throw new Error("root path is not workspace root, please provide a filter");e=n.name}const{selectedProjectsGraph:u}=await r.filterPackagesFromDir(n,[{filter:e??"",followProdDepsOnly:!0}],{prefix:t,workspaceDir:n,patterns:i.packages});return{wd:n,root:t,value:Object.entries(u).reduce(((e,[t,n])=>(e[t]=n.package.manifest,e)),{})}}return{wd:n,root:t,value:{[n]:JSON.parse(E.default.readFileSync(_.default.resolve(n,"package.json"),"utf-8"))}}}""!==T&&o.program.option("-f, --filter <filter>","filter packages");var N="1.0.3",I="YiJie's personal kits.";let M;function j(){M()}function P(){new Promise((e=>M=e))}o.program.version(N).description(I).option("--root <root>","root path").option("-c, --config-path <configPath>","config path");const B=t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:A&&A.src||new URL("cli.min.cjs",document.baseURI).href);function D(e){try{return B.resolve(e),!0}catch(e){return!1}}let U;const G=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of G)if(D(e)){U=e;break}let F="jiek.config";function K(e){const{wd:t}=O();let n=o.program.getOptionValue("configPath");if(n){if(!E.default.existsSync(n))throw new Error(`config file not found: ${n}`);_.default.isAbsolute(n)||(n=_.default.resolve(t,n))}else n=function(e,t){const n=!!U;function r(n){const r=[_.default.resolve(process.cwd(),`${F}.${n}`),_.default.resolve(process.cwd(),`.${F}.${n}`),_.default.resolve(e,`${F}.${n}`),_.default.resolve(e,`.${F}.${n}`)];t&&r.unshift(_.default.resolve(t,`${F}.${n}`),_.default.resolve(t,`.${F}.${n}`));for(const e of r)if(E.default.existsSync(e)&&E.default.lstatSync(e).isFile())return e}return F=r("js")??F,F=r("json")??F,F=r("yaml")??F,n&&(F=r("ts")??F),_.default.resolve(e,F)}(t,e);const r=_.default.extname(n);let s;switch(r){case".js":s=require(n);break;case".json":return require(n);case".yaml":return a.load(E.default.readFileSync(n,"utf-8"));case".ts":if(U){require(U),s=require(n);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${r}`)}if(!s)throw new Error("config file is empty");return s.default??s}const q=t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:A&&A.src||new URL("cli.min.cjs",document.baseURI).href);o.program.command("build").option("-s, --silent","Don't display logs.").option("-e, --entries <ENTRIES>","Specify the entries of the package.json's 'exports' field.(support glob)").action((async({silent:e,entries:t})=>{P();const{build:n}=K();e=e??n?.silent??!1;const{wd:r,value:o={}}=await L()??{};if(0===Object.keys(o).length)throw new Error("no package found");const a=_.default.resolve(r,"node_modules");E.default.existsSync(a)||E.default.mkdirSync(a);const s=(...e)=>_.default.resolve(a,".jiek",...e);E.default.existsSync(s())||E.default.mkdirSync(s());const l=q.resolve("rollup").replace(/dist\/rollup.js$/,"dist/bin/rollup"),p=new i.MultiBar({clearOnComplete:!1,hideCursor:!0,format:"- {bar} | {status} | {input} | {message}"},i.Presets.shades_classic);let c=0;await Promise.all(Object.entries(o).map((async([n,o])=>{const a=o.name?.replace(/^@/g,"").replace(/\//g,"+"),i=s(`${a??"anonymous-"+c++}.rollup.config.js`);E.default.writeFileSync(i,(e=>`\nmodule.exports = require('jiek/rollup').template(${JSON.stringify(e,null,2)})\n`.trimStart())(o));let f="";U&&(f=`node -r ${U} `);const d=`${f}${l} --silent -c ${i}`,g=u.execaCommand(d,{ipc:!0,cwd:n,env:{...process.env,JIEK_ROOT:r,JIEK_ENTRIES:t}}),h={};let y=10;g.on("message",(e=>{"debug"===e.type&&console.log(...Array.isArray(e.data)?e.data:[e.data])})),!e&&g.on("message",(e=>{if("init"===e.type){const{leafMap:t,targetsLength:n}=e.data,r=Array.from(t.entries()).flatMap((([e,t])=>t.map((([t,...n])=>({input:e,path:t,conditions:n})))));console.log(`Package '${o.name}' has ${n} targets to build`),r.forEach((({input:e})=>{y=Math.max(y,e.length)})),r.forEach((({input:e,path:t})=>{const n=`${e}:${t}`;h[n]||(h[n]=p.create(50,0,{input:e.padEnd(y),status:"waiting".padEnd(10)},{barsize:20,linewrap:!0}))}))}if("progress"===e.type){const{path:t,tags:n,input:r,event:o,message:a}=e.data,s=h[`${r}:${t}`];if(!s)return;s.update({start:0,resolve:20,end:50}[o??"start"]??0,{input:r.padEnd(y),status:o?.padEnd(10),message:`${n?.join(", ")}: ${a}`})}})),await new Promise(((e,t)=>{let n="";g.stderr?.on("data",(e=>{n+=e})),g.once("exit",(r=>0===r?e():t(new Error(`rollup build failed:\n${n}`))))}))}))).finally((()=>{p.stop()})),j()}));var Q,W,X,Z,J,z,Y,V,ee,te,ne,re,oe,ae,se,ie,ue,le,pe,ce={};function fe(){return Q||(Q=1,(e=ce).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,n,r=1,o)=>!1!==o&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=o,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges||(e.invalid=!0,0)),e.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){let o=e[r];Array.isArray(o)?n(o):void 0!==o&&t.push(o)}return t};return n(e),t}),ce;var e}function de(){if(X)return W;X=1;const e=fe();return W=(t,n={})=>{let r=(t,o={})=>{let a=n.escapeInvalid&&e.isInvalidBrace(o),s=!0===t.invalid&&!0===n.escapeInvalid,i="";if(t.value)return(a||s)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)i+=r(e);return i};return r(t)}}
1
+ "use strict";var e=require("node:fs"),t=require("node:module"),n=require("node:path"),r=require("@pnpm/filter-workspace-packages"),o=require("commander"),a=require("js-yaml"),s=require("@jiek/utils/getWorkspaceDir"),i=require("cli-progress"),u=require("execa"),l=require("detect-indent"),p=require("inquirer"),c=require("jsonc-parser"),f=require("util"),d=require("path"),g=require("node:child_process"),h=require("@jiek/utils/bumper"),y=require("@jiek/pkger/entrypoints"),A="undefined"!=typeof document?document.currentScript:null;function R(e){return e&&e.__esModule?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var E=R(e),_=R(n),b=R(l),S=R(p),C=R(f),v=R(d),$=m(g);let x,w;function H(){if(x)return x;const e=o.program.getOptionValue("root");return x=e?_.default.isAbsolute(e)?e:_.default.resolve(process.cwd(),e):void 0,x}let k=!1;function O(){if(w)return{wd:w,notWorkspace:k};const e=H();if(void 0!==e){const t=s.isWorkspaceDir(e,T);return k=!t,w=e,{wd:w,notWorkspace:k}}try{w=s.getWorkspaceDir(T)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;w=e,k=!0}return{wd:w,notWorkspace:k}}let T="";try{t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:A&&A.src||new URL("cli.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),T="pnpm"}catch{}async function L(){let e=o.program.getOptionValue("filter");const t=H(),{wd:n,notWorkspace:s}=O();if(!s&&"pnpm"===T){const o=_.default.resolve(n,"pnpm-workspace.yaml"),s=E.default.readFileSync(o,"utf-8"),i=a.load(s);if(t===n&&!e)throw new Error("root path is workspace root, please provide a filter");if(t!==n&&!e){if(!E.default.existsSync(_.default.resolve(t,"package.json")))throw new Error("root path is not workspace root, please provide a filter");const n=JSON.parse(E.default.readFileSync(_.default.resolve(t,"package.json"),"utf-8"));if(!n.name)throw new Error("root path is not workspace root, please provide a filter");e=n.name}const{selectedProjectsGraph:u}=await r.filterPackagesFromDir(n,[{filter:e??"",followProdDepsOnly:!0}],{prefix:t,workspaceDir:n,patterns:i.packages});return{wd:n,root:t,value:Object.entries(u).reduce(((e,[t,n])=>(e[t]=n.package.manifest,e)),{})}}return{wd:n,root:t,value:{[n]:JSON.parse(E.default.readFileSync(_.default.resolve(n,"package.json"),"utf-8"))}}}""!==T&&o.program.option("-f, --filter <filter>","filter packages");var N="1.0.5",I="YiJie's personal kits.";let M;function j(){M()}function P(){new Promise((e=>M=e))}o.program.version(N).description(I).option("--root <root>","root path").option("-c, --config-path <configPath>","config path");const B=t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:A&&A.src||new URL("cli.min.cjs",document.baseURI).href);function D(e){try{return B.resolve(e),!0}catch(e){return!1}}let U;const G=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of G)if(D(e)){U=e;break}let F="jiek.config";function K(e){const{wd:t}=O();let n=o.program.getOptionValue("configPath");if(n){if(!E.default.existsSync(n))throw new Error(`config file not found: ${n}`);_.default.isAbsolute(n)||(n=_.default.resolve(t,n))}else n=function(e,t){const n=!!U;function r(n){const r=[_.default.resolve(process.cwd(),`${F}.${n}`),_.default.resolve(process.cwd(),`.${F}.${n}`),_.default.resolve(e,`${F}.${n}`),_.default.resolve(e,`.${F}.${n}`)];t&&r.unshift(_.default.resolve(t,`${F}.${n}`),_.default.resolve(t,`.${F}.${n}`));for(const e of r)if(E.default.existsSync(e)&&E.default.lstatSync(e).isFile())return e}return F=r("js")??F,F=r("json")??F,F=r("yaml")??F,n&&(F=r("ts")??F),_.default.resolve(e,F)}(t,e);const r=_.default.extname(n);let s;switch(r){case".js":s=require(n);break;case".json":return require(n);case".yaml":return a.load(E.default.readFileSync(n,"utf-8"));case".ts":if(U){require(U),s=require(n);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${r}`)}if(!s)throw new Error("config file is empty");return s.default??s}const q=t.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:A&&A.src||new URL("cli.min.cjs",document.baseURI).href);o.program.command("build").option("-s, --silent","Don't display logs.").option("-e, --entries <ENTRIES>","Specify the entries of the package.json's 'exports' field.(support glob)").option("-v, --verbose","Display debug logs.").action((async({silent:e,entries:t,verbose:n})=>{P();const{build:r}=K();e=e??r?.silent??!1;const{wd:o,value:a={}}=await L()??{};if(0===Object.keys(a).length)throw new Error("no package found");const s=_.default.resolve(o,"node_modules");E.default.existsSync(s)||E.default.mkdirSync(s);const l=(...e)=>_.default.resolve(s,".jiek",...e);E.default.existsSync(l())||E.default.mkdirSync(l());const p=q.resolve("rollup").replace(/dist\/rollup.js$/,"dist/bin/rollup"),c=new i.MultiBar({clearOnComplete:!1,hideCursor:!0,format:"- {bar} | {status} | {input} | {message}"},i.Presets.shades_classic);let f=0;await Promise.all(Object.entries(a).map((async([r,a])=>{const s=a.name?.replace(/^@/g,"").replace(/\//g,"+"),i=l(`${s??"anonymous-"+f++}.rollup.config.js`);E.default.writeFileSync(i,(e=>`\nmodule.exports = require('jiek/rollup').template(${JSON.stringify(e,null,2)})\n`.trimStart())(a));let d="";U&&(d=`node -r ${U} `);const g=`${d}${p} --silent -c ${i}`,h=u.execaCommand(g,{ipc:!0,cwd:r,env:{...process.env,JIEK_ROOT:o,JIEK_ENTRIES:t}}),y={};let A=10;h.on("message",(e=>{"debug"===e.type&&console.log(...Array.isArray(e.data)?e.data:[e.data])})),!e&&h.on("message",(e=>{if("init"===e.type){const{leafMap:t,targetsLength:n}=e.data,r=Array.from(t.entries()).flatMap((([e,t])=>t.map((([t,...n])=>({input:e,path:t,conditions:n})))));console.log(`Package '${a.name}' has ${n} targets to build`),r.forEach((({input:e})=>{A=Math.max(A,e.length)})),r.forEach((({input:e,path:t})=>{const n=`${e}:${t}`;y[n]||(y[n]=c.create(50,0,{input:e.padEnd(A),status:"waiting".padEnd(10)},{barsize:20,linewrap:!0}))}))}if("progress"===e.type){const{path:t,tags:n,input:r,event:o,message:a}=e.data,s=y[`${r}:${t}`];if(!s)return;s.update({start:0,resolve:20,end:50}[o??"start"]??0,{input:r.padEnd(A),status:o?.padEnd(10),message:`${n?.join(", ")}: ${a}`})}})),await new Promise(((e,t)=>{let r="";h.stderr?.on("data",(e=>{r+=e})),h.once("exit",(n=>0===n?e():t(new Error(`rollup build failed:\n${r}`)))),n&&h.stdout?.pipe(process.stdout)}))}))).finally((()=>{c.stop()})),j()}));var Q,W,X,Z,J,z,Y,V,ee,te,ne,re,oe,ae,se,ie,ue,le,pe,ce={};function fe(){return Q||(Q=1,(e=ce).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,n,r=1,o)=>!1!==o&&!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=o,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges||(e.invalid=!0,0)),e.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){let o=e[r];Array.isArray(o)?n(o):void 0!==o&&t.push(o)}return t};return n(e),t}),ce;var e}function de(){if(X)return W;X=1;const e=fe();return W=(t,n={})=>{let r=(t,o={})=>{let a=n.escapeInvalid&&e.isInvalidBrace(o),s=!0===t.invalid&&!0===n.escapeInvalid,i="";if(t.value)return(a||s)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)i+=r(e);return i};return r(t)}}
2
2
  /*!
3
3
  * is-number <https://github.com/jonschlinkert/is-number>
4
4
  *
package/dist/cli.min.js CHANGED
@@ -1,4 +1,4 @@
1
- import e from"node:fs";import{createRequire as t}from"node:module";import n,{resolve as r,relative as o}from"node:path";import{filterPackagesFromDir as s}from"@pnpm/filter-workspace-packages";import{program as a}from"commander";import{load as i}from"js-yaml";import{isWorkspaceDir as u,getWorkspaceDir as p}from"@jiek/utils/getWorkspaceDir";import{MultiBar as l,Presets as c}from"cli-progress";import{execaCommand as f}from"execa";import g from"detect-indent";import d from"inquirer";import{applyEdits as h,modify as A}from"jsonc-parser";import R from"util";import y from"path";import*as m from"node:child_process";import{bump as _}from"@jiek/utils/bumper";import{resolveEntrypoints as E,filterLeafs as b,DEFAULT_SKIP_VALUES as S,entrypoints2Exports as C}from"@jiek/pkger/entrypoints";let v,$;function x(){if(v)return v;const e=a.getOptionValue("root");return v=e?n.isAbsolute(e)?e:n.resolve(process.cwd(),e):void 0,v}let w=!1;function H(){if($)return{wd:$,notWorkspace:w};const e=x();if(void 0!==e){const t=u(e,k);return w=!t,$=e,{wd:$,notWorkspace:w}}try{$=p(k)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;$=e,w=!0}return{wd:$,notWorkspace:w}}let k="";try{t(import.meta.url).resolve("@pnpm/filter-workspace-packages"),k="pnpm"}catch{}async function O(){let t=a.getOptionValue("filter");const r=x(),{wd:o,notWorkspace:u}=H();if(!u&&"pnpm"===k){const a=n.resolve(o,"pnpm-workspace.yaml"),u=e.readFileSync(a,"utf-8"),p=i(u);if(r===o&&!t)throw new Error("root path is workspace root, please provide a filter");if(r!==o&&!t){if(!e.existsSync(n.resolve(r,"package.json")))throw new Error("root path is not workspace root, please provide a filter");const o=JSON.parse(e.readFileSync(n.resolve(r,"package.json"),"utf-8"));if(!o.name)throw new Error("root path is not workspace root, please provide a filter");t=o.name}const{selectedProjectsGraph:l}=await s(o,[{filter:t??"",followProdDepsOnly:!0}],{prefix:r,workspaceDir:o,patterns:p.packages});return{wd:o,root:r,value:Object.entries(l).reduce(((e,[t,n])=>(e[t]=n.package.manifest,e)),{})}}return{wd:o,root:r,value:{[o]:JSON.parse(e.readFileSync(n.resolve(o,"package.json"),"utf-8"))}}}""!==k&&a.option("-f, --filter <filter>","filter packages");var T="1.0.3",L="YiJie's personal kits.";let N;function I(){N()}function M(){new Promise((e=>N=e))}a.version(T).description(L).option("--root <root>","root path").option("-c, --config-path <configPath>","config path");const j=t(import.meta.url);function B(e){try{return j.resolve(e),!0}catch(e){return!1}}let P;const G=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of G)if(B(e)){P=e;break}let D="jiek.config";function K(t){const{wd:r}=H();let o=a.getOptionValue("configPath");if(o){if(!e.existsSync(o))throw new Error(`config file not found: ${o}`);n.isAbsolute(o)||(o=n.resolve(r,o))}else o=function(t,r){const o=!!P;function s(o){const s=[n.resolve(process.cwd(),`${D}.${o}`),n.resolve(process.cwd(),`.${D}.${o}`),n.resolve(t,`${D}.${o}`),n.resolve(t,`.${D}.${o}`)];r&&s.unshift(n.resolve(r,`${D}.${o}`),n.resolve(r,`.${D}.${o}`));for(const t of s)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return D=s("js")??D,D=s("json")??D,D=s("yaml")??D,o&&(D=s("ts")??D),n.resolve(t,D)}(r,t);const s=n.extname(o);let u;switch(s){case".js":u=require(o);break;case".json":return require(o);case".yaml":return i(e.readFileSync(o,"utf-8"));case".ts":if(P){require(P),u=require(o);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":u={};break;default:throw new Error(`unsupported config file type: ${s}`)}if(!u)throw new Error("config file is empty");return u.default??u}const U=t(import.meta.url);a.command("build").option("-s, --silent","Don't display logs.").option("-e, --entries <ENTRIES>","Specify the entries of the package.json's 'exports' field.(support glob)").action((async({silent:t,entries:r})=>{M();const{build:o}=K();t=t??o?.silent??!1;const{wd:s,value:a={}}=await O()??{};if(0===Object.keys(a).length)throw new Error("no package found");const i=n.resolve(s,"node_modules");e.existsSync(i)||e.mkdirSync(i);const u=(...e)=>n.resolve(i,".jiek",...e);e.existsSync(u())||e.mkdirSync(u());const p=U.resolve("rollup").replace(/dist\/rollup.js$/,"dist/bin/rollup"),g=new l({clearOnComplete:!1,hideCursor:!0,format:"- {bar} | {status} | {input} | {message}"},c.shades_classic);let d=0;await Promise.all(Object.entries(a).map((async([n,o])=>{const a=o.name?.replace(/^@/g,"").replace(/\//g,"+"),i=u(`${a??"anonymous-"+d++}.rollup.config.js`);e.writeFileSync(i,(e=>`\nmodule.exports = require('jiek/rollup').template(${JSON.stringify(e,null,2)})\n`.trimStart())(o));let l="";P&&(l=`node -r ${P} `);const c=f(`${l}${p} --silent -c ${i}`,{ipc:!0,cwd:n,env:{...process.env,JIEK_ROOT:s,JIEK_ENTRIES:r}}),h={};let A=10;c.on("message",(e=>{"debug"===e.type&&console.log(...Array.isArray(e.data)?e.data:[e.data])})),!t&&c.on("message",(e=>{if("init"===e.type){const{leafMap:t,targetsLength:n}=e.data,r=Array.from(t.entries()).flatMap((([e,t])=>t.map((([t,...n])=>({input:e,path:t,conditions:n})))));console.log(`Package '${o.name}' has ${n} targets to build`),r.forEach((({input:e})=>{A=Math.max(A,e.length)})),r.forEach((({input:e,path:t})=>{const n=`${e}:${t}`;h[n]||(h[n]=g.create(50,0,{input:e.padEnd(A),status:"waiting".padEnd(10)},{barsize:20,linewrap:!0}))}))}if("progress"===e.type){const{path:t,tags:n,input:r,event:o,message:s}=e.data,a=h[`${r}:${t}`];if(!a)return;a.update({start:0,resolve:20,end:50}[o??"start"]??0,{input:r.padEnd(A),status:o?.padEnd(10),message:`${n?.join(", ")}: ${s}`})}})),await new Promise(((e,t)=>{let n="";c.stderr?.on("data",(e=>{n+=e})),c.once("exit",(r=>0===r?e():t(new Error(`rollup build failed:\n${n}`))))}))}))).finally((()=>{g.stop()})),I()}));var F,Q,W,X,q,Z,J,Y,z,V,ee,te,ne,re,oe,se,ae,ie,ue,pe={};function le(){return F||(F=1,function(e){e.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,n,r=1,o)=>!1!==o&&(!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=o),e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){let o=e[r];Array.isArray(o)?n(o):void 0!==o&&t.push(o)}return t};return n(e),t}}(pe)),pe}function ce(){if(W)return Q;W=1;const e=le();return Q=(t,n={})=>{let r=(t,o={})=>{let s=n.escapeInvalid&&e.isInvalidBrace(o),a=!0===t.invalid&&!0===n.escapeInvalid,i="";if(t.value)return(s||a)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)i+=r(e);return i};return r(t)}}
1
+ import e from"node:fs";import{createRequire as t}from"node:module";import n,{resolve as r,relative as o}from"node:path";import{filterPackagesFromDir as s}from"@pnpm/filter-workspace-packages";import{program as a}from"commander";import{load as i}from"js-yaml";import{isWorkspaceDir as u,getWorkspaceDir as p}from"@jiek/utils/getWorkspaceDir";import{MultiBar as l,Presets as c}from"cli-progress";import{execaCommand as f}from"execa";import g from"detect-indent";import d from"inquirer";import{applyEdits as h,modify as A}from"jsonc-parser";import R from"util";import y from"path";import*as m from"node:child_process";import{bump as _}from"@jiek/utils/bumper";import{resolveEntrypoints as E,filterLeafs as b,DEFAULT_SKIP_VALUES as S,entrypoints2Exports as C}from"@jiek/pkger/entrypoints";let v,$;function x(){if(v)return v;const e=a.getOptionValue("root");return v=e?n.isAbsolute(e)?e:n.resolve(process.cwd(),e):void 0,v}let w=!1;function H(){if($)return{wd:$,notWorkspace:w};const e=x();if(void 0!==e){const t=u(e,k);return w=!t,$=e,{wd:$,notWorkspace:w}}try{$=p(k)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;$=e,w=!0}return{wd:$,notWorkspace:w}}let k="";try{t(import.meta.url).resolve("@pnpm/filter-workspace-packages"),k="pnpm"}catch{}async function O(){let t=a.getOptionValue("filter");const r=x(),{wd:o,notWorkspace:u}=H();if(!u&&"pnpm"===k){const a=n.resolve(o,"pnpm-workspace.yaml"),u=e.readFileSync(a,"utf-8"),p=i(u);if(r===o&&!t)throw new Error("root path is workspace root, please provide a filter");if(r!==o&&!t){if(!e.existsSync(n.resolve(r,"package.json")))throw new Error("root path is not workspace root, please provide a filter");const o=JSON.parse(e.readFileSync(n.resolve(r,"package.json"),"utf-8"));if(!o.name)throw new Error("root path is not workspace root, please provide a filter");t=o.name}const{selectedProjectsGraph:l}=await s(o,[{filter:t??"",followProdDepsOnly:!0}],{prefix:r,workspaceDir:o,patterns:p.packages});return{wd:o,root:r,value:Object.entries(l).reduce(((e,[t,n])=>(e[t]=n.package.manifest,e)),{})}}return{wd:o,root:r,value:{[o]:JSON.parse(e.readFileSync(n.resolve(o,"package.json"),"utf-8"))}}}""!==k&&a.option("-f, --filter <filter>","filter packages");var T="1.0.5",L="YiJie's personal kits.";let N;function I(){N()}function M(){new Promise((e=>N=e))}a.version(T).description(L).option("--root <root>","root path").option("-c, --config-path <configPath>","config path");const j=t(import.meta.url);function B(e){try{return j.resolve(e),!0}catch(e){return!1}}let P;const D=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of D)if(B(e)){P=e;break}let G="jiek.config";function K(t){const{wd:r}=H();let o=a.getOptionValue("configPath");if(o){if(!e.existsSync(o))throw new Error(`config file not found: ${o}`);n.isAbsolute(o)||(o=n.resolve(r,o))}else o=function(t,r){const o=!!P;function s(o){const s=[n.resolve(process.cwd(),`${G}.${o}`),n.resolve(process.cwd(),`.${G}.${o}`),n.resolve(t,`${G}.${o}`),n.resolve(t,`.${G}.${o}`)];r&&s.unshift(n.resolve(r,`${G}.${o}`),n.resolve(r,`.${G}.${o}`));for(const t of s)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return G=s("js")??G,G=s("json")??G,G=s("yaml")??G,o&&(G=s("ts")??G),n.resolve(t,G)}(r,t);const s=n.extname(o);let u;switch(s){case".js":u=require(o);break;case".json":return require(o);case".yaml":return i(e.readFileSync(o,"utf-8"));case".ts":if(P){require(P),u=require(o);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":u={};break;default:throw new Error(`unsupported config file type: ${s}`)}if(!u)throw new Error("config file is empty");return u.default??u}const U=t(import.meta.url);a.command("build").option("-s, --silent","Don't display logs.").option("-e, --entries <ENTRIES>","Specify the entries of the package.json's 'exports' field.(support glob)").option("-v, --verbose","Display debug logs.").action((async({silent:t,entries:r,verbose:o})=>{M();const{build:s}=K();t=t??s?.silent??!1;const{wd:a,value:i={}}=await O()??{};if(0===Object.keys(i).length)throw new Error("no package found");const u=n.resolve(a,"node_modules");e.existsSync(u)||e.mkdirSync(u);const p=(...e)=>n.resolve(u,".jiek",...e);e.existsSync(p())||e.mkdirSync(p());const g=U.resolve("rollup").replace(/dist\/rollup.js$/,"dist/bin/rollup"),d=new l({clearOnComplete:!1,hideCursor:!0,format:"- {bar} | {status} | {input} | {message}"},c.shades_classic);let h=0;await Promise.all(Object.entries(i).map((async([n,s])=>{const i=s.name?.replace(/^@/g,"").replace(/\//g,"+"),u=p(`${i??"anonymous-"+h++}.rollup.config.js`);e.writeFileSync(u,(e=>`\nmodule.exports = require('jiek/rollup').template(${JSON.stringify(e,null,2)})\n`.trimStart())(s));let l="";P&&(l=`node -r ${P} `);const c=f(`${l}${g} --silent -c ${u}`,{ipc:!0,cwd:n,env:{...process.env,JIEK_ROOT:a,JIEK_ENTRIES:r}}),A={};let R=10;c.on("message",(e=>{"debug"===e.type&&console.log(...Array.isArray(e.data)?e.data:[e.data])})),!t&&c.on("message",(e=>{if("init"===e.type){const{leafMap:t,targetsLength:n}=e.data,r=Array.from(t.entries()).flatMap((([e,t])=>t.map((([t,...n])=>({input:e,path:t,conditions:n})))));console.log(`Package '${s.name}' has ${n} targets to build`),r.forEach((({input:e})=>{R=Math.max(R,e.length)})),r.forEach((({input:e,path:t})=>{const n=`${e}:${t}`;A[n]||(A[n]=d.create(50,0,{input:e.padEnd(R),status:"waiting".padEnd(10)},{barsize:20,linewrap:!0}))}))}if("progress"===e.type){const{path:t,tags:n,input:r,event:o,message:s}=e.data,a=A[`${r}:${t}`];if(!a)return;a.update({start:0,resolve:20,end:50}[o??"start"]??0,{input:r.padEnd(R),status:o?.padEnd(10),message:`${n?.join(", ")}: ${s}`})}})),await new Promise(((e,t)=>{let n="";c.stderr?.on("data",(e=>{n+=e})),c.once("exit",(r=>0===r?e():t(new Error(`rollup build failed:\n${n}`)))),o&&c.stdout?.pipe(process.stdout)}))}))).finally((()=>{d.stop()})),I()}));var F,Q,W,X,q,Z,J,Y,z,V,ee,te,ne,re,oe,se,ae,ie,ue,pe={};function le(){return F||(F=1,function(e){e.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find((e=>e.type===t)),e.exceedsLimit=(t,n,r=1,o)=>!1!==o&&(!(!e.isInteger(t)||!e.isInteger(n))&&(Number(n)-Number(t))/Number(r)>=o),e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},e.encloseBrace=e=>"brace"===e.type&&(!(e.commas>>0+e.ranges)&&(e.invalid=!0,!0)),e.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges?(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0):(e.invalid=!0,!0))),e.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),e.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),e.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){let o=e[r];Array.isArray(o)?n(o):void 0!==o&&t.push(o)}return t};return n(e),t}}(pe)),pe}function ce(){if(W)return Q;W=1;const e=le();return Q=(t,n={})=>{let r=(t,o={})=>{let s=n.escapeInvalid&&e.isInvalidBrace(o),a=!0===t.invalid&&!0===n.escapeInvalid,i="";if(t.value)return(s||a)&&e.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(let e of t.nodes)i+=r(e);return i};return r(t)}}
2
2
  /*!
3
3
  * is-number <https://github.com/jonschlinkert/is-number>
4
4
  *
@@ -16,4 +16,4 @@ import e from"node:fs";import{createRequire as t}from"node:module";import n,{res
16
16
  *
17
17
  * Copyright (c) 2014-present, Jon Schlinkert.
18
18
  * Licensed under the MIT License.
19
- */function de(){if(z)return Y;z=1;const e=R,t=ge(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},a=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},i=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},u=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,g=String(e),d=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(g)||s(d)||s(h),R=A?Math.max(g.length,d.length,h.length):0,y=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),m=r.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(r.toRegex&&1===n)return u(i(e,R),i(t,R),!0,r);let _={negatives:[],positives:[]},E=[],b=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?_[(S=o)<0?"negatives":"positives"].push(Math.abs(S)):E.push(a(m(o,b),R,y)),o=f?o-n:o+n,b++;var S;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(_,r):p(E,null,{wrap:!1,...r}):E},g=(e,t,s,a={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,a);if("function"==typeof s)return g(e,t,1,{transform:s});if(n(s))return g(e,t,0,s);let i={...a};return!0===i.capture&&(i.wrap=!0),s=s||i.step||1,o(s)?o(e)&&o(t)?f(e,t,s,i):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),l=a>i,f=Math.min(a,i),g=Math.max(a,i);if(r.toRegex&&1===n)return u(f,g,!1,r);let d=[],h=0;for(;l?a>=i:a<=i;)d.push(s(a,h)),a=l?a-n:a+n,h++;return!0===r.toRegex?p(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(s),1),i):null==s||n(s)?g(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,i)};return Y=g}function he(){if(ae)return se;ae=1;const e=ce(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:a,CHAR_RIGHT_PARENTHESES:i,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:g,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=oe?re:(oe=1,re={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return se=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let y=R||{},m="number"==typeof y.maxLength?Math.min(t,y.maxLength):t;if(A.length>m)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${m})`);let _,E={type:"root",input:A,nodes:[]},b=[E],S=E,C=E,v=0,$=A.length,x=0,w=0;const H=()=>A[x++],k=e=>{if("text"===e.type&&"dot"===C.type&&(C.type="text"),!C||"text"!==C.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e;C.value+=e.value};for(k({type:"bos"});x<$;)if(S=b[b.length-1],_=H(),_!==h&&_!==d)if(_!==n)if(_!==c)if(_!==l)if(_!==a)if(_!==i)if(_!==f&&_!==g&&_!==r)if(_!==u)if(_!==p)if(_===o&&w>0){if(S.ranges>0){S.ranges=0;let t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}k({type:"comma",value:_}),S.commas++}else if(_===s&&w>0&&0===S.commas){let e=S.nodes;if(0===w||0===e.length){k({type:"text",value:_});continue}if("dot"===C.type){if(S.range=[],C.value+=_,C.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,C.type="text";continue}S.ranges++,S.args=[];continue}if("range"===C.type){e.pop();let t=e[e.length-1];t.value+=C.value+_,C=t,S.ranges--;continue}k({type:"dot",value:_})}else k({type:"text",value:_});else{if("brace"!==S.type){k({type:"text",value:_});continue}let e="close";S=b.pop(),S.close=!0,k({type:e,value:_}),w--,S=b[b.length-1]}else{w++;let e=C.value&&"$"===C.value.slice(-1)||!0===S.dollar;S=k({type:"brace",open:!0,close:!1,dollar:e,depth:w,commas:0,ranges:0,nodes:[]}),b.push(S),k({type:"open",value:_})}else{let e,t=_;for(!0!==R.keepQuotes&&(_="");x<$&&(e=H());)if(e!==n){if(e===t){!0===R.keepQuotes&&(_+=e);break}_+=e}else _+=e+H();k({type:"text",value:_})}else{if("paren"!==S.type){k({type:"text",value:_});continue}S=b.pop(),k({type:"text",value:_}),S=b[b.length-1]}else S=k({type:"paren",nodes:[]}),b.push(S),k({type:"text",value:_});else{let e;for(v++;x<$&&(e=H());)if(_+=e,e!==l)if(e!==n){if(e===c&&(v--,0===v))break}else _+=H();else v++;k({type:"text",value:_})}else k({type:"text",value:"\\"+_});else k({type:"text",value:(R.keepEscaping?_:"")+H()});do{if(S=b.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=b[b.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(b.length>0);return k({type:"eos"}),E},se}function Ae(){if(ue)return ie;ue=1;const e=ce(),t=function(){if(ee)return V;ee=1;const e=de(),t=le();return V=(n,r={})=>{let o=(n,s={})=>{let a=t.isInvalidBrace(s),i=!0===n.invalid&&!0===r.escapeInvalid,u=!0===a||!0===i,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return u?p+n.value:"(";if("close"===n.type)return u?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(ne)return te;ne=1;const e=de(),t=ce(),n=le(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return te=(o,s={})=>{let a=void 0===s.rangeLimit?1e3:s.rangeLimit,i=(o,u={})=>{o.queue=[];let p=u,l=u.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let i=n.reduce(o.nodes);if(n.exceedsLimit(...i,s.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=e(...i,s);return 0===u.length&&(u=t(o,s)),l.push(r(l.pop(),u)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,g=o;for(;"brace"!==g.type&&"root"!==g.type&&g.parent;)g=g.parent,f=g.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&i(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(i(o))}}(),r=he(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),ie=o}var Re,ye,me,_e,Ee,be,Se,Ce,ve,$e,xe,we,He,ke={};function Oe(){if(ye)return Re;ye=1;const e=y,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",a=`(?:${o}|$)`,i=`(?:^|${o})`,u=`${r}{1,2}${a}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:a,DOTS_SLASH:u,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${i}${u})`,NO_DOT_SLASH:`(?!${r}{0,1}${a})`,NO_DOTS_SLASH:`(?!${u})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:i},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return Re={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Te(){return me||(me=1,function(e){const t=y,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:a}=Oe();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(a,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(ke)),ke}function Le(){if(ve)return Ce;ve=1;const e=y,t=function(){if(Ee)return _e;Ee=1;const e=Te(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:i,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:h}=Oe(),A=e=>e===i||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return _e=(y,m)=>{const _=m||{},E=y.length-1,b=!0===_.parts||!0===_.scanToEnd,S=[],C=[],v=[];let $,x,w=y,H=-1,k=0,O=0,T=!1,L=!1,N=!1,I=!1,M=!1,j=!1,B=!1,P=!1,G=!1,D=!1,K=0,U={value:"",depth:0,isGlob:!1};const F=()=>H>=E,Q=()=>($=x,w.charCodeAt(++H));for(;H<E;){let e;if(x=Q(),x!==r){if(!0===j||x===u){for(K++;!0!==F()&&(x=Q());)if(x!==r)if(x!==u){if(!0!==j&&x===s&&(x=Q())===s){if(T=U.isBrace=!0,N=U.isGlob=!0,D=!0,!0===b)continue;break}if(!0!==j&&x===o){if(T=U.isBrace=!0,N=U.isGlob=!0,D=!0,!0===b)continue;break}if(x===g&&(K--,0===K)){j=!1,T=U.isBrace=!0,D=!0;break}}else K++;else B=U.backslashes=!0,Q();if(!0===b)continue;break}if(x!==i){if(!0!==_.noext&&!0==(x===c||x===n||x===t||x===f||x===a)&&w.charCodeAt(H+1)===p){if(N=U.isGlob=!0,I=U.isExtglob=!0,D=!0,x===a&&H===k&&(G=!0),!0===b){for(;!0!==F()&&(x=Q());)if(x!==r){if(x===d){N=U.isGlob=!0,D=!0;break}}else B=U.backslashes=!0,x=Q();continue}break}if(x===t){if($===t&&(M=U.isGlobstar=!0),N=U.isGlob=!0,D=!0,!0===b)continue;break}if(x===f){if(N=U.isGlob=!0,D=!0,!0===b)continue;break}if(x===l){for(;!0!==F()&&(e=Q());)if(e!==r){if(e===h){L=U.isBracket=!0,N=U.isGlob=!0,D=!0;break}}else B=U.backslashes=!0,Q();if(!0===b)continue;break}if(!0===_.nonegate||x!==a||H!==k){if(!0!==_.noparen&&x===p){if(N=U.isGlob=!0,!0===b){for(;!0!==F()&&(x=Q());)if(x!==p){if(x===d){D=!0;break}}else B=U.backslashes=!0,x=Q();continue}break}if(!0===N){if(D=!0,!0===b)continue;break}}else P=U.negated=!0,k++}else{if(S.push(H),C.push(U),U={value:"",depth:0,isGlob:!1},!0===D)continue;if($===s&&H===k+1){k+=2;continue}O=H+1}}else B=U.backslashes=!0,x=Q(),x===u&&(j=!0)}!0===_.noext&&(I=!1,N=!1);let W=w,X="",q="";k>0&&(X=w.slice(0,k),w=w.slice(k),O-=k),W&&!0===N&&O>0?(W=w.slice(0,O),q=w.slice(O)):!0===N?(W="",q=w):W=w,W&&""!==W&&"/"!==W&&W!==w&&A(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===_.unescape&&(q&&(q=e.removeBackslashes(q)),W&&!0===B&&(W=e.removeBackslashes(W)));const Z={prefix:X,input:y,start:k,base:W,glob:q,isBrace:T,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:G};if(!0===_.tokens&&(Z.maxDepth=0,A(x)||C.push(U),Z.tokens=C),!0===_.parts||!0===_.tokens){let e;for(let t=0;t<S.length;t++){const n=e?e+1:k,r=S[t],o=y.slice(n,r);_.tokens&&(0===t&&0!==k?(C[t].isPrefix=!0,C[t].value=X):C[t].value=o,R(C[t]),Z.maxDepth+=C[t].depth),0===t&&""===o||v.push(o),e=r}if(e&&e+1<y.length){const t=y.slice(e+1);v.push(t),_.tokens&&(C[C.length-1].value=t,R(C[C.length-1]),Z.maxDepth+=C[C.length-1].depth)}Z.slashes=S,Z.parts=v}return Z}}(),n=function(){if(Se)return be;Se=1;const e=Oe(),t=Te(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:a}=e,i=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=a[l]||l;const f={...c},g="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let d=l.length;if(d>g)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${g}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",y=t.isWindows(c),m=e.globChars(y),_=e.extglobChars(m),{DOT_LITERAL:E,PLUS_LITERAL:b,SLASH_LITERAL:S,ONE_CHAR:C,DOTS_SLASH:v,NO_DOT:$,NO_DOT_SLASH:x,NO_DOTS_SLASH:w,QMARK:H,QMARK_NO_DOT:k,STAR:O,START_ANCHOR:T}=m,L=e=>`(${R}(?:(?!${T}${e.dot?v:E}).)*?)`,N=f.dot?"":$,I=f.dot?H:k;let M=!0===f.bash?L(f):O;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const j={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,j),d=l.length;const B=[],P=[],G=[];let D,K=h;const U=()=>j.index===d-1,F=j.peek=(e=1)=>l[j.index+e],Q=j.advance=()=>l[++j.index]||"",W=()=>l.slice(j.index+1),X=(e="",t=0)=>{j.consumed+=e,j.index+=t},q=e=>{j.output+=null!=e.output?e.output:e.value,X(e.value)},Z=()=>{let e=1;for(;"!"===F()&&("("!==F(2)||"?"===F(3));)Q(),j.start++,e++;return e%2!=0&&(j.negated=!0,j.start++,!0)},J=e=>{j[e]++,G.push(e)},Y=e=>{j[e]--,G.pop()},z=e=>{if("globstar"===K.type){const t=j.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||B.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(j.output=j.output.slice(0,-K.output.length),K.type="star",K.value="*",K.output=M,j.output+=K.output)}if(B.length&&"paren"!==e.type&&(B[B.length-1].inner+=e.value),(e.value||e.output)&&q(e),K&&"text"===K.type&&"text"===e.type)return K.value+=e.value,void(K.output=(K.output||"")+e.value);e.prev=K,A.push(e),K=e},V=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=K,n.parens=j.parens,n.output=j.output;const r=(f.capture?"(":"")+n.open;J("parens"),z({type:e,value:t,output:j.output?"":C}),z({type:"paren",extglob:!0,value:Q(),output:r}),B.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(f)),(r!==M||U()||/^\)+$/.test(W()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=W())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(j.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:D,output:n}),Y("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,a)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?H.repeat(s.length):""):0===a?I+(s?H.repeat(s.length):""):H.repeat(r.length):"."===o?E.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(j.output=l,j):(j.output=t.wrapOutput(n,j,c),j)}for(;!U();){if(D=Q(),"\0"===D)continue;if("\\"===D){const e=F();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",z({type:"text",value:D});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(D+="\\")),!0===f.unescape?D=Q():D+=Q(),0===j.brackets){z({type:"text",value:D});continue}}if(j.brackets>0&&("]"!==D||"["===K.value||"[^"===K.value)){if(!1!==f.posix&&":"===D){const e=K.value.slice(1);if(e.includes("[")&&(K.posix=!0,e.includes(":"))){const e=K.value.lastIndexOf("["),t=K.value.slice(0,e),n=K.value.slice(e+2),o=r[n];if(o){K.value=t+o,j.backtrack=!0,Q(),h.output||1!==A.indexOf(K)||(h.output=C);continue}}}("["===D&&":"!==F()||"-"===D&&"]"===F())&&(D=`\\${D}`),"]"!==D||"["!==K.value&&"[^"!==K.value||(D=`\\${D}`),!0===f.posix&&"!"===D&&"["===K.value&&(D="^"),K.value+=D,q({value:D});continue}if(1===j.quotes&&'"'!==D){D=t.escapeRegex(D),K.value+=D,q({value:D});continue}if('"'===D){j.quotes=1===j.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:D});continue}if("("===D){J("parens"),z({type:"paren",value:D});continue}if(")"===D){if(0===j.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const e=B[B.length-1];if(e&&j.parens===e.parens+1){ee(B.pop());continue}z({type:"paren",value:D,output:j.parens?")":"\\)"}),Y("parens");continue}if("["===D){if(!0!==f.nobracket&&W().includes("]"))J("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));D=`\\${D}`}z({type:"bracket",value:D});continue}if("]"===D){if(!0===f.nobracket||K&&"bracket"===K.type&&1===K.value.length){z({type:"text",value:D,output:`\\${D}`});continue}if(0===j.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));z({type:"text",value:D,output:`\\${D}`});continue}Y("brackets");const e=K.value.slice(1);if(!0===K.posix||"^"!==e[0]||e.includes("/")||(D=`/${D}`),K.value+=D,q({value:D}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(K.value);if(j.output=j.output.slice(0,-K.value.length),!0===f.literalBrackets){j.output+=n,K.value=n;continue}K.value=`(${R}${n}|${K.value})`,j.output+=K.value;continue}if("{"===D&&!0!==f.nobrace){J("braces");const e={type:"brace",value:D,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};P.push(e),z(e);continue}if("}"===D){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=i(n,f),j.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",j.output=n;for(const e of r)j.output+=e.output||e.value}z({type:"brace",value:D,output:t}),Y("braces"),P.pop();continue}if("|"===D){B.length>0&&B[B.length-1].conditions++,z({type:"text",value:D});continue}if(","===D){let e=D;const t=P[P.length-1];t&&"braces"===G[G.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===K.type&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",A.pop(),K=h;continue}z({type:"slash",value:D,output:S});continue}if("."===D){if(j.braces>0&&"dot"===K.type){"."===K.value&&(K.output=E);const e=P[P.length-1];K.type="dots",K.output+=D,K.value+=D,e.dots=!0;continue}if(j.braces+j.parens===0&&"bos"!==K.type&&"slash"!==K.type){z({type:"text",value:D,output:E});continue}z({type:"dot",value:D,output:E});continue}if("?"===D){if((!K||"("!==K.value)&&!0!==f.noextglob&&"("===F()&&"?"!==F(2)){V("qmark",D);continue}if(K&&"paren"===K.type){const e=F();let n=D;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===K.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(n=`\\${D}`),z({type:"text",value:D,output:n});continue}if(!0!==f.dot&&("slash"===K.type||"bos"===K.type)){z({type:"qmark",value:D,output:k});continue}z({type:"qmark",value:D,output:H});continue}if("!"===D){if(!0!==f.noextglob&&"("===F()&&("?"!==F(2)||!/[!=<:]/.test(F(3)))){V("negate",D);continue}if(!0!==f.nonegate&&0===j.index){Z();continue}}if("+"===D){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){V("plus",D);continue}if(K&&"("===K.value||!1===f.regex){z({type:"plus",value:D,output:b});continue}if(K&&("bracket"===K.type||"paren"===K.type||"brace"===K.type)||j.parens>0){z({type:"plus",value:D});continue}z({type:"plus",value:b});continue}if("@"===D){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){z({type:"at",extglob:!0,value:D,output:""});continue}z({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D=`\\${D}`);const e=o.exec(W());e&&(D+=e[0],j.index+=e[0].length),z({type:"text",value:D});continue}if(K&&("globstar"===K.type||!0===K.star)){K.type="star",K.star=!0,K.value+=D,K.output=M,j.backtrack=!0,j.globstar=!0,X(D);continue}let e=W();if(!0!==f.noextglob&&/^\([^?]/.test(e)){V("star",D);continue}if("star"===K.type){if(!0===f.noglobstar){X(D);continue}const t=K.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){z({type:"star",value:D,output:""});continue}const s=j.braces>0&&("comma"===t.type||"brace"===t.type),a=B.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!a){z({type:"star",value:D,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[j.index+4];if(t&&"/"!==t)break;e=e.slice(3),X("/**",3)}if("bos"===t.type&&U()){K.type="globstar",K.value+=D,K.output=L(f),j.output=K.output,j.globstar=!0,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&U()){j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=L(f)+(f.strictSlashes?")":"|$)"),K.value+=D,j.globstar=!0,j.output+=t.output+K.output,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=`${L(f)}${S}|${S}${n})`,K.value+=D,j.output+=t.output+K.output,j.globstar=!0,X(D+Q()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){K.type="globstar",K.value+=D,K.output=`(?:^|${S}|${L(f)}${S})`,j.output=K.output,j.globstar=!0,X(D+Q()),z({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-K.output.length),K.type="globstar",K.output=L(f),K.value+=D,j.output+=K.output,j.globstar=!0,X(D);continue}const n={type:"star",value:D,output:M};!0!==f.bash?!K||"bracket"!==K.type&&"paren"!==K.type||!0!==f.regex?(j.index!==j.start&&"slash"!==K.type&&"dot"!==K.type||("dot"===K.type?(j.output+=x,K.output+=x):!0===f.dot?(j.output+=w,K.output+=w):(j.output+=N,K.output+=N),"*"!==F()&&(j.output+=C,K.output+=C)),z(n)):(n.output=D,z(n)):(n.output=".*?","bos"!==K.type&&"slash"!==K.type||(n.output=N+n.output),z(n))}for(;j.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));j.output=t.escapeLast(j.output,"["),Y("brackets")}for(;j.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));j.output=t.escapeLast(j.output,"("),Y("parens")}for(;j.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));j.output=t.escapeLast(j.output,"{"),Y("braces")}if(!0===f.strictSlashes||"star"!==K.type&&"bracket"!==K.type||z({type:"maybe_slash",value:"",output:`${S}?`}),!0===j.backtrack){j.output="";for(const e of j.tokens)j.output+=null!=e.output?e.output:e.value,e.suffix&&(j.output+=e.suffix)}return j};return p.fastpaths=(r,o)=>{const s={...o},i="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,u=r.length;if(u>i)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${i}`);r=a[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:g,NO_DOT:d,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:y}=e.globChars(p),m=s.dot?h:d,_=s.dot?A:d,E=s.capture?"":"?:";let b=!0===s.bash?".*?":R;s.capture&&(b=`(${b})`);const S=e=>!0===e.noglobstar?b:`(${E}(?:(?!${y}${e.dot?g:l}).)*?)`,C=e=>{switch(e){case"*":return`${m}${f}${b}`;case".*":return`${l}${f}${b}`;case"*.*":return`${m}${b}${l}${f}${b}`;case"*/*":return`${m}${b}${c}${f}${_}${b}`;case"**":return m+S(s);case"**/*":return`(?:${m}${S(s)}${c})?${_}${f}${b}`;case"**/*.*":return`(?:${m}${S(s)}${c})?${_}${b}${l}${f}${b}`;case"**/.*":return`(?:${m}${S(s)}${c})?${l}${f}${b}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=C(t[1]);if(!n)return;return n+l+t[2]}}},v=t.removePrefix(r,{negated:!1,prefix:""});let $=C(v);return $&&!0!==s.strictSlashes&&($+=`${c}?`),$},be=p}(),r=Te(),o=Oe(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(a=e)&&"object"==typeof a&&!Array.isArray(a)&&e.tokens&&e.input;var a;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},u=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(i.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:a,output:f}=s.test(n,p,t,{glob:e,posix:u}),g={glob:e,state:l,regex:p,posix:u,input:n,output:f,match:a,isMatch:o};return"function"==typeof i.onResult&&i.onResult(g),!1===o?(g.isMatch=!1,!!r&&g):c(n)?("function"==typeof i.onIgnore&&i.onIgnore(g),g.isMatch=!1,!!r&&g):("function"==typeof i.onMatch&&i.onMatch(g),!r||g)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:a}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const i=n||{},u=i.format||(a?r.toPosixSlashes:null);let p=e===o,l=p&&u?u(e):e;return!1===p&&(l=u?u(e):e,p=l===o),!1!==p&&!0!==i.capture||(p=!0===i.matchBase||!0===i.basename?s.matchBase(e,t,n,a):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,a=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},a=o.contains?"":"^",i=o.contains?"":"$";let u=`${a}(?:${e.output})${i}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const p=s.toRegex(u,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(a.output=n.fastpaths(e,t)),a.output||(a=n(e,t)),s.compileRe(a,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,Ce=s}function Ne(){return xe?$e:(xe=1,$e=Le())}var Ie=function(){if(He)return we;He=1;const e=R,t=Ae(),n=Ne(),r=Te(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,a=new Set,i=0,u=e=>{a.add(e.output),r&&r.onResult&&r.onResult(e)};for(let a=0;a<t.length;a++){let p=n(String(t[a]),{...r,onResult:u},!0),l=p.state.negated||p.state.negatedExtglob;l&&i++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(i===t.length?[...a]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],a=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)a.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),a={};for(let t of o)a[t]=e[t];return a},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),a=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(a)return a.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},we=s}();const Me='{\n "name": "",\n "version": "0.0.1",\n "description": "",\n "license": "",\n "author": "",\n "files": ["dist"],\n "exports": {\n ".": "./src/index.ts"\n },\n "scripts": {\n },\n "homepage": "",\n "repository": "",\n "bugs": ""\n}'.trimStart(),je="# $name\n\n## Installation\n\n```bash\nnpm install $name\n# or\npnpm install $name\n# or\nyarn add $name\n```\n\n## Usage\n\n\n## License\n\n$license\n".trimStart();const Be=new Map;function Pe(t,r){if(Be.has(t))return Be.get(t)[r];const o=n.resolve(t,"package.json"),s=JSON.parse(e.readFileSync(o,"utf-8"));return Be.set(t,s),s[r]}a.command("init [name]").option("-t, --template <template>","the package.json template file path or file content").action((async()=>{const[,t]=a.args,r=process.cwd(),{init:o={}}=K()??{},{wd:s}=H(),i=n.basename(s),{named:u,template:p,bug:l={},readme:c=je,readmeTemplate:f}=o,R={template:"bug_report.yml",labels:["bug"],...l};let y=c;if(f){const t=n.resolve(s,f);y=e.readFileSync(t,"utf-8")}const m=function(t,r){let o=r??Me,s=!1;try{r&&JSON.parse(r)}catch(e){s=!0}if(s){const s=n.resolve(t,r);o=e.readFileSync(s,"utf-8")}return o}(s,p),{indent:_=" "}=g(m),E={tabSize:_.length,insertSpaces:!0},b=["license","author"];let S=m;for(const e of b)S=h(S,A(S,[e],Pe(s,e),{formattingOptions:E}));let[C,v]=await async function(e,t,{wd:r,cwd:o,workspaceName:s}){const a=o.replace(`${r}/`,"");let i=n.basename(o);if("function"==typeof e)return e(t,{full:r,relative:o});let u,p,l=!1;if("object"==typeof e)if(o===r){const{rule:t}=await d.prompt({type:"list",name:"rule",message:"choose a rule",default:"default",choices:["default"].concat(Object.keys(e))});"default"!==t&&(u=t,p=e[t])}else for(const[t,n]of Object.entries(e)){if(Ie.isMatch(a,t)){u=t,p=n;break}if(Ie.isMatch(`${a}/jiek_ignore_dont_use_same_file_name`,t)){l=!0,u=t,p=n;break}}if(p||(u="packages/*",p=`@${s}/$basename`),!p)throw new Error("no matched rule");if(!t&&l&&(i=await d.prompt({type:"input",name:"name",message:`the matched rule is \`${String(p)}\`, please input the basename\n`}).then((({name:e})=>e))),"function"==typeof p)return p(t,{full:r,relative:o,basename:i});if("string"==typeof p){const e=t??i;return[p.replace(/\$basename/g,e),u?.replace(/\/\*$/g,`/${e}`)]}throw new Error("no matched rule")}(u,t,{wd:s,cwd:r,workspaceName:i});if(!v){const{dir:e}=await d.prompt({type:"input",name:"dir",message:"package directory",default:t});v=e}if(!C){const{name:e}=await d.prompt({type:"input",name:"name",message:"package name",default:t});C=e}S=h(S,A(S,["name"],C,{formattingOptions:E}));let $=Pe(s,"repository");"string"==typeof $&&($={type:"git",url:$,directory:v}),S=h(S,A(S,["repository"],$,{formattingOptions:E}));S=h(S,A(S,["homepage"],`${$?.url}/blob/master/${v}/README.md`,{formattingOptions:E}));let x=R.labels;"function"==typeof x&&(x=x({name:C,dir:v})),x.push(`scope:${C}`);const w=`${$?.url}/issues/new?template=${R.template}&labels=${x.join(",")}`;function k(e){if(!v)throw new Error("pkgDir is not defined");return n.resolve(v,e)}S=h(S,A(S,["bugs"],w,{formattingOptions:E})),e.existsSync(v)||e.mkdirSync(v);const O=k("package.json");if(e.existsSync(O))throw new Error("package.json already exists");e.writeFileSync(O,S),console.log(S,"written to",O);const T=Pe(s,"license"),L=k("README.md");"function"==typeof y&&(y=y({dir:v,packageJson:JSON.parse(S)}));const N=y.replace(/\$name/g,C).replace(/\$license/g,T);e.writeFileSync(L,N)}));const Ge=(e,t)=>new Set([...e].filter((e=>t.has(e))));a.command("publish").aliases(["pub","p"]).option("-b, --bumper <bumper>","bump version","patch").option("-no-b, --no-bumper","no bump version").option("-p, --preview","preview publish").action((async({preview:t,bumper:s,...a})=>{M();const{value:i={}}=await O()??{},u=Object.entries(i);if(0===u.length)throw new Error("no packages selected");const p=u.map((([e,t])=>{const{type:n,exports:s={}}=t,a="module"===n,i={...t},[u,p]=function({entrypoints:e,pkgIsModule:t,entries:n,config:s,dir:a,noFilter:i,isPublish:u}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,g=`./${(e=>o(a??process.cwd(),e))(((...e)=>r(a??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"))}`,[,d]=E(e);n&&Object.entries(d).forEach((([e])=>{n.some((t=>Ie.isMatch(e,t,{matchBase:!0})))||delete d[e]}));const h=i?d:b(d,{skipValue:[/(^|\/)\.jk-noentry/,...S]});return[h,C(h,{outdir:g,withSuffix:u?l:void 0,withSource:u?c:void 0,withConditional:{...f?{import:e=>!t&&0===Ge(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==Ge(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:s,pkgIsModule:a,config:K(e),dir:e,noFilter:!0,isPublish:!0});return i.exports={...u,...p},[e,i]})),l=Object.entries(a).reduce(((e,[t,n])=>(n&&e.push(`--${t}`,n),e)),[]);for(const[r,o]of p){const a=e.readFileSync(n.join(r,"package.json"),"utf-8"),i=JSON.parse(a)??"0.0.0",u=s?_(i.version,s):i.version,{indent:p=" "}=g(a),c={tabSize:p.length,insertSpaces:!0};let f=a;f=h(f,A(f,["version"],u,{formattingOptions:c}));for(const[e,t]of Object.entries(o))if(JSON.stringify(t)!==JSON.stringify(i[e]))if("exports"!==e)f=h(f,A(f,["publishConfig",e],t,{formattingOptions:c}));else{const e=t;for(const[t,n]of Object.entries(e))f=h(f,A(f,["publishConfig","exports",t],n,{formattingOptions:c}));const n=e?.["."],r={};if(n){switch(typeof n){case"string":r["module"===o?.type?"module":"main"]=n;break;case"object":{const e=n;r.main=e.require??e.default,r.module=e.import??e.module??e.default;break}}for(const[e,t]of Object.entries(r))void 0!==t&&(f=h(f,A(f,["publishConfig",e],t,{formattingOptions:c})))}}try{if(e.renameSync(n.join(r,"package.json"),n.join(r,"package.json.bak")),e.writeFileSync(n.join(r,"package.json"),f),console.log(f),t){console.warn("preview mode");continue}m.execSync(["pnpm","publish","--access","public","--no-git-checks",...l].join(" "),{cwd:r,stdio:"inherit"});const o=h(a,A(a,["version"],u,{}));e.writeFileSync(n.join(r,"package.json.bak"),o)}finally{e.unlinkSync(n.join(r,"package.json")),e.renameSync(n.join(r,"package.json.bak"),n.join(r,"package.json"))}}I()})),a.parse(process.argv);
19
+ */function de(){if(z)return Y;z=1;const e=R,t=ge(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},a=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},i=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},u=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,g=String(e),d=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(g)||s(d)||s(h),R=A?Math.max(g.length,d.length,h.length):0,y=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),m=r.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(r.toRegex&&1===n)return u(i(e,R),i(t,R),!0,r);let _={negatives:[],positives:[]},E=[],b=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?_[(S=o)<0?"negatives":"positives"].push(Math.abs(S)):E.push(a(m(o,b),R,y)),o=f?o-n:o+n,b++;var S;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(_,r):p(E,null,{wrap:!1,...r}):E},g=(e,t,s,a={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,a);if("function"==typeof s)return g(e,t,1,{transform:s});if(n(s))return g(e,t,0,s);let i={...a};return!0===i.capture&&(i.wrap=!0),s=s||i.step||1,o(s)?o(e)&&o(t)?f(e,t,s,i):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),l=a>i,f=Math.min(a,i),g=Math.max(a,i);if(r.toRegex&&1===n)return u(f,g,!1,r);let d=[],h=0;for(;l?a>=i:a<=i;)d.push(s(a,h)),a=l?a-n:a+n,h++;return!0===r.toRegex?p(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(s),1),i):null==s||n(s)?g(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,i)};return Y=g}function he(){if(ae)return se;ae=1;const e=ce(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:a,CHAR_RIGHT_PARENTHESES:i,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:g,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=oe?re:(oe=1,re={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return se=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let y=R||{},m="number"==typeof y.maxLength?Math.min(t,y.maxLength):t;if(A.length>m)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${m})`);let _,E={type:"root",input:A,nodes:[]},b=[E],S=E,C=E,v=0,$=A.length,x=0,w=0;const H=()=>A[x++],k=e=>{if("text"===e.type&&"dot"===C.type&&(C.type="text"),!C||"text"!==C.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e;C.value+=e.value};for(k({type:"bos"});x<$;)if(S=b[b.length-1],_=H(),_!==h&&_!==d)if(_!==n)if(_!==c)if(_!==l)if(_!==a)if(_!==i)if(_!==f&&_!==g&&_!==r)if(_!==u)if(_!==p)if(_===o&&w>0){if(S.ranges>0){S.ranges=0;let t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}k({type:"comma",value:_}),S.commas++}else if(_===s&&w>0&&0===S.commas){let e=S.nodes;if(0===w||0===e.length){k({type:"text",value:_});continue}if("dot"===C.type){if(S.range=[],C.value+=_,C.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,C.type="text";continue}S.ranges++,S.args=[];continue}if("range"===C.type){e.pop();let t=e[e.length-1];t.value+=C.value+_,C=t,S.ranges--;continue}k({type:"dot",value:_})}else k({type:"text",value:_});else{if("brace"!==S.type){k({type:"text",value:_});continue}let e="close";S=b.pop(),S.close=!0,k({type:e,value:_}),w--,S=b[b.length-1]}else{w++;let e=C.value&&"$"===C.value.slice(-1)||!0===S.dollar;S=k({type:"brace",open:!0,close:!1,dollar:e,depth:w,commas:0,ranges:0,nodes:[]}),b.push(S),k({type:"open",value:_})}else{let e,t=_;for(!0!==R.keepQuotes&&(_="");x<$&&(e=H());)if(e!==n){if(e===t){!0===R.keepQuotes&&(_+=e);break}_+=e}else _+=e+H();k({type:"text",value:_})}else{if("paren"!==S.type){k({type:"text",value:_});continue}S=b.pop(),k({type:"text",value:_}),S=b[b.length-1]}else S=k({type:"paren",nodes:[]}),b.push(S),k({type:"text",value:_});else{let e;for(v++;x<$&&(e=H());)if(_+=e,e!==l)if(e!==n){if(e===c&&(v--,0===v))break}else _+=H();else v++;k({type:"text",value:_})}else k({type:"text",value:"\\"+_});else k({type:"text",value:(R.keepEscaping?_:"")+H()});do{if(S=b.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=b[b.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(b.length>0);return k({type:"eos"}),E},se}function Ae(){if(ue)return ie;ue=1;const e=ce(),t=function(){if(ee)return V;ee=1;const e=de(),t=le();return V=(n,r={})=>{let o=(n,s={})=>{let a=t.isInvalidBrace(s),i=!0===n.invalid&&!0===r.escapeInvalid,u=!0===a||!0===i,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return u?p+n.value:"(";if("close"===n.type)return u?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(ne)return te;ne=1;const e=de(),t=ce(),n=le(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return te=(o,s={})=>{let a=void 0===s.rangeLimit?1e3:s.rangeLimit,i=(o,u={})=>{o.queue=[];let p=u,l=u.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let i=n.reduce(o.nodes);if(n.exceedsLimit(...i,s.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=e(...i,s);return 0===u.length&&(u=t(o,s)),l.push(r(l.pop(),u)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,g=o;for(;"brace"!==g.type&&"root"!==g.type&&g.parent;)g=g.parent,f=g.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&i(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(i(o))}}(),r=he(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),ie=o}var Re,ye,me,_e,Ee,be,Se,Ce,ve,$e,xe,we,He,ke={};function Oe(){if(ye)return Re;ye=1;const e=y,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",a=`(?:${o}|$)`,i=`(?:^|${o})`,u=`${r}{1,2}${a}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:a,DOTS_SLASH:u,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${i}${u})`,NO_DOT_SLASH:`(?!${r}{0,1}${a})`,NO_DOTS_SLASH:`(?!${u})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:i},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return Re={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Te(){return me||(me=1,function(e){const t=y,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:a}=Oe();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(a,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(ke)),ke}function Le(){if(ve)return Ce;ve=1;const e=y,t=function(){if(Ee)return _e;Ee=1;const e=Te(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:i,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:h}=Oe(),A=e=>e===i||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return _e=(y,m)=>{const _=m||{},E=y.length-1,b=!0===_.parts||!0===_.scanToEnd,S=[],C=[],v=[];let $,x,w=y,H=-1,k=0,O=0,T=!1,L=!1,N=!1,I=!1,M=!1,j=!1,B=!1,P=!1,D=!1,G=!1,K=0,U={value:"",depth:0,isGlob:!1};const F=()=>H>=E,Q=()=>($=x,w.charCodeAt(++H));for(;H<E;){let e;if(x=Q(),x!==r){if(!0===j||x===u){for(K++;!0!==F()&&(x=Q());)if(x!==r)if(x!==u){if(!0!==j&&x===s&&(x=Q())===s){if(T=U.isBrace=!0,N=U.isGlob=!0,G=!0,!0===b)continue;break}if(!0!==j&&x===o){if(T=U.isBrace=!0,N=U.isGlob=!0,G=!0,!0===b)continue;break}if(x===g&&(K--,0===K)){j=!1,T=U.isBrace=!0,G=!0;break}}else K++;else B=U.backslashes=!0,Q();if(!0===b)continue;break}if(x!==i){if(!0!==_.noext&&!0==(x===c||x===n||x===t||x===f||x===a)&&w.charCodeAt(H+1)===p){if(N=U.isGlob=!0,I=U.isExtglob=!0,G=!0,x===a&&H===k&&(D=!0),!0===b){for(;!0!==F()&&(x=Q());)if(x!==r){if(x===d){N=U.isGlob=!0,G=!0;break}}else B=U.backslashes=!0,x=Q();continue}break}if(x===t){if($===t&&(M=U.isGlobstar=!0),N=U.isGlob=!0,G=!0,!0===b)continue;break}if(x===f){if(N=U.isGlob=!0,G=!0,!0===b)continue;break}if(x===l){for(;!0!==F()&&(e=Q());)if(e!==r){if(e===h){L=U.isBracket=!0,N=U.isGlob=!0,G=!0;break}}else B=U.backslashes=!0,Q();if(!0===b)continue;break}if(!0===_.nonegate||x!==a||H!==k){if(!0!==_.noparen&&x===p){if(N=U.isGlob=!0,!0===b){for(;!0!==F()&&(x=Q());)if(x!==p){if(x===d){G=!0;break}}else B=U.backslashes=!0,x=Q();continue}break}if(!0===N){if(G=!0,!0===b)continue;break}}else P=U.negated=!0,k++}else{if(S.push(H),C.push(U),U={value:"",depth:0,isGlob:!1},!0===G)continue;if($===s&&H===k+1){k+=2;continue}O=H+1}}else B=U.backslashes=!0,x=Q(),x===u&&(j=!0)}!0===_.noext&&(I=!1,N=!1);let W=w,X="",q="";k>0&&(X=w.slice(0,k),w=w.slice(k),O-=k),W&&!0===N&&O>0?(W=w.slice(0,O),q=w.slice(O)):!0===N?(W="",q=w):W=w,W&&""!==W&&"/"!==W&&W!==w&&A(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===_.unescape&&(q&&(q=e.removeBackslashes(q)),W&&!0===B&&(W=e.removeBackslashes(W)));const Z={prefix:X,input:y,start:k,base:W,glob:q,isBrace:T,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:D};if(!0===_.tokens&&(Z.maxDepth=0,A(x)||C.push(U),Z.tokens=C),!0===_.parts||!0===_.tokens){let e;for(let t=0;t<S.length;t++){const n=e?e+1:k,r=S[t],o=y.slice(n,r);_.tokens&&(0===t&&0!==k?(C[t].isPrefix=!0,C[t].value=X):C[t].value=o,R(C[t]),Z.maxDepth+=C[t].depth),0===t&&""===o||v.push(o),e=r}if(e&&e+1<y.length){const t=y.slice(e+1);v.push(t),_.tokens&&(C[C.length-1].value=t,R(C[C.length-1]),Z.maxDepth+=C[C.length-1].depth)}Z.slashes=S,Z.parts=v}return Z}}(),n=function(){if(Se)return be;Se=1;const e=Oe(),t=Te(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:a}=e,i=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=a[l]||l;const f={...c},g="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let d=l.length;if(d>g)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${g}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",y=t.isWindows(c),m=e.globChars(y),_=e.extglobChars(m),{DOT_LITERAL:E,PLUS_LITERAL:b,SLASH_LITERAL:S,ONE_CHAR:C,DOTS_SLASH:v,NO_DOT:$,NO_DOT_SLASH:x,NO_DOTS_SLASH:w,QMARK:H,QMARK_NO_DOT:k,STAR:O,START_ANCHOR:T}=m,L=e=>`(${R}(?:(?!${T}${e.dot?v:E}).)*?)`,N=f.dot?"":$,I=f.dot?H:k;let M=!0===f.bash?L(f):O;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const j={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,j),d=l.length;const B=[],P=[],D=[];let G,K=h;const U=()=>j.index===d-1,F=j.peek=(e=1)=>l[j.index+e],Q=j.advance=()=>l[++j.index]||"",W=()=>l.slice(j.index+1),X=(e="",t=0)=>{j.consumed+=e,j.index+=t},q=e=>{j.output+=null!=e.output?e.output:e.value,X(e.value)},Z=()=>{let e=1;for(;"!"===F()&&("("!==F(2)||"?"===F(3));)Q(),j.start++,e++;return e%2!=0&&(j.negated=!0,j.start++,!0)},J=e=>{j[e]++,D.push(e)},Y=e=>{j[e]--,D.pop()},z=e=>{if("globstar"===K.type){const t=j.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||B.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(j.output=j.output.slice(0,-K.output.length),K.type="star",K.value="*",K.output=M,j.output+=K.output)}if(B.length&&"paren"!==e.type&&(B[B.length-1].inner+=e.value),(e.value||e.output)&&q(e),K&&"text"===K.type&&"text"===e.type)return K.value+=e.value,void(K.output=(K.output||"")+e.value);e.prev=K,A.push(e),K=e},V=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=K,n.parens=j.parens,n.output=j.output;const r=(f.capture?"(":"")+n.open;J("parens"),z({type:e,value:t,output:j.output?"":C}),z({type:"paren",extglob:!0,value:Q(),output:r}),B.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=L(f)),(r!==M||U()||/^\)+$/.test(W()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=W())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(j.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:G,output:n}),Y("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,a)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?H.repeat(s.length):""):0===a?I+(s?H.repeat(s.length):""):H.repeat(r.length):"."===o?E.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(j.output=l,j):(j.output=t.wrapOutput(n,j,c),j)}for(;!U();){if(G=Q(),"\0"===G)continue;if("\\"===G){const e=F();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",z({type:"text",value:G});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(G+="\\")),!0===f.unescape?G=Q():G+=Q(),0===j.brackets){z({type:"text",value:G});continue}}if(j.brackets>0&&("]"!==G||"["===K.value||"[^"===K.value)){if(!1!==f.posix&&":"===G){const e=K.value.slice(1);if(e.includes("[")&&(K.posix=!0,e.includes(":"))){const e=K.value.lastIndexOf("["),t=K.value.slice(0,e),n=K.value.slice(e+2),o=r[n];if(o){K.value=t+o,j.backtrack=!0,Q(),h.output||1!==A.indexOf(K)||(h.output=C);continue}}}("["===G&&":"!==F()||"-"===G&&"]"===F())&&(G=`\\${G}`),"]"!==G||"["!==K.value&&"[^"!==K.value||(G=`\\${G}`),!0===f.posix&&"!"===G&&"["===K.value&&(G="^"),K.value+=G,q({value:G});continue}if(1===j.quotes&&'"'!==G){G=t.escapeRegex(G),K.value+=G,q({value:G});continue}if('"'===G){j.quotes=1===j.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:G});continue}if("("===G){J("parens"),z({type:"paren",value:G});continue}if(")"===G){if(0===j.parens&&!0===f.strictBrackets)throw new SyntaxError(u("opening","("));const e=B[B.length-1];if(e&&j.parens===e.parens+1){ee(B.pop());continue}z({type:"paren",value:G,output:j.parens?")":"\\)"}),Y("parens");continue}if("["===G){if(!0!==f.nobracket&&W().includes("]"))J("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));G=`\\${G}`}z({type:"bracket",value:G});continue}if("]"===G){if(!0===f.nobracket||K&&"bracket"===K.type&&1===K.value.length){z({type:"text",value:G,output:`\\${G}`});continue}if(0===j.brackets){if(!0===f.strictBrackets)throw new SyntaxError(u("opening","["));z({type:"text",value:G,output:`\\${G}`});continue}Y("brackets");const e=K.value.slice(1);if(!0===K.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),K.value+=G,q({value:G}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(K.value);if(j.output=j.output.slice(0,-K.value.length),!0===f.literalBrackets){j.output+=n,K.value=n;continue}K.value=`(${R}${n}|${K.value})`,j.output+=K.value;continue}if("{"===G&&!0!==f.nobrace){J("braces");const e={type:"brace",value:G,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};P.push(e),z(e);continue}if("}"===G){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=i(n,f),j.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",j.output=n;for(const e of r)j.output+=e.output||e.value}z({type:"brace",value:G,output:t}),Y("braces"),P.pop();continue}if("|"===G){B.length>0&&B[B.length-1].conditions++,z({type:"text",value:G});continue}if(","===G){let e=G;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===K.type&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",A.pop(),K=h;continue}z({type:"slash",value:G,output:S});continue}if("."===G){if(j.braces>0&&"dot"===K.type){"."===K.value&&(K.output=E);const e=P[P.length-1];K.type="dots",K.output+=G,K.value+=G,e.dots=!0;continue}if(j.braces+j.parens===0&&"bos"!==K.type&&"slash"!==K.type){z({type:"text",value:G,output:E});continue}z({type:"dot",value:G,output:E});continue}if("?"===G){if((!K||"("!==K.value)&&!0!==f.noextglob&&"("===F()&&"?"!==F(2)){V("qmark",G);continue}if(K&&"paren"===K.type){const e=F();let n=G;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===K.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(n=`\\${G}`),z({type:"text",value:G,output:n});continue}if(!0!==f.dot&&("slash"===K.type||"bos"===K.type)){z({type:"qmark",value:G,output:k});continue}z({type:"qmark",value:G,output:H});continue}if("!"===G){if(!0!==f.noextglob&&"("===F()&&("?"!==F(2)||!/[!=<:]/.test(F(3)))){V("negate",G);continue}if(!0!==f.nonegate&&0===j.index){Z();continue}}if("+"===G){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){V("plus",G);continue}if(K&&"("===K.value||!1===f.regex){z({type:"plus",value:G,output:b});continue}if(K&&("bracket"===K.type||"paren"===K.type||"brace"===K.type)||j.parens>0){z({type:"plus",value:G});continue}z({type:"plus",value:b});continue}if("@"===G){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){z({type:"at",extglob:!0,value:G,output:""});continue}z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=o.exec(W());e&&(G+=e[0],j.index+=e[0].length),z({type:"text",value:G});continue}if(K&&("globstar"===K.type||!0===K.star)){K.type="star",K.star=!0,K.value+=G,K.output=M,j.backtrack=!0,j.globstar=!0,X(G);continue}let e=W();if(!0!==f.noextglob&&/^\([^?]/.test(e)){V("star",G);continue}if("star"===K.type){if(!0===f.noglobstar){X(G);continue}const t=K.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){z({type:"star",value:G,output:""});continue}const s=j.braces>0&&("comma"===t.type||"brace"===t.type),a=B.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!a){z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[j.index+4];if(t&&"/"!==t)break;e=e.slice(3),X("/**",3)}if("bos"===t.type&&U()){K.type="globstar",K.value+=G,K.output=L(f),j.output=K.output,j.globstar=!0,X(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&U()){j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=L(f)+(f.strictSlashes?")":"|$)"),K.value+=G,j.globstar=!0,j.output+=t.output+K.output,X(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";j.output=j.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=`${L(f)}${S}|${S}${n})`,K.value+=G,j.output+=t.output+K.output,j.globstar=!0,X(G+Q()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){K.type="globstar",K.value+=G,K.output=`(?:^|${S}|${L(f)}${S})`,j.output=K.output,j.globstar=!0,X(G+Q()),z({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-K.output.length),K.type="globstar",K.output=L(f),K.value+=G,j.output+=K.output,j.globstar=!0,X(G);continue}const n={type:"star",value:G,output:M};!0!==f.bash?!K||"bracket"!==K.type&&"paren"!==K.type||!0!==f.regex?(j.index!==j.start&&"slash"!==K.type&&"dot"!==K.type||("dot"===K.type?(j.output+=x,K.output+=x):!0===f.dot?(j.output+=w,K.output+=w):(j.output+=N,K.output+=N),"*"!==F()&&(j.output+=C,K.output+=C)),z(n)):(n.output=G,z(n)):(n.output=".*?","bos"!==K.type&&"slash"!==K.type||(n.output=N+n.output),z(n))}for(;j.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","]"));j.output=t.escapeLast(j.output,"["),Y("brackets")}for(;j.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing",")"));j.output=t.escapeLast(j.output,"("),Y("parens")}for(;j.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(u("closing","}"));j.output=t.escapeLast(j.output,"{"),Y("braces")}if(!0===f.strictSlashes||"star"!==K.type&&"bracket"!==K.type||z({type:"maybe_slash",value:"",output:`${S}?`}),!0===j.backtrack){j.output="";for(const e of j.tokens)j.output+=null!=e.output?e.output:e.value,e.suffix&&(j.output+=e.suffix)}return j};return p.fastpaths=(r,o)=>{const s={...o},i="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,u=r.length;if(u>i)throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${i}`);r=a[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:g,NO_DOT:d,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:y}=e.globChars(p),m=s.dot?h:d,_=s.dot?A:d,E=s.capture?"":"?:";let b=!0===s.bash?".*?":R;s.capture&&(b=`(${b})`);const S=e=>!0===e.noglobstar?b:`(${E}(?:(?!${y}${e.dot?g:l}).)*?)`,C=e=>{switch(e){case"*":return`${m}${f}${b}`;case".*":return`${l}${f}${b}`;case"*.*":return`${m}${b}${l}${f}${b}`;case"*/*":return`${m}${b}${c}${f}${_}${b}`;case"**":return m+S(s);case"**/*":return`(?:${m}${S(s)}${c})?${_}${f}${b}`;case"**/*.*":return`(?:${m}${S(s)}${c})?${_}${b}${l}${f}${b}`;case"**/.*":return`(?:${m}${S(s)}${c})?${l}${f}${b}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=C(t[1]);if(!n)return;return n+l+t[2]}}},v=t.removePrefix(r,{negated:!1,prefix:""});let $=C(v);return $&&!0!==s.strictSlashes&&($+=`${c}?`),$},be=p}(),r=Te(),o=Oe(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(a=e)&&"object"==typeof a&&!Array.isArray(a)&&e.tokens&&e.input;var a;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},u=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(i.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:a,output:f}=s.test(n,p,t,{glob:e,posix:u}),g={glob:e,state:l,regex:p,posix:u,input:n,output:f,match:a,isMatch:o};return"function"==typeof i.onResult&&i.onResult(g),!1===o?(g.isMatch=!1,!!r&&g):c(n)?("function"==typeof i.onIgnore&&i.onIgnore(g),g.isMatch=!1,!!r&&g):("function"==typeof i.onMatch&&i.onMatch(g),!r||g)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:a}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const i=n||{},u=i.format||(a?r.toPosixSlashes:null);let p=e===o,l=p&&u?u(e):e;return!1===p&&(l=u?u(e):e,p=l===o),!1!==p&&!0!==i.capture||(p=!0===i.matchBase||!0===i.basename?s.matchBase(e,t,n,a):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,a=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},a=o.contains?"":"^",i=o.contains?"":"$";let u=`${a}(?:${e.output})${i}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const p=s.toRegex(u,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(a.output=n.fastpaths(e,t)),a.output||(a=n(e,t)),s.compileRe(a,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,Ce=s}function Ne(){return xe?$e:(xe=1,$e=Le())}var Ie=function(){if(He)return we;He=1;const e=R,t=Ae(),n=Ne(),r=Te(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,a=new Set,i=0,u=e=>{a.add(e.output),r&&r.onResult&&r.onResult(e)};for(let a=0;a<t.length;a++){let p=n(String(t[a]),{...r,onResult:u},!0),l=p.state.negated||p.state.negatedExtglob;l&&i++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(i===t.length?[...a]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],a=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)a.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),a={};for(let t of o)a[t]=e[t];return a},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),a=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(a)return a.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},we=s}();const Me='{\n "name": "",\n "version": "0.0.1",\n "description": "",\n "license": "",\n "author": "",\n "files": ["dist"],\n "exports": {\n ".": "./src/index.ts"\n },\n "scripts": {\n },\n "homepage": "",\n "repository": "",\n "bugs": ""\n}'.trimStart(),je="# $name\n\n## Installation\n\n```bash\nnpm install $name\n# or\npnpm install $name\n# or\nyarn add $name\n```\n\n## Usage\n\n\n## License\n\n$license\n".trimStart();const Be=new Map;function Pe(t,r){if(Be.has(t))return Be.get(t)[r];const o=n.resolve(t,"package.json"),s=JSON.parse(e.readFileSync(o,"utf-8"));return Be.set(t,s),s[r]}a.command("init [name]").option("-t, --template <template>","the package.json template file path or file content").action((async()=>{const[,t]=a.args,r=process.cwd(),{init:o={}}=K()??{},{wd:s}=H(),i=n.basename(s),{named:u,template:p,bug:l={},readme:c=je,readmeTemplate:f}=o,R={template:"bug_report.yml",labels:["bug"],...l};let y=c;if(f){const t=n.resolve(s,f);y=e.readFileSync(t,"utf-8")}const m=function(t,r){let o=r??Me,s=!1;try{r&&JSON.parse(r)}catch(e){s=!0}if(s){const s=n.resolve(t,r);o=e.readFileSync(s,"utf-8")}return o}(s,p),{indent:_=" "}=g(m),E={tabSize:_.length,insertSpaces:!0},b=["license","author"];let S=m;for(const e of b)S=h(S,A(S,[e],Pe(s,e),{formattingOptions:E}));let[C,v]=await async function(e,t,{wd:r,cwd:o,workspaceName:s}){const a=o.replace(`${r}/`,"");let i=n.basename(o);if("function"==typeof e)return e(t,{full:r,relative:o});let u,p,l=!1;if("object"==typeof e)if(o===r){const{rule:t}=await d.prompt({type:"list",name:"rule",message:"choose a rule",default:"default",choices:["default"].concat(Object.keys(e))});"default"!==t&&(u=t,p=e[t])}else for(const[t,n]of Object.entries(e)){if(Ie.isMatch(a,t)){u=t,p=n;break}if(Ie.isMatch(`${a}/jiek_ignore_dont_use_same_file_name`,t)){l=!0,u=t,p=n;break}}if(p||(u="packages/*",p=`@${s}/$basename`),!p)throw new Error("no matched rule");if(!t&&l&&(i=await d.prompt({type:"input",name:"name",message:`the matched rule is \`${String(p)}\`, please input the basename\n`}).then((({name:e})=>e))),"function"==typeof p)return p(t,{full:r,relative:o,basename:i});if("string"==typeof p){const e=t??i;return[p.replace(/\$basename/g,e),u?.replace(/\/\*$/g,`/${e}`)]}throw new Error("no matched rule")}(u,t,{wd:s,cwd:r,workspaceName:i});if(!v){const{dir:e}=await d.prompt({type:"input",name:"dir",message:"package directory",default:t});v=e}if(!C){const{name:e}=await d.prompt({type:"input",name:"name",message:"package name",default:t});C=e}S=h(S,A(S,["name"],C,{formattingOptions:E}));let $=Pe(s,"repository");"string"==typeof $&&($={type:"git",url:$,directory:v}),S=h(S,A(S,["repository"],$,{formattingOptions:E}));S=h(S,A(S,["homepage"],`${$?.url}/blob/master/${v}/README.md`,{formattingOptions:E}));let x=R.labels;"function"==typeof x&&(x=x({name:C,dir:v})),x.push(`scope:${C}`);const w=`${$?.url}/issues/new?template=${R.template}&labels=${x.join(",")}`;function k(e){if(!v)throw new Error("pkgDir is not defined");return n.resolve(v,e)}S=h(S,A(S,["bugs"],w,{formattingOptions:E})),e.existsSync(v)||e.mkdirSync(v);const O=k("package.json");if(e.existsSync(O))throw new Error("package.json already exists");e.writeFileSync(O,S),console.log(S,"written to",O);const T=Pe(s,"license"),L=k("README.md");"function"==typeof y&&(y=y({dir:v,packageJson:JSON.parse(S)}));const N=y.replace(/\$name/g,C).replace(/\$license/g,T);e.writeFileSync(L,N)}));const De=(e,t)=>new Set([...e].filter((e=>t.has(e))));a.command("publish").aliases(["pub","p"]).option("-b, --bumper <bumper>","bump version","patch").option("-no-b, --no-bumper","no bump version").option("-p, --preview","preview publish").action((async({preview:t,bumper:s,...a})=>{M();const{value:i={}}=await O()??{},u=Object.entries(i);if(0===u.length)throw new Error("no packages selected");const p=u.map((([e,t])=>{const{type:n,exports:s={}}=t,a="module"===n,i={...t},[u,p]=function({entrypoints:e,pkgIsModule:t,entries:n,config:s,dir:a,noFilter:i,isPublish:u}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,g=`./${(e=>o(a??process.cwd(),e))(((...e)=>r(a??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"))}`,[,d]=E(e);n&&Object.entries(d).forEach((([e])=>{n.some((t=>Ie.isMatch(e,t,{matchBase:!0})))||delete d[e]}));const h=i?d:b(d,{skipValue:[/(^|\/)\.jk-noentry/,...S]});return[h,C(h,{outdir:g,withSuffix:u?l:void 0,withSource:u?c:void 0,withConditional:{...f?{import:e=>!t&&0===De(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==De(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:s,pkgIsModule:a,config:K(e),dir:e,noFilter:!0,isPublish:!0});return i.exports={...u,...p},[e,i]})),l=Object.entries(a).reduce(((e,[t,n])=>(n&&e.push(`--${t}`,n),e)),[]);for(const[r,o]of p){const a=e.readFileSync(n.join(r,"package.json"),"utf-8"),i=JSON.parse(a)??"0.0.0",u=s?_(i.version,s):i.version,{indent:p=" "}=g(a),c={tabSize:p.length,insertSpaces:!0};let f=a;f=h(f,A(f,["version"],u,{formattingOptions:c}));for(const[e,t]of Object.entries(o))if(JSON.stringify(t)!==JSON.stringify(i[e]))if("exports"!==e)f=h(f,A(f,["publishConfig",e],t,{formattingOptions:c}));else{const e=t;for(const[t,n]of Object.entries(e))f=h(f,A(f,["publishConfig","exports",t],n,{formattingOptions:c}));const n=e?.["."],r={};if(n){switch(typeof n){case"string":r["module"===o?.type?"module":"main"]=n;break;case"object":{const e=n;r.main=e.require??e.default,r.module=e.import??e.module??e.default;break}}for(const[e,t]of Object.entries(r))void 0!==t&&(f=h(f,A(f,["publishConfig",e],t,{formattingOptions:c})))}}try{if(e.renameSync(n.join(r,"package.json"),n.join(r,"package.json.bak")),e.writeFileSync(n.join(r,"package.json"),f),console.log(f),t){console.warn("preview mode");continue}m.execSync(["pnpm","publish","--access","public","--no-git-checks",...l].join(" "),{cwd:r,stdio:"inherit"});const o=h(a,A(a,["version"],u,{}));e.writeFileSync(n.join(r,"package.json.bak"),o)}finally{e.unlinkSync(n.join(r,"package.json")),e.renameSync(n.join(r,"package.json.bak"),n.join(r,"package.json"))}}I()})),a.parse(process.argv);
@@ -4552,6 +4552,7 @@ const generateConfigs = (context, options = {}) => {
4552
4552
  throw new Error(errors.map((e) => e.messageText).join("\n"));
4553
4553
  }
4554
4554
  compilerOptions = options2;
4555
+ delete compilerOptions.composite;
4555
4556
  }
4556
4557
  const exportConditions = [...conditionals, ...compilerOptions.customConditions ?? []];
4557
4558
  const throughEventProps = {
@@ -4537,6 +4537,7 @@ const generateConfigs = (context, options = {}) => {
4537
4537
  throw new Error(errors.map((e) => e.messageText).join("\n"));
4538
4538
  }
4539
4539
  compilerOptions = options2;
4540
+ delete compilerOptions.composite;
4540
4541
  }
4541
4542
  const exportConditions = [...conditionals, ...compilerOptions.customConditions ?? []];
4542
4543
  const throughEventProps = {
@@ -16,4 +16,4 @@
16
16
  *
17
17
  * Copyright (c) 2014-present, Jon Schlinkert.
18
18
  * Licensed under the MIT License.
19
- */function J(){if(H)return $;H=1;const e=Q.default,t=z(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},u=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},i=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(d)||s(g)||s(h),R=A?Math.max(d.length,g.length,h.length):0,_=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),E=r.transform||(e=>t=>!0===e?Number(t):String(t))(_);if(r.toRegex&&1===n)return i(a(e,R),a(t,R),!0,r);let y={negatives:[],positives:[]},C=[],m=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?y[(v=o)<0?"negatives":"positives"].push(Math.abs(v)):C.push(u(E(o,m),R,_)),o=f?o-n:o+n,m++;var v;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(y,r):p(C,null,{wrap:!1,...r}):C},d=(e,t,s,u={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,u);if("function"==typeof s)return d(e,t,1,{transform:s});if(n(s))return d(e,t,0,s);let a={...u};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),u=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=u>a,f=Math.min(u,a),d=Math.max(u,a);if(r.toRegex&&1===n)return i(f,d,!1,r);let g=[],h=0;for(;l?u>=a:u<=a;)g.push(s(u,h)),u=l?u-n:u+n,h++;return!0===r.toRegex?p(g,null,{wrap:!1,options:r}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||n(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return $=d}function ee(){if(M)return I;M=1;const e=Y(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=N?k:(N=1,k={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return I=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let _=R||{},E="number"==typeof _.maxLength?Math.min(t,_.maxLength):t;if(A.length>E)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${E})`);let y,C={type:"root",input:A,nodes:[]},m=[C],v=C,S=C,b=0,x=A.length,$=0,H=0;const T=()=>A[$++],w=e=>{if("text"===e.type&&"dot"===S.type&&(S.type="text"),!S||"text"!==S.type||"text"!==e.type)return v.nodes.push(e),e.parent=v,e.prev=S,S=e,e;S.value+=e.value};for(w({type:"bos"});$<x;)if(v=m[m.length-1],y=T(),y!==h&&y!==g)if(y!==n)if(y!==c)if(y!==l)if(y!==u)if(y!==a)if(y!==f&&y!==d&&y!==r)if(y!==i)if(y!==p)if(y===o&&H>0){if(v.ranges>0){v.ranges=0;let t=v.nodes.shift();v.nodes=[t,{type:"text",value:e(v)}]}w({type:"comma",value:y}),v.commas++}else if(y===s&&H>0&&0===v.commas){let e=v.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===S.type){if(v.range=[],S.value+=y,S.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,S.type="text";continue}v.ranges++,v.args=[];continue}if("range"===S.type){e.pop();let t=e[e.length-1];t.value+=S.value+y,S=t,v.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==v.type){w({type:"text",value:y});continue}let e="close";v=m.pop(),v.close=!0,w({type:e,value:y}),H--,v=m[m.length-1]}else{H++;let e=S.value&&"$"===S.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),m.push(v),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==n){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==v.type){w({type:"text",value:y});continue}v=m.pop(),w({type:"text",value:y}),v=m[m.length-1]}else v=w({type:"paren",nodes:[]}),m.push(v),w({type:"text",value:y});else{let e;for(b++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==n){if(e===c&&(b--,0===b))break}else y+=T();else b++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(v=m.pop(),"root"!==v.type){v.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=m[m.length-1],t=e.nodes.indexOf(v);e.nodes.splice(t,1,...v.nodes)}}while(m.length>0);return w({type:"eos"}),C},I}function te(){if(j)return B;j=1;const e=Y(),t=function(){if(w)return T;w=1;const e=J(),t=Z();return T=(n,r={})=>{let o=(n,s={})=>{let u=t.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,i=!0===u||!0===a,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return i?p+n.value:"(";if("close"===n.type)return i?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":i?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(O)return L;O=1;const e=J(),t=Y(),n=Z(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return L=(o,s={})=>{let u=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,i={})=>{o.queue=[];let p=i,l=i.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=e(...a,s);return 0===i.length&&(i=t(o,s)),l.push(r(l.pop(),i)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&a(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(a(o))}}(),r=ee(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),B=o}var ne,re,oe,se,ue,ae,ie,pe,le,ce,fe,de,ge,he={};function Ae(){if(re)return ne;re=1;const e=W.default,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",u=`(?:${o}|$)`,a=`(?:^|${o})`,i=`${r}{1,2}${u}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:u,DOTS_SLASH:i,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${i})`,NO_DOT_SLASH:`(?!${r}{0,1}${u})`,NO_DOTS_SLASH:`(?!${i})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return ne={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Re(){return oe||(oe=1,function(e){const t=W.default,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:u}=Ae();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(u,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(he)),he}function _e(){if(le)return pe;le=1;const e=W.default,t=function(){if(ue)return se;ue=1;const e=Re(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:h}=Ae(),A=e=>e===a||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return se=(_,E)=>{const y=E||{},C=_.length-1,m=!0===y.parts||!0===y.scanToEnd,v=[],S=[],b=[];let x,$,H=_,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,D=!1,G=!1,U=0,K={value:"",depth:0,isGlob:!1};const q=()=>T>=C,F=()=>(x=$,H.charCodeAt(++T));for(;T<C;){let e;if($=F(),$!==r){if(!0===B||$===i){for(U++;!0!==q()&&($=F());)if($!==r)if($!==i){if(!0!==B&&$===s&&($=F())===s){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if(!0!==B&&$===o){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===d&&(U--,0===U)){B=!1,O=K.isBrace=!0,G=!0;break}}else U++;else j=K.backslashes=!0,F();if(!0===m)continue;break}if($!==a){if(!0!==y.noext&&!0==($===c||$===n||$===t||$===f||$===u)&&H.charCodeAt(T+1)===p){if(N=K.isGlob=!0,I=K.isExtglob=!0,G=!0,$===u&&T===w&&(D=!0),!0===m){for(;!0!==q()&&($=F());)if($!==r){if($===g){N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===f){if(N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===l){for(;!0!==q()&&(e=F());)if(e!==r){if(e===h){k=K.isBracket=!0,N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,F();if(!0===m)continue;break}if(!0===y.nonegate||$!==u||T!==w){if(!0!==y.noparen&&$===p){if(N=K.isGlob=!0,!0===m){for(;!0!==q()&&($=F());)if($!==p){if($===g){G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if(!0===N){if(G=!0,!0===m)continue;break}}else P=K.negated=!0,w++}else{if(v.push(T),S.push(K),K={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=K.backslashes=!0,$=F(),$===i&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let Q=H,W="",X="";w>0&&(W=H.slice(0,w),H=H.slice(w),L-=w),Q&&!0===N&&L>0?(Q=H.slice(0,L),X=H.slice(L)):!0===N?(Q="",X=H):Q=H,Q&&""!==Q&&"/"!==Q&&Q!==H&&A(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),!0===y.unescape&&(X&&(X=e.removeBackslashes(X)),Q&&!0===j&&(Q=e.removeBackslashes(Q)));const Z={prefix:W,input:_,start:w,base:Q,glob:X,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:D};if(!0===y.tokens&&(Z.maxDepth=0,A($)||S.push(K),Z.tokens=S),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<v.length;t++){const n=e?e+1:w,r=v[t],o=_.slice(n,r);y.tokens&&(0===t&&0!==w?(S[t].isPrefix=!0,S[t].value=W):S[t].value=o,R(S[t]),Z.maxDepth+=S[t].depth),0===t&&""===o||b.push(o),e=r}if(e&&e+1<_.length){const t=_.slice(e+1);b.push(t),y.tokens&&(S[S.length-1].value=t,R(S[S.length-1]),Z.maxDepth+=S[S.length-1].depth)}Z.slashes=v,Z.parts=b}return Z}}(),n=function(){if(ie)return ae;ie=1;const e=Ae(),t=Re(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:u}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},i=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=u[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",_=t.isWindows(c),E=e.globChars(_),y=e.extglobChars(E),{DOT_LITERAL:C,PLUS_LITERAL:m,SLASH_LITERAL:v,ONE_CHAR:S,DOTS_SLASH:b,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?b:C}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,B),g=l.length;const j=[],P=[],D=[];let G,U=h;const K=()=>B.index===g-1,q=B.peek=(e=1)=>l[B.index+e],F=B.advance=()=>l[++B.index]||"",Q=()=>l.slice(B.index+1),W=(e="",t=0)=>{B.consumed+=e,B.index+=t},X=e=>{B.output+=null!=e.output?e.output:e.value,W(e.value)},Z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)F(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,D.push(e)},V=e=>{B[e]--,D.pop()},z=e=>{if("globstar"===U.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(B.output=B.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=M,B.output+=U.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&X(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,A.push(e),U=e},J=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=U,n.parens=B.parens,n.output=B.output;const r=(f.capture?"(":"")+n.open;Y("parens"),z({type:e,value:t,output:B.output?"":S}),z({type:"paren",extglob:!0,value:F(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||K()||/^\)+$/.test(Q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Q())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:G,output:n}),V("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,u)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===u?I+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?C.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(n,B,c),B)}for(;!K();){if(G=F(),"\0"===G)continue;if("\\"===G){const e=q();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",z({type:"text",value:G});continue}const t=/^\\+/.exec(Q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(G+="\\")),!0===f.unescape?G=F():G+=F(),0===B.brackets){z({type:"text",value:G});continue}}if(B.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==f.posix&&":"===G){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),n=U.value.slice(e+2),o=r[n];if(o){U.value=t+o,B.backtrack=!0,F(),h.output||1!==A.indexOf(U)||(h.output=S);continue}}}("["===G&&":"!==q()||"-"===G&&"]"===q())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===f.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,X({value:G});continue}if(1===B.quotes&&'"'!==G){G=t.escapeRegex(G),U.value+=G,X({value:G});continue}if('"'===G){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:G});continue}if("("===G){Y("parens"),z({type:"paren",value:G});continue}if(")"===G){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(i("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}z({type:"paren",value:G,output:B.parens?")":"\\)"}),V("parens");continue}if("["===G){if(!0!==f.nobracket&&Q().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));G=`\\${G}`}z({type:"bracket",value:G});continue}if("]"===G){if(!0===f.nobracket||U&&"bracket"===U.type&&1===U.value.length){z({type:"text",value:G,output:`\\${G}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(i("opening","["));z({type:"text",value:G,output:`\\${G}`});continue}V("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),U.value+=G,X({value:G}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(U.value);if(B.output=B.output.slice(0,-U.value.length),!0===f.literalBrackets){B.output+=n,U.value=n;continue}U.value=`(${R}${n}|${U.value})`,B.output+=U.value;continue}if("{"===G&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:G,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),z(e);continue}if("}"===G){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=B.output.slice(0,e.outputIndex),r=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",B.output=n;for(const e of r)B.output+=e.output||e.value}z({type:"brace",value:G,output:t}),V("braces"),P.pop();continue}if("|"===G){j.length>0&&j[j.length-1].conditions++,z({type:"text",value:G});continue}if(","===G){let e=G;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===U.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",A.pop(),U=h;continue}z({type:"slash",value:G,output:v});continue}if("."===G){if(B.braces>0&&"dot"===U.type){"."===U.value&&(U.output=C);const e=P[P.length-1];U.type="dots",U.output+=G,U.value+=G,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==U.type&&"slash"!==U.type){z({type:"text",value:G,output:C});continue}z({type:"dot",value:G,output:C});continue}if("?"===G){if((!U||"("!==U.value)&&!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const e=q();let n=G;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Q()))&&(n=`\\${G}`),z({type:"text",value:G,output:n});continue}if(!0!==f.dot&&("slash"===U.type||"bos"===U.type)){z({type:"qmark",value:G,output:w});continue}z({type:"qmark",value:G,output:T});continue}if("!"===G){if(!0!==f.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){J("negate",G);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("plus",G);continue}if(U&&"("===U.value||!1===f.regex){z({type:"plus",value:G,output:m});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||B.parens>0){z({type:"plus",value:G});continue}z({type:"plus",value:m});continue}if("@"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){z({type:"at",extglob:!0,value:G,output:""});continue}z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=o.exec(Q());e&&(G+=e[0],B.index+=e[0].length),z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=M,B.backtrack=!0,B.globstar=!0,W(G);continue}let e=Q();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",G);continue}if("star"===U.type){if(!0===f.noglobstar){W(G);continue}const t=U.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){z({type:"star",value:G,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),u=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!u){z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){U.type="globstar",U.value+=G,U.output=k(f),B.output=U.output,B.globstar=!0,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&K()){B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=k(f)+(f.strictSlashes?")":"|$)"),U.value+=G,B.globstar=!0,B.output+=t.output+U.output,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=`${k(f)}${v}|${v}${n})`,U.value+=G,B.output+=t.output+U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${v}|${k(f)}${v})`,B.output=U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-U.output.length),U.type="globstar",U.output=k(f),U.value+=G,B.output+=U.output,B.globstar=!0,W(G);continue}const n={type:"star",value:G,output:M};!0!==f.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==f.regex?(B.index!==B.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(B.output+=$,U.output+=$):!0===f.dot?(B.output+=H,U.output+=H):(B.output+=N,U.output+=N),"*"!==q()&&(B.output+=S,U.output+=S)),z(n)):(n.output=G,z(n)):(n.output=".*?","bos"!==U.type&&"slash"!==U.type||(n.output=N+n.output),z(n))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));B.output=t.escapeLast(B.output,"["),V("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing",")"));B.output=t.escapeLast(B.output,"("),V("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","}"));B.output=t.escapeLast(B.output,"{"),V("braces")}if(!0===f.strictSlashes||"star"!==U.type&&"bracket"!==U.type||z({type:"maybe_slash",value:"",output:`${v}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,i=r.length;if(i>a)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${a}`);r=u[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:_}=e.globChars(p),E=s.dot?h:g,y=s.dot?A:g,C=s.capture?"":"?:";let m=!0===s.bash?".*?":R;s.capture&&(m=`(${m})`);const v=e=>!0===e.noglobstar?m:`(${C}(?:(?!${_}${e.dot?d:l}).)*?)`,S=e=>{switch(e){case"*":return`${E}${f}${m}`;case".*":return`${l}${f}${m}`;case"*.*":return`${E}${m}${l}${f}${m}`;case"*/*":return`${E}${m}${c}${f}${y}${m}`;case"**":return E+v(s);case"**/*":return`(?:${E}${v(s)}${c})?${y}${f}${m}`;case"**/*.*":return`(?:${E}${v(s)}${c})?${y}${m}${l}${f}${m}`;case"**/.*":return`(?:${E}${v(s)}${c})?${l}${f}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=S(t[1]);if(!n)return;return n+l+t[2]}}},b=t.removePrefix(r,{negated:!1,prefix:""});let x=S(b);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},ae=p}(),r=Re(),o=Ae(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(u=e)&&"object"==typeof u&&!Array.isArray(u)&&e.tokens&&e.input;var u;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},i=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:u,output:f}=s.test(n,p,t,{glob:e,posix:i}),d={glob:e,state:l,regex:p,posix:i,input:n,output:f,match:u,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):c(n)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof a.onMatch&&a.onMatch(d),!r||d)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:u}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},i=a.format||(u?r.toPosixSlashes:null);let p=e===o,l=p&&i?i(e):e;return!1===p&&(l=i?i(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,n,u):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,u=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},u=o.contains?"":"^",a=o.contains?"":"$";let i=`${u}(?:${e.output})${a}`;e&&!0===e.negated&&(i=`^(?!${i}).*$`);const p=s.toRegex(i,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let u={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(u.output=n.fastpaths(e,t)),u.output||(u=n(e,t)),s.compileRe(u,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,pe=s}function Ee(){return fe?ce:(fe=1,ce=_e())}var ye=function(){if(ge)return de;ge=1;const e=Q.default,t=te(),n=Ee(),r=Re(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,u=new Set,a=0,i=e=>{u.add(e.output),r&&r.onResult&&r.onResult(e)};for(let u=0;u<t.length;u++){let p=n(String(t[u]),{...r,onResult:i},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...u]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],u=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)u.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),u={};for(let t of o)u[t]=e[t];return u},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),u=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(u)return u.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},de=s}();const Ce=(e,t)=>new Set([...e].filter((e=>t.has(e))));let me;function ve(){if(me)return me;const e=g.program.getOptionValue("root");return me=e?D.default.isAbsolute(e)?e:D.default.resolve(process.cwd(),e):void 0,me}let Se,be="";try{A.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&g.program.option("-f, --filter <filter>","filter packages");let xe=!1;const $e=A.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href);function He(e){try{return $e.resolve(e),!0}catch(e){return!1}}let Te;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if(He(e)){Te=e;break}let Le="jiek.config";const Oe=e=>{e=t.resolve(e);const n=t.dirname(e),{extends:r,...o}=(s=e,P.default.existsSync(s)&&P.default.statSync(s).isFile()?R.parse(P.default.readFileSync(s,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var s;const u=(a=r?Array.isArray(r)?r:[r]:[],a?.map((e=>t.resolve(n,e)))??[]);var a;return 0===u.length?o:u.map(Oe).concat(o).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},ke=(e,n)=>{e=t.resolve(e),n=t.resolve(n);const r=t.dirname(e),o=Oe(e),[s,u,a,i]=[o.references?.map((({path:e})=>e)),o.files,o.include,o.exclude].map((e=>e?.map((e=>t.resolve(r,e)))??[]));if(i.length>0&&i.some((e=>ye.isMatch(n,e))))return;if(0===o.files?.length&&0===o.include?.length)return;let p=!1;if(p||(p=u.length>0&&u.includes(n)),p||(p=a.length>0&&a.some((e=>ye.isMatch(n,e)))),p)return o.compilerOptions??{};if(!(o.files&&o.files.length>0||o.include&&o.include.length>0)){s.reverse();for(const e of s){const t=ke(e,n);if(t)return t}return o.compilerOptions}};var Ne=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Ie=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:Me,JIEK_ENTRIES:Be}=process.env,je=Me??o.getWorkspaceDir(),Pe={},De=[U.default()],Ge=function(e){const{wd:t}=function(){if(Se)return{wd:Se,notWorkspace:xe};const e=ve();if(void 0!==e){const t=o.isWorkspaceDir(e,be);return xe=!t,Se=e,{wd:Se,notWorkspace:xe}}try{Se=o.getWorkspaceDir(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,xe=!0}return{wd:Se,notWorkspace:xe}}();let n=g.program.getOptionValue("configPath");if(n){if(!P.default.existsSync(n))throw new Error(`config file not found: ${n}`);D.default.isAbsolute(n)||(n=D.default.resolve(t,n))}else n=function(e,t){const n=!!Te;function r(n){const r=[D.default.resolve(process.cwd(),`${Le}.${n}`),D.default.resolve(process.cwd(),`.${Le}.${n}`),D.default.resolve(e,`${Le}.${n}`),D.default.resolve(e,`.${Le}.${n}`)];t&&r.unshift(D.default.resolve(t,`${Le}.${n}`),D.default.resolve(t,`.${Le}.${n}`));for(const e of r)if(P.default.existsSync(e)&&P.default.lstatSync(e).isFile())return e}return Le=r("js")??Le,Le=r("json")??Le,Le=r("yaml")??Le,n&&(Le=r("ts")??Le),D.default.resolve(e,Le)}(t,e);const r=D.default.extname(n);let s;switch(r){case".js":s=require(n);break;case".json":return require(n);case".yaml":return h.load(P.default.readFileSync(n,"utf-8"));case".ts":if(Te){require(Te),s=require(n);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${r}`)}if(!s)throw new Error("config file is empty");return s.default??s}()??{},{build:Ue={}}=Ge,Ke=`./${t.relative(process.cwd(),t.resolve(("object"==typeof Ue?.output?.dir?Ue.output.dir.js:Ue?.output?.dir)??"dist"))}`,qe=/\.(css|s[ac]ss|less|styl)$/,Fe=e=>t.resolve(je,e),Qe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),We=(e,t=Ue?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}],Xe=(e,n={})=>{const{path:o,name:s,input:u,output:i,external:l,pkgIsModule:c,conditionals:f}=e,d=f.includes("import"),g=f.includes("require"),h=f.includes("browser");let A;[Fe("tsconfig.json"),Fe("tsconfig.dts.json")].forEach((e=>{P.default.existsSync(e)&&P.default.statSync(e).isFile()&&(A=e)}));let R={};if(A){const e=ke(A,t.resolve(u)),{options:n,errors:r}=F.default.convertCompilerOptionsFromJson(e,t.dirname(A));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));R=n}const _=[...f,...R.customConditions??[]],E={type:"progress",data:{name:s,path:o,exportConditions:_,input:u}},y=n?.output?.dir,{js:C,dts:m}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(e,Ue.plugins);return[{input:u,external:l,output:[...We({file:i,name:s,interop:"auto",sourcemap:"object"==typeof n?.output?.sourcemap?n.output.sourcemap.js:n?.output?.sourcemap,format:d?"esm":g?"cjs":h?"umd":c?"esm":"cjs",strict:"object"==typeof n?.output?.strict?n.output.strict.js:n?.output?.strict})],plugins:[a.nodeResolve({exportConditions:_}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:t.resolve(i.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),q.default({tsconfig:A}),G.default(),Ne({onEvent:(e,t)=>p.sendMessage({...E,data:{...E.data,event:e,message:t,tags:["js"]}})}),C]},{input:u,external:l,output:[{dir:t.resolve(("object"==typeof y?y.dts:y)??"dist"),sourcemap:"object"==typeof n?.output?.sourcemap?n.output.sourcemap.dts:n?.output?.sourcemap,entryFileNames:()=>i.replace(`${Ke}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof n?.output?.strict?n.output.strict.dts:n?.output?.strict}],plugins:[a.nodeResolve({exportConditions:_}),Ie({patterns:[qe]}),r.dts({respectExternal:!0,compilerOptions:R}),Ne({onEvent:(e,t)=>p.sendMessage({...E,data:{...E.data,event:e,message:t,tags:["dts"]}})}),m]}]};exports.template=function(e){const{name:r,type:o,exports:s}=e,u="module"===o;if(!r)throw new Error("package.json name is required");if(!s)throw new Error("package.json exports is required");const a=Be?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),i=Qe(r),l=function(e=process.cwd()){const t="string"==typeof e?P.default.existsSync(`${e}/package.json`)?JSON.parse(P.default.readFileSync(`${e}/package.json`,"utf-8")):{}:e,{dependencies:n={},peerDependencies:r={},optionalDependencies:o={}}=t;return Object.keys(n).concat(Object.keys(r)).concat(Object.keys(o)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(e),[c,f]=function({entrypoints:e,pkgIsModule:r,entries:o,config:s,dir:u,noFilter:a,isPublish:i}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,d=`./${g=((...e)=>t.resolve(u??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"),t.relative(u??process.cwd(),g)}`;var g;const[,h]=n.resolveEntrypoints(e);o&&Object.entries(h).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete h[e]}));const A=a?h:n.filterLeafs(h,{skipValue:[/(^|\/)\.jk-noentry/,...n.DEFAULT_SKIP_VALUES]}),R=f?{import:e=>!r&&0===Ce(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!r||0!==Ce(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{};return[A,n.entrypoints2Exports(A,{outdir:d,withSuffix:i?l:void 0,withSource:i?c:void 0,withConditional:{...R}})]}({entrypoints:s,pkgIsModule:u,entries:a,config:Ge}),d=new Map;n.getAllLeafs(c,(({keys:e,value:t})=>{if("string"==typeof t){const n=d.get(t)??[];d.set(t,n),n.push(e)}return!1}));const g=[];return d.forEach(((e,t)=>e.forEach((e=>{const[r,...o]=e,s=i+("."===r?"":Qe(r)),a=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(f,e),p={path:r,name:s,input:t,external:l,pkgIsModule:u};switch(typeof a){case"string":g.push(...Xe({...p,output:a,conditionals:o},Ue));break;case"object":n.getAllLeafs(a,(({keys:e,value:t})=>{const n=[...new Set([...o,...e])];return"string"==typeof t&&g.push(...Xe({...p,output:t,conditionals:n},Ue)),!1}))}})))),p.sendMessage({type:"init",data:{leafMap:d,targetsLength:g.length}}),g.map((e=>({...Pe,...e,plugins:[...De,e.plugins]})))};
19
+ */function J(){if(H)return $;H=1;const e=Q.default,t=z(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},u=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},a=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},i=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,d=String(e),g=String(t),h=String(n);n=Math.max(Math.abs(n),1);let A=s(d)||s(g)||s(h),R=A?Math.max(d.length,g.length,h.length):0,_=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),E=r.transform||(e=>t=>!0===e?Number(t):String(t))(_);if(r.toRegex&&1===n)return i(a(e,R),a(t,R),!0,r);let y={negatives:[],positives:[]},C=[],m=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?y[(v=o)<0?"negatives":"positives"].push(Math.abs(v)):C.push(u(E(o,m),R,_)),o=f?o-n:o+n,m++;var v;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(y,r):p(C,null,{wrap:!1,...r}):C},d=(e,t,s,u={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,u);if("function"==typeof s)return d(e,t,1,{transform:s});if(n(s))return d(e,t,0,s);let a={...u};return!0===a.capture&&(a.wrap=!0),s=s||a.step||1,o(s)?o(e)&&o(t)?f(e,t,s,a):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),u=`${e}`.charCodeAt(0),a=`${t}`.charCodeAt(0),l=u>a,f=Math.min(u,a),d=Math.max(u,a);if(r.toRegex&&1===n)return i(f,d,!1,r);let g=[],h=0;for(;l?u>=a:u<=a;)g.push(s(u,h)),u=l?u-n:u+n,h++;return!0===r.toRegex?p(g,null,{wrap:!1,options:r}):g})(e,t,Math.max(Math.abs(s),1),a):null==s||n(s)?d(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,a)};return $=d}function ee(){if(M)return I;M=1;const e=Y(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:d,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:h}=N?k:(N=1,k={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return I=(A,R={})=>{if("string"!=typeof A)throw new TypeError("Expected a string");let _=R||{},E="number"==typeof _.maxLength?Math.min(t,_.maxLength):t;if(A.length>E)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${E})`);let y,C={type:"root",input:A,nodes:[]},m=[C],v=C,S=C,b=0,x=A.length,$=0,H=0;const T=()=>A[$++],w=e=>{if("text"===e.type&&"dot"===S.type&&(S.type="text"),!S||"text"!==S.type||"text"!==e.type)return v.nodes.push(e),e.parent=v,e.prev=S,S=e,e;S.value+=e.value};for(w({type:"bos"});$<x;)if(v=m[m.length-1],y=T(),y!==h&&y!==g)if(y!==n)if(y!==c)if(y!==l)if(y!==u)if(y!==a)if(y!==f&&y!==d&&y!==r)if(y!==i)if(y!==p)if(y===o&&H>0){if(v.ranges>0){v.ranges=0;let t=v.nodes.shift();v.nodes=[t,{type:"text",value:e(v)}]}w({type:"comma",value:y}),v.commas++}else if(y===s&&H>0&&0===v.commas){let e=v.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===S.type){if(v.range=[],S.value+=y,S.type="range",3!==v.nodes.length&&5!==v.nodes.length){v.invalid=!0,v.ranges=0,S.type="text";continue}v.ranges++,v.args=[];continue}if("range"===S.type){e.pop();let t=e[e.length-1];t.value+=S.value+y,S=t,v.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==v.type){w({type:"text",value:y});continue}let e="close";v=m.pop(),v.close=!0,w({type:e,value:y}),H--,v=m[m.length-1]}else{H++;let e=S.value&&"$"===S.value.slice(-1)||!0===v.dollar;v=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),m.push(v),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==n){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==v.type){w({type:"text",value:y});continue}v=m.pop(),w({type:"text",value:y}),v=m[m.length-1]}else v=w({type:"paren",nodes:[]}),m.push(v),w({type:"text",value:y});else{let e;for(b++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==n){if(e===c&&(b--,0===b))break}else y+=T();else b++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(v=m.pop(),"root"!==v.type){v.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=m[m.length-1],t=e.nodes.indexOf(v);e.nodes.splice(t,1,...v.nodes)}}while(m.length>0);return w({type:"eos"}),C},I}function te(){if(j)return B;j=1;const e=Y(),t=function(){if(w)return T;w=1;const e=J(),t=Z();return T=(n,r={})=>{let o=(n,s={})=>{let u=t.isInvalidBrace(s),a=!0===n.invalid&&!0===r.escapeInvalid,i=!0===u||!0===a,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return i?p+n.value:"(";if("close"===n.type)return i?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":i?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(O)return L;O=1;const e=J(),t=Y(),n=Z(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return L=(o,s={})=>{let u=void 0===s.rangeLimit?1e3:s.rangeLimit,a=(o,i={})=>{o.queue=[];let p=i,l=i.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let a=n.reduce(o.nodes);if(n.exceedsLimit(...a,s.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=e(...a,s);return 0===i.length&&(i=t(o,s)),l.push(r(l.pop(),i)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,d=o;for(;"brace"!==d.type&&"root"!==d.type&&d.parent;)d=d.parent,f=d.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&a(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(a(o))}}(),r=ee(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),B=o}var ne,re,oe,se,ue,ae,ie,pe,le,ce,fe,de,ge,he={};function Ae(){if(re)return ne;re=1;const e=W.default,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",u=`(?:${o}|$)`,a=`(?:^|${o})`,i=`${r}{1,2}${u}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:u,DOTS_SLASH:i,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${i})`,NO_DOT_SLASH:`(?!${r}{0,1}${u})`,NO_DOTS_SLASH:`(?!${i})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return ne={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function Re(){return oe||(oe=1,function(e){const t=W.default,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:u}=Ae();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(u,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(he)),he}function _e(){if(le)return pe;le=1;const e=W.default,t=function(){if(ue)return se;ue=1;const e=Re(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:i,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:d,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:h}=Ae(),A=e=>e===a||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return se=(_,E)=>{const y=E||{},C=_.length-1,m=!0===y.parts||!0===y.scanToEnd,v=[],S=[],b=[];let x,$,H=_,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,D=!1,G=!1,U=0,K={value:"",depth:0,isGlob:!1};const q=()=>T>=C,F=()=>(x=$,H.charCodeAt(++T));for(;T<C;){let e;if($=F(),$!==r){if(!0===B||$===i){for(U++;!0!==q()&&($=F());)if($!==r)if($!==i){if(!0!==B&&$===s&&($=F())===s){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if(!0!==B&&$===o){if(O=K.isBrace=!0,N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===d&&(U--,0===U)){B=!1,O=K.isBrace=!0,G=!0;break}}else U++;else j=K.backslashes=!0,F();if(!0===m)continue;break}if($!==a){if(!0!==y.noext&&!0==($===c||$===n||$===t||$===f||$===u)&&H.charCodeAt(T+1)===p){if(N=K.isGlob=!0,I=K.isExtglob=!0,G=!0,$===u&&T===w&&(D=!0),!0===m){for(;!0!==q()&&($=F());)if($!==r){if($===g){N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if($===t){if(x===t&&(M=K.isGlobstar=!0),N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===f){if(N=K.isGlob=!0,G=!0,!0===m)continue;break}if($===l){for(;!0!==q()&&(e=F());)if(e!==r){if(e===h){k=K.isBracket=!0,N=K.isGlob=!0,G=!0;break}}else j=K.backslashes=!0,F();if(!0===m)continue;break}if(!0===y.nonegate||$!==u||T!==w){if(!0!==y.noparen&&$===p){if(N=K.isGlob=!0,!0===m){for(;!0!==q()&&($=F());)if($!==p){if($===g){G=!0;break}}else j=K.backslashes=!0,$=F();continue}break}if(!0===N){if(G=!0,!0===m)continue;break}}else P=K.negated=!0,w++}else{if(v.push(T),S.push(K),K={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=K.backslashes=!0,$=F(),$===i&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let Q=H,W="",X="";w>0&&(W=H.slice(0,w),H=H.slice(w),L-=w),Q&&!0===N&&L>0?(Q=H.slice(0,L),X=H.slice(L)):!0===N?(Q="",X=H):Q=H,Q&&""!==Q&&"/"!==Q&&Q!==H&&A(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),!0===y.unescape&&(X&&(X=e.removeBackslashes(X)),Q&&!0===j&&(Q=e.removeBackslashes(Q)));const Z={prefix:W,input:_,start:w,base:Q,glob:X,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:D};if(!0===y.tokens&&(Z.maxDepth=0,A($)||S.push(K),Z.tokens=S),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<v.length;t++){const n=e?e+1:w,r=v[t],o=_.slice(n,r);y.tokens&&(0===t&&0!==w?(S[t].isPrefix=!0,S[t].value=W):S[t].value=o,R(S[t]),Z.maxDepth+=S[t].depth),0===t&&""===o||b.push(o),e=r}if(e&&e+1<_.length){const t=_.slice(e+1);b.push(t),y.tokens&&(S[S.length-1].value=t,R(S[S.length-1]),Z.maxDepth+=S[S.length-1].depth)}Z.slashes=v,Z.parts=b}return Z}}(),n=function(){if(ie)return ae;ie=1;const e=Ae(),t=Re(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:u}=e,a=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},i=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=u[l]||l;const f={...c},d="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let g=l.length;if(g>d)throw new SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);const h={type:"bos",value:"",output:f.prepend||""},A=[h],R=f.capture?"":"?:",_=t.isWindows(c),E=e.globChars(_),y=e.extglobChars(E),{DOT_LITERAL:C,PLUS_LITERAL:m,SLASH_LITERAL:v,ONE_CHAR:S,DOTS_SLASH:b,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=E,k=e=>`(${R}(?:(?!${O}${e.dot?b:C}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};l=t.removePrefix(l,B),g=l.length;const j=[],P=[],D=[];let G,U=h;const K=()=>B.index===g-1,q=B.peek=(e=1)=>l[B.index+e],F=B.advance=()=>l[++B.index]||"",Q=()=>l.slice(B.index+1),W=(e="",t=0)=>{B.consumed+=e,B.index+=t},X=e=>{B.output+=null!=e.output?e.output:e.value,W(e.value)},Z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)F(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,D.push(e)},V=e=>{B[e]--,D.pop()},z=e=>{if("globstar"===U.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(B.output=B.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=M,B.output+=U.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&X(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,A.push(e),U=e},J=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=U,n.parens=B.parens,n.output=B.output;const r=(f.capture?"(":"")+n.open;Y("parens"),z({type:e,value:t,output:B.output?"":S}),z({type:"paren",extglob:!0,value:F(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||K()||/^\)+$/.test(Q()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=Q())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:G,output:n}),V("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,u)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===u?I+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?C.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(n,B,c),B)}for(;!K();){if(G=F(),"\0"===G)continue;if("\\"===G){const e=q();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",z({type:"text",value:G});continue}const t=/^\\+/.exec(Q());let n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(G+="\\")),!0===f.unescape?G=F():G+=F(),0===B.brackets){z({type:"text",value:G});continue}}if(B.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==f.posix&&":"===G){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),n=U.value.slice(e+2),o=r[n];if(o){U.value=t+o,B.backtrack=!0,F(),h.output||1!==A.indexOf(U)||(h.output=S);continue}}}("["===G&&":"!==q()||"-"===G&&"]"===q())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===f.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,X({value:G});continue}if(1===B.quotes&&'"'!==G){G=t.escapeRegex(G),U.value+=G,X({value:G});continue}if('"'===G){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&z({type:"text",value:G});continue}if("("===G){Y("parens"),z({type:"paren",value:G});continue}if(")"===G){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(i("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}z({type:"paren",value:G,output:B.parens?")":"\\)"}),V("parens");continue}if("["===G){if(!0!==f.nobracket&&Q().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));G=`\\${G}`}z({type:"bracket",value:G});continue}if("]"===G){if(!0===f.nobracket||U&&"bracket"===U.type&&1===U.value.length){z({type:"text",value:G,output:`\\${G}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(i("opening","["));z({type:"text",value:G,output:`\\${G}`});continue}V("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),U.value+=G,X({value:G}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(U.value);if(B.output=B.output.slice(0,-U.value.length),!0===f.literalBrackets){B.output+=n,U.value=n;continue}U.value=`(${R}${n}|${U.value})`,B.output+=U.value;continue}if("{"===G&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:G,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),z(e);continue}if("}"===G){const e=P[P.length-1];if(!0===f.nobrace||!e){z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=A.slice(),n=[];for(let t=e.length-1;t>=0&&(A.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=a(n,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=B.output.slice(0,e.outputIndex),r=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",B.output=n;for(const e of r)B.output+=e.output||e.value}z({type:"brace",value:G,output:t}),V("braces"),P.pop();continue}if("|"===G){j.length>0&&j[j.length-1].conditions++,z({type:"text",value:G});continue}if(","===G){let e=G;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===U.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",A.pop(),U=h;continue}z({type:"slash",value:G,output:v});continue}if("."===G){if(B.braces>0&&"dot"===U.type){"."===U.value&&(U.output=C);const e=P[P.length-1];U.type="dots",U.output+=G,U.value+=G,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==U.type&&"slash"!==U.type){z({type:"text",value:G,output:C});continue}z({type:"dot",value:G,output:C});continue}if("?"===G){if((!U||"("!==U.value)&&!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const e=q();let n=G;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(Q()))&&(n=`\\${G}`),z({type:"text",value:G,output:n});continue}if(!0!==f.dot&&("slash"===U.type||"bos"===U.type)){z({type:"qmark",value:G,output:w});continue}z({type:"qmark",value:G,output:T});continue}if("!"===G){if(!0!==f.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){J("negate",G);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){J("plus",G);continue}if(U&&"("===U.value||!1===f.regex){z({type:"plus",value:G,output:m});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||B.parens>0){z({type:"plus",value:G});continue}z({type:"plus",value:m});continue}if("@"===G){if(!0!==f.noextglob&&"("===q()&&"?"!==q(2)){z({type:"at",extglob:!0,value:G,output:""});continue}z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=o.exec(Q());e&&(G+=e[0],B.index+=e[0].length),z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=M,B.backtrack=!0,B.globstar=!0,W(G);continue}let e=Q();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",G);continue}if("star"===U.type){if(!0===f.noglobstar){W(G);continue}const t=U.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){z({type:"star",value:G,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),u=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!u){z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),W("/**",3)}if("bos"===t.type&&K()){U.type="globstar",U.value+=G,U.output=k(f),B.output=U.output,B.globstar=!0,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&K()){B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=k(f)+(f.strictSlashes?")":"|$)"),U.value+=G,B.globstar=!0,B.output+=t.output+U.output,W(G);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+U.output).length),t.output=`(?:${t.output}`,U.type="globstar",U.output=`${k(f)}${v}|${v}${n})`,U.value+=G,B.output+=t.output+U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${v}|${k(f)}${v})`,B.output=U.output,B.globstar=!0,W(G+F()),z({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-U.output.length),U.type="globstar",U.output=k(f),U.value+=G,B.output+=U.output,B.globstar=!0,W(G);continue}const n={type:"star",value:G,output:M};!0!==f.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==f.regex?(B.index!==B.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(B.output+=$,U.output+=$):!0===f.dot?(B.output+=H,U.output+=H):(B.output+=N,U.output+=N),"*"!==q()&&(B.output+=S,U.output+=S)),z(n)):(n.output=G,z(n)):(n.output=".*?","bos"!==U.type&&"slash"!==U.type||(n.output=N+n.output),z(n))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","]"));B.output=t.escapeLast(B.output,"["),V("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing",")"));B.output=t.escapeLast(B.output,"("),V("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(i("closing","}"));B.output=t.escapeLast(B.output,"{"),V("braces")}if(!0===f.strictSlashes||"star"!==U.type&&"bracket"!==U.type||z({type:"maybe_slash",value:"",output:`${v}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(r,o)=>{const s={...o},a="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,i=r.length;if(i>a)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${a}`);r=u[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:h,NO_DOTS_SLASH:A,STAR:R,START_ANCHOR:_}=e.globChars(p),E=s.dot?h:g,y=s.dot?A:g,C=s.capture?"":"?:";let m=!0===s.bash?".*?":R;s.capture&&(m=`(${m})`);const v=e=>!0===e.noglobstar?m:`(${C}(?:(?!${_}${e.dot?d:l}).)*?)`,S=e=>{switch(e){case"*":return`${E}${f}${m}`;case".*":return`${l}${f}${m}`;case"*.*":return`${E}${m}${l}${f}${m}`;case"*/*":return`${E}${m}${c}${f}${y}${m}`;case"**":return E+v(s);case"**/*":return`(?:${E}${v(s)}${c})?${y}${f}${m}`;case"**/*.*":return`(?:${E}${v(s)}${c})?${y}${m}${l}${f}${m}`;case"**/.*":return`(?:${E}${v(s)}${c})?${l}${f}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=S(t[1]);if(!n)return;return n+l+t[2]}}},b=t.removePrefix(r,{negated:!1,prefix:""});let x=S(b);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},ae=p}(),r=Re(),o=Ae(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(u=e)&&"object"==typeof u&&!Array.isArray(u)&&e.tokens&&e.input;var u;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},i=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(a.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:u,output:f}=s.test(n,p,t,{glob:e,posix:i}),d={glob:e,state:l,regex:p,posix:i,input:n,output:f,match:u,isMatch:o};return"function"==typeof a.onResult&&a.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):c(n)?("function"==typeof a.onIgnore&&a.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof a.onMatch&&a.onMatch(d),!r||d)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:u}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},i=a.format||(u?r.toPosixSlashes:null);let p=e===o,l=p&&i?i(e):e;return!1===p&&(l=i?i(e):e,p=l===o),!1!==p&&!0!==a.capture||(p=!0===a.matchBase||!0===a.basename?s.matchBase(e,t,n,u):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,u=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},u=o.contains?"":"^",a=o.contains?"":"$";let i=`${u}(?:${e.output})${a}`;e&&!0===e.negated&&(i=`^(?!${i}).*$`);const p=s.toRegex(i,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let u={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(u.output=n.fastpaths(e,t)),u.output||(u=n(e,t)),s.compileRe(u,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,pe=s}function Ee(){return fe?ce:(fe=1,ce=_e())}var ye=function(){if(ge)return de;ge=1;const e=Q.default,t=te(),n=Ee(),r=Re(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,u=new Set,a=0,i=e=>{u.add(e.output),r&&r.onResult&&r.onResult(e)};for(let u=0;u<t.length;u++){let p=n(String(t[u]),{...r,onResult:i},!0),l=p.state.negated||p.state.negatedExtglob;l&&a++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(a===t.length?[...u]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],u=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)u.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),u={};for(let t of o)u[t]=e[t];return u},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),u=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(u)return u.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},de=s}();const Ce=(e,t)=>new Set([...e].filter((e=>t.has(e))));let me;function ve(){if(me)return me;const e=g.program.getOptionValue("root");return me=e?D.default.isAbsolute(e)?e:D.default.resolve(process.cwd(),e):void 0,me}let Se,be="";try{A.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href).resolve("@pnpm/filter-workspace-packages"),be="pnpm"}catch{}""!==be&&g.program.option("-f, --filter <filter>","filter packages");let xe=!1;const $e=A.createRequire("undefined"==typeof document?require("url").pathToFileURL(__filename).href:_&&_.src||new URL("index.min.cjs",document.baseURI).href);function He(e){try{return $e.resolve(e),!0}catch(e){return!1}}let Te;const we=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of we)if(He(e)){Te=e;break}let Le="jiek.config";const Oe=e=>{e=t.resolve(e);const n=t.dirname(e),{extends:r,...o}=(s=e,P.default.existsSync(s)&&P.default.statSync(s).isFile()?R.parse(P.default.readFileSync(s,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var s;const u=(a=r?Array.isArray(r)?r:[r]:[],a?.map((e=>t.resolve(n,e)))??[]);var a;return 0===u.length?o:u.map(Oe).concat(o).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},ke=(e,n)=>{e=t.resolve(e),n=t.resolve(n);const r=t.dirname(e),o=Oe(e),[s,u,a,i]=[o.references?.map((({path:e})=>e)),o.files,o.include,o.exclude].map((e=>e?.map((e=>t.resolve(r,e)))??[]));if(i.length>0&&i.some((e=>ye.isMatch(n,e))))return;if(0===o.files?.length&&0===o.include?.length)return;let p=!1;if(p||(p=u.length>0&&u.includes(n)),p||(p=a.length>0&&a.some((e=>ye.isMatch(n,e)))),p)return o.compilerOptions??{};if(!(o.files&&o.files.length>0||o.include&&o.include.length>0)){s.reverse();for(const e of s){const t=ke(e,n);if(t)return t}return o.compilerOptions}};var Ne=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Ie=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:Me,JIEK_ENTRIES:Be}=process.env,je=Me??o.getWorkspaceDir(),Pe={},De=[U.default()],Ge=function(e){const{wd:t}=function(){if(Se)return{wd:Se,notWorkspace:xe};const e=ve();if(void 0!==e){const t=o.isWorkspaceDir(e,be);return xe=!t,Se=e,{wd:Se,notWorkspace:xe}}try{Se=o.getWorkspaceDir(be)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;Se=e,xe=!0}return{wd:Se,notWorkspace:xe}}();let n=g.program.getOptionValue("configPath");if(n){if(!P.default.existsSync(n))throw new Error(`config file not found: ${n}`);D.default.isAbsolute(n)||(n=D.default.resolve(t,n))}else n=function(e,t){const n=!!Te;function r(n){const r=[D.default.resolve(process.cwd(),`${Le}.${n}`),D.default.resolve(process.cwd(),`.${Le}.${n}`),D.default.resolve(e,`${Le}.${n}`),D.default.resolve(e,`.${Le}.${n}`)];t&&r.unshift(D.default.resolve(t,`${Le}.${n}`),D.default.resolve(t,`.${Le}.${n}`));for(const e of r)if(P.default.existsSync(e)&&P.default.lstatSync(e).isFile())return e}return Le=r("js")??Le,Le=r("json")??Le,Le=r("yaml")??Le,n&&(Le=r("ts")??Le),D.default.resolve(e,Le)}(t,e);const r=D.default.extname(n);let s;switch(r){case".js":s=require(n);break;case".json":return require(n);case".yaml":return h.load(P.default.readFileSync(n,"utf-8"));case".ts":if(Te){require(Te),s=require(n);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":s={};break;default:throw new Error(`unsupported config file type: ${r}`)}if(!s)throw new Error("config file is empty");return s.default??s}()??{},{build:Ue={}}=Ge,Ke=`./${t.relative(process.cwd(),t.resolve(("object"==typeof Ue?.output?.dir?Ue.output.dir.js:Ue?.output?.dir)??"dist"))}`,qe=/\.(css|s[ac]ss|less|styl)$/,Fe=e=>t.resolve(je,e),Qe=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),We=(e,t=Ue?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],K.default()]}],Xe=(e,n={})=>{const{path:o,name:s,input:u,output:i,external:l,pkgIsModule:c,conditionals:f}=e,d=f.includes("import"),g=f.includes("require"),h=f.includes("browser");let A;[Fe("tsconfig.json"),Fe("tsconfig.dts.json")].forEach((e=>{P.default.existsSync(e)&&P.default.statSync(e).isFile()&&(A=e)}));let R={};if(A){const e=ke(A,t.resolve(u)),{options:n,errors:r}=F.default.convertCompilerOptionsFromJson(e,t.dirname(A));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));R=n,delete R.composite}const _=[...f,...R.customConditions??[]],E={type:"progress",data:{name:s,path:o,exportConditions:_,input:u}},y=n?.output?.dir,{js:C,dts:m}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(e,Ue.plugins);return[{input:u,external:l,output:[...We({file:i,name:s,interop:"auto",sourcemap:"object"==typeof n?.output?.sourcemap?n.output.sourcemap.js:n?.output?.sourcemap,format:d?"esm":g?"cjs":h?"umd":c?"esm":"cjs",strict:"object"==typeof n?.output?.strict?n.output.strict.js:n?.output?.strict})],plugins:[a.nodeResolve({exportConditions:_}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:t.resolve(i.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),q.default({tsconfig:A}),G.default(),Ne({onEvent:(e,t)=>p.sendMessage({...E,data:{...E.data,event:e,message:t,tags:["js"]}})}),C]},{input:u,external:l,output:[{dir:t.resolve(("object"==typeof y?y.dts:y)??"dist"),sourcemap:"object"==typeof n?.output?.sourcemap?n.output.sourcemap.dts:n?.output?.sourcemap,entryFileNames:()=>i.replace(`${Ke}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof n?.output?.strict?n.output.strict.dts:n?.output?.strict}],plugins:[a.nodeResolve({exportConditions:_}),Ie({patterns:[qe]}),r.dts({respectExternal:!0,compilerOptions:R}),Ne({onEvent:(e,t)=>p.sendMessage({...E,data:{...E.data,event:e,message:t,tags:["dts"]}})}),m]}]};exports.template=function(e){const{name:r,type:o,exports:s}=e,u="module"===o;if(!r)throw new Error("package.json name is required");if(!s)throw new Error("package.json exports is required");const a=Be?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),i=Qe(r),l=function(e=process.cwd()){const t="string"==typeof e?P.default.existsSync(`${e}/package.json`)?JSON.parse(P.default.readFileSync(`${e}/package.json`,"utf-8")):{}:e,{dependencies:n={},peerDependencies:r={},optionalDependencies:o={}}=t;return Object.keys(n).concat(Object.keys(r)).concat(Object.keys(o)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(e),[c,f]=function({entrypoints:e,pkgIsModule:r,entries:o,config:s,dir:u,noFilter:a,isPublish:i}){const{build:p={},publish:{withSuffix:l=!1,withSource:c=!0}={}}=s??{},{crossModuleConvertor:f=!0}=p,d=`./${g=((...e)=>t.resolve(u??process.cwd(),...e))(("object"==typeof p?.output?.dir?p.output.dir.js:p?.output?.dir)??"dist"),t.relative(u??process.cwd(),g)}`;var g;const[,h]=n.resolveEntrypoints(e);o&&Object.entries(h).forEach((([e])=>{o.some((t=>ye.isMatch(e,t,{matchBase:!0})))||delete h[e]}));const A=a?h:n.filterLeafs(h,{skipValue:[/(^|\/)\.jk-noentry/,...n.DEFAULT_SKIP_VALUES]}),R=f?{import:e=>!r&&0===Ce(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!r||0!==Ce(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{};return[A,n.entrypoints2Exports(A,{outdir:d,withSuffix:i?l:void 0,withSource:i?c:void 0,withConditional:{...R}})]}({entrypoints:s,pkgIsModule:u,entries:a,config:Ge}),d=new Map;n.getAllLeafs(c,(({keys:e,value:t})=>{if("string"==typeof t){const n=d.get(t)??[];d.set(t,n),n.push(e)}return!1}));const g=[];return d.forEach(((e,t)=>e.forEach((e=>{const[r,...o]=e,s=i+("."===r?"":Qe(r)),a=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(f,e),p={path:r,name:s,input:t,external:l,pkgIsModule:u};switch(typeof a){case"string":g.push(...Xe({...p,output:a,conditionals:o},Ue));break;case"object":n.getAllLeafs(a,(({keys:e,value:t})=>{const n=[...new Set([...o,...e])];return"string"==typeof t&&g.push(...Xe({...p,output:t,conditionals:n},Ue)),!1}))}})))),p.sendMessage({type:"init",data:{leafMap:d,targetsLength:g.length}}),g.map((e=>({...Pe,...e,plugins:[...De,e.plugins]})))};
@@ -16,4 +16,4 @@ import e from"node:fs";import t,{resolve as n,relative as r,dirname as o}from"no
16
16
  *
17
17
  * Copyright (c) 2014-present, Jon Schlinkert.
18
18
  * Licensed under the MIT License.
19
- */function Y(){if(N)return k;N=1;const e=y,t=Z(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},i=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},u=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},a=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,g=String(e),d=String(t),A=String(n);n=Math.max(Math.abs(n),1);let h=s(g)||s(d)||s(A),R=h?Math.max(g.length,d.length,A.length):0,E=!1===h&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),_=r.transform||(e=>t=>!0===e?Number(t):String(t))(E);if(r.toRegex&&1===n)return a(u(e,R),u(t,R),!0,r);let y={negatives:[],positives:[]},m=[],C=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?y[(S=o)<0?"negatives":"positives"].push(Math.abs(S)):m.push(i(_(o,C),R,E)),o=f?o-n:o+n,C++;var S;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(y,r):p(m,null,{wrap:!1,...r}):m},g=(e,t,s,i={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,i);if("function"==typeof s)return g(e,t,1,{transform:s});if(n(s))return g(e,t,0,s);let u={...i};return!0===u.capture&&(u.wrap=!0),s=s||u.step||1,o(s)?o(e)&&o(t)?f(e,t,s,u):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),i=`${e}`.charCodeAt(0),u=`${t}`.charCodeAt(0),l=i>u,f=Math.min(i,u),g=Math.max(i,u);if(r.toRegex&&1===n)return a(f,g,!1,r);let d=[],A=0;for(;l?i>=u:i<=u;)d.push(s(i,A)),i=l?i-n:i+n,A++;return!0===r.toRegex?p(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(s),1),u):null==s||n(s)?g(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,u)};return k=g}function z(){if(K)return D;K=1;const e=X(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:i,CHAR_RIGHT_PARENTHESES:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:g,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A}=G?P:(G=1,P={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return D=(h,R={})=>{if("string"!=typeof h)throw new TypeError("Expected a string");let E=R||{},_="number"==typeof E.maxLength?Math.min(t,E.maxLength):t;if(h.length>_)throw new SyntaxError(`Input length (${h.length}), exceeds max characters (${_})`);let y,m={type:"root",input:h,nodes:[]},C=[m],S=m,b=m,v=0,x=h.length,$=0,H=0;const T=()=>h[$++],w=e=>{if("text"===e.type&&"dot"===b.type&&(b.type="text"),!b||"text"!==b.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=b,b=e,e;b.value+=e.value};for(w({type:"bos"});$<x;)if(S=C[C.length-1],y=T(),y!==A&&y!==d)if(y!==n)if(y!==c)if(y!==l)if(y!==i)if(y!==u)if(y!==f&&y!==g&&y!==r)if(y!==a)if(y!==p)if(y===o&&H>0){if(S.ranges>0){S.ranges=0;let t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}w({type:"comma",value:y}),S.commas++}else if(y===s&&H>0&&0===S.commas){let e=S.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===b.type){if(S.range=[],b.value+=y,b.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,b.type="text";continue}S.ranges++,S.args=[];continue}if("range"===b.type){e.pop();let t=e[e.length-1];t.value+=b.value+y,b=t,S.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==S.type){w({type:"text",value:y});continue}let e="close";S=C.pop(),S.close=!0,w({type:e,value:y}),H--,S=C[C.length-1]}else{H++;let e=b.value&&"$"===b.value.slice(-1)||!0===S.dollar;S=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),C.push(S),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==n){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==S.type){w({type:"text",value:y});continue}S=C.pop(),w({type:"text",value:y}),S=C[C.length-1]}else S=w({type:"paren",nodes:[]}),C.push(S),w({type:"text",value:y});else{let e;for(v++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==n){if(e===c&&(v--,0===v))break}else y+=T();else v++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(S=C.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=C[C.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(C.length>0);return w({type:"eos"}),m},D}function V(){if(F)return U;F=1;const e=X(),t=function(){if(M)return I;M=1;const e=Y(),t=W();return I=(n,r={})=>{let o=(n,s={})=>{let i=t.isInvalidBrace(s),u=!0===n.invalid&&!0===r.escapeInvalid,a=!0===i||!0===u,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return a?p+n.value:"(";if("close"===n.type)return a?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(j)return B;j=1;const e=Y(),t=X(),n=W(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return B=(o,s={})=>{let i=void 0===s.rangeLimit?1e3:s.rangeLimit,u=(o,a={})=>{o.queue=[];let p=a,l=a.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let u=n.reduce(o.nodes);if(n.exceedsLimit(...u,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let a=e(...u,s);return 0===a.length&&(a=t(o,s)),l.push(r(l.pop(),a)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,g=o;for(;"brace"!==g.type&&"root"!==g.type&&g.parent;)g=g.parent,f=g.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&u(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(u(o))}}(),r=z(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),U=o}var J,ee,te,ne,re,oe,se,ie,ue,ae,pe,le,ce,fe={};function ge(){if(ee)return J;ee=1;const e=m,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",i=`(?:${o}|$)`,u=`(?:^|${o})`,a=`${r}{1,2}${i}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${u}${a})`,NO_DOT_SLASH:`(?!${r}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:u},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return J={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function de(){return te||(te=1,function(e){const t=m,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:i}=ge();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(fe)),fe}function Ae(){if(ue)return ie;ue=1;const e=m,t=function(){if(re)return ne;re=1;const e=de(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:A}=ge(),h=e=>e===u||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return ne=(E,_)=>{const y=_||{},m=E.length-1,C=!0===y.parts||!0===y.scanToEnd,S=[],b=[],v=[];let x,$,H=E,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,G=!1,D=!1,K=0,U={value:"",depth:0,isGlob:!1};const F=()=>T>=m,Q=()=>(x=$,H.charCodeAt(++T));for(;T<m;){let e;if($=Q(),$!==r){if(!0===B||$===a){for(K++;!0!==F()&&($=Q());)if($!==r)if($!==a){if(!0!==B&&$===s&&($=Q())===s){if(O=U.isBrace=!0,N=U.isGlob=!0,D=!0,!0===C)continue;break}if(!0!==B&&$===o){if(O=U.isBrace=!0,N=U.isGlob=!0,D=!0,!0===C)continue;break}if($===g&&(K--,0===K)){B=!1,O=U.isBrace=!0,D=!0;break}}else K++;else j=U.backslashes=!0,Q();if(!0===C)continue;break}if($!==u){if(!0!==y.noext&&!0==($===c||$===n||$===t||$===f||$===i)&&H.charCodeAt(T+1)===p){if(N=U.isGlob=!0,I=U.isExtglob=!0,D=!0,$===i&&T===w&&(G=!0),!0===C){for(;!0!==F()&&($=Q());)if($!==r){if($===d){N=U.isGlob=!0,D=!0;break}}else j=U.backslashes=!0,$=Q();continue}break}if($===t){if(x===t&&(M=U.isGlobstar=!0),N=U.isGlob=!0,D=!0,!0===C)continue;break}if($===f){if(N=U.isGlob=!0,D=!0,!0===C)continue;break}if($===l){for(;!0!==F()&&(e=Q());)if(e!==r){if(e===A){k=U.isBracket=!0,N=U.isGlob=!0,D=!0;break}}else j=U.backslashes=!0,Q();if(!0===C)continue;break}if(!0===y.nonegate||$!==i||T!==w){if(!0!==y.noparen&&$===p){if(N=U.isGlob=!0,!0===C){for(;!0!==F()&&($=Q());)if($!==p){if($===d){D=!0;break}}else j=U.backslashes=!0,$=Q();continue}break}if(!0===N){if(D=!0,!0===C)continue;break}}else P=U.negated=!0,w++}else{if(S.push(T),b.push(U),U={value:"",depth:0,isGlob:!1},!0===D)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=U.backslashes=!0,$=Q(),$===a&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let W=H,X="",q="";w>0&&(X=H.slice(0,w),H=H.slice(w),L-=w),W&&!0===N&&L>0?(W=H.slice(0,L),q=H.slice(L)):!0===N?(W="",q=H):W=H,W&&""!==W&&"/"!==W&&W!==H&&h(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===y.unescape&&(q&&(q=e.removeBackslashes(q)),W&&!0===j&&(W=e.removeBackslashes(W)));const Z={prefix:X,input:E,start:w,base:W,glob:q,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:G};if(!0===y.tokens&&(Z.maxDepth=0,h($)||b.push(U),Z.tokens=b),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<S.length;t++){const n=e?e+1:w,r=S[t],o=E.slice(n,r);y.tokens&&(0===t&&0!==w?(b[t].isPrefix=!0,b[t].value=X):b[t].value=o,R(b[t]),Z.maxDepth+=b[t].depth),0===t&&""===o||v.push(o),e=r}if(e&&e+1<E.length){const t=E.slice(e+1);v.push(t),y.tokens&&(b[b.length-1].value=t,R(b[b.length-1]),Z.maxDepth+=b[b.length-1].depth)}Z.slashes=S,Z.parts=v}return Z}}(),n=function(){if(se)return oe;se=1;const e=ge(),t=de(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=e,u=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},a=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=i[l]||l;const f={...c},g="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let d=l.length;if(d>g)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${g}`);const A={type:"bos",value:"",output:f.prepend||""},h=[A],R=f.capture?"":"?:",E=t.isWindows(c),_=e.globChars(E),y=e.extglobChars(_),{DOT_LITERAL:m,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=_,k=e=>`(${R}(?:(?!${O}${e.dot?v:m}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};l=t.removePrefix(l,B),d=l.length;const j=[],P=[],G=[];let D,K=A;const U=()=>B.index===d-1,F=B.peek=(e=1)=>l[B.index+e],Q=B.advance=()=>l[++B.index]||"",W=()=>l.slice(B.index+1),X=(e="",t=0)=>{B.consumed+=e,B.index+=t},q=e=>{B.output+=null!=e.output?e.output:e.value,X(e.value)},Z=()=>{let e=1;for(;"!"===F()&&("("!==F(2)||"?"===F(3));)Q(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,G.push(e)},z=e=>{B[e]--,G.pop()},V=e=>{if("globstar"===K.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(B.output=B.output.slice(0,-K.output.length),K.type="star",K.value="*",K.output=M,B.output+=K.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&q(e),K&&"text"===K.type&&"text"===e.type)return K.value+=e.value,void(K.output=(K.output||"")+e.value);e.prev=K,h.push(e),K=e},J=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=K,n.parens=B.parens,n.output=B.output;const r=(f.capture?"(":"")+n.open;Y("parens"),V({type:e,value:t,output:B.output?"":b}),V({type:"paren",extglob:!0,value:Q(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||U()||/^\)+$/.test(W()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=W())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:D,output:n}),z("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,i)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===i?I+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?m.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(n,B,c),B)}for(;!U();){if(D=Q(),"\0"===D)continue;if("\\"===D){const e=F();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",V({type:"text",value:D});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(D+="\\")),!0===f.unescape?D=Q():D+=Q(),0===B.brackets){V({type:"text",value:D});continue}}if(B.brackets>0&&("]"!==D||"["===K.value||"[^"===K.value)){if(!1!==f.posix&&":"===D){const e=K.value.slice(1);if(e.includes("[")&&(K.posix=!0,e.includes(":"))){const e=K.value.lastIndexOf("["),t=K.value.slice(0,e),n=K.value.slice(e+2),o=r[n];if(o){K.value=t+o,B.backtrack=!0,Q(),A.output||1!==h.indexOf(K)||(A.output=b);continue}}}("["===D&&":"!==F()||"-"===D&&"]"===F())&&(D=`\\${D}`),"]"!==D||"["!==K.value&&"[^"!==K.value||(D=`\\${D}`),!0===f.posix&&"!"===D&&"["===K.value&&(D="^"),K.value+=D,q({value:D});continue}if(1===B.quotes&&'"'!==D){D=t.escapeRegex(D),K.value+=D,q({value:D});continue}if('"'===D){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&V({type:"text",value:D});continue}if("("===D){Y("parens"),V({type:"paren",value:D});continue}if(")"===D){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(a("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}V({type:"paren",value:D,output:B.parens?")":"\\)"}),z("parens");continue}if("["===D){if(!0!==f.nobracket&&W().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(a("closing","]"));D=`\\${D}`}V({type:"bracket",value:D});continue}if("]"===D){if(!0===f.nobracket||K&&"bracket"===K.type&&1===K.value.length){V({type:"text",value:D,output:`\\${D}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(a("opening","["));V({type:"text",value:D,output:`\\${D}`});continue}z("brackets");const e=K.value.slice(1);if(!0===K.posix||"^"!==e[0]||e.includes("/")||(D=`/${D}`),K.value+=D,q({value:D}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(K.value);if(B.output=B.output.slice(0,-K.value.length),!0===f.literalBrackets){B.output+=n,K.value=n;continue}K.value=`(${R}${n}|${K.value})`,B.output+=K.value;continue}if("{"===D&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:D,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),V(e);continue}if("}"===D){const e=P[P.length-1];if(!0===f.nobrace||!e){V({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=u(n,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=B.output.slice(0,e.outputIndex),r=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",B.output=n;for(const e of r)B.output+=e.output||e.value}V({type:"brace",value:D,output:t}),z("braces"),P.pop();continue}if("|"===D){j.length>0&&j[j.length-1].conditions++,V({type:"text",value:D});continue}if(","===D){let e=D;const t=P[P.length-1];t&&"braces"===G[G.length-1]&&(t.comma=!0,e="|"),V({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===K.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",h.pop(),K=A;continue}V({type:"slash",value:D,output:S});continue}if("."===D){if(B.braces>0&&"dot"===K.type){"."===K.value&&(K.output=m);const e=P[P.length-1];K.type="dots",K.output+=D,K.value+=D,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==K.type&&"slash"!==K.type){V({type:"text",value:D,output:m});continue}V({type:"dot",value:D,output:m});continue}if("?"===D){if((!K||"("!==K.value)&&!0!==f.noextglob&&"("===F()&&"?"!==F(2)){J("qmark",D);continue}if(K&&"paren"===K.type){const e=F();let n=D;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===K.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(n=`\\${D}`),V({type:"text",value:D,output:n});continue}if(!0!==f.dot&&("slash"===K.type||"bos"===K.type)){V({type:"qmark",value:D,output:w});continue}V({type:"qmark",value:D,output:T});continue}if("!"===D){if(!0!==f.noextglob&&"("===F()&&("?"!==F(2)||!/[!=<:]/.test(F(3)))){J("negate",D);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===D){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){J("plus",D);continue}if(K&&"("===K.value||!1===f.regex){V({type:"plus",value:D,output:C});continue}if(K&&("bracket"===K.type||"paren"===K.type||"brace"===K.type)||B.parens>0){V({type:"plus",value:D});continue}V({type:"plus",value:C});continue}if("@"===D){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){V({type:"at",extglob:!0,value:D,output:""});continue}V({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D=`\\${D}`);const e=o.exec(W());e&&(D+=e[0],B.index+=e[0].length),V({type:"text",value:D});continue}if(K&&("globstar"===K.type||!0===K.star)){K.type="star",K.star=!0,K.value+=D,K.output=M,B.backtrack=!0,B.globstar=!0,X(D);continue}let e=W();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",D);continue}if("star"===K.type){if(!0===f.noglobstar){X(D);continue}const t=K.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){V({type:"star",value:D,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),i=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!i){V({type:"star",value:D,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),X("/**",3)}if("bos"===t.type&&U()){K.type="globstar",K.value+=D,K.output=k(f),B.output=K.output,B.globstar=!0,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&U()){B.output=B.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=k(f)+(f.strictSlashes?")":"|$)"),K.value+=D,B.globstar=!0,B.output+=t.output+K.output,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=`${k(f)}${S}|${S}${n})`,K.value+=D,B.output+=t.output+K.output,B.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){K.type="globstar",K.value+=D,K.output=`(?:^|${S}|${k(f)}${S})`,B.output=K.output,B.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-K.output.length),K.type="globstar",K.output=k(f),K.value+=D,B.output+=K.output,B.globstar=!0,X(D);continue}const n={type:"star",value:D,output:M};!0!==f.bash?!K||"bracket"!==K.type&&"paren"!==K.type||!0!==f.regex?(B.index!==B.start&&"slash"!==K.type&&"dot"!==K.type||("dot"===K.type?(B.output+=$,K.output+=$):!0===f.dot?(B.output+=H,K.output+=H):(B.output+=N,K.output+=N),"*"!==F()&&(B.output+=b,K.output+=b)),V(n)):(n.output=D,V(n)):(n.output=".*?","bos"!==K.type&&"slash"!==K.type||(n.output=N+n.output),V(n))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(a("closing","]"));B.output=t.escapeLast(B.output,"["),z("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(a("closing",")"));B.output=t.escapeLast(B.output,"("),z("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(a("closing","}"));B.output=t.escapeLast(B.output,"{"),z("braces")}if(!0===f.strictSlashes||"star"!==K.type&&"bracket"!==K.type||V({type:"maybe_slash",value:"",output:`${S}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(r,o)=>{const s={...o},u="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,a=r.length;if(a>u)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${u}`);r=i[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:g,NO_DOT:d,NO_DOTS:A,NO_DOTS_SLASH:h,STAR:R,START_ANCHOR:E}=e.globChars(p),_=s.dot?A:d,y=s.dot?h:d,m=s.capture?"":"?:";let C=!0===s.bash?".*?":R;s.capture&&(C=`(${C})`);const S=e=>!0===e.noglobstar?C:`(${m}(?:(?!${E}${e.dot?g:l}).)*?)`,b=e=>{switch(e){case"*":return`${_}${f}${C}`;case".*":return`${l}${f}${C}`;case"*.*":return`${_}${C}${l}${f}${C}`;case"*/*":return`${_}${C}${c}${f}${y}${C}`;case"**":return _+S(s);case"**/*":return`(?:${_}${S(s)}${c})?${y}${f}${C}`;case"**/*.*":return`(?:${_}${S(s)}${c})?${y}${C}${l}${f}${C}`;case"**/.*":return`(?:${_}${S(s)}${c})?${l}${f}${C}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=b(t[1]);if(!n)return;return n+l+t[2]}}},v=t.removePrefix(r,{negated:!1,prefix:""});let x=b(v);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},oe=p}(),r=de(),o=ge(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const u=t||{},a=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(u.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(u.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:i,output:f}=s.test(n,p,t,{glob:e,posix:a}),g={glob:e,state:l,regex:p,posix:a,input:n,output:f,match:i,isMatch:o};return"function"==typeof u.onResult&&u.onResult(g),!1===o?(g.isMatch=!1,!!r&&g):c(n)?("function"==typeof u.onIgnore&&u.onIgnore(g),g.isMatch=!1,!!r&&g):("function"==typeof u.onMatch&&u.onMatch(g),!r||g)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const u=n||{},a=u.format||(i?r.toPosixSlashes:null);let p=e===o,l=p&&a?a(e):e;return!1===p&&(l=a?a(e):e,p=l===o),!1!==p&&!0!==u.capture||(p=!0===u.matchBase||!0===u.basename?s.matchBase(e,t,n,i):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,i=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},i=o.contains?"":"^",u=o.contains?"":"$";let a=`${i}(?:${e.output})${u}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const p=s.toRegex(a,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(i.output=n.fastpaths(e,t)),i.output||(i=n(e,t)),s.compileRe(i,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,ie=s}function he(){return pe?ae:(pe=1,ae=Ae())}var Re=function(){if(ce)return le;ce=1;const e=y,t=V(),n=he(),r=de(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,i=new Set,u=0,a=e=>{i.add(e.output),r&&r.onResult&&r.onResult(e)};for(let i=0;i<t.length;i++){let p=n(String(t[i]),{...r,onResult:a},!0),l=p.state.negated||p.state.negatedExtglob;l&&u++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(u===t.length?[...i]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],i=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)i.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),i={};for(let t of o)i[t]=e[t];return i},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),i=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(i)return i.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},le=s}();const Ee=(e,t)=>new Set([...e].filter((e=>t.has(e))));let _e;function ye(){if(_e)return _e;const e=C.getOptionValue("root");return _e=e?t.isAbsolute(e)?e:t.resolve(process.cwd(),e):void 0,_e}let me,Ce="";try{b(import.meta.url).resolve("@pnpm/filter-workspace-packages"),Ce="pnpm"}catch{}""!==Ce&&C.option("-f, --filter <filter>","filter packages");let Se=!1;const be=b(import.meta.url);function ve(e){try{return be.resolve(e),!0}catch(e){return!1}}let xe;const $e=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of $e)if(ve(e)){xe=e;break}let He="jiek.config";const Te=t=>{t=n(t);const r=o(t),{extends:s,...i}=(u=t,e.existsSync(u)&&e.statSync(u).isFile()?v(e.readFileSync(u,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var u;const a=(p=s?Array.isArray(s)?s:[s]:[],p?.map((e=>n(r,e)))??[]);var p;return 0===a.length?i:a.map(Te).concat(i).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},we=(e,t)=>{e=n(e),t=n(t);const r=o(e),s=Te(e),[i,u,a,p]=[s.references?.map((({path:e})=>e)),s.files,s.include,s.exclude].map((e=>e?.map((e=>n(r,e)))??[]));if(p.length>0&&p.some((e=>Re.isMatch(t,e))))return;if(0===s.files?.length&&0===s.include?.length)return;let l=!1;if(l||(l=u.length>0&&u.includes(t)),l||(l=a.length>0&&a.some((e=>Re.isMatch(t,e)))),l)return s.compilerOptions??{};if(!(s.files&&s.files.length>0||s.include&&s.include.length>0)){i.reverse();for(const e of i){const n=we(e,t);if(n)return n}return s.compilerOptions}};var Le=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Oe=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:ke,JIEK_ENTRIES:Ne}=process.env,Ie=ke??f(),Me={},Be=[d()],je=function(n){const{wd:r}=function(){if(me)return{wd:me,notWorkspace:Se};const e=ye();if(void 0!==e){const t=c(e,Ce);return Se=!t,me=e,{wd:me,notWorkspace:Se}}try{me=f(Ce)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;me=e,Se=!0}return{wd:me,notWorkspace:Se}}();let o=C.getOptionValue("configPath");if(o){if(!e.existsSync(o))throw new Error(`config file not found: ${o}`);t.isAbsolute(o)||(o=t.resolve(r,o))}else o=function(n,r){const o=!!xe;function s(o){const s=[t.resolve(process.cwd(),`${He}.${o}`),t.resolve(process.cwd(),`.${He}.${o}`),t.resolve(n,`${He}.${o}`),t.resolve(n,`.${He}.${o}`)];r&&s.unshift(t.resolve(r,`${He}.${o}`),t.resolve(r,`.${He}.${o}`));for(const t of s)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return He=s("js")??He,He=s("json")??He,He=s("yaml")??He,o&&(He=s("ts")??He),t.resolve(n,He)}(r,n);const s=t.extname(o);let i;switch(s){case".js":i=require(o);break;case".json":return require(o);case".yaml":return S(e.readFileSync(o,"utf-8"));case".ts":if(xe){require(xe),i=require(o);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":i={};break;default:throw new Error(`unsupported config file type: ${s}`)}if(!i)throw new Error("config file is empty");return i.default??i}()??{},{build:Pe={}}=je,Ge=`./${r(process.cwd(),n(("object"==typeof Pe?.output?.dir?Pe.output.dir.js:Pe?.output?.dir)??"dist"))}`,De=/\.(css|s[ac]ss|less|styl)$/,Ke=e=>n(Ie,e),Ue=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),Fe=(e,t=Pe?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],h()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],h()]}],Qe=(t,r={})=>{const{path:s,name:i,input:u,output:a,external:p,pkgIsModule:c,conditionals:f}=t,d=f.includes("import"),h=f.includes("require"),y=f.includes("browser");let m;[Ke("tsconfig.json"),Ke("tsconfig.dts.json")].forEach((t=>{e.existsSync(t)&&e.statSync(t).isFile()&&(m=t)}));let C={};if(m){const e=we(m,n(u)),{options:t,errors:r}=_.convertCompilerOptionsFromJson(e,o(m));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));C=t}const S=[...f,...C.customConditions??[]],b={type:"progress",data:{name:i,path:s,exportConditions:S,input:u}},v=r?.output?.dir,{js:x,dts:$}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(t,Pe.plugins);return[{input:u,external:p,output:[...Fe({file:a,name:i,interop:"auto",sourcemap:"object"==typeof r?.output?.sourcemap?r.output.sourcemap.js:r?.output?.sourcemap,format:d?"esm":h?"cjs":y?"umd":c?"esm":"cjs",strict:"object"==typeof r?.output?.strict?r.output.strict.js:r?.output?.strict})],plugins:[A({exportConditions:S}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:n(a.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),E({tsconfig:m}),g(),Le({onEvent:(e,t)=>R({...b,data:{...b.data,event:e,message:t,tags:["js"]}})}),x]},{input:u,external:p,output:[{dir:n(("object"==typeof v?v.dts:v)??"dist"),sourcemap:"object"==typeof r?.output?.sourcemap?r.output.sourcemap.dts:r?.output?.sourcemap,entryFileNames:()=>a.replace(`${Ge}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof r?.output?.strict?r.output.strict.dts:r?.output?.strict}],plugins:[A({exportConditions:S}),Oe({patterns:[De]}),l({respectExternal:!0,compilerOptions:C}),Le({onEvent:(e,t)=>R({...b,data:{...b.data,event:e,message:t,tags:["dts"]}})}),$]}]};function We(t){const{name:o,type:l,exports:c}=t,f="module"===l;if(!o)throw new Error("package.json name is required");if(!c)throw new Error("package.json exports is required");const g=Ne?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),d=Ue(o),A=function(t=process.cwd()){const n="string"==typeof t?e.existsSync(`${t}/package.json`)?JSON.parse(e.readFileSync(`${t}/package.json`,"utf-8")):{}:t,{dependencies:r={},peerDependencies:o={},optionalDependencies:s={}}=n;return Object.keys(r).concat(Object.keys(o)).concat(Object.keys(s)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(t),[h,E]=function({entrypoints:e,pkgIsModule:t,entries:o,config:p,dir:l,noFilter:c,isPublish:f}){const{build:g={},publish:{withSuffix:d=!1,withSource:A=!0}={}}=p??{},{crossModuleConvertor:h=!0}=g,R=`./${(e=>r(l??process.cwd(),e))(((...e)=>n(l??process.cwd(),...e))(("object"==typeof g?.output?.dir?g.output.dir.js:g?.output?.dir)??"dist"))}`,[,E]=s(e);o&&Object.entries(E).forEach((([e])=>{o.some((t=>Re.isMatch(e,t,{matchBase:!0})))||delete E[e]}));const _=c?E:i(E,{skipValue:[/(^|\/)\.jk-noentry/,...u]});return[_,a(_,{outdir:R,withSuffix:f?d:void 0,withSource:f?A:void 0,withConditional:{...h?{import:e=>!t&&0===Ee(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==Ee(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:c,pkgIsModule:f,entries:g,config:je}),_=new Map;p(h,(({keys:e,value:t})=>{if("string"==typeof t){const n=_.get(t)??[];_.set(t,n),n.push(e)}return!1}));const y=[];return _.forEach(((e,t)=>e.forEach((e=>{const[n,...r]=e,o=d+("."===n?"":Ue(n)),s=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(E,e),i={path:n,name:o,input:t,external:A,pkgIsModule:f};switch(typeof s){case"string":y.push(...Qe({...i,output:s,conditionals:r},Pe));break;case"object":p(s,(({keys:e,value:t})=>{const n=[...new Set([...r,...e])];return"string"==typeof t&&y.push(...Qe({...i,output:t,conditionals:n},Pe)),!1}))}})))),R({type:"init",data:{leafMap:_,targetsLength:y.length}}),y.map((e=>({...Me,...e,plugins:[...Be,e.plugins]})))}export{We as template};
19
+ */function Y(){if(N)return k;N=1;const e=y,t=Z(),n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>"number"==typeof e||"string"==typeof e&&""!==e,o=e=>Number.isInteger(+e),s=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},i=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},u=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},a=(e,n,r,o)=>{if(r)return t(e,n,{wrap:!1,...o});let s=String.fromCharCode(e);return e===n?s:`[${s}-${String.fromCharCode(n)}]`},p=(e,n,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return t(e,n,r)},l=(...t)=>new RangeError("Invalid range arguments: "+e.inspect(...t)),c=(e,t,n)=>{if(!0===n.strictRanges)throw l([e,t]);return[]},f=(e,t,n=1,r={})=>{let o=Number(e),c=Number(t);if(!Number.isInteger(o)||!Number.isInteger(c)){if(!0===r.strictRanges)throw l([e,t]);return[]}0===o&&(o=0),0===c&&(c=0);let f=o>c,g=String(e),d=String(t),A=String(n);n=Math.max(Math.abs(n),1);let h=s(g)||s(d)||s(A),R=h?Math.max(g.length,d.length,A.length):0,E=!1===h&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),_=r.transform||(e=>t=>!0===e?Number(t):String(t))(E);if(r.toRegex&&1===n)return a(u(e,R),u(t,R),!0,r);let y={negatives:[],positives:[]},m=[],C=0;for(;f?o>=c:o<=c;)!0===r.toRegex&&n>1?y[(S=o)<0?"negatives":"positives"].push(Math.abs(S)):m.push(i(_(o,C),R,E)),o=f?o-n:o+n,C++;var S;return!0===r.toRegex?n>1?((e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let n,r=t.capture?"":"?:",o="",s="";return e.positives.length&&(o=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=o&&s?`${o}|${s}`:o||s,t.wrap?`(${r}${n})`:n})(y,r):p(m,null,{wrap:!1,...r}):m},g=(e,t,s,i={})=>{if(null==t&&r(e))return[e];if(!r(e)||!r(t))return c(e,t,i);if("function"==typeof s)return g(e,t,1,{transform:s});if(n(s))return g(e,t,0,s);let u={...i};return!0===u.capture&&(u.wrap=!0),s=s||u.step||1,o(s)?o(e)&&o(t)?f(e,t,s,u):((e,t,n=1,r={})=>{if(!o(e)&&e.length>1||!o(t)&&t.length>1)return c(e,t,r);let s=r.transform||(e=>String.fromCharCode(e)),i=`${e}`.charCodeAt(0),u=`${t}`.charCodeAt(0),l=i>u,f=Math.min(i,u),g=Math.max(i,u);if(r.toRegex&&1===n)return a(f,g,!1,r);let d=[],A=0;for(;l?i>=u:i<=u;)d.push(s(i,A)),i=l?i-n:i+n,A++;return!0===r.toRegex?p(d,null,{wrap:!1,options:r}):d})(e,t,Math.max(Math.abs(s),1),u):null==s||n(s)?g(e,t,1,s):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(s,u)};return k=g}function z(){if(K)return D;K=1;const e=X(),{MAX_LENGTH:t,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:i,CHAR_RIGHT_PARENTHESES:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:c,CHAR_DOUBLE_QUOTE:f,CHAR_SINGLE_QUOTE:g,CHAR_NO_BREAK_SPACE:d,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A}=G?P:(G=1,P={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"});return D=(h,R={})=>{if("string"!=typeof h)throw new TypeError("Expected a string");let E=R||{},_="number"==typeof E.maxLength?Math.min(t,E.maxLength):t;if(h.length>_)throw new SyntaxError(`Input length (${h.length}), exceeds max characters (${_})`);let y,m={type:"root",input:h,nodes:[]},C=[m],S=m,b=m,v=0,x=h.length,$=0,H=0;const T=()=>h[$++],w=e=>{if("text"===e.type&&"dot"===b.type&&(b.type="text"),!b||"text"!==b.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=b,b=e,e;b.value+=e.value};for(w({type:"bos"});$<x;)if(S=C[C.length-1],y=T(),y!==A&&y!==d)if(y!==n)if(y!==c)if(y!==l)if(y!==i)if(y!==u)if(y!==f&&y!==g&&y!==r)if(y!==a)if(y!==p)if(y===o&&H>0){if(S.ranges>0){S.ranges=0;let t=S.nodes.shift();S.nodes=[t,{type:"text",value:e(S)}]}w({type:"comma",value:y}),S.commas++}else if(y===s&&H>0&&0===S.commas){let e=S.nodes;if(0===H||0===e.length){w({type:"text",value:y});continue}if("dot"===b.type){if(S.range=[],b.value+=y,b.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,b.type="text";continue}S.ranges++,S.args=[];continue}if("range"===b.type){e.pop();let t=e[e.length-1];t.value+=b.value+y,b=t,S.ranges--;continue}w({type:"dot",value:y})}else w({type:"text",value:y});else{if("brace"!==S.type){w({type:"text",value:y});continue}let e="close";S=C.pop(),S.close=!0,w({type:e,value:y}),H--,S=C[C.length-1]}else{H++;let e=b.value&&"$"===b.value.slice(-1)||!0===S.dollar;S=w({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),C.push(S),w({type:"open",value:y})}else{let e,t=y;for(!0!==R.keepQuotes&&(y="");$<x&&(e=T());)if(e!==n){if(e===t){!0===R.keepQuotes&&(y+=e);break}y+=e}else y+=e+T();w({type:"text",value:y})}else{if("paren"!==S.type){w({type:"text",value:y});continue}S=C.pop(),w({type:"text",value:y}),S=C[C.length-1]}else S=w({type:"paren",nodes:[]}),C.push(S),w({type:"text",value:y});else{let e;for(v++;$<x&&(e=T());)if(y+=e,e!==l)if(e!==n){if(e===c&&(v--,0===v))break}else y+=T();else v++;w({type:"text",value:y})}else w({type:"text",value:"\\"+y});else w({type:"text",value:(R.keepEscaping?y:"")+T()});do{if(S=C.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=C[C.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(C.length>0);return w({type:"eos"}),m},D}function V(){if(F)return U;F=1;const e=X(),t=function(){if(M)return I;M=1;const e=Y(),t=W();return I=(n,r={})=>{let o=(n,s={})=>{let i=t.isInvalidBrace(s),u=!0===n.invalid&&!0===r.escapeInvalid,a=!0===i||!0===u,p=!0===r.escapeInvalid?"\\":"",l="";if(!0===n.isOpen)return p+n.value;if(!0===n.isClose)return p+n.value;if("open"===n.type)return a?p+n.value:"(";if("close"===n.type)return a?p+n.value:")";if("comma"===n.type)return"comma"===n.prev.type?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let o=t.reduce(n.nodes),s=e(...o,{...r,wrap:!1,toRegex:!0});if(0!==s.length)return o.length>1&&s.length>1?`(${s})`:s}if(n.nodes)for(let e of n.nodes)l+=o(e,n);return l};return o(n)}}(),n=function(){if(j)return B;j=1;const e=Y(),t=X(),n=W(),r=(e="",t="",o=!1)=>{let s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return o?n.flatten(t).map((e=>`{${e}}`)):t;for(let n of e)if(Array.isArray(n))for(let e of n)s.push(r(e,t,o));else for(let e of t)!0===o&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?r(n,e,o):n+e);return n.flatten(s)};return B=(o,s={})=>{let i=void 0===s.rangeLimit?1e3:s.rangeLimit,u=(o,a={})=>{o.queue=[];let p=a,l=a.queue;for(;"brace"!==p.type&&"root"!==p.type&&p.parent;)p=p.parent,l=p.queue;if(o.invalid||o.dollar)return void l.push(r(l.pop(),t(o,s)));if("brace"===o.type&&!0!==o.invalid&&2===o.nodes.length)return void l.push(r(l.pop(),["{}"]));if(o.nodes&&o.ranges>0){let u=n.reduce(o.nodes);if(n.exceedsLimit(...u,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let a=e(...u,s);return 0===a.length&&(a=t(o,s)),l.push(r(l.pop(),a)),void(o.nodes=[])}let c=n.encloseBrace(o),f=o.queue,g=o;for(;"brace"!==g.type&&"root"!==g.type&&g.parent;)g=g.parent,f=g.queue;for(let e=0;e<o.nodes.length;e++){let t=o.nodes[e];"comma"!==t.type||"brace"!==o.type?"close"!==t.type?t.value&&"open"!==t.type?f.push(r(f.pop(),t.value)):t.nodes&&u(t,o):l.push(r(l.pop(),f,c)):(1===e&&f.push(""),f.push(""))}return f};return n.flatten(u(o))}}(),r=z(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};return o.parse=(e,t={})=>r(e,t),o.stringify=(t,n={})=>e("string"==typeof t?o.parse(t,n):t,n),o.compile=(e,n={})=>("string"==typeof e&&(e=o.parse(e,n)),t(e,n)),o.expand=(e,t={})=>{"string"==typeof e&&(e=o.parse(e,t));let r=n(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},o.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?o.compile(e,t):o.expand(e,t),U=o}var J,ee,te,ne,re,oe,se,ie,ue,ae,pe,le,ce,fe={};function ge(){if(ee)return J;ee=1;const e=m,t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",i=`(?:${o}|$)`,u=`(?:^|${o})`,a=`${r}{1,2}${i}`,p={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${u}${a})`,NO_DOT_SLASH:`(?!${r}{0,1}${i})`,NO_DOTS_SLASH:`(?!${a})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:u},l={...p,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`};return J={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?l:p}}function de(){return te||(te=1,function(e){const t=m,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:i}=ge();e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const o=t.lastIndexOf(n,r);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,n,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(fe)),fe}function Ae(){if(ue)return ie;ue=1;const e=m,t=function(){if(re)return ne;re=1;const e=de(),{CHAR_ASTERISK:t,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:c,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:d,CHAR_RIGHT_SQUARE_BRACKET:A}=ge(),h=e=>e===u||e===r,R=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};return ne=(E,_)=>{const y=_||{},m=E.length-1,C=!0===y.parts||!0===y.scanToEnd,S=[],b=[],v=[];let x,$,H=E,T=-1,w=0,L=0,O=!1,k=!1,N=!1,I=!1,M=!1,B=!1,j=!1,P=!1,G=!1,D=!1,K=0,U={value:"",depth:0,isGlob:!1};const F=()=>T>=m,Q=()=>(x=$,H.charCodeAt(++T));for(;T<m;){let e;if($=Q(),$!==r){if(!0===B||$===a){for(K++;!0!==F()&&($=Q());)if($!==r)if($!==a){if(!0!==B&&$===s&&($=Q())===s){if(O=U.isBrace=!0,N=U.isGlob=!0,D=!0,!0===C)continue;break}if(!0!==B&&$===o){if(O=U.isBrace=!0,N=U.isGlob=!0,D=!0,!0===C)continue;break}if($===g&&(K--,0===K)){B=!1,O=U.isBrace=!0,D=!0;break}}else K++;else j=U.backslashes=!0,Q();if(!0===C)continue;break}if($!==u){if(!0!==y.noext&&!0==($===c||$===n||$===t||$===f||$===i)&&H.charCodeAt(T+1)===p){if(N=U.isGlob=!0,I=U.isExtglob=!0,D=!0,$===i&&T===w&&(G=!0),!0===C){for(;!0!==F()&&($=Q());)if($!==r){if($===d){N=U.isGlob=!0,D=!0;break}}else j=U.backslashes=!0,$=Q();continue}break}if($===t){if(x===t&&(M=U.isGlobstar=!0),N=U.isGlob=!0,D=!0,!0===C)continue;break}if($===f){if(N=U.isGlob=!0,D=!0,!0===C)continue;break}if($===l){for(;!0!==F()&&(e=Q());)if(e!==r){if(e===A){k=U.isBracket=!0,N=U.isGlob=!0,D=!0;break}}else j=U.backslashes=!0,Q();if(!0===C)continue;break}if(!0===y.nonegate||$!==i||T!==w){if(!0!==y.noparen&&$===p){if(N=U.isGlob=!0,!0===C){for(;!0!==F()&&($=Q());)if($!==p){if($===d){D=!0;break}}else j=U.backslashes=!0,$=Q();continue}break}if(!0===N){if(D=!0,!0===C)continue;break}}else P=U.negated=!0,w++}else{if(S.push(T),b.push(U),U={value:"",depth:0,isGlob:!1},!0===D)continue;if(x===s&&T===w+1){w+=2;continue}L=T+1}}else j=U.backslashes=!0,$=Q(),$===a&&(B=!0)}!0===y.noext&&(I=!1,N=!1);let W=H,X="",q="";w>0&&(X=H.slice(0,w),H=H.slice(w),L-=w),W&&!0===N&&L>0?(W=H.slice(0,L),q=H.slice(L)):!0===N?(W="",q=H):W=H,W&&""!==W&&"/"!==W&&W!==H&&h(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===y.unescape&&(q&&(q=e.removeBackslashes(q)),W&&!0===j&&(W=e.removeBackslashes(W)));const Z={prefix:X,input:E,start:w,base:W,glob:q,isBrace:O,isBracket:k,isGlob:N,isExtglob:I,isGlobstar:M,negated:P,negatedExtglob:G};if(!0===y.tokens&&(Z.maxDepth=0,h($)||b.push(U),Z.tokens=b),!0===y.parts||!0===y.tokens){let e;for(let t=0;t<S.length;t++){const n=e?e+1:w,r=S[t],o=E.slice(n,r);y.tokens&&(0===t&&0!==w?(b[t].isPrefix=!0,b[t].value=X):b[t].value=o,R(b[t]),Z.maxDepth+=b[t].depth),0===t&&""===o||v.push(o),e=r}if(e&&e+1<E.length){const t=E.slice(e+1);v.push(t),y.tokens&&(b[b.length-1].value=t,R(b[b.length-1]),Z.maxDepth+=b[b.length-1].depth)}Z.slashes=S,Z.parts=v}return Z}}(),n=function(){if(se)return oe;se=1;const e=ge(),t=de(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=e,u=(e,n)=>{if("function"==typeof n.expandRange)return n.expandRange(...e,n);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((e=>t.escapeRegex(e))).join("..")}return r},a=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(l,c)=>{if("string"!=typeof l)throw new TypeError("Expected a string");l=i[l]||l;const f={...c},g="number"==typeof f.maxLength?Math.min(n,f.maxLength):n;let d=l.length;if(d>g)throw new SyntaxError(`Input length: ${d}, exceeds maximum allowed length: ${g}`);const A={type:"bos",value:"",output:f.prepend||""},h=[A],R=f.capture?"":"?:",E=t.isWindows(c),_=e.globChars(E),y=e.extglobChars(_),{DOT_LITERAL:m,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:x,NO_DOT_SLASH:$,NO_DOTS_SLASH:H,QMARK:T,QMARK_NO_DOT:w,STAR:L,START_ANCHOR:O}=_,k=e=>`(${R}(?:(?!${O}${e.dot?v:m}).)*?)`,N=f.dot?"":x,I=f.dot?T:w;let M=!0===f.bash?k(f):L;f.capture&&(M=`(${M})`),"boolean"==typeof f.noext&&(f.noextglob=f.noext);const B={input:l,index:-1,start:0,dot:!0===f.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};l=t.removePrefix(l,B),d=l.length;const j=[],P=[],G=[];let D,K=A;const U=()=>B.index===d-1,F=B.peek=(e=1)=>l[B.index+e],Q=B.advance=()=>l[++B.index]||"",W=()=>l.slice(B.index+1),X=(e="",t=0)=>{B.consumed+=e,B.index+=t},q=e=>{B.output+=null!=e.output?e.output:e.value,X(e.value)},Z=()=>{let e=1;for(;"!"===F()&&("("!==F(2)||"?"===F(3));)Q(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Y=e=>{B[e]++,G.push(e)},z=e=>{B[e]--,G.pop()},V=e=>{if("globstar"===K.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||j.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(B.output=B.output.slice(0,-K.output.length),K.type="star",K.value="*",K.output=M,B.output+=K.output)}if(j.length&&"paren"!==e.type&&(j[j.length-1].inner+=e.value),(e.value||e.output)&&q(e),K&&"text"===K.type&&"text"===e.type)return K.value+=e.value,void(K.output=(K.output||"")+e.value);e.prev=K,h.push(e),K=e},J=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=K,n.parens=B.parens,n.output=B.output;const r=(f.capture?"(":"")+n.open;Y("parens"),V({type:e,value:t,output:B.output?"":b}),V({type:"paren",extglob:!0,value:Q(),output:r}),j.push(n)},ee=e=>{let t,n=e.close+(f.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=k(f)),(r!==M||U()||/^\)+$/.test(W()))&&(n=e.close=`)$))${r}`),e.inner.includes("*")&&(t=W())&&/^\.[^\\/.]+$/.test(t)){const o=p(t,{...c,fastpaths:!1}).output;n=e.close=`)${o})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:D,output:n}),z("parens")};if(!1!==f.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(l)){let e=!1,n=l.replace(s,((t,n,r,o,s,i)=>"\\"===o?(e=!0,t):"?"===o?n?n+o+(s?T.repeat(s.length):""):0===i?I+(s?T.repeat(s.length):""):T.repeat(r.length):"."===o?m.repeat(r.length):"*"===o?n?n+o+(s?M:""):M:n?t:`\\${t}`));return!0===e&&(n=!0===f.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),n===l&&!0===f.contains?(B.output=l,B):(B.output=t.wrapOutput(n,B,c),B)}for(;!U();){if(D=Q(),"\0"===D)continue;if("\\"===D){const e=F();if("/"===e&&!0!==f.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",V({type:"text",value:D});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(D+="\\")),!0===f.unescape?D=Q():D+=Q(),0===B.brackets){V({type:"text",value:D});continue}}if(B.brackets>0&&("]"!==D||"["===K.value||"[^"===K.value)){if(!1!==f.posix&&":"===D){const e=K.value.slice(1);if(e.includes("[")&&(K.posix=!0,e.includes(":"))){const e=K.value.lastIndexOf("["),t=K.value.slice(0,e),n=K.value.slice(e+2),o=r[n];if(o){K.value=t+o,B.backtrack=!0,Q(),A.output||1!==h.indexOf(K)||(A.output=b);continue}}}("["===D&&":"!==F()||"-"===D&&"]"===F())&&(D=`\\${D}`),"]"!==D||"["!==K.value&&"[^"!==K.value||(D=`\\${D}`),!0===f.posix&&"!"===D&&"["===K.value&&(D="^"),K.value+=D,q({value:D});continue}if(1===B.quotes&&'"'!==D){D=t.escapeRegex(D),K.value+=D,q({value:D});continue}if('"'===D){B.quotes=1===B.quotes?0:1,!0===f.keepQuotes&&V({type:"text",value:D});continue}if("("===D){Y("parens"),V({type:"paren",value:D});continue}if(")"===D){if(0===B.parens&&!0===f.strictBrackets)throw new SyntaxError(a("opening","("));const e=j[j.length-1];if(e&&B.parens===e.parens+1){ee(j.pop());continue}V({type:"paren",value:D,output:B.parens?")":"\\)"}),z("parens");continue}if("["===D){if(!0!==f.nobracket&&W().includes("]"))Y("brackets");else{if(!0!==f.nobracket&&!0===f.strictBrackets)throw new SyntaxError(a("closing","]"));D=`\\${D}`}V({type:"bracket",value:D});continue}if("]"===D){if(!0===f.nobracket||K&&"bracket"===K.type&&1===K.value.length){V({type:"text",value:D,output:`\\${D}`});continue}if(0===B.brackets){if(!0===f.strictBrackets)throw new SyntaxError(a("opening","["));V({type:"text",value:D,output:`\\${D}`});continue}z("brackets");const e=K.value.slice(1);if(!0===K.posix||"^"!==e[0]||e.includes("/")||(D=`/${D}`),K.value+=D,q({value:D}),!1===f.literalBrackets||t.hasRegexChars(e))continue;const n=t.escapeRegex(K.value);if(B.output=B.output.slice(0,-K.value.length),!0===f.literalBrackets){B.output+=n,K.value=n;continue}K.value=`(${R}${n}|${K.value})`,B.output+=K.value;continue}if("{"===D&&!0!==f.nobrace){Y("braces");const e={type:"brace",value:D,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),V(e);continue}if("}"===D){const e=P[P.length-1];if(!0===f.nobrace||!e){V({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=u(n,f),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=B.output.slice(0,e.outputIndex),r=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",B.output=n;for(const e of r)B.output+=e.output||e.value}V({type:"brace",value:D,output:t}),z("braces"),P.pop();continue}if("|"===D){j.length>0&&j[j.length-1].conditions++,V({type:"text",value:D});continue}if(","===D){let e=D;const t=P[P.length-1];t&&"braces"===G[G.length-1]&&(t.comma=!0,e="|"),V({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===K.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",h.pop(),K=A;continue}V({type:"slash",value:D,output:S});continue}if("."===D){if(B.braces>0&&"dot"===K.type){"."===K.value&&(K.output=m);const e=P[P.length-1];K.type="dots",K.output+=D,K.value+=D,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==K.type&&"slash"!==K.type){V({type:"text",value:D,output:m});continue}V({type:"dot",value:D,output:m});continue}if("?"===D){if((!K||"("!==K.value)&&!0!==f.noextglob&&"("===F()&&"?"!==F(2)){J("qmark",D);continue}if(K&&"paren"===K.type){const e=F();let n=D;if("<"===e&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===K.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(n=`\\${D}`),V({type:"text",value:D,output:n});continue}if(!0!==f.dot&&("slash"===K.type||"bos"===K.type)){V({type:"qmark",value:D,output:w});continue}V({type:"qmark",value:D,output:T});continue}if("!"===D){if(!0!==f.noextglob&&"("===F()&&("?"!==F(2)||!/[!=<:]/.test(F(3)))){J("negate",D);continue}if(!0!==f.nonegate&&0===B.index){Z();continue}}if("+"===D){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){J("plus",D);continue}if(K&&"("===K.value||!1===f.regex){V({type:"plus",value:D,output:C});continue}if(K&&("bracket"===K.type||"paren"===K.type||"brace"===K.type)||B.parens>0){V({type:"plus",value:D});continue}V({type:"plus",value:C});continue}if("@"===D){if(!0!==f.noextglob&&"("===F()&&"?"!==F(2)){V({type:"at",extglob:!0,value:D,output:""});continue}V({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D=`\\${D}`);const e=o.exec(W());e&&(D+=e[0],B.index+=e[0].length),V({type:"text",value:D});continue}if(K&&("globstar"===K.type||!0===K.star)){K.type="star",K.star=!0,K.value+=D,K.output=M,B.backtrack=!0,B.globstar=!0,X(D);continue}let e=W();if(!0!==f.noextglob&&/^\([^?]/.test(e)){J("star",D);continue}if("star"===K.type){if(!0===f.noglobstar){X(D);continue}const t=K.prev,n=t.prev,r="slash"===t.type||"bos"===t.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===f.bash&&(!r||e[0]&&"/"!==e[0])){V({type:"star",value:D,output:""});continue}const s=B.braces>0&&("comma"===t.type||"brace"===t.type),i=j.length&&("pipe"===t.type||"paren"===t.type);if(!r&&"paren"!==t.type&&!s&&!i){V({type:"star",value:D,output:""});continue}for(;"/**"===e.slice(0,3);){const t=l[B.index+4];if(t&&"/"!==t)break;e=e.slice(3),X("/**",3)}if("bos"===t.type&&U()){K.type="globstar",K.value+=D,K.output=k(f),B.output=K.output,B.globstar=!0,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&!o&&U()){B.output=B.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=k(f)+(f.strictSlashes?")":"|$)"),K.value+=D,B.globstar=!0,B.output+=t.output+K.output,X(D);continue}if("slash"===t.type&&"bos"!==t.prev.type&&"/"===e[0]){const n=void 0!==e[1]?"|$":"";B.output=B.output.slice(0,-(t.output+K.output).length),t.output=`(?:${t.output}`,K.type="globstar",K.output=`${k(f)}${S}|${S}${n})`,K.value+=D,B.output+=t.output+K.output,B.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}if("bos"===t.type&&"/"===e[0]){K.type="globstar",K.value+=D,K.output=`(?:^|${S}|${k(f)}${S})`,B.output=K.output,B.globstar=!0,X(D+Q()),V({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-K.output.length),K.type="globstar",K.output=k(f),K.value+=D,B.output+=K.output,B.globstar=!0,X(D);continue}const n={type:"star",value:D,output:M};!0!==f.bash?!K||"bracket"!==K.type&&"paren"!==K.type||!0!==f.regex?(B.index!==B.start&&"slash"!==K.type&&"dot"!==K.type||("dot"===K.type?(B.output+=$,K.output+=$):!0===f.dot?(B.output+=H,K.output+=H):(B.output+=N,K.output+=N),"*"!==F()&&(B.output+=b,K.output+=b)),V(n)):(n.output=D,V(n)):(n.output=".*?","bos"!==K.type&&"slash"!==K.type||(n.output=N+n.output),V(n))}for(;B.brackets>0;){if(!0===f.strictBrackets)throw new SyntaxError(a("closing","]"));B.output=t.escapeLast(B.output,"["),z("brackets")}for(;B.parens>0;){if(!0===f.strictBrackets)throw new SyntaxError(a("closing",")"));B.output=t.escapeLast(B.output,"("),z("parens")}for(;B.braces>0;){if(!0===f.strictBrackets)throw new SyntaxError(a("closing","}"));B.output=t.escapeLast(B.output,"{"),z("braces")}if(!0===f.strictSlashes||"star"!==K.type&&"bracket"!==K.type||V({type:"maybe_slash",value:"",output:`${S}?`}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};return p.fastpaths=(r,o)=>{const s={...o},u="number"==typeof s.maxLength?Math.min(n,s.maxLength):n,a=r.length;if(a>u)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${u}`);r=i[r]||r;const p=t.isWindows(o),{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:f,DOTS_SLASH:g,NO_DOT:d,NO_DOTS:A,NO_DOTS_SLASH:h,STAR:R,START_ANCHOR:E}=e.globChars(p),_=s.dot?A:d,y=s.dot?h:d,m=s.capture?"":"?:";let C=!0===s.bash?".*?":R;s.capture&&(C=`(${C})`);const S=e=>!0===e.noglobstar?C:`(${m}(?:(?!${E}${e.dot?g:l}).)*?)`,b=e=>{switch(e){case"*":return`${_}${f}${C}`;case".*":return`${l}${f}${C}`;case"*.*":return`${_}${C}${l}${f}${C}`;case"*/*":return`${_}${C}${c}${f}${y}${C}`;case"**":return _+S(s);case"**/*":return`(?:${_}${S(s)}${c})?${y}${f}${C}`;case"**/*.*":return`(?:${_}${S(s)}${c})?${y}${C}${l}${f}${C}`;case"**/.*":return`(?:${_}${S(s)}${c})?${l}${f}${C}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=b(t[1]);if(!n)return;return n+l+t[2]}}},v=t.removePrefix(r,{negated:!1,prefix:""});let x=b(v);return x&&!0!==s.strictSlashes&&(x+=`${c}?`),x},oe=p}(),r=de(),o=ge(),s=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>s(e,t,n))),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const o=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const u=t||{},a=r.isWindows(t),p=o?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=p.state;delete p.state;let c=()=>!1;if(u.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=s(u.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:i,output:f}=s.test(n,p,t,{glob:e,posix:a}),g={glob:e,state:l,regex:p,posix:a,input:n,output:f,match:i,isMatch:o};return"function"==typeof u.onResult&&u.onResult(g),!1===o?(g.isMatch=!1,!!r&&g):c(n)?("function"==typeof u.onIgnore&&u.onIgnore(g),g.isMatch=!1,!!r&&g):("function"==typeof u.onMatch&&u.onMatch(g),!r||g)};return n&&(f.state=l),f};return s.test=(e,t,n,{glob:o,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const u=n||{},a=u.format||(i?r.toPosixSlashes:null);let p=e===o,l=p&&a?a(e):e;return!1===p&&(l=a?a(e):e,p=l===o),!1!==p&&!0!==u.capture||(p=!0===u.matchBase||!0===u.basename?s.matchBase(e,t,n,i):t.exec(l)),{isMatch:Boolean(p),match:p,output:l}},s.matchBase=(t,n,o,i=r.isWindows(o))=>(n instanceof RegExp?n:s.makeRe(n,o)).test(e.basename(t)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map((e=>s.parse(e,t))):n(e,{...t,fastpaths:!1}),s.scan=(e,n)=>t(e,n),s.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},i=o.contains?"":"^",u=o.contains?"":"$";let a=`${i}(?:${e.output})${u}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const p=s.toRegex(a,t);return!0===r&&(p.state=e),p},s.makeRe=(e,t={},r=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(i.output=n.fastpaths(e,t)),i.output||(i=n(e,t)),s.compileRe(i,t,r,o)},s.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},s.constants=o,ie=s}function he(){return pe?ae:(pe=1,ae=Ae())}var Re=function(){if(ce)return le;ce=1;const e=y,t=V(),n=he(),r=de(),o=e=>""===e||"./"===e,s=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let o=new Set,s=new Set,i=new Set,u=0,a=e=>{i.add(e.output),r&&r.onResult&&r.onResult(e)};for(let i=0;i<t.length;i++){let p=n(String(t[i]),{...r,onResult:a},!0),l=p.state.negated||p.state.negatedExtglob;l&&u++;for(let t of e){let e=p(t,!0);(l?!e.isMatch:e.isMatch)&&(l?o.add(e.output):(o.delete(e.output),s.add(e.output)))}}let p=(u===t.length?[...i]:[...s]).filter((e=>!o.has(e)));if(r&&0===p.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return p};return s.match=s,s.matcher=(e,t)=>n(e,t),s.any=s.isMatch=(e,t,r)=>n(t,r)(e),s.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,o=[],i=new Set(s(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),o.push(e.output)}}));for(let e of o)i.has(e)||r.add(e);return[...r]},s.contains=(t,n,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);if(Array.isArray(n))return n.some((e=>s.contains(t,e,r)));if("string"==typeof n){if(o(t)||o(n))return!1;if(t.includes(n)||t.startsWith("./")&&t.slice(2).includes(n))return!0}return s.isMatch(t,n,{...r,contains:!0})},s.matchKeys=(e,t,n)=>{if(!r.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=s(Object.keys(e),t,n),i={};for(let t of o)i[t]=e[t];return i},s.some=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(o.some((e=>t(e))))return!0}return!1},s.every=(e,t,r)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=n(String(e),r);if(!o.every((e=>t(e))))return!1}return!0},s.all=(t,r,o)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${e.inspect(t)}"`);return[].concat(r).every((e=>n(e,o)(t)))},s.capture=(e,t,o)=>{let s=r.isWindows(o),i=n.makeRe(String(e),{...o,capture:!0}).exec(s?r.toPosixSlashes(t):t);if(i)return i.slice(1).map((e=>void 0===e?"":e))},s.makeRe=(...e)=>n.makeRe(...e),s.scan=(...e)=>n.scan(...e),s.parse=(e,r)=>{let o=[];for(let s of[].concat(e||[]))for(let e of t(String(s),r))o.push(n.parse(e,r));return o},s.braces=(e,n)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return n&&!0===n.nobrace||!/\{.*\}/.test(e)?[e]:t(e,n)},s.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return s.braces(e,{...t,expand:!0})},le=s}();const Ee=(e,t)=>new Set([...e].filter((e=>t.has(e))));let _e;function ye(){if(_e)return _e;const e=C.getOptionValue("root");return _e=e?t.isAbsolute(e)?e:t.resolve(process.cwd(),e):void 0,_e}let me,Ce="";try{b(import.meta.url).resolve("@pnpm/filter-workspace-packages"),Ce="pnpm"}catch{}""!==Ce&&C.option("-f, --filter <filter>","filter packages");let Se=!1;const be=b(import.meta.url);function ve(e){try{return be.resolve(e),!0}catch(e){return!1}}let xe;const $e=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of $e)if(ve(e)){xe=e;break}let He="jiek.config";const Te=t=>{t=n(t);const r=o(t),{extends:s,...i}=(u=t,e.existsSync(u)&&e.statSync(u).isFile()?v(e.readFileSync(u,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var u;const a=(p=s?Array.isArray(s)?s:[s]:[],p?.map((e=>n(r,e)))??[]);var p;return 0===a.length?i:a.map(Te).concat(i).reduce(((e,{compilerOptions:t={},references:n,...r})=>({...e,...r,compilerOptions:{...e.compilerOptions,...t}})),{})},we=(e,t)=>{e=n(e),t=n(t);const r=o(e),s=Te(e),[i,u,a,p]=[s.references?.map((({path:e})=>e)),s.files,s.include,s.exclude].map((e=>e?.map((e=>n(r,e)))??[]));if(p.length>0&&p.some((e=>Re.isMatch(t,e))))return;if(0===s.files?.length&&0===s.include?.length)return;let l=!1;if(l||(l=u.length>0&&u.includes(t)),l||(l=a.length>0&&a.some((e=>Re.isMatch(t,e)))),l)return s.compilerOptions??{};if(!(s.files&&s.files.length>0||s.include&&s.include.length>0)){i.reverse();for(const e of i){const n=we(e,t);if(n)return n}return s.compilerOptions}};var Le=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,n)=>t?.("transform",`Transforming ${n}...`)}}},Oe=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:ke,JIEK_ENTRIES:Ne}=process.env,Ie=ke??f(),Me={},Be=[d()],je=function(n){const{wd:r}=function(){if(me)return{wd:me,notWorkspace:Se};const e=ye();if(void 0!==e){const t=c(e,Ce);return Se=!t,me=e,{wd:me,notWorkspace:Se}}try{me=f(Ce)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;me=e,Se=!0}return{wd:me,notWorkspace:Se}}();let o=C.getOptionValue("configPath");if(o){if(!e.existsSync(o))throw new Error(`config file not found: ${o}`);t.isAbsolute(o)||(o=t.resolve(r,o))}else o=function(n,r){const o=!!xe;function s(o){const s=[t.resolve(process.cwd(),`${He}.${o}`),t.resolve(process.cwd(),`.${He}.${o}`),t.resolve(n,`${He}.${o}`),t.resolve(n,`.${He}.${o}`)];r&&s.unshift(t.resolve(r,`${He}.${o}`),t.resolve(r,`.${He}.${o}`));for(const t of s)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return He=s("js")??He,He=s("json")??He,He=s("yaml")??He,o&&(He=s("ts")??He),t.resolve(n,He)}(r,n);const s=t.extname(o);let i;switch(s){case".js":i=require(o);break;case".json":return require(o);case".yaml":return S(e.readFileSync(o,"utf-8"));case".ts":if(xe){require(xe),i=require(o);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":i={};break;default:throw new Error(`unsupported config file type: ${s}`)}if(!i)throw new Error("config file is empty");return i.default??i}()??{},{build:Pe={}}=je,Ge=`./${r(process.cwd(),n(("object"==typeof Pe?.output?.dir?Pe.output.dir.js:Pe?.output?.dir)??"dist"))}`,De=/\.(css|s[ac]ss|less|styl)$/,Ke=e=>n(Ie,e),Ue=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),Fe=(e,t=Pe?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],h()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],h()]}],Qe=(t,r={})=>{const{path:s,name:i,input:u,output:a,external:p,pkgIsModule:c,conditionals:f}=t,d=f.includes("import"),h=f.includes("require"),y=f.includes("browser");let m;[Ke("tsconfig.json"),Ke("tsconfig.dts.json")].forEach((t=>{e.existsSync(t)&&e.statSync(t).isFile()&&(m=t)}));let C={};if(m){const e=we(m,n(u)),{options:t,errors:r}=_.convertCompilerOptionsFromJson(e,o(m));if(r.length>0)throw new Error(r.map((e=>e.messageText)).join("\n"));C=t,delete C.composite}const S=[...f,...C.customConditions??[]],b={type:"progress",data:{name:i,path:s,exportConditions:S,input:u}},v=r?.output?.dir,{js:x,dts:$}=((e,t)=>{if(!1===t||null==t)return{js:[],dts:[]};let n=[],r=[];switch(typeof t){case"function":n=t("js",e),r=t("dts",e);break;case"object":"js"in t||"dts"in t?(n=t.js??[],r=t.dts??[]):(n=t,r=t)}return{js:n,dts:r}})(t,Pe.plugins);return[{input:u,external:p,output:[...Fe({file:a,name:i,interop:"auto",sourcemap:"object"==typeof r?.output?.sourcemap?r.output.sourcemap.js:r?.output?.sourcemap,format:d?"esm":h?"cjs":y?"umd":c?"esm":"cjs",strict:"object"==typeof r?.output?.strict?r.output.strict.js:r?.output?.strict})],plugins:[A({exportConditions:S}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:n(a.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),E({tsconfig:m}),g(),Le({onEvent:(e,t)=>R({...b,data:{...b.data,event:e,message:t,tags:["js"]}})}),x]},{input:u,external:p,output:[{dir:n(("object"==typeof v?v.dts:v)??"dist"),sourcemap:"object"==typeof r?.output?.sourcemap?r.output.sourcemap.dts:r?.output?.sourcemap,entryFileNames:()=>a.replace(`${Ge}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof r?.output?.strict?r.output.strict.dts:r?.output?.strict}],plugins:[A({exportConditions:S}),Oe({patterns:[De]}),l({respectExternal:!0,compilerOptions:C}),Le({onEvent:(e,t)=>R({...b,data:{...b.data,event:e,message:t,tags:["dts"]}})}),$]}]};function We(t){const{name:o,type:l,exports:c}=t,f="module"===l;if(!o)throw new Error("package.json name is required");if(!c)throw new Error("package.json exports is required");const g=Ne?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),d=Ue(o),A=function(t=process.cwd()){const n="string"==typeof t?e.existsSync(`${t}/package.json`)?JSON.parse(e.readFileSync(`${t}/package.json`,"utf-8")):{}:t,{dependencies:r={},peerDependencies:o={},optionalDependencies:s={}}=n;return Object.keys(r).concat(Object.keys(o)).concat(Object.keys(s)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(t),[h,E]=function({entrypoints:e,pkgIsModule:t,entries:o,config:p,dir:l,noFilter:c,isPublish:f}){const{build:g={},publish:{withSuffix:d=!1,withSource:A=!0}={}}=p??{},{crossModuleConvertor:h=!0}=g,R=`./${(e=>r(l??process.cwd(),e))(((...e)=>n(l??process.cwd(),...e))(("object"==typeof g?.output?.dir?g.output.dir.js:g?.output?.dir)??"dist"))}`,[,E]=s(e);o&&Object.entries(E).forEach((([e])=>{o.some((t=>Re.isMatch(e,t,{matchBase:!0})))||delete E[e]}));const _=c?E:i(E,{skipValue:[/(^|\/)\.jk-noentry/,...u]});return[_,a(_,{outdir:R,withSuffix:f?d:void 0,withSource:f?A:void 0,withConditional:{...h?{import:e=>!t&&0===Ee(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==Ee(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:c,pkgIsModule:f,entries:g,config:je}),_=new Map;p(h,(({keys:e,value:t})=>{if("string"==typeof t){const n=_.get(t)??[];_.set(t,n),n.push(e)}return!1}));const y=[];return _.forEach(((e,t)=>e.forEach((e=>{const[n,...r]=e,o=d+("."===n?"":Ue(n)),s=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(E,e),i={path:n,name:o,input:t,external:A,pkgIsModule:f};switch(typeof s){case"string":y.push(...Qe({...i,output:s,conditionals:r},Pe));break;case"object":p(s,(({keys:e,value:t})=>{const n=[...new Set([...r,...e])];return"string"==typeof t&&y.push(...Qe({...i,output:t,conditionals:n},Pe)),!1}))}})))),R({type:"init",data:{leafMap:_,targetsLength:y.length}}),y.map((e=>({...Me,...e,plugins:[...Be,e.plugins]})))}export{We as template};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jiek",
3
3
  "type": "module",
4
- "version": "1.0.4",
4
+ "version": "1.0.6",
5
5
  "description": "YiJie's personal kits.",
6
6
  "bin": {
7
7
  "jiek": "bin/jiek.js",
@@ -24,12 +24,15 @@ program
24
24
  .command('build')
25
25
  .option('-s, --silent', "Don't display logs.")
26
26
  .option('-e, --entries <ENTRIES>', "Specify the entries of the package.json's 'exports' field.(support glob)")
27
+ .option('-v, --verbose', 'Display debug logs.')
27
28
  .action(async ({
28
29
  silent,
29
- entries
30
+ entries,
31
+ verbose
30
32
  }: {
31
33
  silent: boolean
32
34
  entries: string
35
+ verbose: boolean
33
36
  }) => {
34
37
  actionRestore()
35
38
  const { build } = loadConfig()
@@ -148,6 +151,7 @@ program
148
151
  code === 0
149
152
  ? resolve()
150
153
  : reject(new Error(`rollup build failed:\n${errorStr}`)))
154
+ verbose && child.stdout?.pipe(process.stdout)
151
155
  })
152
156
  })
153
157
  ).finally(() => {
@@ -167,6 +167,7 @@ const generateConfigs = (context: ConfigGenerateContext, options: TemplateOption
167
167
  throw new Error(errors.map(e => e.messageText).join('\n'))
168
168
  }
169
169
  compilerOptions = options
170
+ delete compilerOptions.composite
170
171
  }
171
172
  const exportConditions = [...conditionals, ...(compilerOptions.customConditions ?? [])]
172
173
  const throughEventProps: RollupProgressEvent & { type: 'progress' } = {