@raclettejs/core 0.1.30 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +18 -3
  2. package/dist/cli.js +1562 -0
  3. package/dist/cli.js.map +7 -0
  4. package/dist/index.js +452 -0
  5. package/dist/index.js.map +7 -0
  6. package/package.json +4 -4
  7. package/services/backend/.yarn/install-state.gz +0 -0
  8. package/services/backend/dist/core/eventBus/index.js +7 -0
  9. package/services/backend/dist/core/pluginSystem/configGenerator/index.js +346 -0
  10. package/services/backend/dist/core/sockets/index.js +95 -0
  11. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/events/index.js +31 -0
  12. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/index.js +48 -0
  13. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/routes/index.js +15 -0
  14. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/events/index.js +22 -0
  15. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/index.js +51 -0
  16. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/routes/index.js +19 -0
  17. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/events/index.js +22 -0
  18. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/index.js +48 -0
  19. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/index.js +19 -0
  20. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/events/index.js +31 -0
  21. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/index.js +49 -0
  22. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/routes/index.js +16 -0
  23. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/events/index.js +39 -0
  24. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/index.js +50 -0
  25. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/routes/index.js +19 -0
  26. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/events/index.js +31 -0
  27. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/index.js +51 -0
  28. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/routes/index.js +21 -0
  29. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/events/index.js +31 -0
  30. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/index.js +48 -0
  31. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/routes/index.js +15 -0
  32. package/services/backend/dist/corePlugins/raclette__core/backend/index.js +34 -0
  33. package/services/backend/dist/domains/index.js +11 -0
  34. package/services/backend/dist/domains/system/index.js +11 -0
  35. package/services/backend/dist/domains/system/routes/index.js +17 -0
  36. package/services/backend/dist/helpers/index.js +14 -0
  37. package/services/backend/dist/index.js +3 -0
  38. package/services/backend/dist/modules/authentication/index.js +253 -0
  39. package/services/backend/dist/shared/types/core/index.js +8 -0
  40. package/services/backend/dist/shared/types/dataTypes/index.js +6 -0
  41. package/services/backend/dist/shared/types/index.js +8 -0
  42. package/services/backend/dist/shared/types/plugins/index.js +8 -0
  43. package/services/backend/dist/types/index.js +12 -0
  44. package/services/backend/dist/utils/index.js +2 -0
  45. package/services/frontend/.yarn/install-state.gz +0 -0
  46. package/services/frontend/src/orchestrator/assets/styles/layers.css +1 -1
  47. package/services/frontend/src/orchestrator/assets/styles/tailwindStyles.css +3 -3
  48. package/package/LICENSE.md +0 -699
  49. package/package/README.md +0 -49
  50. package/package/dev/README.md +0 -4
  51. package/package/index.js +0 -11
  52. package/package/raclette.default.config.yaml +0 -60
  53. package/package/services/backend/README.md +0 -172
  54. package/package/services/backend/yarn.lock +0 -5320
  55. package/package/services/frontend/README.md +0 -511
  56. package/package/services/frontend/src/core/lib/eggs/readme.md +0 -75
  57. package/package/services/frontend/yarn.lock +0 -0
  58. package/package/src/README.md +0 -404
  59. package/package/templates/README.md +0 -0
package/dist/cli.js ADDED
@@ -0,0 +1,1562 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
+ var Nh=Object.create;var fo=Object.defineProperty;var Lh=Object.getOwnPropertyDescriptor;var Ih=Object.getOwnPropertyNames;var Fh=Object.getPrototypeOf,jh=Object.prototype.hasOwnProperty;var M=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var vt=(e,t)=>()=>(e&&(t=e(e=0)),t);var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mh=(e,t)=>{for(var r in t)fo(e,r,{get:t[r],enumerable:!0})},Bh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ih(t))!jh.call(e,o)&&o!==r&&fo(e,o,{get:()=>t[o],enumerable:!(n=Lh(t,o))||n.enumerable});return e};var Ht=(e,t,r)=>(r=e!=null?Nh(Fh(e)):{},Bh(t||!e||!e.__esModule?fo(r,"default",{value:e,enumerable:!0}):r,e));var yr=k(_o=>{var Yr=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},bo=class extends Yr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};_o.CommanderError=Yr;_o.InvalidArgumentError=bo});var Kr=k(xo=>{var{InvalidArgumentError:rm}=yr(),Eo=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new rm(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function nm(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}xo.Argument=Eo;xo.humanReadableArgName=nm});var Co=k(wo=>{var{humanReadableArgName:om}=Kr(),ko=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(o=>!o._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,i)=>o.name().localeCompare(i.name())),r}compareOptions(t,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(o=>!o.hidden),n=t._getHelpOption();if(n&&!n.hidden){let o=n.short&&t._findOption(n.short),i=n.long&&t._findOption(n.long);!o&&!i?r.push(n):n.long&&!i?r.push(t.createOption(n.long,n.description)):n.short&&!o&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);r.push(...o)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>om(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let o=t.parent;o;o=o.parent)n=o.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let o=new Map;return t.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[])}),r.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[]),o.get(s).push(i)}),o}formatHelp(t,r){let n=r.padWidth(t,r),o=r.helpWidth??80;function i(p,d){return r.formatItem(p,n,d,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let c=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,d)=>{let y=p.map(g=>i(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(d,y,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(d=>i(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));s=s.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,d)=>{let y=p.map(g=>i(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));s=s.concat(this.formatItemList(d,y,r))}),s.join(`
4
+ `)}displayWidth(t){return Qa(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,o){let s=" ".repeat(2);if(!n)return s+t;let a=t.padEnd(r+t.length-o.displayWidth(t)),c=2,l=(this.helpWidth??80)-r-c-2,p;return l<this.minWidthToWrap||o.preformatted(n)?p=n:p=o.boxWrap(n,l).replace(/\n/g,`
5
+ `+" ".repeat(r+c)),s+a+" ".repeat(c)+p.replace(/\n/g,`
6
+ ${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,i=[];return n.forEach(s=>{let a=s.match(o);if(a===null){i.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let p=this.displayWidth(l);if(u+p<=r){c.push(l),u+=p;return}i.push(c.join(""));let d=l.trimStart();c=[d],u=this.displayWidth(d)}),i.push(c.join(""))}),i.join(`
7
+ `)}};function Qa(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}wo.Help=ko;wo.stripColor=Qa});var Oo=k(Ro=>{var{InvalidArgumentError:im}=yr(),Ao=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=sm(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new im(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Za(this.name().replace(/^no-/,"")):Za(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},So=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return r.negate===(i===t)}};function Za(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function sm(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(t=i.shift()),o.test(i[0])&&(r=i.shift()),!t&&n.test(i[0])&&(t=i.shift()),!t&&o.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let s=i[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
8
+ - a short flag is a single dash and a single character
9
+ - either use a single dash and a single character (for a short flag)
10
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
11
+ - too many short flags`):o.test(s)?new Error(`${a}
12
+ - too many long flags`):new Error(`${a}
13
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Ro.Option=Ao;Ro.DualOptions=So});var tc=k(ec=>{function am(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;e[o-1]===t[n-1]?i=0:i=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}function cm(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let n=[],o=3,i=.4;return t.forEach(s=>{if(s.length<=1)return;let a=am(e,s),c=Math.max(e.length,s.length);(c-a)/c>i&&(a<o?(o=a,n=[s]):a===o&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
14
+ (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
15
+ (Did you mean ${n[0]}?)`:""}ec.suggestSimilar=cm});var ic=k(No=>{var lm=M("node:events").EventEmitter,To=M("node:child_process"),nt=M("node:path"),zr=M("node:fs"),B=M("node:process"),{Argument:um,humanReadableArgName:pm}=Kr(),{CommanderError:Po}=yr(),{Help:dm,stripColor:fm}=Co(),{Option:rc,DualOptions:hm}=Oo(),{suggestSimilar:nc}=tc(),$o=class e extends lm{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>B.stdout.write(r),writeErr:r=>B.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>B.stdout.isTTY?B.stdout.columns:void 0,getErrHelpWidth:()=>B.stderr.isTTY?B.stderr.columns:void 0,getOutHasColors:()=>Do()??(B.stdout.isTTY&&B.stdout.hasColors?.()),getErrHasColors:()=>Do()??(B.stderr.isTTY&&B.stderr.hasColors?.()),stripColor:r=>fm(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let o=r,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return o&&(c.description(o),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),o?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new dm,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
16
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new um(t,r)}argument(t,r,n,o){let i=this.createArgument(t,r);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,o,i]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(o);return a.helpOption(!1),i&&a.arguments(i),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
17
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new Po(t,r,n)),B.exit(t)}action(t){let r=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new rc(t,r)}_callParseArg(t,r,n,o){try{return t.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
18
+ - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=o=>[o.name()].concat(o.aliases()),n=r(t).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let o=(i,s,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,s):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${t.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(t,r,n,o,i){if(typeof r=="object"&&r instanceof rc)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let a=o;o=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(t,r,n,o){return this._optionEx({},t,r,n,o)}requiredOption(t,r,n,o){return this._optionEx({mandatory:!0},t,r,n,o)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){B.versions?.electron&&(r.from="electron");let o=B.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=B.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":B.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
19
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,n){if(zr.existsSync(t))return;let o=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
20
+ - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
22
+ - ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,p){let d=nt.resolve(l,p);if(zr.existsSync(d))return d;if(o.includes(nt.extname(p)))return;let y=o.find(g=>zr.existsSync(`${d}${g}`));if(y)return`${d}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=zr.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=nt.resolve(nt.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!t._executableFile&&this._scriptPath){let p=nt.basename(this._scriptPath,nt.extname(this._scriptPath));p!==this._name&&(l=i(a,`${p}-${t._name}`))}s=l||s}n=o.includes(nt.extname(s));let c;B.platform!=="win32"?n?(r.unshift(s),r=oc(B.execArgv).concat(r),c=To.spawn(B.argv[0],r,{stdio:"inherit"})):c=To.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=oc(B.execArgv).concat(r),c=To.spawn(B.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{B.on(p,()=>{c.killed===!1&&c.exitCode===null&&c.kill(p)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new Po(l,"commander.executeSubCommandAsync","(close)")):B.exit(l)}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)B.exit(1);else{let p=new Po(1,"commander.executeSubCommandAsync","(error)");p.nestedError=l,u(p)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let o=this._findCommand(t);o||this.help({error:!0}),o._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,a)=>t(n,a,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=t(n,i,n.defaultValue))),r[o]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),r==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let o=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,r))}),o}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=t.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],o=r;function i(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(p=>p.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,a=null,c=null,u=0;for(;u<t.length||c;){let l=c??t[u++];if(c=null,l==="--"){o===n&&o.push(l),o.push(...t.slice(u));break}if(a&&(!i(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,i(l)){let p=this._findOption(l);if(p){if(p.required){let d=t[u++];d===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,d)}else if(p.optional){let d=null;u<t.length&&(!i(t[u])||s(t[u]))&&(d=t[u++]),this.emit(`option:${p.name()}`,d)}else this.emit(`option:${p.name()}`);a=p.variadic?p:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let p=this._findOption(`-${l[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,l.slice(2)):(this.emit(`option:${p.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let p=l.indexOf("="),d=this._findOption(l.slice(0,p));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(p+1));continue}}if(o===r&&i(l)&&!(this.commands.length===0&&s(l))&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),n.push(...t.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...t.slice(u));break}else if(this._defaultCommandName){n.push(l,...t.slice(u));break}}if(this._passThroughOptions){o.push(l,...t.slice(u));break}o.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();t[o]=o===this._versionOptionName?this._version:this[o]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
23
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
25
+ `),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in B.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,B.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new hm(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),u=this.options.find(p=>p.negate&&a===p.attributeName()),l=this.options.find(p=>!p.negate&&a===p.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||s},o=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${o(t)} cannot be used with ${o(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);r=nc(t,o)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),r=nc(t,o)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${t}
26
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>pm(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=nt.basename(t,nt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(t){t=t||{};let r=!!t.error,n,o,i;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let i=this.helpInformation({error:n.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",o))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(B.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
27
+ Expecting one of '${n.join("', '")}'`);let o=`${t}Help`;return this.on(o,i=>{let s;typeof r=="function"?s=r({error:i.error,command:i.command}):s=r,s&&i.write(`${s}
28
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function oc(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],o=i[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:t})}function Do(){if(B.env.NO_COLOR||B.env.FORCE_COLOR==="0"||B.env.FORCE_COLOR==="false")return!1;if(B.env.FORCE_COLOR||B.env.CLICOLOR_FORCE!==void 0)return!0}No.Command=$o;No.useColor=Do});var lc=k($e=>{var{Argument:sc}=Kr(),{Command:Lo}=ic(),{CommanderError:mm,InvalidArgumentError:ac}=yr(),{Help:gm}=Co(),{Option:cc}=Oo();$e.program=new Lo;$e.createCommand=e=>new Lo(e);$e.createOption=(e,t)=>new cc(e,t);$e.createArgument=(e,t)=>new sc(e,t);$e.Command=Lo;$e.Option=cc;$e.Argument=sc;$e.Help=gm;$e.CommanderError=mm;$e.InvalidArgumentError=ac;$e.InvalidOptionArgumentError=ac});var yl=k((HA,My)=>{My.exports={name:"dotenv",version:"17.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var kl=k((GA,it)=>{var Xo=M("fs"),nn=M("path"),By=M("os"),Hy=M("crypto"),Gy=yl(),Jo=Gy.version,vl=["\u{1F510} encrypt with Dotenvx: https://dotenvx.com","\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit","\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild","\u{1F916} agentic secret storage: https://dotenvx.com/as2","\u26A1\uFE0F secrets for agents: https://dotenvx.com/as2","\u{1F6E1}\uFE0F auth for agents: https://vestauth.com","\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`","\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }","\u2699\uFE0F enable debug logging with { debug: true }","\u2699\uFE0F override existing env vars with { override: true }","\u2699\uFE0F suppress all logs with { quiet: true }","\u2699\uFE0F write to custom object with { processEnv: myObject }","\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"];function Vy(){return vl[Math.floor(Math.random()*vl.length)]}function zt(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function Wy(){return process.stdout.isTTY}function Uy(e){return Wy()?`\x1B[2m${e}\x1B[0m`:e}var qy=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yy(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
29
+ `);let n;for(;(n=qy.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(i=i.replace(/\\n/g,`
30
+ `),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}function Ky(e){e=e||{};let t=xl(e);e.path=t;let r=ue.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=El(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=Xy(r,a);i=ue.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return ue.parse(i)}function zy(e){console.error(`[dotenv@${Jo}][WARN] ${e}`)}function wr(e){console.log(`[dotenv@${Jo}][DEBUG] ${e}`)}function _l(e){console.log(`[dotenv@${Jo}] ${e}`)}function El(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Xy(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let o=r.searchParams.get("environment");if(!o){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let i=`DOTENV_VAULT_${o.toUpperCase()}`,s=e.parsed[i];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function xl(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Xo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=nn.resolve(process.cwd(),".env.vault");return Xo.existsSync(t)?t:null}function bl(e){return e[0]==="~"?nn.join(By.homedir(),e.slice(1)):e}function Jy(e){let t=zt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=zt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&_l("Loading env from encrypted .env.vault");let n=ue._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),ue.populate(o,n,e),{parsed:n}}function Qy(e){let t=nn.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=zt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=zt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&wr("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[bl(e.path)];else{s=[];for(let l of e.path)s.push(bl(l))}let a,c={};for(let l of s)try{let p=ue.parse(Xo.readFileSync(l,{encoding:r}));ue.populate(c,p,e)}catch(p){o&&wr(`Failed to load ${l} ${p.message}`),a=p}let u=ue.populate(n,c,e);if(o=zt(n.DOTENV_CONFIG_DEBUG||o),i=zt(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,p=[];for(let d of s)try{let y=nn.relative(process.cwd(),d);p.push(y)}catch(y){o&&wr(`Failed to load ${d} ${y.message}`),a=y}_l(`injecting env (${l}) from ${p.join(",")} ${Uy(`-- tip: ${Vy()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function Zy(e){if(El(e).length===0)return ue.configDotenv(e);let t=xl(e);return t?ue._configVault(e):(zy(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ue.configDotenv(e))}function ev(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{let s=Hy.createDecipheriv("aes-256-gcm",r,o);return s.setAuthTag(i),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function tv(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override),i={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s],i[s]=t[s]),n&&wr(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],i[s]=t[s]);return i}var ue={configDotenv:Qy,_configVault:Jy,_parseVault:Ky,config:Zy,decrypt:ev,parse:Yy,populate:tv};it.exports.configDotenv=ue.configDotenv;it.exports._configVault=ue._configVault;it.exports._parseVault=ue._parseVault;it.exports.config=ue.config;it.exports.decrypt=ue.decrypt;it.exports.parse=ue.parse;it.exports.populate=ue.populate;it.exports=ue});var wl=k((UA,rv)=>{rv.exports={name:"@raclettejs/core",version:"0.1.31",description:"racletteJS core package",repository:"https://gitlab.com/raclettejs/core",author:"Pacifico Digital Explorations GmbH <info@raclettejs.com>",license:"AGPL-3.0-only",type:"module",scripts:{build:"node build.mjs || true",dev:"node watch.mjs",watch:"node watch.mjs","format:check":"prettier --check .","format:fix":"prettier --write .",lint:"eslint","lint:grouped":"FILTER_RULE=$RULE eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --format ./dev/eslint/groupByRuleFormatter.cjs","lint:fix":"eslint --fix",prepare:"husky",prepublishOnly:"yarn run build && yarn run sync","publish:patch":"yarn version --patch && yarn publish",sync:"node ./scripts/sync-exports.js"},bin:{"check-dependencies.sh":"./bin/check-dependencies.sh",raclette:"./bin/cli.js"},main:"index.js",types:"./types/index.ts",files:["services","bin","dist","types","scripts","index.js","README.md","yarn.lock","src/types.ts","LICENSE.md","CONTRIBUTING.md","raclette.default.config.yaml","templates"],exports:{".":{types:"./types/index.ts",import:"./dist/index.js"},"./backend":{types:"./services/backend/src/index.ts",import:"./services/backend/src/index.ts"},"./frontend":{types:"./services/frontend/src/core/index.ts",import:"./services/frontend/src/core/index.ts"},"./orchestrator":{types:"./services/frontend/src/orchestrator/index.ts",import:"./services/frontend/src/orchestrator/index.ts"}},config:{},dependencies:{"@inquirer/prompts":"8.3.2","@types/mustache":"4.2.6",chalk:"5.6.2",chokidar:"5.0.0","cli-highlight":"2.1.11",commander:"14.0.3",dotenv:"17.3.1",esbuild:"0.27.4","fs-extra":"11.3.4",globby:"16.1.1","js-yaml":"4.1.1",mustache:"4.2.0",ramda:"0.32.0","tsc-alias":"1.8.16"},devDependencies:{"@emnapi/core":"1.9.2","@emnapi/runtime":"1.9.2","@eslint/js":"9.35.0","@raclettejs/types":"workspace:^","@types/fs-extra":"11.0.4","@types/js-yaml":"4.0.9","@types/node":"25.5.0","@types/ramda":"0.31.1",eslint:"9.35.0","eslint-config-prettier":"9.1.2","eslint-flat-config-utils":"3.0.2","eslint-plugin-import":"2.32.0","eslint-plugin-prefer-arrow-functions":"3.9.1","eslint-plugin-prettier":"5.5.5","eslint-plugin-vue":"9.33.0",globals:"17.4.0",husky:"9.1.7",prettier:"3.8.1",typescript:"5.9.3","typescript-eslint":"8.57.1","vue-eslint-parser":"9.4.3"}}});import{on as nv,once as Cl}from"node:events";import{PassThrough as ov,getDefaultHighWaterMark as iv}from"node:stream";import{finished as Rl}from"node:stream/promises";function ti(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)ei(o);let t=e.some(({readableObjectMode:o})=>o),r=sv(e,t),n=new Zo({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var sv,Zo,av,cv,lv,ei,uv,pv,dv,fv,hv,Ol,Tl,ri,Pl,mv,on,Al,Sl,$l=vt(()=>{sv=(e,t)=>{if(e.length===0)return iv(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Zo=class extends ov{#e=new Set([]);#o=new Set([]);#i=new Set([]);#r;#n=Symbol("unpipe");#t=new WeakMap;add(t){if(ei(t),this.#e.has(t))return;this.#e.add(t),this.#r??=av(this,this.#e,this.#n);let r=uv({passThroughStream:this,stream:t,streams:this.#e,ended:this.#o,aborted:this.#i,onFinished:this.#r,unpipeEvent:this.#n});this.#t.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(ei(t),!this.#e.has(t))return!1;let r=this.#t.get(t);return r===void 0?!1:(this.#t.delete(t),t.unpipe(this),await r,!0)}},av=async(e,t,r)=>{on(e,Al);let n=new AbortController;try{await Promise.race([cv(e,n),lv(e,t,r,n)])}finally{n.abort(),on(e,-Al)}},cv=async(e,{signal:t})=>{try{await Rl(e,{signal:t,cleanup:!0})}catch(r){throw Ol(e,r),r}},lv=async(e,t,r,{signal:n})=>{for await(let[o]of nv(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},ei=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},uv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{on(e,Sl);let a=new AbortController;try{await Promise.race([pv(i,t,a),dv({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),fv({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),on(e,-Sl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?ri(e):hv(e))},pv=async(e,t,{signal:r})=>{try{await e,r.aborted||ri(t)}catch(n){r.aborted||Ol(t,n)}},dv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await Rl(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;Tl(s)?o.add(t):Pl(e,s)}},fv=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await Cl(e,o,{signal:i}),!e.readable)return Cl(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},hv=e=>{e.writable&&e.end()},Ol=(e,t)=>{Tl(t)?ri(e):Pl(e,t)},Tl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",ri=e=>{(e.readable||e.writable)&&e.destroy()},Pl=(e,t)=>{e.destroyed||(e.once("error",mv),e.destroy(t))},mv=()=>{},on=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Al=2,Sl=1});var Dl=k(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.splitWhen=Xt.flatten=void 0;function gv(e){return e.reduce((t,r)=>[].concat(t,r),[])}Xt.flatten=gv;function yv(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Xt.splitWhen=yv});var Nl=k(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.isEnoentCodeError=void 0;function vv(e){return e.code==="ENOENT"}sn.isEnoentCodeError=vv});var Ll=k(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.createDirentFromStats=void 0;var ni=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function bv(e,t){return new ni(e,t)}an.createDirentFromStats=bv});var Ml=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.convertPosixPathToPattern=se.convertWindowsPathToPattern=se.convertPathToPattern=se.escapePosixPath=se.escapeWindowsPath=se.escape=se.removeLeadingDotSegment=se.makeAbsolute=se.unixify=void 0;var _v=M("os"),Ev=M("path"),Il=_v.platform()==="win32",xv=2,kv=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,wv=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Cv=/^\\\\([.?])/,Av=/\\(?![!()+@[\]{}])/g;function Sv(e){return e.replace(/\\/g,"/")}se.unixify=Sv;function Rv(e,t){return Ev.resolve(e,t)}se.makeAbsolute=Rv;function Ov(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(xv)}return e}se.removeLeadingDotSegment=Ov;se.escape=Il?oi:ii;function oi(e){return e.replace(wv,"\\$2")}se.escapeWindowsPath=oi;function ii(e){return e.replace(kv,"\\$2")}se.escapePosixPath=ii;se.convertPathToPattern=Il?Fl:jl;function Fl(e){return oi(e).replace(Cv,"//$1").replace(Av,"/")}se.convertWindowsPathToPattern=Fl;function jl(e){return ii(e)}se.convertPosixPathToPattern=jl});var Hl=k((eS,Bl)=>{Bl.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var Wl=k((tS,Vl)=>{var Tv=Hl(),Gl={"{":"}","(":")","[":"]"},Pv=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,o=-2,i=-2,s=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(s===-1||s>n||(s=e.indexOf("\\",t),s===-1||s>n)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(s=e.indexOf("\\",t),s===-1||s>o))||i!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(i=e.indexOf(")",t),i>t&&(s=e.indexOf("\\",t),s===-1||s>i))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(i=e.indexOf(")",r),i>r&&(s=e.indexOf("\\",r),s===-1||s>i))))return!0;if(e[t]==="\\"){var a=e[t+1];t+=2;var c=Gl[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},$v=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=Gl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};Vl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Tv(t))return!0;var n=Pv;return r&&r.strict===!1&&(n=$v),n(t)}});var ql=k((rS,Ul)=>{"use strict";var Dv=Wl(),Nv=M("path").posix.dirname,Lv=M("os").platform()==="win32",si="/",Iv=/\\/g,Fv=/[\{\[].*[\}\]]$/,jv=/(^|[^\\])([\{\[]|\([^\)]+$)/,Mv=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Ul.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Lv&&t.indexOf(si)<0&&(t=t.replace(Iv,si)),Fv.test(t)&&(t+=si),t+="a";do t=Nv(t);while(Dv(t)||jv.test(t));return t.replace(Mv,"$1")}});var cn=k(De=>{"use strict";De.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;De.find=(e,t)=>e.nodes.find(r=>r.type===t);De.exceedsLimit=(e,t,r=1,n)=>n===!1||!De.isInteger(e)||!De.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;De.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};De.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;De.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;De.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;De.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);De.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let i=n[o];if(Array.isArray(i)){r(i);continue}i!==void 0&&t.push(i)}return t};return r(e),t}});var ln=k((oS,Kl)=>{"use strict";var Yl=cn();Kl.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&Yl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&Yl.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(e)}});var Xl=k((iS,zl)=>{"use strict";zl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var iu=k((sS,ou)=>{"use strict";var Jl=Xl(),Nt=(e,t,r)=>{if(Jl(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Jl(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),i=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=e+":"+t+"="+o+i+s+a;if(Nt.cache.hasOwnProperty(c))return Nt.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let m=e+"|"+t;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let p=nu(e)||nu(t),d={min:e,max:t,a:u,b:l},y=[],g=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let m=l<0?Math.abs(l):1;g=Ql(m,Math.abs(u),d,n),u=d.a=0}return l>=0&&(y=Ql(u,l,d,n)),d.negatives=g,d.positives=y,d.result=Bv(g,y,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&y.length+g.length>1&&(d.result=`(?:${d.result})`),Nt.cache[c]=d,d.result};function Bv(e,t,r){let n=ai(e,t,"-",!1,r)||[],o=ai(t,e,"",!1,r)||[],i=ai(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Hv(e,t){let r=1,n=1,o=eu(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=eu(e,r);for(o=tu(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=tu(t+1,n)-1;return i=[...i],i.sort(Wv),i}function Gv(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Vv(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,u]=n[a];c===u?i+=c:c!=="0"||u!=="9"?i+=Uv(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Ql(e,t,r,n){let o=Hv(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Gv(String(s),String(u),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+ru(a.count),s=u+1;continue}r.isPadded&&(p=qv(u,r,n)),l.string=p+l.pattern+ru(l.count),i.push(l),s=u+1,a=l}return i}function ai(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Zl(t,"string",a)&&i.push(r+a),n&&Zl(t,"string",a)&&i.push(r+a)}return i}function Vv(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Wv(e,t){return e>t?1:t>e?-1:0}function Zl(e,t,r){return e.some(n=>n[t]===r)}function eu(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function tu(e,t){return e-e%Math.pow(10,t)}function ru(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Uv(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function nu(e){return/^-?(0+)\d/.test(e)}function qv(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}Nt.cache={};Nt.clearCache=()=>Nt.cache={};ou.exports=Nt});var ui=k((aS,du)=>{"use strict";var Yv=M("util"),au=iu(),su=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Kv=e=>t=>e===!0?Number(t):String(t),ci=e=>typeof e=="number"||typeof e=="string"&&e!=="",Cr=e=>Number.isInteger(+e),li=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},zv=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Xv=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},pn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Jv=(e,t,r)=>{e.negatives.sort((a,c)=>a<c?-1:a>c?1:0),e.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=t.capture?"":"?:",o="",i="",s;return e.positives.length&&(o=e.positives.map(a=>pn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>pn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},cu=(e,t,r,n)=>{if(r)return au(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},lu=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return au(e,t,r)},uu=(...e)=>new RangeError("Invalid range arguments: "+Yv.inspect(...e)),pu=(e,t,r)=>{if(r.strictRanges===!0)throw uu([e,t]);return[]},Qv=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Zv=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw uu([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),u=String(r);r=Math.max(Math.abs(r),1);let l=li(a)||li(c)||li(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&zv(e,t,n)===!1,y=n.transform||Kv(d);if(n.toRegex&&r===1)return cu(pn(e,p),pn(t,p),!0,n);let g={negatives:[],positives:[]},m=S=>g[S<0?"negatives":"positives"].push(Math.abs(S)),E=[],x=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?m(o):E.push(Xv(y(o,x),p,d)),o=s?o-r:o+r,x++;return n.toRegex===!0?r>1?Jv(g,n,p):lu(E,null,{wrap:!1,...n}):E},eb=(e,t,r=1,n={})=>{if(!Cr(e)&&e.length>1||!Cr(t)&&t.length>1)return pu(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),i=`${e}`.charCodeAt(0),s=`${t}`.charCodeAt(0),a=i>s,c=Math.min(i,s),u=Math.max(i,s);if(n.toRegex&&r===1)return cu(c,u,!1,n);let l=[],p=0;for(;a?i>=s:i<=s;)l.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?lu(l,null,{wrap:!1,options:n}):l},un=(e,t,r,n={})=>{if(t==null&&ci(e))return[e];if(!ci(e)||!ci(t))return pu(e,t,n);if(typeof r=="function")return un(e,t,1,{transform:r});if(su(r))return un(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,Cr(r)?Cr(e)&&Cr(t)?Zv(e,t,r,o):eb(e,t,Math.max(Math.abs(r),1),o):r!=null&&!su(r)?Qv(r,o):un(e,t,1,r)};du.exports=un});var mu=k((cS,hu)=>{"use strict";var tb=ui(),fu=cn(),rb=(e,t={})=>{let r=(n,o={})=>{let i=fu.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=fu.reduce(n.nodes),p=tb(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(e)};hu.exports=rb});var vu=k((lS,yu)=>{"use strict";var nb=ui(),gu=ln(),Jt=cn(),Lt=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Jt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(Lt(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Lt(o,i,r):o+i);return Jt.flatten(n)},ob=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,i={})=>{o.queue=[];let s=i,a=i.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(o.invalid||o.dollar){a.push(Lt(a.pop(),gu(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(Lt(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Jt.reduce(o.nodes);if(Jt.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=nb(...p,t);d.length===0&&(d=gu(o,t)),a.push(Lt(a.pop(),d)),o.nodes=[];return}let c=Jt.encloseBrace(o),u=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&u.push(""),u.push("");continue}if(d.type==="close"){a.push(Lt(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(Lt(u.pop(),d.value));continue}d.nodes&&n(d,o)}return u};return Jt.flatten(n(e))};yu.exports=ob});var _u=k((uS,bu)=>{"use strict";bu.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
31
+ `,CHAR_NO_BREAK_SPACE:"\xA0",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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Cu=k((pS,wu)=>{"use strict";var ib=ln(),{MAX_LENGTH:Eu,CHAR_BACKSLASH:pi,CHAR_BACKTICK:sb,CHAR_COMMA:ab,CHAR_DOT:cb,CHAR_LEFT_PARENTHESES:lb,CHAR_RIGHT_PARENTHESES:ub,CHAR_LEFT_CURLY_BRACE:pb,CHAR_RIGHT_CURLY_BRACE:db,CHAR_LEFT_SQUARE_BRACKET:xu,CHAR_RIGHT_SQUARE_BRACKET:ku,CHAR_DOUBLE_QUOTE:fb,CHAR_SINGLE_QUOTE:hb,CHAR_NO_BREAK_SPACE:mb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:gb}=_u(),yb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Eu,r.maxLength):Eu;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},i=[o],s=o,a=o,c=0,u=e.length,l=0,p=0,d,y=()=>e[l++],g=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(g({type:"bos"});l<u;)if(s=i[i.length-1],d=y(),!(d===gb||d===mb)){if(d===pi){g({type:"text",value:(t.keepEscaping?d:"")+y()});continue}if(d===ku){g({type:"text",value:"\\"+d});continue}if(d===xu){c++;let m;for(;l<u&&(m=y());){if(d+=m,m===xu){c++;continue}if(m===pi){d+=y();continue}if(m===ku&&(c--,c===0))break}g({type:"text",value:d});continue}if(d===lb){s=g({type:"paren",nodes:[]}),i.push(s),g({type:"text",value:d});continue}if(d===ub){if(s.type!=="paren"){g({type:"text",value:d});continue}s=i.pop(),g({type:"text",value:d}),s=i[i.length-1];continue}if(d===fb||d===hb||d===sb){let m=d,E;for(t.keepQuotes!==!0&&(d="");l<u&&(E=y());){if(E===pi){d+=E+y();continue}if(E===m){t.keepQuotes===!0&&(d+=E);break}d+=E}g({type:"text",value:d});continue}if(d===pb){p++;let E={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=g(E),i.push(s),g({type:"open",value:d});continue}if(d===db){if(s.type!=="brace"){g({type:"text",value:d});continue}let m="close";s=i.pop(),s.close=!0,g({type:m,value:d}),p--,s=i[i.length-1];continue}if(d===ab&&p>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:ib(s)}]}g({type:"comma",value:d}),s.commas++;continue}if(d===cb&&p>0&&s.commas===0){let m=s.nodes;if(p===0||m.length===0){g({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let E=m[m.length-1];E.value+=a.value+d,a=E,s.ranges--;continue}g({type:"dot",value:d});continue}g({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0)});let m=i[i.length-1],E=m.nodes.indexOf(s);m.nodes.splice(E,1,...s.nodes)}while(i.length>0);return g({type:"eos"}),o};wu.exports=yb});var Ru=k((dS,Su)=>{"use strict";var Au=ln(),vb=mu(),bb=vu(),_b=Cu(),Re=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Re.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Re.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Re.parse=(e,t={})=>_b(e,t);Re.stringify=(e,t={})=>Au(typeof e=="string"?Re.parse(e,t):e,t);Re.compile=(e,t={})=>(typeof e=="string"&&(e=Re.parse(e,t)),vb(e,t));Re.expand=(e,t={})=>{typeof e=="string"&&(e=Re.parse(e,t));let r=bb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Re.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Re.compile(e,t):Re.expand(e,t);Su.exports=Re});var Ar=k((fS,Du)=>{"use strict";var Eb=M("path"),Je="\\\\/",Ou=`[^${Je}]`,xb=0,st="\\.",kb="\\+",wb="\\?",dn="\\/",Cb="(?=.)",Tu="[^/]",di=`(?:${dn}|$)`,Pu=`(?:^|${dn})`,fi=`${st}{1,2}${di}`,Ab=`(?!${st})`,Sb=`(?!${Pu}${fi})`,Rb=`(?!${st}{0,1}${di})`,Ob=`(?!${fi})`,Tb=`[^.${dn}]`,Pb=`${Tu}*?`,$u={DOT_LITERAL:st,PLUS_LITERAL:kb,QMARK_LITERAL:wb,SLASH_LITERAL:dn,ONE_CHAR:Cb,QMARK:Tu,END_ANCHOR:di,DOTS_SLASH:fi,NO_DOT:Ab,NO_DOTS:Sb,NO_DOT_SLASH:Rb,NO_DOTS_SLASH:Ob,QMARK_NO_DOT:Tb,STAR:Pb,START_ANCHOR:Pu},$b={...$u,SLASH_LITERAL:`[${Je}]`,QMARK:Ou,STAR:`${Ou}*?`,DOTS_SLASH:`${st}{1,2}(?:[${Je}]|$)`,NO_DOT:`(?!${st})`,NO_DOTS:`(?!(?:^|[${Je}])${st}{1,2}(?:[${Je}]|$))`,NO_DOT_SLASH:`(?!${st}{0,1}(?:[${Je}]|$))`,NO_DOTS_SLASH:`(?!${st}{1,2}(?:[${Je}]|$))`,QMARK_NO_DOT:`[^.${Je}]`,START_ANCHOR:`(?:^|[${Je}])`,END_ANCHOR:`(?:[${Je}]|$)`},Db={__proto__:null,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"};Du.exports={DEFAULT_MAX_EXTGLOB_RECURSION:xb,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Db,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:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},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:Eb.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?$b:$u}}});var Sr=k(we=>{"use strict";var Nb=M("path"),Lb=process.platform==="win32",{REGEX_BACKSLASH:Ib,REGEX_REMOVE_BACKSLASH:Fb,REGEX_SPECIAL_CHARS:jb,REGEX_SPECIAL_CHARS_GLOBAL:Mb}=Ar();we.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);we.hasRegexChars=e=>jb.test(e);we.isRegexChar=e=>e.length===1&&we.hasRegexChars(e);we.escapeRegex=e=>e.replace(Mb,"\\$1");we.toPosixSlashes=e=>e.replace(Ib,"/");we.removeBackslashes=e=>e.replace(Fb,t=>t==="\\"?"":t);we.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};we.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Lb===!0||Nb.sep==="\\";we.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?we.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};we.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};we.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Hu=k((mS,Bu)=>{"use strict";var Nu=Sr(),{CHAR_ASTERISK:hi,CHAR_AT:Bb,CHAR_BACKWARD_SLASH:Rr,CHAR_COMMA:Hb,CHAR_DOT:mi,CHAR_EXCLAMATION_MARK:gi,CHAR_FORWARD_SLASH:Mu,CHAR_LEFT_CURLY_BRACE:yi,CHAR_LEFT_PARENTHESES:vi,CHAR_LEFT_SQUARE_BRACKET:Gb,CHAR_PLUS:Vb,CHAR_QUESTION_MARK:Lu,CHAR_RIGHT_CURLY_BRACE:Wb,CHAR_RIGHT_PARENTHESES:Iu,CHAR_RIGHT_SQUARE_BRACKET:Ub}=Ar(),Fu=e=>e===Mu||e===Rr,ju=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},qb=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,u=-1,l=0,p=0,d=!1,y=!1,g=!1,m=!1,E=!1,x=!1,S=!1,$=!1,oe=!1,q=!1,T=0,L,w,F={value:"",depth:0,isGlob:!1},ae=()=>u>=n,_=()=>c.charCodeAt(u+1),Q=()=>(L=w,c.charCodeAt(++u));for(;u<n;){w=Q();let ve;if(w===Rr){S=F.backslashes=!0,w=Q(),w===yi&&(x=!0);continue}if(x===!0||w===yi){for(T++;ae()!==!0&&(w=Q());){if(w===Rr){S=F.backslashes=!0,Q();continue}if(w===yi){T++;continue}if(x!==!0&&w===mi&&(w=Q())===mi){if(d=F.isBrace=!0,g=F.isGlob=!0,q=!0,o===!0)continue;break}if(x!==!0&&w===Hb){if(d=F.isBrace=!0,g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Wb&&(T--,T===0)){x=!1,d=F.isBrace=!0,q=!0;break}}if(o===!0)continue;break}if(w===Mu){if(i.push(u),s.push(F),F={value:"",depth:0,isGlob:!1},q===!0)continue;if(L===mi&&u===l+1){l+=2;continue}p=u+1;continue}if(r.noext!==!0&&(w===Vb||w===Bb||w===hi||w===Lu||w===gi)===!0&&_()===vi){if(g=F.isGlob=!0,m=F.isExtglob=!0,q=!0,w===gi&&u===l&&(oe=!0),o===!0){for(;ae()!==!0&&(w=Q());){if(w===Rr){S=F.backslashes=!0,w=Q();continue}if(w===Iu){g=F.isGlob=!0,q=!0;break}}continue}break}if(w===hi){if(L===hi&&(E=F.isGlobstar=!0),g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Lu){if(g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Gb){for(;ae()!==!0&&(ve=Q());){if(ve===Rr){S=F.backslashes=!0,Q();continue}if(ve===Ub){y=F.isBracket=!0,g=F.isGlob=!0,q=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&w===gi&&u===l){$=F.negated=!0,l++;continue}if(r.noparen!==!0&&w===vi){if(g=F.isGlob=!0,o===!0){for(;ae()!==!0&&(w=Q());){if(w===vi){S=F.backslashes=!0,w=Q();continue}if(w===Iu){q=!0;break}}continue}break}if(g===!0){if(q=!0,o===!0)continue;break}}r.noext===!0&&(m=!1,g=!1);let z=c,gt="",v="";l>0&&(gt=c.slice(0,l),c=c.slice(l),p-=l),z&&g===!0&&p>0?(z=c.slice(0,p),v=c.slice(p)):g===!0?(z="",v=c):z=c,z&&z!==""&&z!=="/"&&z!==c&&Fu(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),r.unescape===!0&&(v&&(v=Nu.removeBackslashes(v)),z&&S===!0&&(z=Nu.removeBackslashes(z)));let b={prefix:gt,input:e,start:l,base:z,glob:v,isBrace:d,isBracket:y,isGlob:g,isExtglob:m,isGlobstar:E,negated:$,negatedExtglob:oe};if(r.tokens===!0&&(b.maxDepth=0,Fu(w)||s.push(F),b.tokens=s),r.parts===!0||r.tokens===!0){let ve;for(let j=0;j<i.length;j++){let Ve=ve?ve+1:l,We=i[j],Se=e.slice(Ve,We);r.tokens&&(j===0&&l!==0?(s[j].isPrefix=!0,s[j].value=gt):s[j].value=Se,ju(s[j]),b.maxDepth+=s[j].depth),(j!==0||Se!=="")&&a.push(Se),ve=We}if(ve&&ve+1<e.length){let j=e.slice(ve+1);a.push(j),r.tokens&&(s[s.length-1].value=j,ju(s[s.length-1]),b.maxDepth+=s[s.length-1].depth)}b.slashes=i,b.parts=a}return b};Bu.exports=qb});var qu=k((gS,Uu)=>{"use strict";var Or=Ar(),me=Sr(),{MAX_LENGTH:fn,POSIX_REGEX_SOURCE:Yb,REGEX_NON_SPECIAL_CHARS:Kb,REGEX_SPECIAL_CHARS_BACKREF:zb,REPLACEMENTS:Gu}=Or,Xb=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>me.escapeRegex(o)).join("..")}return r},Qt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Vu=e=>{let t=[],r=0,n=0,o=0,i="",s=!1;for(let a of e){if(s===!0){i+=a,s=!1;continue}if(a==="\\"){i+=a,s=!0;continue}if(a==='"'){o=o===1?0:1,i+=a;continue}if(o===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){t.push(i),i="";continue}}}i+=a}return t.push(i),t},Jb=e=>{let t=!1;for(let r of e){if(t===!0){t=!1;continue}if(r==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Wu=e=>{let t=e.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),r=!0);if(Jb(t))return t.replace(/\\(.)/g,"$1")},Qb=e=>{let t=e.map(Wu).filter(Boolean);for(let r=0;r<t.length;r++)for(let n=r+1;n<t.length;n++){let o=t[r],i=t[n],s=o[0];if(!(!s||o!==s.repeat(o.length)||i!==s.repeat(i.length))&&(o===i||o.startsWith(i)||i.startsWith(o)))return!0}return!1},bi=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let r=0,n=0,o=0,i=!1;for(let s=1;s<e.length;s++){let a=e[s];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){o=o===1?0:1;continue}if(o!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return t===!0&&s!==e.length-1?void 0:{type:e[0],body:e.slice(2,s),end:s}}}}},Zb=e=>{let t=0,r=[];for(;t<e.length;){let o=bi(e.slice(t),!1);if(!o||o.type!=="*")return;let i=Vu(o.body).map(a=>a.trim());if(i.length!==1)return;let s=Wu(i[0]);if(!s||s.length!==1)return;r.push(s),t+=o.end+1}return r.length<1?void 0:`${r.length===1?me.escapeRegex(r[0]):`[${r.map(o=>me.escapeRegex(o)).join("")}]`}*`},e_=e=>{let t=0,r=e.trim(),n=bi(r);for(;n;)t++,r=n.body.trim(),n=bi(r);return t},t_=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion=="number"?t.maxExtglobRecursion:Or.DEFAULT_MAX_EXTGLOB_RECURSION,n=Vu(e).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||Qb(n)))return{risky:!0};for(let o of n){let i=Zb(o);if(i)return{risky:!0,safeOutput:i};if(e_(o)>r)return{risky:!0}}return{risky:!1}},_i=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Gu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(fn,r.maxLength):fn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},s=[i],a=r.capture?"":"?:",c=me.isWindows(t),u=Or.globChars(c),l=Or.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:y,ONE_CHAR:g,DOTS_SLASH:m,NO_DOT:E,NO_DOT_SLASH:x,NO_DOTS_SLASH:S,QMARK:$,QMARK_NO_DOT:oe,STAR:q,START_ANCHOR:T}=u,L=A=>`(${a}(?:(?!${T}${A.dot?m:p}).)*?)`,w=r.dot?"":E,F=r.dot?$:oe,ae=r.bash===!0?L(r):q;r.capture&&(ae=`(${ae})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};e=me.removePrefix(e,_),o=e.length;let Q=[],z=[],gt=[],v=i,b,ve=()=>_.index===o-1,j=_.peek=(A=1)=>e[_.index+A],Ve=_.advance=()=>e[++_.index]||"",We=()=>e.slice(_.index+1),Se=(A="",Z=0)=>{_.consumed+=A,_.index+=Z},Hr=A=>{_.output+=A.output!=null?A.output:A.value,Se(A.value)},$h=()=>{let A=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Ve(),_.start++,A++;return A%2===0?!1:(_.negated=!0,_.start++,!0)},Gr=A=>{_[A]++,gt.push(A)},yt=A=>{_[A]--,gt.pop()},N=A=>{if(v.type==="globstar"){let Z=_.braces>0&&(A.type==="comma"||A.type==="brace"),C=A.extglob===!0||Q.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!Z&&!C&&(_.output=_.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=ae,_.output+=v.output)}if(Q.length&&A.type!=="paren"&&(Q[Q.length-1].inner+=A.value),(A.value||A.output)&&Hr(A),v&&v.type==="text"&&A.type==="text"){v.value+=A.value,v.output=(v.output||"")+A.value;return}A.prev=v,s.push(A),v=A},Vr=(A,Z)=>{let C={...l[Z],conditions:1,inner:""};C.prev=v,C.parens=_.parens,C.output=_.output,C.startIndex=_.index,C.tokensIndex=s.length;let D=(r.capture?"(":"")+C.open;Gr("parens"),N({type:A,value:Z,output:_.output?"":g}),N({type:"paren",extglob:!0,value:Ve(),output:D}),Q.push(C)},Dh=A=>{let Z=e.slice(A.startIndex,_.index+1),C=e.slice(A.startIndex+2,_.index),D=t_(C,r);if((A.type==="plus"||A.type==="star")&&D.risky){let Y=D.safeOutput?(A.output?"":g)+(r.capture?`(${D.safeOutput})`:D.safeOutput):void 0,Ue=s[A.tokensIndex];Ue.type="text",Ue.value=Z,Ue.output=Y||me.escapeRegex(Z);for(let qe=A.tokensIndex+1;qe<s.length;qe++)s[qe].value="",s[qe].output="",delete s[qe].suffix;_.output=A.output+Ue.output,_.backtrack=!0,N({type:"paren",extglob:!0,value:b,output:""}),yt("parens");return}let X=A.close+(r.capture?")":""),ce;if(A.type==="negate"){let Y=ae;if(A.inner&&A.inner.length>1&&A.inner.includes("/")&&(Y=L(r)),(Y!==ae||ve()||/^\)+$/.test(We()))&&(X=A.close=`)$))${Y}`),A.inner.includes("*")&&(ce=We())&&/^\.[^\\/.]+$/.test(ce)){let Ue=_i(ce,{...t,fastpaths:!1}).output;X=A.close=`)${Ue})${Y})`}A.prev.type==="bos"&&(_.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:b,output:X}),yt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let A=!1,Z=e.replace(zb,(C,D,X,ce,Y,Ue)=>ce==="\\"?(A=!0,C):ce==="?"?D?D+ce+(Y?$.repeat(Y.length):""):Ue===0?F+(Y?$.repeat(Y.length):""):$.repeat(X.length):ce==="."?p.repeat(X.length):ce==="*"?D?D+ce+(Y?ae:""):ae:D?C:`\\${C}`);return A===!0&&(r.unescape===!0?Z=Z.replace(/\\/g,""):Z=Z.replace(/\\+/g,C=>C.length%2===0?"\\\\":C?"\\":"")),Z===e&&r.contains===!0?(_.output=e,_):(_.output=me.wrapOutput(Z,_,t),_)}for(;!ve();){if(b=Ve(),b==="\0")continue;if(b==="\\"){let C=j();if(C==="/"&&r.bash!==!0||C==="."||C===";")continue;if(!C){b+="\\",N({type:"text",value:b});continue}let D=/^\\+/.exec(We()),X=0;if(D&&D[0].length>2&&(X=D[0].length,_.index+=X,X%2!==0&&(b+="\\")),r.unescape===!0?b=Ve():b+=Ve(),_.brackets===0){N({type:"text",value:b});continue}}if(_.brackets>0&&(b!=="]"||v.value==="["||v.value==="[^")){if(r.posix!==!1&&b===":"){let C=v.value.slice(1);if(C.includes("[")&&(v.posix=!0,C.includes(":"))){let D=v.value.lastIndexOf("["),X=v.value.slice(0,D),ce=v.value.slice(D+2),Y=Yb[ce];if(Y){v.value=X+Y,_.backtrack=!0,Ve(),!i.output&&s.indexOf(v)===1&&(i.output=g);continue}}}(b==="["&&j()!==":"||b==="-"&&j()==="]")&&(b=`\\${b}`),b==="]"&&(v.value==="["||v.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&v.value==="["&&(b="^"),v.value+=b,Hr({value:b});continue}if(_.quotes===1&&b!=='"'){b=me.escapeRegex(b),v.value+=b,Hr({value:b});continue}if(b==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&N({type:"text",value:b});continue}if(b==="("){Gr("parens"),N({type:"paren",value:b});continue}if(b===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qt("opening","("));let C=Q[Q.length-1];if(C&&_.parens===C.parens+1){Dh(Q.pop());continue}N({type:"paren",value:b,output:_.parens?")":"\\)"}),yt("parens");continue}if(b==="["){if(r.nobracket===!0||!We().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qt("closing","]"));b=`\\${b}`}else Gr("brackets");N({type:"bracket",value:b});continue}if(b==="]"){if(r.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){N({type:"text",value:b,output:`\\${b}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Qt("opening","["));N({type:"text",value:b,output:`\\${b}`});continue}yt("brackets");let C=v.value.slice(1);if(v.posix!==!0&&C[0]==="^"&&!C.includes("/")&&(b=`/${b}`),v.value+=b,Hr({value:b}),r.literalBrackets===!1||me.hasRegexChars(C))continue;let D=me.escapeRegex(v.value);if(_.output=_.output.slice(0,-v.value.length),r.literalBrackets===!0){_.output+=D,v.value=D;continue}v.value=`(${a}${D}|${v.value})`,_.output+=v.value;continue}if(b==="{"&&r.nobrace!==!0){Gr("braces");let C={type:"brace",value:b,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};z.push(C),N(C);continue}if(b==="}"){let C=z[z.length-1];if(r.nobrace===!0||!C){N({type:"text",value:b,output:b});continue}let D=")";if(C.dots===!0){let X=s.slice(),ce=[];for(let Y=X.length-1;Y>=0&&(s.pop(),X[Y].type!=="brace");Y--)X[Y].type!=="dots"&&ce.unshift(X[Y].value);D=Xb(ce,r),_.backtrack=!0}if(C.comma!==!0&&C.dots!==!0){let X=_.output.slice(0,C.outputIndex),ce=_.tokens.slice(C.tokensIndex);C.value=C.output="\\{",b=D="\\}",_.output=X;for(let Y of ce)_.output+=Y.output||Y.value}N({type:"brace",value:b,output:D}),yt("braces"),z.pop();continue}if(b==="|"){Q.length>0&&Q[Q.length-1].conditions++,N({type:"text",value:b});continue}if(b===","){let C=b,D=z[z.length-1];D&&gt[gt.length-1]==="braces"&&(D.comma=!0,C="|"),N({type:"comma",value:b,output:C});continue}if(b==="/"){if(v.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),v=i;continue}N({type:"slash",value:b,output:y});continue}if(b==="."){if(_.braces>0&&v.type==="dot"){v.value==="."&&(v.output=p);let C=z[z.length-1];v.type="dots",v.output+=b,v.value+=b,C.dots=!0;continue}if(_.braces+_.parens===0&&v.type!=="bos"&&v.type!=="slash"){N({type:"text",value:b,output:p});continue}N({type:"dot",value:b,output:p});continue}if(b==="?"){if(!(v&&v.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Vr("qmark",b);continue}if(v&&v.type==="paren"){let D=j(),X=b;if(D==="<"&&!me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(We()))&&(X=`\\${b}`),N({type:"text",value:b,output:X});continue}if(r.dot!==!0&&(v.type==="slash"||v.type==="bos")){N({type:"qmark",value:b,output:oe});continue}N({type:"qmark",value:b,output:$});continue}if(b==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){Vr("negate",b);continue}if(r.nonegate!==!0&&_.index===0){$h();continue}}if(b==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Vr("plus",b);continue}if(v&&v.value==="("||r.regex===!1){N({type:"plus",value:b,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||_.parens>0){N({type:"plus",value:b});continue}N({type:"plus",value:d});continue}if(b==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){N({type:"at",extglob:!0,value:b,output:""});continue}N({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);let C=Kb.exec(We());C&&(b+=C[0],_.index+=C[0].length),N({type:"text",value:b});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=b,v.output=ae,_.backtrack=!0,_.globstar=!0,Se(b);continue}let A=We();if(r.noextglob!==!0&&/^\([^?]/.test(A)){Vr("star",b);continue}if(v.type==="star"){if(r.noglobstar===!0){Se(b);continue}let C=v.prev,D=C.prev,X=C.type==="slash"||C.type==="bos",ce=D&&(D.type==="star"||D.type==="globstar");if(r.bash===!0&&(!X||A[0]&&A[0]!=="/")){N({type:"star",value:b,output:""});continue}let Y=_.braces>0&&(C.type==="comma"||C.type==="brace"),Ue=Q.length&&(C.type==="pipe"||C.type==="paren");if(!X&&C.type!=="paren"&&!Y&&!Ue){N({type:"star",value:b,output:""});continue}for(;A.slice(0,3)==="/**";){let qe=e[_.index+4];if(qe&&qe!=="/")break;A=A.slice(3),Se("/**",3)}if(C.type==="bos"&&ve()){v.type="globstar",v.value+=b,v.output=L(r),_.output=v.output,_.globstar=!0,Se(b);continue}if(C.type==="slash"&&C.prev.type!=="bos"&&!ce&&ve()){_.output=_.output.slice(0,-(C.output+v.output).length),C.output=`(?:${C.output}`,v.type="globstar",v.output=L(r)+(r.strictSlashes?")":"|$)"),v.value+=b,_.globstar=!0,_.output+=C.output+v.output,Se(b);continue}if(C.type==="slash"&&C.prev.type!=="bos"&&A[0]==="/"){let qe=A[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(C.output+v.output).length),C.output=`(?:${C.output}`,v.type="globstar",v.output=`${L(r)}${y}|${y}${qe})`,v.value+=b,_.output+=C.output+v.output,_.globstar=!0,Se(b+Ve()),N({type:"slash",value:"/",output:""});continue}if(C.type==="bos"&&A[0]==="/"){v.type="globstar",v.value+=b,v.output=`(?:^|${y}|${L(r)}${y})`,_.output=v.output,_.globstar=!0,Se(b+Ve()),N({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-v.output.length),v.type="globstar",v.output=L(r),v.value+=b,_.output+=v.output,_.globstar=!0,Se(b);continue}let Z={type:"star",value:b,output:ae};if(r.bash===!0){Z.output=".*?",(v.type==="bos"||v.type==="slash")&&(Z.output=w+Z.output),N(Z);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&r.regex===!0){Z.output=b,N(Z);continue}(_.index===_.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(_.output+=x,v.output+=x):r.dot===!0?(_.output+=S,v.output+=S):(_.output+=w,v.output+=w),j()!=="*"&&(_.output+=g,v.output+=g)),N(Z)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qt("closing","]"));_.output=me.escapeLast(_.output,"["),yt("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qt("closing",")"));_.output=me.escapeLast(_.output,"("),yt("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qt("closing","}"));_.output=me.escapeLast(_.output,"{"),yt("braces")}if(r.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let A of _.tokens)_.output+=A.output!=null?A.output:A.value,A.suffix&&(_.output+=A.suffix)}return _};_i.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(fn,r.maxLength):fn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=Gu[e]||e;let i=me.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:y,START_ANCHOR:g}=Or.globChars(i),m=r.dot?p:l,E=r.dot?d:l,x=r.capture?"":"?:",S={negated:!1,prefix:""},$=r.bash===!0?".*?":y;r.capture&&($=`(${$})`);let oe=w=>w.noglobstar===!0?$:`(${x}(?:(?!${g}${w.dot?u:s}).)*?)`,q=w=>{switch(w){case"*":return`${m}${c}${$}`;case".*":return`${s}${c}${$}`;case"*.*":return`${m}${$}${s}${c}${$}`;case"*/*":return`${m}${$}${a}${c}${E}${$}`;case"**":return m+oe(r);case"**/*":return`(?:${m}${oe(r)}${a})?${E}${c}${$}`;case"**/*.*":return`(?:${m}${oe(r)}${a})?${E}${$}${s}${c}${$}`;case"**/.*":return`(?:${m}${oe(r)}${a})?${s}${c}${$}`;default:{let F=/^(.*?)\.(\w+)$/.exec(w);if(!F)return;let ae=q(F[1]);return ae?ae+s+F[2]:void 0}}},T=me.removePrefix(e,S),L=q(T);return L&&r.strictSlashes!==!0&&(L+=`${a}?`),L};Uu.exports=_i});var Ku=k((yS,Yu)=>{"use strict";var r_=M("path"),n_=Hu(),Ei=qu(),xi=Sr(),o_=Ar(),i_=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>re(d,t,r));return d=>{for(let y of l){let g=y(d);if(g)return g}return!1}}let n=i_(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},i=xi.isWindows(t),s=n?re.compileRe(e,t):re.makeRe(e,t,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};c=re(o.ignore,l,r)}let u=(l,p=!1)=>{let{isMatch:d,match:y,output:g}=re.test(l,s,t,{glob:e,posix:i}),m={glob:e,state:a,regex:s,posix:i,input:l,output:g,match:y,isMatch:d};return typeof o.onResult=="function"&&o.onResult(m),d===!1?(m.isMatch=!1,p?m:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(m),m.isMatch=!1,p?m:!1):(typeof o.onMatch=="function"&&o.onMatch(m),p?m:!0)};return r&&(u.state=a),u};re.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=r||{},s=i.format||(o?xi.toPosixSlashes:null),a=e===n,c=a&&s?s(e):e;return a===!1&&(c=s?s(e):e,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=re.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};re.matchBase=(e,t,r,n=xi.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(r_.basename(e));re.isMatch=(e,t,r)=>re(t,r)(e);re.parse=(e,t)=>Array.isArray(e)?e.map(r=>re.parse(r,t)):Ei(e,{...t,fastpaths:!1});re.scan=(e,t)=>n_(e,t);re.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},i=o.contains?"":"^",s=o.contains?"":"$",a=`${i}(?:${e.output})${s}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let c=re.toRegex(a,t);return n===!0&&(c.state=e),c};re.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=Ei.fastpaths(e,t)),o.output||(o=Ei(e,t)),re.compileRe(o,t,r,n)};re.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};re.constants=o_;Yu.exports=re});var Xu=k((vS,zu)=>{"use strict";zu.exports=Ku()});var rp=k((bS,tp)=>{"use strict";var Qu=M("util"),Zu=Ru(),Qe=Xu(),ki=Sr(),Ju=e=>e===""||e==="./",ep=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Qe(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let y of e){let g=p(y,!0);(d?!g.isMatch:g.isMatch)&&(d?n.add(g.output):(n.delete(g.output),o.add(g.output)))}}let u=(s===t.length?[...i]:[...o]).filter(l=>!n.has(l));if(r&&u.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return u};J.match=J;J.matcher=(e,t)=>Qe(e,t);J.isMatch=(e,t,r)=>Qe(t,r)(e);J.any=J.isMatch;J.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],i=a=>{r.onResult&&r.onResult(a),o.push(a.output)},s=new Set(J(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};J.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Qu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>J.contains(e,n,r));if(typeof t=="string"){if(Ju(e)||Ju(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...r,contains:!0})};J.matchKeys=(e,t,r)=>{if(!ki.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=J(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};J.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(n.some(s=>i(s)))return!0}return!1};J.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};J.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Qu.inspect(e)}"`);return[].concat(t).every(n=>Qe(n,r)(e))};J.capture=(e,t,r)=>{let n=ki.isWindows(r),i=Qe.makeRe(String(e),{...r,capture:!0}).exec(n?ki.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};J.makeRe=(...e)=>Qe.makeRe(...e);J.scan=(...e)=>Qe.scan(...e);J.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of Zu(String(n),t))r.push(Qe.parse(o,t));return r};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!ep(e)?[e]:Zu(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=ep;tp.exports=J});var dp=k(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.isAbsolute=O.partitionAbsoluteAndRelative=O.removeDuplicateSlashes=O.matchAny=O.convertPatternsToRe=O.makeRe=O.getPatternParts=O.expandBraceExpansion=O.expandPatternsWithBraceExpansion=O.isAffectDepthOfReadingPattern=O.endsWithSlashGlobStar=O.hasGlobStar=O.getBaseDirectory=O.isPatternRelatedToParentDirectory=O.getPatternsOutsideCurrentDirectory=O.getPatternsInsideCurrentDirectory=O.getPositivePatterns=O.getNegativePatterns=O.isPositivePattern=O.isNegativePattern=O.convertToNegativePattern=O.convertToPositivePattern=O.isDynamicPattern=O.isStaticPattern=void 0;var np=M("path"),s_=ql(),wi=rp(),op="**",a_="\\",c_=/[*?]|^!/,l_=/\[[^[]*]/,u_=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,p_=/[!*+?@]\([^(]*\)/,d_=/,|\.\./,f_=/(?!^)\/{2,}/g;function ip(e,t={}){return!sp(e,t)}O.isStaticPattern=ip;function sp(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(a_)||c_.test(e)||l_.test(e)||u_.test(e)||t.extglob!==!1&&p_.test(e)||t.braceExpansion!==!1&&h_(e))}O.isDynamicPattern=sp;function h_(e){let t=e.indexOf("{");if(t===-1)return!1;let r=e.indexOf("}",t+1);if(r===-1)return!1;let n=e.slice(t,r);return d_.test(n)}function m_(e){return hn(e)?e.slice(1):e}O.convertToPositivePattern=m_;function g_(e){return"!"+e}O.convertToNegativePattern=g_;function hn(e){return e.startsWith("!")&&e[1]!=="("}O.isNegativePattern=hn;function ap(e){return!hn(e)}O.isPositivePattern=ap;function y_(e){return e.filter(hn)}O.getNegativePatterns=y_;function v_(e){return e.filter(ap)}O.getPositivePatterns=v_;function b_(e){return e.filter(t=>!Ci(t))}O.getPatternsInsideCurrentDirectory=b_;function __(e){return e.filter(Ci)}O.getPatternsOutsideCurrentDirectory=__;function Ci(e){return e.startsWith("..")||e.startsWith("./..")}O.isPatternRelatedToParentDirectory=Ci;function E_(e){return s_(e,{flipBackslashes:!1})}O.getBaseDirectory=E_;function x_(e){return e.includes(op)}O.hasGlobStar=x_;function cp(e){return e.endsWith("/"+op)}O.endsWithSlashGlobStar=cp;function k_(e){let t=np.basename(e);return cp(e)||ip(t)}O.isAffectDepthOfReadingPattern=k_;function w_(e){return e.reduce((t,r)=>t.concat(lp(r)),[])}O.expandPatternsWithBraceExpansion=w_;function lp(e){let t=wi.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}O.expandBraceExpansion=lp;function C_(e,t){let{parts:r}=wi.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return r.length===0&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}O.getPatternParts=C_;function up(e,t){return wi.makeRe(e,t)}O.makeRe=up;function A_(e,t){return e.map(r=>up(r,t))}O.convertPatternsToRe=A_;function S_(e,t){return t.some(r=>r.test(e))}O.matchAny=S_;function R_(e){return e.replace(f_,"/")}O.removeDuplicateSlashes=R_;function O_(e){let t=[],r=[];for(let n of e)pp(n)?t.push(n):r.push(n);return[t,r]}O.partitionAbsoluteAndRelative=O_;function pp(e){return np.isAbsolute(e)}O.isAbsolute=pp});var gp=k((ES,mp)=>{"use strict";var T_=M("stream"),fp=T_.PassThrough,P_=Array.prototype.slice;mp.exports=$_;function $_(){let e=[],t=P_.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let o=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=fp(n);function a(){for(let l=0,p=arguments.length;l<p;l++)e.push(hp(arguments[l],n));return c(),this}function c(){if(r)return;r=!0;let l=e.shift();if(!l){process.nextTick(u);return}Array.isArray(l)||(l=[l]);let p=l.length+1;function d(){--p>0||(r=!1,c())}function y(g){function m(){g.removeListener("merge2UnpipeEnd",m),g.removeListener("end",m),i&&g.removeListener("error",E),d()}function E(x){s.emit("error",x)}if(g._readableState.endEmitted)return d();g.on("merge2UnpipeEnd",m),g.on("end",m),i&&g.on("error",E),g.pipe(s,{end:!1}),g.resume()}for(let g=0;g<l.length;g++)y(l[g]);d()}function u(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function hp(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=hp(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(fp(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var vp=k(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.merge=void 0;var D_=gp();function N_(e){let t=D_(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>yp(e)),t.once("end",()=>yp(e)),t}mn.merge=N_;function yp(e){e.forEach(t=>t.emit("close"))}});var bp=k(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.isEmpty=Zt.isString=void 0;function L_(e){return typeof e=="string"}Zt.isString=L_;function I_(e){return e===""}Zt.isEmpty=I_});var at=k(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.string=ge.stream=ge.pattern=ge.path=ge.fs=ge.errno=ge.array=void 0;var F_=Dl();ge.array=F_;var j_=Nl();ge.errno=j_;var M_=Ll();ge.fs=M_;var B_=Ml();ge.path=B_;var H_=dp();ge.pattern=H_;var G_=vp();ge.stream=G_;var V_=bp();ge.string=V_});var kp=k(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.convertPatternGroupToTask=ye.convertPatternGroupsToTasks=ye.groupPatternsByBaseDirectory=ye.getNegativePatternsAsPositive=ye.getPositivePatterns=ye.convertPatternsToTasks=ye.generate=void 0;var Be=at();function W_(e,t){let r=_p(e,t),n=_p(t.ignore,t),o=Ep(r),i=xp(r,n),s=o.filter(l=>Be.pattern.isStaticPattern(l,t)),a=o.filter(l=>Be.pattern.isDynamicPattern(l,t)),c=Ai(s,i,!1),u=Ai(a,i,!0);return c.concat(u)}ye.generate=W_;function _p(e,t){let r=e;return t.braceExpansion&&(r=Be.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Be.pattern.removeDuplicateSlashes(n))}function Ai(e,t,r){let n=[],o=Be.pattern.getPatternsOutsideCurrentDirectory(e),i=Be.pattern.getPatternsInsideCurrentDirectory(e),s=Si(o),a=Si(i);return n.push(...Ri(s,t,r)),"."in a?n.push(Oi(".",i,t,r)):n.push(...Ri(a,t,r)),n}ye.convertPatternsToTasks=Ai;function Ep(e){return Be.pattern.getPositivePatterns(e)}ye.getPositivePatterns=Ep;function xp(e,t){return Be.pattern.getNegativePatterns(e).concat(t).map(Be.pattern.convertToPositivePattern)}ye.getNegativePatternsAsPositive=xp;function Si(e){let t={};return e.reduce((r,n)=>{let o=Be.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}ye.groupPatternsByBaseDirectory=Si;function Ri(e,t,r){return Object.keys(e).map(n=>Oi(n,e[n],t,r))}ye.convertPatternGroupsToTasks=Ri;function Oi(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(Be.pattern.convertToNegativePattern))}}ye.convertPatternGroupToTask=Oi});var Cp=k(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.read=void 0;function U_(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){wp(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){Ti(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){wp(r,i);return}Ti(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),Ti(r,s)})})}gn.read=U_;function wp(e,t){e(t)}function Ti(e,t){e(null,t)}});var Ap=k(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.read=void 0;function q_(e,t){let r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw n}}yn.read=q_});var Sp=k(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.createFileSystemAdapter=xt.FILE_SYSTEM_ADAPTER=void 0;var vn=M("fs");xt.FILE_SYSTEM_ADAPTER={lstat:vn.lstat,stat:vn.stat,lstatSync:vn.lstatSync,statSync:vn.statSync};function Y_(e){return e===void 0?xt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},xt.FILE_SYSTEM_ADAPTER),e)}xt.createFileSystemAdapter=Y_});var Rp=k($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});var K_=Sp(),Pi=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=K_.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,r){return t??r}};$i.default=Pi});var It=k(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.statSync=kt.stat=kt.Settings=void 0;var Op=Cp(),z_=Ap(),Di=Rp();kt.Settings=Di.default;function X_(e,t,r){if(typeof t=="function"){Op.read(e,Ni(),t);return}Op.read(e,Ni(t),r)}kt.stat=X_;function J_(e,t){let r=Ni(t);return z_.read(e,r)}kt.statSync=J_;function Ni(e={}){return e instanceof Di.default?e:new Di.default(e)}});var $p=k((PS,Pp)=>{var Tp;Pp.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(Tp||(Tp=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var Np=k(($S,Dp)=>{Dp.exports=Z_;var Q_=$p();function Z_(e,t){let r,n,o,i=!0;Array.isArray(e)?(r=[],n=e.length):(o=Object.keys(e),r={},n=o.length);function s(c){function u(){t&&t(c,r),t=null}i?Q_(u):u()}function a(c,u,l){r[c]=l,(--n===0||u)&&s(u)}n?o?o.forEach(function(c){e[c](function(u,l){a(c,u,l)})}):e.forEach(function(c,u){c(function(l,p){a(u,l,p)})}):s(null),i=!1}});var Li=k(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var bn=process.versions.node.split(".");if(bn[0]===void 0||bn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Lp=Number.parseInt(bn[0],10),eE=Number.parseInt(bn[1],10),Ip=10,tE=10,rE=Lp>Ip,nE=Lp===Ip&&eE>=tE;_n.IS_SUPPORT_READDIR_WITH_FILE_TYPES=rE||nE});var Fp=k(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.createDirentFromStats=void 0;var Ii=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function oE(e,t){return new Ii(e,t)}En.createDirentFromStats=oE});var Fi=k(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.fs=void 0;var iE=Fp();xn.fs=iE});var ji=k(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.joinPathSegments=void 0;function sE(e,t,r){return e.endsWith(r)?e+t:e+r+t}kn.joinPathSegments=sE});var Vp=k(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.readdir=wt.readdirWithFileTypes=wt.read=void 0;var aE=It(),jp=Np(),cE=Li(),Mp=Fi(),Bp=ji();function lE(e,t,r){if(!t.stats&&cE.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Hp(e,t,r);return}Gp(e,t,r)}wt.read=lE;function Hp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){wn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:Bp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){Mi(r,i);return}let s=i.map(a=>uE(a,t));jp(s,(a,c)=>{if(a!==null){wn(r,a);return}Mi(r,c)})})}wt.readdirWithFileTypes=Hp;function uE(e,t){return r=>{if(!e.dirent.isSymbolicLink()){r(null,e);return}t.fs.stat(e.path,(n,o)=>{if(n!==null){if(t.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,e);return}e.dirent=Mp.fs.createDirentFromStats(e.name,o),r(null,e)})}}function Gp(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){wn(r,n);return}let i=o.map(s=>{let a=Bp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{aE.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let p={name:s,path:a,dirent:Mp.fs.createDirentFromStats(s,l)};t.stats&&(p.stats=l),c(null,p)})}});jp(i,(s,a)=>{if(s!==null){wn(r,s);return}Mi(r,a)})})}wt.readdir=Gp;function wn(e,t){e(t)}function Mi(e,t){e(null,t)}});var Kp=k(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.readdir=Ct.readdirWithFileTypes=Ct.read=void 0;var pE=It(),dE=Li(),Wp=Fi(),Up=ji();function fE(e,t){return!t.stats&&dE.IS_SUPPORT_READDIR_WITH_FILE_TYPES?qp(e,t):Yp(e,t)}Ct.read=fE;function qp(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:Up.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=Wp.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}Ct.readdirWithFileTypes=qp;function Yp(e,t){return t.fs.readdirSync(e).map(n=>{let o=Up.joinPathSegments(e,n,t.pathSegmentSeparator),i=pE.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:Wp.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}Ct.readdir=Yp});var zp=k(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.createFileSystemAdapter=At.FILE_SYSTEM_ADAPTER=void 0;var er=M("fs");At.FILE_SYSTEM_ADAPTER={lstat:er.lstat,stat:er.stat,lstatSync:er.lstatSync,statSync:er.statSync,readdir:er.readdir,readdirSync:er.readdirSync};function hE(e){return e===void 0?At.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},At.FILE_SYSTEM_ADAPTER),e)}At.createFileSystemAdapter=hE});var Xp=k(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var mE=M("path"),gE=It(),yE=zp(),Bi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=yE.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,mE.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new gE.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Hi.default=Bi});var Cn=k(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.Settings=St.scandirSync=St.scandir=void 0;var Jp=Vp(),vE=Kp(),Gi=Xp();St.Settings=Gi.default;function bE(e,t,r){if(typeof t=="function"){Jp.read(e,Vi(),t);return}Jp.read(e,Vi(t),r)}St.scandir=bE;function _E(e,t){let r=Vi(t);return vE.read(e,r)}St.scandirSync=_E;function Vi(e={}){return e instanceof Gi.default?e:new Gi.default(e)}});var Zp=k((GS,Qp)=>{"use strict";function EE(e){var t=new e,r=t;function n(){var i=t;return i.next?t=i.next:(t=new e,r=t),i.next=null,i}function o(i){r.next=i,r=i}return{get:n,release:o}}Qp.exports=EE});var td=k((VS,Wi)=>{"use strict";var xE=Zp();function ed(e,t,r){if(typeof e=="function"&&(r=t,t=e,e=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=xE(kE),o=null,i=null,s=0,a=null,c={push:m,drain:Ce,saturated:Ce,pause:l,paused:!1,get concurrency(){return r},set concurrency(T){if(!(T>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=T,!c.paused)for(;o&&s<r;)s++,x()},running:u,resume:y,idle:g,length:p,getQueue:d,unshift:E,empty:Ce,kill:S,killAndDrain:$,error:q,abort:oe};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var T=o,L=0;T;)T=T.next,L++;return L}function d(){for(var T=o,L=[];T;)L.push(T.value),T=T.next;return L}function y(){if(c.paused){if(c.paused=!1,o===null){s++,x();return}for(;o&&s<r;)s++,x()}}function g(){return s===0&&c.length()===0}function m(T,L){var w=n.get();w.context=e,w.release=x,w.value=T,w.callback=L||Ce,w.errorHandler=a,s>=r||c.paused?i?(i.next=w,i=w):(o=w,i=w,c.saturated()):(s++,t.call(e,w.value,w.worked))}function E(T,L){var w=n.get();w.context=e,w.release=x,w.value=T,w.callback=L||Ce,w.errorHandler=a,s>=r||c.paused?o?(w.next=o,o=w):(o=w,i=w,c.saturated()):(s++,t.call(e,w.value,w.worked))}function x(T){T&&n.release(T);var L=o;L&&s<=r?c.paused?s--:(i===o&&(i=null),o=L.next,L.next=null,t.call(e,L.value,L.worked),i===null&&c.empty()):--s===0&&c.drain()}function S(){o=null,i=null,c.drain=Ce}function $(){o=null,i=null,c.drain(),c.drain=Ce}function oe(){var T=o;for(o=null,i=null;T;){var L=T.next,w=T.callback,F=T.errorHandler,ae=T.value,_=T.context;T.value=null,T.callback=Ce,T.errorHandler=null,F&&F(new Error("abort"),ae),w.call(_,new Error("abort")),T.release(T),T=L}c.drain=Ce}function q(T){a=T}}function Ce(){}function kE(){this.value=null,this.callback=Ce,this.next=null,this.release=Ce,this.context=null,this.errorHandler=null;var e=this;this.worked=function(r,n){var o=e.callback,i=e.errorHandler,s=e.value;e.value=null,e.callback=Ce,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function wE(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,p){t.call(this,l).then(function(d){p(null,d)},p)}var o=ed(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=u,o;function a(l){var p=new Promise(function(d,y){i(l,function(g,m){if(g){y(g);return}d(m)})});return p.catch(Ce),p}function c(l){var p=new Promise(function(d,y){s(l,function(g,m){if(g){y(g);return}d(m)})});return p.catch(Ce),p}function u(){var l=new Promise(function(p){process.nextTick(function(){if(o.idle())p();else{var d=o.drain;o.drain=function(){typeof d=="function"&&d(),p(),o.drain=d}}})});return l}}Wi.exports=ed;Wi.exports.promise=wE});var An=k(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.joinPathSegments=Ze.replacePathSegmentSeparator=Ze.isAppliedFilter=Ze.isFatalError=void 0;function CE(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ze.isFatalError=CE;function AE(e,t){return e===null||e(t)}Ze.isAppliedFilter=AE;function SE(e,t){return e.split(/[/\\]/).join(t)}Ze.replacePathSegmentSeparator=SE;function RE(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ze.joinPathSegments=RE});var Yi=k(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var OE=An(),Ui=class{constructor(t,r){this._root=t,this._settings=r,this._root=OE.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};qi.default=Ui});var Xi=k(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});var TE=M("events"),PE=Cn(),$E=td(),Sn=An(),DE=Yi(),Ki=class extends DE.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=PE.scandir,this._emitter=new TE.EventEmitter,this._queue=$E(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){let n={directory:t,base:r};this._queue.push(n,o=>{o!==null&&this._handleError(o)})}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,(n,o)=>{if(n!==null){r(n,void 0);return}for(let i of o)this._handleEntry(i,t.base);r(null,void 0)})}_handleError(t){this._isDestroyed||!Sn.isFatalError(this._settings,t)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError)return;let n=t.path;r!==void 0&&(t.path=Sn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Sn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Sn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};zi.default=Ki});var rd=k(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var NE=Xi(),Ji=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new NE.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{LE(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{IE(t,this._storage)}),this._reader.read()}};Qi.default=Ji;function LE(e,t){e(t)}function IE(e,t){e(null,t)}});var nd=k(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var FE=M("stream"),jE=Xi(),Zi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new jE.default(this._root,this._settings),this._stream=new FE.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};es.default=Zi});var od=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var ME=Cn(),Rn=An(),BE=Yi(),ts=class extends BE.default{constructor(){super(...arguments),this._scandir=ME.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(let t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,r){try{let n=this._scandir(t,this._settings.fsScandirSettings);for(let o of n)this._handleEntry(o,r)}catch(n){this._handleError(n)}}_handleError(t){if(Rn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=Rn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Rn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&Rn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};rs.default=ts});var id=k(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var HE=od(),ns=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new HE.default(this._root,this._settings)}read(){return this._reader.read()}};os.default=ns});var sd=k(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var GE=M("path"),VE=Cn(),is=class{constructor(t={}){this._options=t,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,GE.sep),this.fsScandirSettings=new VE.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};ss.default=is});var Tn=k(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.Settings=et.walkStream=et.walkSync=et.walk=void 0;var ad=rd(),WE=nd(),UE=id(),as=sd();et.Settings=as.default;function qE(e,t,r){if(typeof t=="function"){new ad.default(e,On()).read(t);return}new ad.default(e,On(t)).read(r)}et.walk=qE;function YE(e,t){let r=On(t);return new UE.default(e,r).read()}et.walkSync=YE;function KE(e,t){let r=On(t);return new WE.default(e,r).read()}et.walkStream=KE;function On(e={}){return e instanceof as.default?e:new as.default(e)}});var Pn=k(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var zE=M("path"),XE=It(),cd=at(),cs=class{constructor(t){this._settings=t,this._fsStatSettings=new XE.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return zE.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:cd.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!cd.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};ls.default=cs});var ds=k(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var JE=M("stream"),QE=It(),ZE=Tn(),ex=Pn(),us=class extends ex.default{constructor(){super(...arguments),this._walkStream=ZE.walkStream,this._stat=QE.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new JE.PassThrough({objectMode:!0});o._write=(i,s,a)=>this._getEntry(n[i],t[i],r).then(c=>{c!==null&&r.entryFilter(c)&&o.push(c),i===n.length-1&&o.end(),a()}).catch(a);for(let i=0;i<n.length;i++)o.write(i);return o}_getEntry(t,r,n){return this._getStat(t).then(o=>this._makeEntry(o,r)).catch(o=>{if(n.errorFilter(o))return null;throw o})}_getStat(t){return new Promise((r,n)=>{this._stat(t,this._fsStatSettings,(o,i)=>o===null?r(i):n(o))})}};ps.default=us});var ld=k(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var tx=Tn(),rx=Pn(),nx=ds(),fs=class extends rx.default{constructor(){super(...arguments),this._walkAsync=tx.walk,this._readerStream=new nx.default(this._settings)}dynamic(t,r){return new Promise((n,o)=>{this._walkAsync(t,r,(i,s)=>{i===null?n(s):o(i)})})}async static(t,r){let n=[],o=this._readerStream.static(t,r);return new Promise((i,s)=>{o.once("error",s),o.on("data",a=>n.push(a)),o.once("end",()=>i(n))})}};hs.default=fs});var ud=k(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var Tr=at(),ms=class{constructor(t,r,n){this._patterns=t,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let t of this._patterns){let r=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:t,segments:r,sections:n})}}_getPatternSegments(t){return Tr.pattern.getPatternParts(t,this._micromatchOptions).map(n=>Tr.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Tr.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return Tr.array.splitWhen(t,r=>r.dynamic&&Tr.pattern.hasGlobStar(r.pattern))}};gs.default=ms});var pd=k(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var ox=ud(),ys=class extends ox.default{match(t){let r=t.split("/"),n=r.length,o=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of o){let s=i.sections[0];if(!i.complete&&n>s.length||r.every((c,u)=>{let l=i.segments[u];return!!(l.dynamic&&l.patternRe.test(c)||!l.dynamic&&l.pattern===c)}))return!0}return!1}};vs.default=ys});var dd=k(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var $n=at(),ix=pd(),bs=class{constructor(t,r){this._settings=t,this._micromatchOptions=r}getFilter(t,r,n){let o=this._getMatcher(r),i=this._getNegativePatternsRe(n);return s=>this._filter(t,s,o,i)}_getMatcher(t){return new ix.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter($n.pattern.isAffectDepthOfReadingPattern);return $n.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=$n.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,o)}_isSkippedByDeep(t,r){return this._settings.deep===1/0?!1:this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){let n=r.split("/").length;if(t==="")return n;let o=t.split("/").length;return n-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!$n.pattern.matchAny(t,r)}};_s.default=bs});var fd=k(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var Rt=at(),Es=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=Rt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:Rt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:Rt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:Rt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=Rt.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;let o=this._isMatchToPatternsSet(n,r,t.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(n),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,r,n){return!(!this._isMatchToPatterns(t,r.positive.all,n)||this._isMatchToPatterns(t,r.negative.relative,n)||this._isMatchToAbsoluteNegative(t,r.negative.absolute,n))}_isMatchToAbsoluteNegative(t,r,n){if(r.length===0)return!1;let o=Rt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=Rt.pattern.matchAny(t,r);return!o&&n?Rt.pattern.matchAny(t+"/",r):o}};xs.default=Es});var hd=k(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});var sx=at(),ks=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return sx.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};ws.default=ks});var gd=k(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var md=at(),Cs=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=md.path.makeAbsolute(this._settings.cwd,r),r=md.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};As.default=Cs});var Dn=k(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});var ax=M("path"),cx=dd(),lx=fd(),ux=hd(),px=gd(),Ss=class{constructor(t){this._settings=t,this.errorFilter=new ux.default(this._settings),this.entryFilter=new lx.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new cx.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new px.default(this._settings)}_getRootDirectory(t){return ax.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){let r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};Rs.default=Ss});var yd=k(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});var dx=ld(),fx=Dn(),Os=class extends fx.default{constructor(){super(...arguments),this._reader=new dx.default(this._settings)}async read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(r,t,n)).map(i=>n.transform(i))}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};Ts.default=Os});var vd=k($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var hx=M("stream"),mx=ds(),gx=Dn(),Ps=class extends gx.default{constructor(){super(...arguments),this._reader=new mx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new hx.Readable({objectMode:!0,read:()=>{}});return o.once("error",s=>i.emit("error",s)).on("data",s=>i.emit("data",n.transform(s))).once("end",()=>i.emit("end")),i.once("close",()=>o.destroy()),i}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};$s.default=Ps});var bd=k(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var yx=It(),vx=Tn(),bx=Pn(),Ds=class extends bx.default{constructor(){super(...arguments),this._walkSync=vx.walkSync,this._statSync=yx.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){let n=[];for(let o of t){let i=this._getFullEntryPath(o),s=this._getEntry(i,o,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(t,r,n){try{let o=this._getStat(t);return this._makeEntry(o,r)}catch(o){if(n.errorFilter(o))return null;throw o}}_getStat(t){return this._statSync(t,this._fsStatSettings)}};Ns.default=Ds});var _d=k(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});var _x=bd(),Ex=Dn(),Ls=class extends Ex.default{constructor(){super(...arguments),this._reader=new _x.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(r,t,n).map(n.transform)}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};Is.default=Ls});var Ed=k(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var tr=M("fs"),xx=M("os"),kx=Math.max(xx.cpus().length,1);rr.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:tr.lstat,lstatSync:tr.lstatSync,stat:tr.stat,statSync:tr.statSync,readdir:tr.readdir,readdirSync:tr.readdirSync};var Fs=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,kx),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===void 0?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},rr.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};rr.default=Fs});var Nn=k((h0,kd)=>{"use strict";var xd=kp(),wx=yd(),Cx=vd(),Ax=_d(),js=Ed(),Ne=at();async function Ms(e,t){He(e);let r=Bs(e,wx.default,t),n=await Promise.all(r);return Ne.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){He(u);let p=Bs(u,Ax.default,l);return Ne.array.flatten(p)}e.sync=t;function r(u,l){He(u);let p=Bs(u,Cx.default,l);return Ne.stream.merge(p)}e.stream=r;function n(u,l){He(u);let p=[].concat(u),d=new js.default(l);return xd.generate(p,d)}e.generateTasks=n;function o(u,l){He(u);let p=new js.default(l);return Ne.pattern.isDynamicPattern(u,p)}e.isDynamicPattern=o;function i(u){return He(u),Ne.path.escape(u)}e.escapePath=i;function s(u){return He(u),Ne.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(d){return He(d),Ne.path.escapePosixPath(d)}u.escapePath=l;function p(d){return He(d),Ne.path.convertPosixPathToPattern(d)}u.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(u){function l(d){return He(d),Ne.path.escapeWindowsPath(d)}u.escapePath=l;function p(d){return He(d),Ne.path.convertWindowsPathToPattern(d)}u.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(Ms||(Ms={}));function Bs(e,t,r){let n=[].concat(e),o=new js.default(r),i=xd.generate(n,o),s=new t(o);return i.map(s.read,s)}function He(e){if(![].concat(e).every(n=>Ne.string.isString(n)&&!Ne.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}kd.exports=Ms});var wd=vt(()=>{});import{promisify as Sx}from"node:util";import{execFile as Rx,execFileSync as v0}from"node:child_process";import{fileURLToPath as Ox}from"node:url";function Pr(e){return e instanceof URL?Ox(e):e}var _0,E0,Hs=vt(()=>{wd();_0=Sx(Rx);E0=10*1024*1024});var Dd=k((w0,Fn)=>{function Sd(e){return Array.isArray(e)?e:[e]}var Tx=void 0,Vs="",Cd=" ",Gs="\\",Px=/^\s+$/,$x=/(?:[^\\]|^)\\$/,Dx=/^\\!/,Nx=/^\\#/,Lx=/\r?\n/g,Ix=/^\.{0,2}\/|^\.{1,2}$/,Fx=/\/$/,nr="/",Rd="node-ignore";typeof Symbol<"u"&&(Rd=Symbol.for("node-ignore"));var Od=Rd,or=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),jx=/([0-z])-([0-z])/g,Td=()=>!1,Mx=e=>e.replace(jx,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Vs),Bx=e=>{let{length:t}=e;return e.slice(0,t-t%2)},Hx=[[/^\uFEFF/,()=>Vs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?Cd:Vs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+Cd}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Gs],[/\\\\/g,()=>Gs],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===Gs?`\\[${r}${Bx(n)}${o}`:o==="]"&&n.length%2===0?`[${Mx(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],Gx=/(^|\\\/)?\\\*$/,$r="regex",Ln="checkRegex",Ad="_",Vx={[$r](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Ln](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},Wx=e=>Hx.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),In=e=>typeof e=="string",Ux=e=>e&&In(e)&&!Px.test(e)&&!$x.test(e)&&e.indexOf("#")!==0,qx=e=>e.split(Lx).filter(Boolean),Ws=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,or(this,"body",n),or(this,"ignoreCase",o),or(this,"regexPrefix",s)}get regex(){let t=Ad+$r;return this[t]?this[t]:this._make($r,t)}get checkRegex(){let t=Ad+Ln;return this[t]?this[t]:this._make(Ln,t)}_make(t,r){let n=this.regexPrefix.replace(Gx,Vx[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return or(this,r,o)}},Yx=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(Dx,"!").replace(Nx,"#");let i=Wx(o);return new Ws(e,t,o,r,n,i)},Us=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[Od]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(In(t)&&(t={pattern:t}),Ux(t.pattern)){let r=Yx(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Sd(In(t)?qx(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:u}=c;i===u&&o!==i||u&&!o&&!i&&!r||!c[n].test(t)||(o=!u,i=u,s=u?Tx:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},Kx=(e,t)=>{throw new t(e)},ct=(e,t,r)=>In(e)?e?ct.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),Pd=e=>Ix.test(e);ct.isNotRelative=Pd;ct.convert=e=>e;var qs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){or(this,Od,!0),this._rules=new Us(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,r,n,o){let i=t&&ct.convert(t);return ct(i,t,this._strictPathCheck?Kx:Td),this._t(i,r,n,o)}checkIgnore(t){if(!Fx.test(t))return this.test(t);let r=t.split(nr).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(nr)+nr,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Ln)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(nr).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,$r);let i=this._t(o.join(nr)+nr,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,$r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Sd(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Ys=e=>new qs(e),zx=e=>ct(e&&ct.convert(e),e,Td),$d=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");ct.convert=e;let t=/^[a-z]:\//i;ct.isNotRelative=r=>t.test(r)||Pd(r)};typeof process<"u"&&process.platform==="win32"&&$d();Fn.exports=Ys;Ys.default=Ys;Fn.exports.isPathValid=zx;or(Fn.exports,Symbol.for("setupWindows"),$d)});import Ks from"node:path";function Dr(e,t){let r=Ks.relative(t,e);return!!(r&&r!==".."&&!r.startsWith(`..${Ks.sep}`)&&r!==Ks.resolve(e))}var zs=vt(()=>{});function jn(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var Nd=vt(()=>{});import Ld from"node:fs";import Oe from"node:path";import{promisify as Xx}from"node:util";var Xs,Ge,Jx,Qx,Js,Id,Ae,Mn,Qs,Zx,Bn,ek,tk,Fd,Zs,rk,nk,ea,ok,jd,ik,Md,ta,ra=vt(()=>{Xs=Ht(Nn(),1);zs();Ge=e=>e[0]==="!",Jx=e=>{if(!e.startsWith("/"))return e;let t=e.slice(1),r=t.indexOf("/"),n=r>0?t.slice(0,r):t;return r>0&&!Xs.default.isDynamicPattern(n)?e:t},Qx=(e,t)=>t===e,Js=e=>{if(!Oe.isAbsolute(e))return;let t=[];for(let r of e.split("/"))if(r){if(Xs.default.isDynamicPattern(r))break;t.push(r)}return t.length===0?void 0:`/${t.join("/")}`},Id=(e,t=[],r=!1)=>{if(!e.startsWith("/"))return e;let n=Jx(e);if(n!==e)return n;if(r)return e.slice(1);let o=Js(e);return o!==void 0&&t.some(s=>Qx(s,o))?e:e.slice(1)},Ae=(e,t)=>{let r=e?.[t];return typeof r=="function"?r.bind(e):void 0},Mn=(e,t)=>{let r=e?.[t];if(typeof r=="function")return Xx(r.bind(e))},Qs=e=>{if(!e.endsWith("/"))return e;let t=e.replace(/\/+$/u,"");if(!t)return"/**";if(t==="**")return"**/**";let r=t.startsWith("/"),o=(r?t.slice(1):t).includes("/");return`${!r&&!o&&!t.startsWith("**/")?"**/":""}${t}/**`},Zx=e=>{let r=(Ge(e)?e.slice(1):e).match(/^(\.\.\/)+/);return r?r[0]:""},Bn=(e,t)=>{if(e.length===0||t.length===0)return t;let r=e.map(i=>Zx(i)),n=r[0];return!n||!r.every(i=>i===n)?t:t.map(i=>i.startsWith("**/")&&!i.startsWith("../")?n+i:i)},ek=e=>Ae(e?.promises,"stat")??Ae(Ld.promises,"stat"),tk=e=>Ae(e||Ld,"statSync"),Fd=e=>!!(e?.isDirectory?.()||e?.isFile?.()),Zs=(e,t)=>{let r=[],n=e;for(r.push(n);n!==t;){let o=Oe.dirname(n);if(o===n)break;n=o,r.push(n)}return r},rk=async(e,t)=>{for(let r of e){let n=Oe.join(r,".git");try{let o=await t(n);if(Fd(o))return r}catch{}}},nk=(e,t)=>{let r=tk(t);if(!r)return;let n=Oe.resolve(e),{root:o}=Oe.parse(n),i=Zs(n,o);for(let s of i){let a=Oe.join(s,".git");try{let c=r(a);if(Fd(c))return s}catch{}}},ea=(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return nk(e,t)},ok=async(e,t)=>{let r=ek(t);if(!r)return ea(e,t);let n=Oe.resolve(e),{root:o}=Oe.parse(n),i=Zs(n,o);return rk(i,r)},jd=async(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return ok(e,t)},ik=(e,t)=>{let r=Oe.resolve(e),n=Oe.resolve(t);return n===r||Dr(n,r)},Md=(e,t)=>{if(e&&typeof e!="string")throw new TypeError("gitRoot must be a string or undefined");if(typeof t!="string")throw new TypeError("cwd must be a string");return e?ik(e,t)?[...Zs(Oe.resolve(t),Oe.resolve(e))].reverse().map(n=>Oe.join(n,".gitignore")):[]:[]},ta=(e,t,r)=>{if(t)return[];let n=[],o=!1;for(let i of e){if(Ge(i)){o=!0;break}n.push(r(i))}return o?[]:n}});import sk from"node:process";import ak from"node:fs";import ck from"node:fs/promises";import Te from"node:path";var na,Bd,lk,uk,Hn,pk,dk,Hd,Gd,fk,hk,mk,gk,Vd,yk,Wd,Gn,vk,bk,_k,Ek,Ud,qd,Yd,oa,ia,xk,Kd,zd,Xd,Jd,sa=vt(()=>{na=Ht(Nn(),1),Bd=Ht(Dd(),1);zs();Nd();Hs();ra();lk=["**/node_modules","**/flow-typed","**/coverage","**/.git"],uk={absolute:!0,dot:!0},Hn="**/.gitignore",pk=e=>Ae(e?.promises,"readFile")??Ae(ck,"readFile")??Mn(e,"readFile"),dk=e=>Ae(e,"readFileSync")??Ae(ak,"readFileSync"),Hd=(e,t)=>e&&(e.code==="ENOENT"||e.code==="ENOTDIR")?!0:!!t,Gd=(e,t)=>t instanceof Error?(t.message=`Failed to read ignore file at ${e}: ${t.message}`,t):new Error(`Failed to read ignore file at ${e}: ${String(t)}`),fk=(e,t,r)=>{try{let n=t(e,"utf8");return{filePath:e,content:n}}catch(n){if(Hd(n,r))return;throw Gd(e,n)}},hk=async(e,t,r)=>(await Promise.all(e.map(async o=>{try{let i=await t(o,"utf8");return{filePath:o,content:i}}catch(i){if(Hd(i,r))return;throw Gd(o,i)}}))).filter(Boolean),mk=(e,t,r)=>e.map(n=>fk(n,t,r)).filter(Boolean),gk=e=>{let t=new Set;return e.filter(r=>t.has(r)?!1:(t.add(r),!0))},Vd=(e,t,r)=>e(t,{...r,...uk}),yk=(e,t)=>e?Md(e,t.cwd):[],Wd=(e,t,r)=>gk([...yk(e,t),...r]),Gn=(e,t,r)=>{let n=r||t.cwd,o=xk(e,n);return{patterns:o,predicate:Ek(o,t.cwd,n),usingGitRoot:!!(r&&r!==t.cwd)}},vk=(e,t)=>{if(!t)return e;let r=Ge(e),n=r?e.slice(1):e,o=n.indexOf("/"),i=o!==-1&&o!==n.length-1,s;return i?n.startsWith("/")?s=Te.posix.join(t,n.slice(1)):s=Te.posix.join(t,n):s=Te.posix.join(t,"**",n),r?"!"+s:s},bk=(e,t)=>{let r=jn(Te.relative(t,Te.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>vk(n,r))},_k=(e,t)=>{if(Te.isAbsolute(e)){let r=Te.relative(t,e);return r&&!Dr(e,t)?void 0:r}if(e.startsWith("./"))return e.slice(2);if(!e.startsWith("../"))return e},Ek=(e,t,r)=>{let n=(0,Bd.default)().add(e),o=Te.normalize(Te.resolve(t)),i=Te.normalize(Te.resolve(r));return s=>{if(s=Pr(s),Te.normalize(Te.resolve(s))===o)return!1;let c=_k(s,i);return c===void 0?!1:c?n.ignores(jn(c)):!1}},Ud=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[],r=Pr(e.cwd)??sk.cwd(),n=typeof e.deep=="number"?Math.max(0,e.deep)+1:Number.POSITIVE_INFINITY;return{cwd:r,suppressErrors:e.suppressErrors??!1,deep:n,ignore:[...t,...lk],followSymbolicLinks:e.followSymbolicLinks??!0,concurrency:e.concurrency,throwErrorOnBrokenSymbolicLink:e.throwErrorOnBrokenSymbolicLink??!1,fs:e.fs}},qd=async(e,t,r)=>{let n=Ud(t),o=await Vd(na.default,e,n),i=r?await jd(n.cwd,n.fs):void 0,s=Wd(i,n,o),a=pk(n.fs);return{files:await hk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},Yd=(e,t,r)=>{let n=Ud(t),o=Vd(na.default.sync,e,n),i=r?ea(n.cwd,n.fs):void 0,s=Wd(i,n,o),a=dk(n.fs);return{files:mk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},oa=async(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=await qd(e,t,!1);return Gn(r,n,o).predicate},ia=(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=Yd(e,t,!1);return Gn(r,n,o).predicate},xk=(e,t)=>e.flatMap(r=>bk(r,t)),Kd=async(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=await qd(e,t,r);return Gn(n,o,i)},zd=(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=Yd(e,t,r);return Gn(n,o,i)},Xd=e=>oa(Hn,e),Jd=e=>ia(Hn,e)});var df={};Mh(df,{convertPathToPattern:()=>Ik,generateGlobTasks:()=>Nk,generateGlobTasksSync:()=>Lk,globby:()=>pa,globbyStream:()=>$k,globbySync:()=>Pk,isDynamicPattern:()=>Dk,isGitIgnored:()=>Xd,isGitIgnoredSync:()=>Jd,isIgnoredByIgnoreFiles:()=>oa,isIgnoredByIgnoreFilesSync:()=>ia});import aa from"node:process";import ca from"node:fs";import lt from"node:path";import{Readable as kk}from"node:stream";var ir,wk,Ck,Ak,Sk,Rk,ef,tf,Vn,Qd,Zd,la,Ok,rf,nf,Un,of,Tk,sf,Wn,af,cf,lf,uf,pf,ua,pa,Pk,$k,Dk,Nk,Lk,Ik,da=vt(()=>{$l();ir=Ht(Nn(),1);Hs();sa();ra();sa();wk=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},Ck=e=>Ae(e?.promises,"stat")??Ae(ca.promises,"stat")??Mn(e,"stat"),Ak=e=>Ae(e,"statSync")??Ae(ca,"statSync"),Sk=async(e,t)=>{try{return(await Ck(t)(e)).isDirectory()}catch{return!1}},Rk=(e,t)=>{try{return Ak(t)(e).isDirectory()}catch{return!1}},ef=(e,t)=>{let r=Ge(e)?e.slice(1):e;return lt.isAbsolute(r)?r:lt.join(t,r)},tf=e=>{let t=e?.match(/\*\*\/([^/]+)$/);if(!t)return!1;let r=t[1],n=/[*?[\]{}]/.test(r),o=lt.extname(r)&&!r.startsWith(".");return!n&&!o},Vn=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>lt.posix.join(e,`**/${lt.extname(o)?o:`${o}${n}`}`)):[lt.posix.join(e,`**${n?`/*${n}`:""}`)]},Qd=async(e,{cwd:t=aa.cwd(),files:r,extensions:n,fs:o}={})=>(await Promise.all(e.map(async s=>{let a=Ge(s)?s.slice(1):s;if(tf(a))return Vn({directoryPath:s,files:r,extensions:n});let c=ef(s,t);return await Sk(c,o)?Vn({directoryPath:s,files:r,extensions:n}):s}))).flat(),Zd=(e,{cwd:t=aa.cwd(),files:r,extensions:n,fs:o}={})=>e.flatMap(i=>{let s=Ge(i)?i.slice(1):i;if(tf(s))return Vn({directoryPath:i,files:r,extensions:n});let a=ef(i,t);return Rk(a,o)?Vn({directoryPath:i,files:r,extensions:n}):i}),la=e=>(e=[...new Set([e].flat())],wk(e),e),Ok=(e,t=ca)=>{if(!e||!t.statSync)return;let r;try{r=t.statSync(e)}catch{return}if(!r.isDirectory())throw new Error(`The \`cwd\` option must be a path to a directory, got: ${e}`)},rf=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[];return e={...e,ignore:t,expandDirectories:e.expandDirectories??!0,cwd:Pr(e.cwd)},Ok(e.cwd,e.fs),e},nf=e=>async(t,r)=>e(la(t),rf(r)),Un=e=>(t,r)=>e(la(t),rf(r)),of=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?la(t):[];return r&&n.push(Hn),n},Tk=async e=>{let t=of(e);if(t.length===0)return{options:e,filter:Wn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=await Kd(t,e,r),s=ta(n,i,Qs);return{options:{...e,ignore:[...e.ignore,...s]},filter:Wn(o,e.cwd)}},sf=e=>{let t=of(e);if(t.length===0)return{options:e,filter:Wn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=zd(t,e,r),s=ta(n,i,Qs);return{options:{...e,ignore:[...e.ignore,...s]},filter:Wn(o,e.cwd)}},Wn=(e,t)=>{let r=new Set,n=t||aa.cwd(),o=new Map;return i=>{let s=lt.normalize(i.path??i);if(r.has(s))return!1;if(e){let a=o.get(s);if(a===void 0&&(a=lt.isAbsolute(s)?s:lt.resolve(n,s),o.set(s,a),o.size>1e4&&o.clear()),e(a))return!1}return r.add(s),!0}},af=(e,t)=>e.flat().filter(r=>t(r)),cf=(e,t)=>{if(e.length>0&&e.every(s=>Ge(s))){if(t.expandNegationOnlyPatterns===!1)return[];e=["**/*",...e]}let r=[],n=!1,o=[];for(let s of e){if(Ge(s)){o.push(`!${Id(s.slice(1),r,n)}`);continue}o.push(s);let a=Js(s);if(a===void 0){n=!0;continue}r.push(a)}e=o;let i=[];for(;e.length>0;){let s=e.findIndex(c=>Ge(c));if(s===-1){i.push({patterns:e,options:t});break}let a=e[s].slice(1);for(let c of i)c.options.ignore.push(a);s!==0&&i.push({patterns:e.slice(0,s),options:{...t,ignore:[...t.ignore,a]}}),e=e.slice(s+1)}return i},lf=e=>e.map(t=>({patterns:t.patterns,options:{...t.options,ignore:Bn(t.patterns,t.options.ignore)}})),uf=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),pf=async(e,t)=>{let r=cf(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return lf(r);let s={...uf(o,n),fs:i};return Promise.all(r.map(async a=>{let{patterns:c,options:u}=a;return[c,u.ignore]=await Promise.all([Qd(c,s),Qd(u.ignore,{cwd:n,fs:i})]),u.ignore=Bn(c,u.ignore),{patterns:c,options:u}}))},ua=(e,t)=>{let r=cf(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return lf(r);let s={...uf(o,n),fs:i};return r.map(a=>{let{patterns:c,options:u}=a;return c=Zd(c,s),u.ignore=Zd(u.ignore,{cwd:n,fs:i}),u.ignore=Bn(c,u.ignore),{patterns:c,options:u}})},pa=nf(async(e,t)=>{let{options:r,filter:n}=await Tk(t),o=await pf(e,r),i=await Promise.all(o.map(s=>(0,ir.default)(s.patterns,s.options)));return af(i,n)}),Pk=Un((e,t)=>{let{options:r,filter:n}=sf(t),i=ua(e,r).map(s=>ir.default.sync(s.patterns,s.options));return af(i,n)}),$k=Un((e,t)=>{let{options:r,filter:n}=sf(t),i=ua(e,r).map(a=>ir.default.stream(a.patterns,a.options));return i.length===0?kk.from([]):ti(i).filter(a=>n(a))}),Dk=Un((e,t)=>e.some(r=>ir.default.isDynamicPattern(r,t))),Nk=nf(pf),Lk=Un(ua),{convertPathToPattern:Ik}=ir.default});var Ye=["frontend","backend"],ho=["workbench.frontend","workbench.backend"],Wr=[...Ye,...ho];var Ha=(e=0)=>t=>`\x1B[${t+e}m`,Ga=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Va=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},MC=Object.keys(ee.modifier),Hh=Object.keys(ee.color),Gh=Object.keys(ee.bgColor),BC=[...Hh,...Gh];function Vh(){let e=new Map;for(let[t,r]of Object.entries(ee)){for(let[n,o]of Object.entries(r))ee[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ee[n],e.set(o[0],o[1]);Object.defineProperty(ee,t,{value:r,enumerable:!1})}return Object.defineProperty(ee,"codes",{value:e,enumerable:!1}),ee.color.close="\x1B[39m",ee.bgColor.close="\x1B[49m",ee.color.ansi=Ha(),ee.color.ansi256=Ga(),ee.color.ansi16m=Va(),ee.bgColor.ansi=Ha(10),ee.bgColor.ansi256=Ga(10),ee.bgColor.ansi16m=Va(10),Object.defineProperties(ee,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>ee.rgbToAnsi256(...ee.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ee.ansi256ToAnsi(ee.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ee.ansi256ToAnsi(ee.hexToAnsi256(t)),enumerable:!1}}),ee}var Wh=Vh(),Me=Wh;import mo from"node:process";import Uh from"node:os";import Wa from"node:tty";function Pe(e,t=globalThis.Deno?globalThis.Deno.args:mo.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:te}=mo,Ur;Pe("no-color")||Pe("no-colors")||Pe("color=false")||Pe("color=never")?Ur=0:(Pe("color")||Pe("colors")||Pe("color=true")||Pe("color=always"))&&(Ur=1);function qh(){if("FORCE_COLOR"in te)return te.FORCE_COLOR==="true"?1:te.FORCE_COLOR==="false"?0:te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(te.FORCE_COLOR,10),3)}function Yh(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Kh(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=qh();n!==void 0&&(Ur=n);let o=r?Ur:n;if(o===0)return 0;if(r){if(Pe("color=16m")||Pe("color=full")||Pe("color=truecolor"))return 3;if(Pe("color=256"))return 2}if("TF_BUILD"in te&&"AGENT_NAME"in te)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(te.TERM==="dumb")return i;if(mo.platform==="win32"){let s=Uh.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in te)||te.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if(te.COLORTERM==="truecolor"||te.TERM==="xterm-kitty"||te.TERM==="xterm-ghostty"||te.TERM==="wezterm")return 3;if("TERM_PROGRAM"in te){let s=Number.parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:i}function Ua(e,t={}){let r=Kh(e,{streamIsTTY:e&&e.isTTY,...t});return Yh(r)}var zh={stdout:Ua({isTTY:Wa.isatty(1)}),stderr:Ua({isTTY:Wa.isatty(2)})},qa=zh;function Ya(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function Ka(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
32
+ `:`
33
+ `)+r,o=n+1,n=e.indexOf(`
34
+ `,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:za,stderr:Xa}=qa,go=Symbol("GENERATOR"),Gt=Symbol("STYLER"),mr=Symbol("IS_EMPTY"),Ja=["ansi","ansi","ansi256","ansi16m"],Vt=Object.create(null),Xh=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=za?za.level:0;e.level=t.level===void 0?r:t.level};var Jh=e=>{let t=(...r)=>r.join(" ");return Xh(t,e),Object.setPrototypeOf(t,gr.prototype),t};function gr(e){return Jh(e)}Object.setPrototypeOf(gr.prototype,Function.prototype);for(let[e,t]of Object.entries(Me))Vt[e]={get(){let r=qr(this,vo(t.open,t.close,this[Gt]),this[mr]);return Object.defineProperty(this,e,{value:r}),r}};Vt.visible={get(){let e=qr(this,this[Gt],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var yo=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Me[r].ansi16m(...n):t==="ansi256"?Me[r].ansi256(Me.rgbToAnsi256(...n)):Me[r].ansi(Me.rgbToAnsi(...n)):e==="hex"?yo("rgb",t,r,...Me.hexToRgb(...n)):Me[r][e](...n),Qh=["rgb","hex","ansi256"];for(let e of Qh){Vt[e]={get(){let{level:r}=this;return function(...n){let o=vo(yo(e,Ja[r],"color",...n),Me.color.close,this[Gt]);return qr(this,o,this[mr])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Vt[t]={get(){let{level:r}=this;return function(...n){let o=vo(yo(e,Ja[r],"bgColor",...n),Me.bgColor.close,this[Gt]);return qr(this,o,this[mr])}}}}var Zh=Object.defineProperties(()=>{},{...Vt,level:{enumerable:!0,get(){return this[go].level},set(e){this[go].level=e}}}),vo=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},qr=(e,t,r)=>{let n=(...o)=>em(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Zh),n[go]=e,n[Gt]=t,n[mr]=r,n},em=(e,t)=>{if(e.level<=0||!t)return e[mr]?"":t;let r=e[Gt];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Ya(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
35
+ `);return i!==-1&&(t=Ka(t,o,n,i)),n+t+o};Object.defineProperties(gr.prototype,Vt);var tm=gr(),XC=gr({level:Xa?Xa.level:0});var h=tm;var uc=Ht(lc(),1),{program:iA,createCommand:sA,createArgument:aA,createOption:cA,CommanderError:lA,InvalidArgumentError:uA,InvalidOptionArgumentError:pA,Command:pc,Argument:dA,Option:fA,Help:hA}=uc.default;function W(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ke(e){return function t(r){return arguments.length===0||W(r)?t:e.apply(this,arguments)}}function ze(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return W(r)?t:Ke(function(o){return e(r,o)});default:return W(r)&&W(n)?t:W(r)?Ke(function(o){return e(o,n)}):W(n)?Ke(function(o){return e(r,o)}):e(r,n)}}}function vr(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return W(r)?t:ze(function(i,s){return e(r,i,s)});case 2:return W(r)&&W(n)?t:W(r)?ze(function(i,s){return e(i,n,s)}):W(n)?ze(function(i,s){return e(r,i,s)}):Ke(function(i){return e(r,n,i)});default:return W(r)&&W(n)&&W(o)?t:W(r)&&W(n)?ze(function(i,s){return e(i,s,o)}):W(r)&&W(o)?ze(function(i,s){return e(i,n,s)}):W(n)&&W(o)?ze(function(i,s){return e(r,i,s)}):W(r)?Ke(function(i){return e(i,n,o)}):W(n)?Ke(function(i){return e(r,i,o)}):W(o)?Ke(function(i){return e(r,n,i)}):e(r,n,o)}}}function Wt(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Xr(e){return Object.prototype.toString.call(e)==="[object Object]"}var ym=vr(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)Wt(i,r)&&(o[i]=Wt(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)Wt(i,n)&&!Wt(i,o)&&(o[i]=n[i]);return o}),dc=ym;var vm=vr(function e(t,r,n){return dc(function(o,i,s){return Xr(i)&&Xr(s)?e(t,i,s):t(o,i,s)},r,n)}),fc=vm;var bm=ze(function(t,r){return fc(function(n,o,i){return i},t,r)}),bt=bm;import Pt from"fs-extra";import hr from"path";function Oc(e){return typeof e>"u"||e===null}function _m(e){return typeof e=="object"&&e!==null}function Em(e){return Array.isArray(e)?e:Oc(e)?[]:[e]}function xm(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function km(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function wm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Cm=Oc,Am=_m,Sm=Em,Rm=km,Om=wm,Tm=xm,le={isNothing:Cm,isObject:Am,toArray:Sm,repeat:Rm,isNegativeZero:Om,extend:Tm};function Tc(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
36
+
37
+ `+e.mark.snippet),n+" "+r):n}function _r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Tc(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}_r.prototype=Object.create(Error.prototype);_r.prototype.constructor=_r;_r.prototype.toString=function(t){return this.name+": "+Tc(this,t)};var be=_r;function Io(e,t,r,n,o){var i="",s="",a=Math.floor(o/2)-1;return n-t>a&&(i=" ... ",t=n-a+i.length),r-n>a&&(s=" ...",r=n+a-s.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+s,pos:n-t+i.length}}function Fo(e,t){return le.repeat(" ",t-e.length)+e}function Pm(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],i,s=-1;i=r.exec(e.buffer);)o.push(i.index),n.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var a="",c,u,l=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+l+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)u=Io(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),p),a=le.repeat(" ",t.indent)+Fo((e.line-c+1).toString(),l)+" | "+u.str+`
38
+ `+a;for(u=Io(e.buffer,n[s],o[s],e.position,p),a+=le.repeat(" ",t.indent)+Fo((e.line+1).toString(),l)+" | "+u.str+`
39
+ `,a+=le.repeat("-",t.indent+l+3+u.pos)+`^
40
+ `,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=Io(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),p),a+=le.repeat(" ",t.indent)+Fo((e.line+c+1).toString(),l)+" | "+u.str+`
41
+ `;return a.replace(/\n$/,"")}var $m=Pm,Dm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Nm=["scalar","sequence","mapping"];function Lm(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Im(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Dm.indexOf(r)===-1)throw new be('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Lm(t.styleAliases||null),Nm.indexOf(this.kind)===-1)throw new be('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var fe=Im;function hc(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(i,s){i.tag===n.tag&&i.kind===n.kind&&i.multi===n.multi&&(o=s)}),r[o]=n}),r}function Fm(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function Mo(e){return this.extend(e)}Mo.prototype.extend=function(t){var r=[],n=[];if(t instanceof fe)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new be("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof fe))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new be("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new be("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(i){if(!(i instanceof fe))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(Mo.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=hc(o,"implicit"),o.compiledExplicit=hc(o,"explicit"),o.compiledTypeMap=Fm(o.compiledImplicit,o.compiledExplicit),o};var Pc=Mo,$c=new fe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Dc=new fe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Nc=new fe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Lc=new Pc({explicit:[$c,Dc,Nc]});function jm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Mm(){return null}function Bm(e){return e===null}var Ic=new fe("tag:yaml.org,2002:null",{kind:"scalar",resolve:jm,construct:Mm,predicate:Bm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Hm(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Gm(e){return e==="true"||e==="True"||e==="TRUE"}function Vm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Fc=new fe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Hm,construct:Gm,predicate:Vm,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Wm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Um(e){return 48<=e&&e<=55}function qm(e){return 48<=e&&e<=57}function Ym(e){if(e===null)return!1;var t=e.length,r=0,n=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Wm(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Um(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!qm(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function Km(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function zm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!le.isNegativeZero(e)}var jc=new fe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ym,construct:Km,predicate:zm,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Xm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jm(e){return!(e===null||!Xm.test(e)||e[e.length-1]==="_")}function Qm(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var Zm=/^[-+]?[0-9]+e/;function eg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(le.isNegativeZero(e))return"-0.0";return r=e.toString(10),Zm.test(r)?r.replace("e",".e"):r}function tg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||le.isNegativeZero(e))}var Mc=new fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jm,construct:Qm,predicate:tg,represent:eg,defaultStyle:"lowercase"}),Bc=Lc.extend({implicit:[Ic,Fc,jc,Mc]}),Hc=Bc,Gc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Vc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function rg(e){return e===null?!1:Gc.exec(e)!==null||Vc.exec(e)!==null}function ng(e){var t,r,n,o,i,s,a,c=0,u=null,l,p,d;if(t=Gc.exec(e),t===null&&(t=Vc.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(i=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(l=+t[10],p=+(t[11]||0),u=(l*60+p)*6e4,t[9]==="-"&&(u=-u)),d=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&d.setTime(d.getTime()-u),d}function og(e){return e.toISOString()}var Wc=new fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:rg,construct:ng,instanceOf:Date,represent:og});function ig(e){return e==="<<"||e===null}var Uc=new fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ig}),Wo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
42
+ \r`;function sg(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Wo;for(r=0;r<o;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function ag(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Wo,s=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|i.indexOf(n.charAt(t));return r=o%4*6,r===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):r===18?(a.push(s>>10&255),a.push(s>>2&255)):r===12&&a.push(s>>4&255),new Uint8Array(a)}function cg(e){var t="",r=0,n,o,i=e.length,s=Wo;for(n=0;n<i;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return o=i%3,o===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):o===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):o===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function lg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var qc=new fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:sg,construct:ag,predicate:lg,represent:cg}),ug=Object.prototype.hasOwnProperty,pg=Object.prototype.toString;function dg(e){if(e===null)return!0;var t=[],r,n,o,i,s,a=e;for(r=0,n=a.length;r<n;r+=1){if(o=a[r],s=!1,pg.call(o)!=="[object Object]")return!1;for(i in o)if(ug.call(o,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function fg(e){return e!==null?e:[]}var Yc=new fe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:dg,construct:fg}),hg=Object.prototype.toString;function mg(e){if(e===null)return!0;var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],hg.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function gg(e){if(e===null)return[];var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}var Kc=new fe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:mg,construct:gg}),yg=Object.prototype.hasOwnProperty;function vg(e){if(e===null)return!0;var t,r=e;for(t in r)if(yg.call(r,t)&&r[t]!==null)return!1;return!0}function bg(e){return e!==null?e:{}}var zc=new fe("tag:yaml.org,2002:set",{kind:"mapping",resolve:vg,construct:bg}),Uo=Hc.extend({implicit:[Wc,Uc],explicit:[qc,Yc,Kc,zc]}),Et=Object.prototype.hasOwnProperty,Jr=1,Xc=2,Jc=3,Qr=4,jo=1,_g=2,mc=3,Eg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,xg=/[\x85\u2028\u2029]/,kg=/[,\[\]\{\}]/,Qc=/^(?:!|!!|![a-z\-]+!)$/i,Zc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function gc(e){return Object.prototype.toString.call(e)}function Xe(e){return e===10||e===13}function Dt(e){return e===9||e===32}function xe(e){return e===9||e===32||e===10||e===13}function qt(e){return e===44||e===91||e===93||e===123||e===125}function wg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Cg(e){return e===120?2:e===117?4:e===85?8:0}function Ag(e){return 48<=e&&e<=57?e-48:-1}function yc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
43
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Sg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function el(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var tl=new Array(256),rl=new Array(256);for($t=0;$t<256;$t++)tl[$t]=yc($t)?1:0,rl[$t]=yc($t);var $t;function Rg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Uo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function nl(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=$m(r),new be(t,r)}function R(e,t){throw nl(e,t)}function Zr(e,t){e.onWarning&&e.onWarning.call(null,nl(e,t))}var vc={YAML:function(t,r,n){var o,i,s;t.version!==null&&R(t,"duplication of %YAML directive"),n.length!==1&&R(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&R(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&R(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Zr(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&R(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],Qc.test(o)||R(t,"ill-formed tag handle (first argument) of the TAG directive"),Et.call(t.tagMap,o)&&R(t,'there is a previously declared suffix for "'+o+'" tag handle'),Zc.test(i)||R(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{R(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};function _t(e,t,r,n){var o,i,s,a;if(t<r){if(a=e.input.slice(t,r),n)for(o=0,i=a.length;o<i;o+=1)s=a.charCodeAt(o),s===9||32<=s&&s<=1114111||R(e,"expected valid JSON character");else Eg.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function bc(e,t,r,n){var o,i,s,a;for(le.isObject(r)||R(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),s=0,a=o.length;s<a;s+=1)i=o[s],Et.call(t,i)||(el(t,i,r[i]),n[i]=!0)}function Yt(e,t,r,n,o,i,s,a,c){var u,l;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),u=0,l=o.length;u<l;u+=1)Array.isArray(o[u])&&R(e,"nested arrays are not supported inside keys"),typeof o=="object"&&gc(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&gc(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(u=0,l=i.length;u<l;u+=1)bc(e,t,i[u],r);else bc(e,t,i,r);else!e.json&&!Et.call(r,o)&&Et.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,R(e,"duplicated mapping key")),el(t,o,i),delete r[o];return t}function qo(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ie(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Dt(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Xe(o))for(qo(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Zr(e,"deficient indentation"),n}function rn(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||xe(r)))}function Yo(e,t){t===1?e.result+=" ":t>1&&(e.result+=le.repeat(`
44
+ `,t-1))}function Og(e,t,r){var n,o,i,s,a,c,u,l,p=e.kind,d=e.result,y;if(y=e.input.charCodeAt(e.position),xe(y)||qt(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(o=e.input.charCodeAt(e.position+1),xe(o)||r&&qt(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;y!==0;){if(y===58){if(o=e.input.charCodeAt(e.position+1),xe(o)||r&&qt(o))break}else if(y===35){if(n=e.input.charCodeAt(e.position-1),xe(n))break}else{if(e.position===e.lineStart&&rn(e)||r&&qt(y))break;if(Xe(y))if(c=e.line,u=e.lineStart,l=e.lineIndent,ie(e,!1,-1),e.lineIndent>=t){a=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=l;break}}a&&(_t(e,i,s,!1),Yo(e,e.line-c),i=s=e.position,a=!1),Dt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return _t(e,i,s,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function Tg(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(_t(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else Xe(r)?(_t(e,n,o,!0),Yo(e,ie(e,!1,t)),n=o=e.position):e.position===e.lineStart&&rn(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}function Pg(e,t){var r,n,o,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return _t(e,r,e.position,!0),e.position++,!0;if(a===92){if(_t(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Xe(a))ie(e,!1,t);else if(a<256&&tl[a])e.result+=rl[a],e.position++;else if((s=Cg(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=wg(a))>=0?i=(i<<4)+s:R(e,"expected hexadecimal character");e.result+=Sg(i),e.position++}else R(e,"unknown escape sequence");r=n=e.position}else Xe(a)?(_t(e,r,n,!0),Yo(e,ie(e,!1,t)),r=n=e.position):e.position===e.lineStart&&rn(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}function $g(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,l,p,d,y,g=Object.create(null),m,E,x,S;if(S=e.input.charCodeAt(e.position),S===91)l=93,y=!1,a=[];else if(S===123)l=125,y=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),S=e.input.charCodeAt(++e.position);S!==0;){if(ie(e,!0,t),S=e.input.charCodeAt(e.position),S===l)return e.position++,e.tag=s,e.anchor=c,e.kind=y?"mapping":"sequence",e.result=a,!0;r?S===44&&R(e,"expected the node content, but found ','"):R(e,"missed comma between flow collection entries"),E=m=x=null,p=d=!1,S===63&&(u=e.input.charCodeAt(e.position+1),xe(u)&&(p=d=!0,e.position++,ie(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,Kt(e,t,Jr,!1,!0),E=e.tag,m=e.result,ie(e,!0,t),S=e.input.charCodeAt(e.position),(d||e.line===n)&&S===58&&(p=!0,S=e.input.charCodeAt(++e.position),ie(e,!0,t),Kt(e,t,Jr,!1,!0),x=e.result),y?Yt(e,a,g,E,m,x,n,o,i):p?a.push(Yt(e,null,g,E,m,x,n,o,i)):a.push(m),ie(e,!0,t),S=e.input.charCodeAt(e.position),S===44?(r=!0,S=e.input.charCodeAt(++e.position)):r=!1}R(e,"unexpected end of the stream within a flow collection")}function Dg(e,t){var r,n,o=jo,i=!1,s=!1,a=t,c=0,u=!1,l,p;if(p=e.input.charCodeAt(e.position),p===124)n=!1;else if(p===62)n=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)jo===o?o=p===43?mc:_g:R(e,"repeat of a chomping mode identifier");else if((l=Ag(p))>=0)l===0?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?R(e,"repeat of an indentation width identifier"):(a=t+l-1,s=!0);else break;if(Dt(p)){do p=e.input.charCodeAt(++e.position);while(Dt(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Xe(p)&&p!==0)}for(;p!==0;){for(qo(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Xe(p)){c++;continue}if(e.lineIndent<a){o===mc?e.result+=le.repeat(`
45
+ `,i?1+c:c):o===jo&&i&&(e.result+=`
46
+ `);break}for(n?Dt(p)?(u=!0,e.result+=le.repeat(`
47
+ `,i?1+c:c)):u?(u=!1,e.result+=le.repeat(`
48
+ `,c+1)):c===0?i&&(e.result+=" "):e.result+=le.repeat(`
49
+ `,c):e.result+=le.repeat(`
50
+ `,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Xe(p)&&p!==0;)p=e.input.charCodeAt(++e.position);_t(e,r,e.position,!1)}return!0}function _c(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!xe(s))));){if(a=!0,e.position++,ie(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Kt(e,t,Jc,!1,!0),i.push(e.result),ie(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)R(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function Ng(e,t,r){var n,o,i,s,a,c,u=e.tag,l=e.anchor,p={},d=Object.create(null),y=null,g=null,m=null,E=!1,x=!1,S;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),S=e.input.charCodeAt(e.position);S!==0;){if(!E&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(S===63||S===58)&&xe(n))S===63?(E&&(Yt(e,p,d,y,g,null,s,a,c),y=g=m=null),x=!0,E=!0,o=!0):E?(E=!1,o=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,S=n;else{if(s=e.line,a=e.lineStart,c=e.position,!Kt(e,r,Xc,!1,!0))break;if(e.line===i){for(S=e.input.charCodeAt(e.position);Dt(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),xe(S)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Yt(e,p,d,y,g,null,s,a,c),y=g=m=null),x=!0,E=!1,o=!1,y=e.tag,g=e.result;else if(x)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=l,!0}else if(x)R(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=l,!0}if((e.line===i||e.lineIndent>t)&&(E&&(s=e.line,a=e.lineStart,c=e.position),Kt(e,t,Qr,!0,o)&&(E?g=e.result:m=e.result),E||(Yt(e,p,d,y,g,m,s,a,c),y=g=m=null),ie(e,!0,-1),S=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&S!==0)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return E&&Yt(e,p,d,y,g,null,s,a,c),x&&(e.tag=u,e.anchor=l,e.kind="mapping",e.result=p),x}function Lg(e){var t,r=!1,n=!1,o,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&R(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,o="!!",s=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!xe(s);)s===33&&(n?R(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Qc.test(o)||R(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),kg.test(i)&&R(e,"tag suffix cannot contain flow indicator characters")}i&&!Zc.test(i)&&R(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{R(e,"tag name is malformed: "+i)}return r?e.tag=i:Et.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:R(e,'undeclared tag handle "'+o+'"'),!0}function Ig(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&R(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!xe(r)&&!qt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Fg(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!xe(n)&&!qt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Et.call(e.anchorMap,r)||R(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ie(e,!0,-1),!0}function Kt(e,t,r,n,o){var i,s,a,c=1,u=!1,l=!1,p,d,y,g,m,E;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Qr===r||Jc===r,n&&ie(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Lg(e)||Ig(e);)ie(e,!0,-1)?(u=!0,a=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=u||o),(c===1||Qr===r)&&(Jr===r||Xc===r?m=t:m=t+1,E=e.position-e.lineStart,c===1?a&&(_c(e,E)||Ng(e,E,m))||$g(e,m)?l=!0:(s&&Dg(e,m)||Tg(e,m)||Pg(e,m)?l=!0:Fg(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):Og(e,m,Jr===r)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=a&&_c(e,E))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,d=e.implicitTypes.length;p<d;p+=1)if(g=e.implicitTypes[p],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Et.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,y=e.typeMap.multi[e.kind||"fallback"],p=0,d=y.length;p<d;p+=1)if(e.tag.slice(0,y[p].tag.length)===y[p].tag){g=y[p];break}g||R(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function jg(e){var t=e.position,r,n,o,i=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(ie(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(i=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!xe(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&R(e,"directive name must not be less than one character in length");s!==0;){for(;Dt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Xe(s));break}if(Xe(s))break;for(r=e.position;s!==0&&!xe(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&qo(e),Et.call(vc,n)?vc[n](e,n,o):Zr(e,'unknown document directive "'+n+'"')}if(ie(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ie(e,!0,-1)):i&&R(e,"directives end mark is expected"),Kt(e,e.lineIndent-1,Qr,!1,!0),ie(e,!0,-1),e.checkLineBreaks&&xg.test(e.input.slice(t,e.position))&&Zr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&rn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ie(e,!0,-1));return}if(e.position<e.length-1)R(e,"end of the stream or a document separator is expected");else return}function ol(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
51
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Rg(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,R(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)jg(r);return r.documents}function Mg(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=ol(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Bg(e,t){var r=ol(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new be("expected a single document in the stream, but found more")}}var Hg=Mg,Gg=Bg,il={loadAll:Hg,load:Gg},sl=Object.prototype.toString,al=Object.prototype.hasOwnProperty,Ko=65279,Vg=9,Er=10,Wg=13,Ug=32,qg=33,Yg=34,Bo=35,Kg=37,zg=38,Xg=39,Jg=42,cl=44,Qg=45,en=58,Zg=61,ey=62,ty=63,ry=64,ll=91,ul=93,ny=96,pl=123,oy=124,dl=125,he={};he[0]="\\0";he[7]="\\a";he[8]="\\b";he[9]="\\t";he[10]="\\n";he[11]="\\v";he[12]="\\f";he[13]="\\r";he[27]="\\e";he[34]='\\"';he[92]="\\\\";he[133]="\\N";he[160]="\\_";he[8232]="\\L";he[8233]="\\P";var iy=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],sy=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ay(e,t){var r,n,o,i,s,a,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,i=n.length;o<i;o+=1)s=n[o],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&al.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function cy(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new be("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+le.repeat("0",n-t.length)+t}var ly=1,xr=2;function uy(e){this.schema=e.schema||Uo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=le.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ay(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?xr:ly,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ec(e,t){for(var r=le.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
52
+ `,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
53
+ `&&(i+=r),i+=s;return i}function Ho(e,t){return`
54
+ `+le.repeat(" ",e.indent*t)}function py(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function tn(e){return e===Ug||e===Vg}function kr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ko||65536<=e&&e<=1114111}function xc(e){return kr(e)&&e!==Ko&&e!==Wg&&e!==Er}function kc(e,t,r){var n=xc(e),o=n&&!tn(e);return(r?n:n&&e!==cl&&e!==ll&&e!==ul&&e!==pl&&e!==dl)&&e!==Bo&&!(t===en&&!o)||xc(t)&&!tn(t)&&e===Bo||t===en&&o}function dy(e){return kr(e)&&e!==Ko&&!tn(e)&&e!==Qg&&e!==ty&&e!==en&&e!==cl&&e!==ll&&e!==ul&&e!==pl&&e!==dl&&e!==Bo&&e!==zg&&e!==Jg&&e!==qg&&e!==oy&&e!==Zg&&e!==ey&&e!==Xg&&e!==Yg&&e!==Kg&&e!==ry&&e!==ny}function fy(e){return!tn(e)&&e!==en}function br(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function fl(e){var t=/^\n* /;return t.test(e)}var hl=1,Go=2,ml=3,gl=4,Ut=5;function hy(e,t,r,n,o,i,s,a){var c,u=0,l=null,p=!1,d=!1,y=n!==-1,g=-1,m=dy(br(e,0))&&fy(br(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=br(e,c),!kr(u))return Ut;m=m&&kc(u,l,a),l=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=br(e,c),u===Er)p=!0,y&&(d=d||c-g-1>n&&e[g+1]!==" ",g=c);else if(!kr(u))return Ut;m=m&&kc(u,l,a),l=u}d=d||y&&c-g-1>n&&e[g+1]!==" "}return!p&&!d?m&&!s&&!o(e)?hl:i===xr?Ut:Go:r>9&&fl(e)?Ut:s?i===xr?Ut:Go:d?gl:ml}function my(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===xr?'""':"''";if(!e.noCompatMode&&(iy.indexOf(t)!==-1||sy.test(t)))return e.quotingType===xr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=n||e.flowLevel>-1&&r>=e.flowLevel;function c(u){return py(e,u)}switch(hy(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case hl:return t;case Go:return"'"+t.replace(/'/g,"''")+"'";case ml:return"|"+wc(t,e.indent)+Cc(Ec(t,i));case gl:return">"+wc(t,e.indent)+Cc(Ec(gy(t,s),i));case Ut:return'"'+yy(t)+'"';default:throw new be("impossible error: invalid scalar style")}})()}function wc(e,t){var r=fl(e)?String(t):"",n=e[e.length-1]===`
55
+ `,o=n&&(e[e.length-2]===`
56
+ `||e===`
57
+ `),i=o?"+":n?"":"-";return r+i+`
58
+ `}function Cc(e){return e[e.length-1]===`
59
+ `?e.slice(0,-1):e}function gy(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
60
+ `);return u=u!==-1?u:e.length,r.lastIndex=u,Ac(e.slice(0,u),t)})(),o=e[0]===`
61
+ `||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
62
+ `:"")+Ac(c,t),o=i}return n}function Ac(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,i,s=0,a=0,c="";n=r.exec(e);)a=n.index,a-o>t&&(i=s>o?s:a,c+=`
63
+ `+e.slice(o,i),o=i+1),s=a;return c+=`
64
+ `,e.length-o>t&&s>o?c+=e.slice(o,s)+`
65
+ `+e.slice(s+1):c+=e.slice(o),c.slice(1)}function yy(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=br(e,o),n=he[r],!n&&kr(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||cy(r);return t}function vy(e,t,r){var n="",o=e.tag,i,s,a;for(i=0,s=r.length;i<s;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(ot(e,t,a,!1,!1)||typeof a>"u"&&ot(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function Sc(e,t,r,n){var o="",i=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(ot(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&ot(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=Ho(e,t)),e.dump&&Er===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function by(e,t,r){var n="",o=e.tag,i=Object.keys(r),s,a,c,u,l;for(s=0,a=i.length;s<a;s+=1)l="",n!==""&&(l+=", "),e.condenseFlow&&(l+='"'),c=i[s],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),ot(e,t,c,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ot(e,t,u,!1,!1)&&(l+=e.dump,n+=l));e.tag=o,e.dump="{"+n+"}"}function _y(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,l,p,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new be("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=Ho(e,t)),u=s[a],l=r[u],e.replacer&&(l=e.replacer.call(r,u,l)),ot(e,t+1,u,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Er===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=Ho(e,t)),ot(e,t+1,l,!0,p)&&(e.dump&&Er===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function Rc(e,t,r){var n,o,i,s,a,c;for(o=r?e.explicitTypes:e.implicitTypes,i=0,s=o.length;i<s;i+=1)if(a=o[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(r?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,sl.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(al.call(a.represent,c))n=a.represent[c](t,c);else throw new be("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function ot(e,t,r,n,o,i,s){e.tag=null,e.dump=r,Rc(e,r,!1)||Rc(e,r,!0);var a=sl.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var l=a==="[object Object]"||a==="[object Array]",p,d;if(l&&(p=e.duplicates.indexOf(r),d=p!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(o=!1),d&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(l&&d&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(_y(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(by(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Sc(e,t-1,e.dump,o):Sc(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(vy(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&my(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new be("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Ey(e,t){var r=[],n=[],o,i;for(Vo(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function Vo(e,t,r){var n,o,i;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)Vo(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)Vo(e[n[o]],t,r)}function xy(e,t){t=t||{};var r=new uy(t);r.noRefs||Ey(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),ot(r,0,n,!0,!0)?r.dump+`
66
+ `:""}var ky=xy,wy={dump:ky};function zo(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Cy=fe,Ay=Pc,Sy=Lc,Ry=Bc,Oy=Hc,Ty=Uo,Py=il.load,$y=il.loadAll,Dy=wy.dump,Ny=be,Ly={binary:qc,float:Mc,map:Nc,null:Ic,pairs:Kc,set:zc,timestamp:Wc,bool:Fc,int:jc,merge:Uc,omap:Yc,seq:Dc,str:$c},Iy=zo("safeLoad","load"),Fy=zo("safeLoadAll","loadAll"),jy=zo("safeDump","dump"),ke={Type:Cy,Schema:Ay,FAILSAFE_SCHEMA:Sy,JSON_SCHEMA:Ry,CORE_SCHEMA:Oy,DEFAULT_SCHEMA:Ty,load:Py,loadAll:$y,dump:Dy,YAMLException:Ny,types:Ly,safeLoad:Iy,safeLoadAll:Fy,safeDump:jy};import Kn from"fs-extra";import Fr from"path";import{extname as rw,resolve as nw,join as ow}from"path";var kf=Ht(kl(),1);import iw from"chokidar";import{pathToFileURL as sw}from"url";import sr from"fs-extra";import qn from"path";var Qo=class{constructor(){this.level="info";this.verbose=!1}setLevel(t){this.level=t}setVerbose(t){this.verbose=t}shouldLog(t){let r={error:0,warn:1,info:2,debug:3};return t==="debug"&&this.verbose?!0:r[t]<=r[this.level]}getTypeStyle(t){switch(t){case"success":return h.green;case"error":return h.red;case"warning":return h.yellow;case"info":return h.blue;case"instruction":return h.cyan;case"progress":return h.reset;case"debug":return h.gray;case"raclette":return h.rgb(221,139,64);default:return r=>r}}getTypeIcon(t){switch(t){case"success":return"\u2705";case"error":return"\u274C";case"warning":return"\u26A0\uFE0F";case"info":return"\u2139\uFE0F ";case"instruction":return"\u{1F4A1}";case"progress":return"\u{1F504}";case"debug":return"";case"raclette":return"\u{1F9C0}";default:return""}}log(t,r,n){if(!this.shouldLog(t))return;let o=n?this.getTypeStyle(n):h.reset,i=n?this.getTypeIcon(n):"",s=i?`${i} `:"";console.log(o(`${s}${r}`))}logError(t,r){if(!this.shouldLog("error"))return;let n=this.getTypeStyle("error"),o=this.getTypeIcon("error"),i=o?`${o} `:"";r?console.error(n(`${i}${t}`),r):console.error(n(`${i}${t}`))}error(t,r){this.logError(t,r)}warn(t){this.log("warn",t,"warning")}info(t){this.log("info",t,"info")}debug(t){this.log("debug",t,"debug")}success(t){this.log("info",t,"success")}instruction(t){this.log("info",t,"instruction")}progress(t){this.log("info",t,"progress")}raclette(t){this.log("info",t,"raclette")}raw(t,r="info"){this.shouldLog(r)&&console.log(t)}},f=new Qo;var ff=(e,t=["js","yaml","yml"])=>{for(let r of t){let n=e+"."+r;if(sr.existsSync(n))return n}throw new Error(`Could not find any of ${e+"{"+t.join(",")+"}"}`)},hf=async(e=process.cwd())=>{let t=qn.join(e,".raclette");return await sr.ensureDir(t),t},Nr=(e=process.cwd())=>{let t=wl().name,n=(e.includes("node_modules")?[[e.match(/(.*node_modules)/)?.[1]||"",t],[e,"node_modules",t],[e,"../../..",t]]:[[e,"node_modules",t],[e,"../..","raclette"],[e,"../..",t],[e,"../..","core"],[e,"..","raclette"],[e,"..",t],[e,"..","core"]]).map(i=>qn.resolve(...i,"package.json")).find(i=>sr.readJsonSync(i,{throws:!1})?.name===t);if(n)return n.slice(0,-12);let o="Could not determine core package path to set up VFS. Canceling...";throw f.error(o),new Error(o)},mf=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(da(),df));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},gf=async(e,t)=>await sr.pathExists(e)?(await sr.ensureDir(qn.dirname(t)),await sr.copy(e,t),f.debug(`\u2705 Copied ${qn.basename(e)} to ${t}`),!0):(f.warn(chalk.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);import _f from"fs-extra";import Ft from"path";var Fk=Object.prototype.toString,cr=Array.isArray||function(t){return Fk.call(t)==="[object Array]"};function ha(e){return typeof e=="function"}function jk(e){return cr(e)?"array":typeof e}function fa(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yf(e,t){return e!=null&&typeof e=="object"&&t in e}function Mk(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var Bk=RegExp.prototype.test;function Hk(e,t){return Bk.call(e,t)}var Gk=/\S/;function Vk(e){return!Hk(Gk,e)}var Wk={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Uk(e){return String(e).replace(/[&<>"'`=\/]/g,function(r){return Wk[r]})}var qk=/\s*/,Yk=/\s+/,vf=/\s*=/,Kk=/\s*\}/,zk=/#|\^|\/|>|\{|&|=|!/;function Xk(e,t){if(!e)return[];var r=!1,n=[],o=[],i=[],s=!1,a=!1,c="",u=0;function l(){if(s&&!a)for(;i.length;)delete o[i.pop()];else i=[];s=!1,a=!1}var p,d,y;function g(w){if(typeof w=="string"&&(w=w.split(Yk,2)),!cr(w)||w.length!==2)throw new Error("Invalid tags: "+w);p=new RegExp(fa(w[0])+"\\s*"),d=new RegExp("\\s*"+fa(w[1])),y=new RegExp("\\s*"+fa("}"+w[1]))}g(t||Le.tags);for(var m=new Ir(e),E,x,S,$,oe,q;!m.eos();){if(E=m.pos,S=m.scanUntil(p),S)for(var T=0,L=S.length;T<L;++T)$=S.charAt(T),Vk($)?(i.push(o.length),c+=$):(a=!0,r=!0,c+=" "),o.push(["text",$,E,E+1]),E+=1,$===`
67
+ `&&(l(),c="",u=0,r=!1);if(!m.scan(p))break;if(s=!0,x=m.scan(zk)||"name",m.scan(qk),x==="="?(S=m.scanUntil(vf),m.scan(vf),m.scanUntil(d)):x==="{"?(S=m.scanUntil(y),m.scan(Kk),m.scanUntil(d),x="&"):S=m.scanUntil(d),!m.scan(d))throw new Error("Unclosed tag at "+m.pos);if(x==">"?oe=[x,S,E,m.pos,c,u,r]:oe=[x,S,E,m.pos],u++,o.push(oe),x==="#"||x==="^")n.push(oe);else if(x==="/"){if(q=n.pop(),!q)throw new Error('Unopened section "'+S+'" at '+E);if(q[1]!==S)throw new Error('Unclosed section "'+q[1]+'" at '+E)}else x==="name"||x==="{"||x==="&"?a=!0:x==="="&&g(S)}if(l(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+m.pos);return Qk(Jk(o))}function Jk(e){for(var t=[],r,n,o=0,i=e.length;o<i;++o)r=e[o],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(t.push(r),n=r));return t}function Qk(e){for(var t=[],r=t,n=[],o,i,s=0,a=e.length;s<a;++s)switch(o=e[s],o[0]){case"#":case"^":r.push(o),n.push(o),r=o[4]=[];break;case"/":i=n.pop(),i[5]=o[2],r=n.length>0?n[n.length-1][4]:t;break;default:r.push(o)}return t}function Ir(e){this.string=e,this.tail=e,this.pos=0}Ir.prototype.eos=function(){return this.tail===""};Ir.prototype.scan=function(t){var r=this.tail.match(t);if(!r||r.index!==0)return"";var n=r[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};Ir.prototype.scanUntil=function(t){var r=this.tail.search(t),n;switch(r){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=n.length,n};function ar(e,t){this.view=e,this.cache={".":this.view},this.parent=t}ar.prototype.push=function(t){return new ar(t,this)};ar.prototype.lookup=function(t){var r=this.cache,n;if(r.hasOwnProperty(t))n=r[t];else{for(var o=this,i,s,a,c=!1;o;){if(t.indexOf(".")>0)for(i=o.view,s=t.split("."),a=0;i!=null&&a<s.length;)a===s.length-1&&(c=yf(i,s[a])||Mk(i,s[a])),i=i[s[a++]];else i=o.view[t],c=yf(o.view,t);if(c){n=i;break}o=o.parent}r[t]=n}return ha(n)&&(n=n.call(this.view)),n};function _e(){this.templateCache={_cache:{},set:function(t,r){this._cache[t]=r},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}_e.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};_e.prototype.parse=function(t,r){var n=this.templateCache,o=t+":"+(r||Le.tags).join(":"),i=typeof n<"u",s=i?n.get(o):void 0;return s==null&&(s=Xk(t,r),i&&n.set(o,s)),s};_e.prototype.render=function(t,r,n,o){var i=this.getConfigTags(o),s=this.parse(t,i),a=r instanceof ar?r:new ar(r,void 0);return this.renderTokens(s,a,n,t,o)};_e.prototype.renderTokens=function(t,r,n,o,i){for(var s="",a,c,u,l=0,p=t.length;l<p;++l)u=void 0,a=t[l],c=a[0],c==="#"?u=this.renderSection(a,r,n,o,i):c==="^"?u=this.renderInverted(a,r,n,o,i):c===">"?u=this.renderPartial(a,r,n,i):c==="&"?u=this.unescapedValue(a,r):c==="name"?u=this.escapedValue(a,r,i):c==="text"&&(u=this.rawValue(a)),u!==void 0&&(s+=u);return s};_e.prototype.renderSection=function(t,r,n,o,i){var s=this,a="",c=r.lookup(t[1]);function u(d){return s.render(d,r,n,i)}if(c){if(cr(c))for(var l=0,p=c.length;l<p;++l)a+=this.renderTokens(t[4],r.push(c[l]),n,o,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")a+=this.renderTokens(t[4],r.push(c),n,o,i);else if(ha(c)){if(typeof o!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(r.view,o.slice(t[3],t[5]),u),c!=null&&(a+=c)}else a+=this.renderTokens(t[4],r,n,o,i);return a}};_e.prototype.renderInverted=function(t,r,n,o,i){var s=r.lookup(t[1]);if(!s||cr(s)&&s.length===0)return this.renderTokens(t[4],r,n,o,i)};_e.prototype.indentPartial=function(t,r,n){for(var o=r.replace(/[^ \t]/g,""),i=t.split(`
68
+ `),s=0;s<i.length;s++)i[s].length&&(s>0||!n)&&(i[s]=o+i[s]);return i.join(`
69
+ `)};_e.prototype.renderPartial=function(t,r,n,o){if(n){var i=this.getConfigTags(o),s=ha(n)?n(t[1]):n[t[1]];if(s!=null){var a=t[6],c=t[5],u=t[4],l=s;c==0&&u&&(l=this.indentPartial(s,u,a));var p=this.parse(l,i);return this.renderTokens(p,r,n,l,o)}}};_e.prototype.unescapedValue=function(t,r){var n=r.lookup(t[1]);if(n!=null)return n};_e.prototype.escapedValue=function(t,r,n){var o=this.getConfigEscape(n)||Le.escape,i=r.lookup(t[1]);if(i!=null)return typeof i=="number"&&o===Le.escape?String(i):o(i)};_e.prototype.rawValue=function(t){return t[1]};_e.prototype.getConfigTags=function(t){return cr(t)?t:t&&typeof t=="object"?t.tags:void 0};_e.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!cr(t))return t.escape};var Le={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){Lr.templateCache=e},get templateCache(){return Lr.templateCache}},Lr=new _e;Le.clearCache=function(){return Lr.clearCache()};Le.parse=function(t,r){return Lr.parse(t,r)};Le.render=function(t,r,n,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+jk(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Lr.render(t,r,n,o)};Le.escape=Uk;Le.Scanner=Ir;Le.Context=ar;Le.Writer=_e;var bf=Le;import{fileURLToPath as Zk}from"url";var ma=class extends Error{constructor(t,r=void 0){super(t+(r?": "+r.message:"")),this.name="BuildError"}},ew={yaml:{entry:e=>Object.entries(e).map(t=>t[0]+": "+JSON.stringify(t[1]))},js:{}},Ef=(e,t,r=null)=>{let n=tw(e);try{let o=bf.render(_f.readFileSync(n,"utf-8"),{...t,...ew.yaml});return r&&_f.writeFileSync(Ft.resolve(r,e),o,"utf8"),o}catch(o){throw new ma(`Could not process "${n}"`,o)}},Yn=()=>Ft.resolve(Ft.dirname(Zk(import.meta.url)),"../package.json"),xf=()=>Ft.resolve(Ft.dirname(Yn())),tw=e=>Ft.resolve(Ft.dirname(Yn()),"templates",e);var aw=["js","mjs","ts","yaml","yml"],wf=async()=>{function e(r){if(typeof r=="string"){if(r==="true")return!0;if(r==="false")return!1;if(/^\d+$/.test(r)){let n=Number(r);if(!isNaN(n))return n}if(/^\d+\.\d+$/.test(r)){let n=Number(r);if(!isNaN(n))return n}return r}if(Array.isArray(r))return r.map(n=>e(n));if(r&&typeof r=="object"){let n={};for(let[o,i]of Object.entries(r))n[o]=e(i);return n}return r}let t=(0,kf.config)({path:ow(process.cwd(),".env")}).parsed;return e(t)},cw=Fr.join(Fr.dirname(Yn()),"raclette.default.config.yaml"),jt=async(e=cw,t={})=>{let n={env:{[process.env?.environment||"development"]:t}},o=nw(e),i;try{switch(rw(e)){case".*":let s=e.slice(0,-1);i=await jt(s+aw.find(a=>Kn.existsSync(s+a)));break;case".yaml":case".yml":i=ke.load(Kn.readFileSync(o,"utf8"),{filename:e});break;case".ts":case".mjs":case".js":i=(await import(`${sw(o).href}?t=${Date.now()}`)).default;break;default:throw new TypeError(`config.load() does not support ${e} file extension.`)}}catch(s){throw new Error(`Failed to load config ${o}: ${s?.message}`)}return bt(i,n)},Cf=(e="null")=>{try{return ke.load(e)}catch(t){throw new Error(`Failed to parse config: ${t?.message}`)}},ga=(...e)=>{let t=e[0];for(let r of e.slice(1))t=bt(t,r);return t},ya=async(e,t)=>{f.debug("Generating service configuration files...");let r={name:e.name,env:e.env,modules:e.modules,plugins:e.plugins,global:e.global};for(let n of Ye){let o=Fr.join(t,n);Kn.ensureDirSync(o);let i={...r,service:n,...e[n]},s=`// Generated Raclette ${n} Configuration
70
+ // This file is auto-generated, do not edit directly
71
+
72
+ export const racletteConfig = ${JSON.stringify(i,null,2)};
73
+
74
+ export default racletteConfig;
75
+ `;Kn.writeFileSync(Fr.join(o,"raclette.config.js"),s)}},Af=(e,t)=>{let r=ff(Fr.join(e,"raclette.config"));f.progress(`\u{1F50D} Watching for changes in original config: ${r}`);let n=iw.watch(r,{ignored:/(^|[/\\])\../,persistent:!0});return n.on("change",async o=>{f.progress(`\u{1F4DD} Original config file changed: ${o}`);try{await jt(r,t)}catch(i){f.error("Error reloading configuration: "+i.message)}}),()=>n.close()};import{spawn as $a}from"child_process";import Tt,{pathExists as Fw}from"fs-extra";import Ie from"path";import Qn from"fs-extra";import ur from"path";import{execSync as ut}from"child_process";import uw from"fs-extra";var zn=null,va=()=>{if(zn)return zn;let e=pw(),t=dw(e),r=e,n=!0,o=fw(t);return zn={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},zn};var pw=()=>{try{let e;process.platform==="win32"?e=ut("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
76
+ `)[0]:e=ut("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return ut(`"${e}" --version`,{stdio:"pipe"}),e}catch{throw new Error(`Docker found at ${e} but not executable`)}}catch{let t=["/Applications/Docker.app/Contents/Resources/bin/docker","/usr/local/bin/docker","C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe","C:\\Program Files\\Docker\\Docker\\resources\\docker.exe","/usr/bin/docker","/snap/docker/current/bin/docker"];for(let r of t)if(uw.existsSync(r))try{return ut(`"${r}" --version`,{stdio:"pipe"}),f.debug(h.yellow(`Found Docker at: ${r}`)),r}catch{}throw new Error("Docker not found in PATH or common installation locations")}},dw=e=>{try{return ut(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(h.yellow("Could not determine Docker version")),"unknown"}},fw=e=>{let t=e.match(/Docker version (\d+)\.(\d+)/);if(!t)return!1;let r=parseInt(t[1]),n=parseInt(t[2]);return r>28||r===28&&n>=0},Xn=()=>{f.raw(h.blue("\u{1F433} Checking Docker installation..."));try{let e=va();f.debug(`\u2705 Docker found at: ${e.dockerPath}`),f.debug(`Docker version: ${e.version}`);try{ut(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),f.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(h.red(`
77
+ \u274C Modern Docker Compose is not available`)),console.warn(h.yellow(`
78
+ \u{1F4CB} Raclette requires Docker with integrated 'compose' command`)),console.warn(h.yellow("Please update to Docker version 20.10.13+ or Docker Desktop 4.1.0+")),new Error("Modern Docker Compose is required")}e.isDocker28Plus&&f.debug("\u26A0\uFE0F Detected Docker 28+, using enhanced path resolution");try{ut(`"${e.dockerPath}" info`,{stdio:"pipe",encoding:"utf8"}),f.success(" Docker daemon is running")}catch{throw f.error("Docker daemon is not running"),f.warn("Please start Docker Desktop or the Docker daemon and try again."),process.platform==="darwin"?console.log(h.yellow(`
79
+ macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(h.yellow(`
80
+ Windows: Start Docker Desktop from the Start menu`)):console.log(h.yellow(`
81
+ Linux: Start Docker daemon with "systemctl start docker"`)),new Error("Docker daemon is not running")}return e}catch(e){throw e.message.includes("Docker daemon is not running")||e.message.includes("Modern Docker Compose is required")?e:(f.error("Docker installation issue: "+e.message),console.log(h.yellow(`
82
+ \u{1F4E5} Installation guide:`)),console.log(h.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(h.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(h.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},pe=(e,t={})=>{let n=`"${va().dockerPath}" ${e.join(" ")}`;try{let o=ut(n,{...t,stdio:t.stdio||"pipe",encoding:t.stdio==="inherit"?void 0:t.encoding||"utf8",shell:!0});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker command failed: ${n}
83
+ Error: ${o.message}`)}},Ee=(e,t={})=>{let n=`"${va().composeCommand}" compose ${e.join(" ")}`;f.debug(`Execute Docker Command: ${n}`);try{let o=ut(n,{stdio:"pipe",encoding:"utf8",shell:!0,...t});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker Compose command failed: ${n}
84
+ Error: ${o.message}`)}},jr=e=>{try{return pe(["ps","-a","--filter",`name=^${e}$`,"--format",'"{{.Names}}"']).trim().split(`
85
+ `).some(r=>r.trim()===e)}catch{return!1}},lr=e=>{try{return pe(["ps","--filter",`name=^${e}$`,"--format",'"{{.Names}}"']).trim().split(`
86
+ `).some(r=>r.trim()===e)}catch{return!1}},Jn=e=>{f.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{pe(["network","inspect",e]),f.debug(`\u2705 Network '${e}' already exists`);return}catch{f.debug(`\u{1F310} Creating Docker network '${e}'...`);try{pe(["network","create",e],{stdio:"inherit"}),f.debug(`\u2705 Network '${e}' created`)}catch(r){if(r.message?.includes("already exists")){f.debug(`\u2705 Network '${e}' already exists`);return}throw f.error("Failed to create network: "+r.message),r}}},ba=(e,t,r={})=>pe(["exec",e,"sh","-c",`"${t}"`],r),hw=e=>{try{let t=pe(["ps","-a","--filter",`name=^${e}`,"--format",'"{{.Names}}"']);return t.trim()?t.trim().split(`
87
+ `).filter(r=>r.trim().length>0):[]}catch{return[]}},Sf=e=>{let t=hw(e);if(t.length===0){f.debug(`\u26A0\uFE0F No containers found with prefix '${e}'`);return}f.debug(`\u26A0\uFE0F Found ${t.length} container(s) with prefix '${e}':`),t.forEach(r=>{f.debug(` - ${r}`)});try{f.debug("Stopping containers..."),pe(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),pe(["rm",...t],{stdio:"inherit"}),f.success(`Successfully stopped and removed ${t.length} container(s)`)}catch(r){throw f.error(`Failed to stop containers with prefix '${e}': ${r.message}`),r}};var mw="raclette-public-shared",tt={mongodb:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20},cache:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3},backend:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},dr=e=>({test:["CMD","curl","-f",`http://0.0.0.0:${e}/`],interval:"10s",timeout:"30s",retries:10}),gw=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),_a=(e,t)=>ur.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?ur.resolve(t,e):ur.resolve(t,e),Zn=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Zn(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=_a(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=gw(o):o&&typeof o=="object"?r[n]=Zn(o,t):r[n]=o;return r},Ot=(e,t)=>{let r=Zn(e,t);if(r.source&&r.source.includes("/")&&(r.source=_a(r.source,t)),r.mustExist&&!Qn.existsSync(r.source))return f.debug(`Skipping volume mount: ${r.source} does not exist`),null;if(!r.type&&!r.readonly&&!r.volumeOptions&&!r.bindOptions&&!r.tmpfsOptions)return`${r.source}:${r.target}${r.readonly?":ro":""}`;let n={type:r.type||"volume",source:r.source,target:r.target};return r.readonly&&(n.read_only=!0),r.volumeOptions&&(n.volume=r.volumeOptions),r.bindOptions&&(n.bind=r.bindOptions),r.tmpfsOptions&&(n.tmpfs=r.tmpfsOptions),n},yw=(e,t)=>{if(!e.includes("/")||e.startsWith("${"))return e;let r=e.split(":");if(r.length<2)return e;let n=r[0],o=r[1],i=r.slice(2).join(":"),s=_a(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},eo=(e,t)=>e.map(r=>typeof r=="string"?yw(r,t):r).map(r=>r),Ea=async(e,t,r,n=!1,o="development",i=!0,s=!0)=>{let a={services:{},volumes:{"yarn-cache":{driver:"local"}},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},c=e.env[o]||{};a.volumes[mw]=null,e.volumes&&Object.entries(e.volumes).forEach(([p,d])=>{d===null?a.volumes[p]=null:a.volumes[p]=Zn(d,t)});let u=!1,l=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let p=e.services.mongodb.name;jr(p)&&(f.debug(`MongoDB container '${p}' already exists, will be skipped`),u=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let p=e.services.cache.name;jr(p)&&(f.debug(`Cache container '${p}' already exists, will be skipped`),l=!0)}}if(e.services.mongodb?.enabled&&!u){let d=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,y=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,g=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${d}}`,image:"mongo:8.2",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${y}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${g}}:/data/config`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},e.services.mongodb.volumes&&e.services.mongodb.volumes.length>0&&e.services.mongodb.volumes.forEach(m=>{let E=Ot(m,t);E&&a.services.mongodb.volumes.push(E)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=null),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(e.services.cache?.enabled&&!l){let d=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,y=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${d}}`,image:"valkey/valkey:9.0-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${y}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let g=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",m=e?.backend?.cache?.persistence||"none";m==="none"&&(a.services.cache.command='valkey-server --save ""'),m==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),m==="rdb"&&(a.services.cache.command="valkey-server --save "+g),m==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+g),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(E=>{let x=Ot(E,t);x&&a.services.cache.volumes.push(x)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=null)}if(!n){let p=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let d=e.services.backend.name??`${e.name}-backend`,y=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${d}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:p?"yarn run dev:inspect":"yarn dev",environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${RACLETTE_SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}","RACLETTE_FRONTEND_URLS=${RACLETTE_FRONTEND_URLS:-}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://mongodb:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb?.port||27017}}/\${RACLETTE_MONGODB_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-redis://cache:\${RACLETTE_CACHE_PORT:-${e.services.cache?.port||6379}}}${e.services.cache?.db?`/${e.services.cache?.db}`:""}`,...Object.entries(c).map(([g,m])=>`${g}=${m}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${y}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${pr("backend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...p?[`${p||"9229"}:9229`]:[]],networks:["raclette_shared"],depends_on:{},healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},e.services.backend.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(g=>{let m=Ot(g,t);m&&a.services.backend.volumes.push(m)}),e.services.mongodb?.enabled&&!u&&(a.services.backend.depends_on.mongodb={condition:"service_started"}),e.services.cache?.enabled&&!l&&(a.services.backend.depends_on.cache={condition:"service_healthy"}),Object.keys(a.services.backend.depends_on).length===0&&delete a.services.backend.depends_on,a.volumes[y]=null}if(e.services.frontend?.enabled){let d=e.services.frontend.name??`${e.name}-frontend`,y=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,g=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${d}}`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:`\${NODE_ENV:-${o}}`},target:`\${NODE_ENV:-${o}}`},command:"yarn dev",depends_on:{},environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-true}",`RACLETTE_SERVER_BASE_URL=\${RACLETTE_SERVER_BASE_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,`RACLETTE_SOCKET_URL=\${RACLETTE_SOCKET_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,...Object.entries(c).map(([m,E])=>`${m}=${E}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${y}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins",...o==="development"?["./.raclette/frontend/raclette.config.js:/app/raclette.config.js",`${pr("frontend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_CLIENT_PORT:-${e.services.frontend.port}}:8081`],networks:["raclette_shared"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:8081/"],interval:"10s",timeout:"30s",retries:10}},o!=="production"&&(a.services.frontend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.frontend.volumes.push("./.raclette/frontend/package.json:/app/package.json"),a.services.frontend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.backend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/backend/package.json:/app/package.json")),e.services.frontend.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(m=>{let E=Ot(m,t);E&&a.services.frontend.volumes.push(E)}),e.services.backend?.enabled&&(a.services.frontend.depends_on.backend={condition:"service_healthy"}),Object.keys(a.services.frontend.depends_on).length===0&&delete a.services.frontend.depends_on,a.volumes[y]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let d=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,y=d&&!d.endsWith("/")?d+"/":d;a.services.backend?.volumes?.push(`${y}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${y}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(p=>{p.volumes&&(p.volumes=eo(p.volumes,t))}),await Qn.writeFile(r,ke.dump(a)),await to(e,ur.dirname(r),o)},pr=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Rf=async(e,t,r,n="development")=>{await Ea(e,t,r,!1,n,!1,!1)},to=async(e,t,r)=>{let n=ur.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
88
+ WORKDIR /app
89
+
90
+ # add bash since alpine doesn't come with a shell
91
+ RUN apk update && apk add bash curl ${(e.services.backend?.installPackages||[]).join(" ")}
92
+
93
+ COPY backend/package.json backend/yarn.lock ./
94
+ COPY backend/raclette.config.js ./
95
+
96
+ ARG NODE_ENV=${r}
97
+
98
+ # until we are published we can't install here due to the sensitive files
99
+ #RUN if [ "$NODE_ENV" = "development" ]; \\
100
+ # then yarn install; \\
101
+ # else yarn install --production=true; \\
102
+ # fi;
103
+
104
+ # make sure our raclette packages are being resolved by adding a symlink to handle nodes module resolution
105
+ RUN mkdir -p /app/node_modules/@raclettejs/core
106
+ RUN ln -sf /app/src /app/node_modules/@raclettejs/core/backend
107
+
108
+ COPY ./dist/check-dependencies.sh /app/
109
+ RUN chmod +x /app/check-dependencies.sh
110
+
111
+ # copy everything else that is not ignored (see .dockerignore)
112
+ COPY ./virtual/backend ./
113
+
114
+ # set default values
115
+ ENV PORT 3000
116
+
117
+ # set port
118
+ EXPOSE 3000
119
+ EXPOSE 9229
120
+
121
+ # default command
122
+ CMD ["yarn", "run", "${r==="production"?"build":"dev"}"]
123
+ `;await Qn.writeFile(n,o);let i=ur.join(t,"frontend.Dockerfile"),s=`FROM node:24-alpine3.21 AS build
124
+ WORKDIR /app
125
+
126
+ RUN apk update && apk add bash curl ${(e.services.frontend?.installPackages||[]).join(" ")}
127
+
128
+ # Copy package files first for better caching
129
+ COPY frontend/package.json frontend/yarn.lock ./
130
+ COPY frontend/raclette.config.js ./
131
+
132
+ ARG NODE_ENV=${r}
133
+
134
+ # until we are published we can't install here due to the sensitive files
135
+ # Install dependencies
136
+ #RUN if [ "$NODE_ENV" = "development" ]; \\
137
+ # then yarn install; \\
138
+ # else yarn install --production=false; \\
139
+ # fi
140
+
141
+ # Copy source files - we'll handle development overrides through volumes
142
+ COPY ./virtual/frontend/ ./
143
+
144
+ COPY ./dist/check-dependencies.sh /app/
145
+ RUN chmod +x /app/check-dependencies.sh
146
+
147
+ RUN rm -rf ./src/shared
148
+
149
+ # Now copy the actual shared folder - be explicit with the path
150
+ COPY virtual/backend/src/shared/ ./src/shared/
151
+
152
+ # Ports
153
+ ENV PORT ${e.services.frontend?.port||8081}
154
+ EXPOSE ${e.services.frontend?.port||8081}
155
+
156
+ # Add development target
157
+ FROM build AS development
158
+ CMD ["yarn", "run", "dev"]
159
+
160
+ # ----------------------------------------------------------------
161
+ # 2. production stage
162
+ # Here we will use a new docker image, which is only the web server
163
+ FROM nginx:stable-alpine AS production
164
+ WORKDIR /app
165
+
166
+ # Copy nginx config as a template
167
+ COPY frontend/provision/nginx.conf /etc/nginx/conf.d/default.conf.template
168
+
169
+ COPY --from=build app/dist /usr/share/nginx/html
170
+ COPY frontend/provision/entrypoint.sh /docker-entrypoint.d/entrypoint.sh
171
+
172
+ # Make sure the entrypoint is executable
173
+ RUN chmod +x /docker-entrypoint.d/entrypoint.sh
174
+
175
+ ENV PORT 80
176
+ EXPOSE 80
177
+
178
+ CMD ["nginx", "-g", "daemon off;"]`;await Qn.writeFile(i,s)};import Of from"path";var ro=async(e,t,r)=>Ye.filter(n=>r||e.services[n]?.enabled),no=async(e,t,r,n={})=>{if(r.length===0)return;console.log(h.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=Of.join(t,"docker-compose.yml"),s=["-p",e.name??Of.basename(process.cwd()),"-f",o,"build"];n.noCache&&s.push("--no-cache");for(let a of r)try{console.log(h.blue(`\u{1F504} Rebuilding ${a} service...`)),Ee([...s,a],{stdio:"inherit"}),f.success(` Service ${a} rebuilt successfully`)}catch(c){f.error(`Error rebuilding service ${a}: ${c.message}`)}};import Gf from"fs-extra";import Vf from"path";var Tf=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?xa():[]],xa=()=>[],Pf=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],$f=(e=!1)=>{let t=` // JavaScript config
179
+ {
180
+ files: ["**/*.{js,mjs,cjs}"],
181
+ languageOptions: {
182
+ globals: {
183
+ ...globals.browser,
184
+ ...globals.node,
185
+ test: "readonly",
186
+ expect: "readonly",
187
+ it: "readonly",
188
+ cy: "readonly"
189
+ },
190
+ ecmaVersion: 2022,
191
+ sourceType: 'module'
192
+ },
193
+ rules: {
194
+ // Common recommended rules
195
+ "no-console": "warn",
196
+ "prefer-const": "error",
197
+ "no-unused-vars": "warn",
198
+ "curly": ["error", "all"],
199
+ "eqeqeq": ["error", "always"],
200
+ "require-await": "error",
201
+ "padding-line-between-statements": [
202
+ "error",
203
+ // nextline after const
204
+ { blankLine: "always", prev: "const", next: "*" },
205
+ // nextline after let
206
+ { blankLine: "always", prev: "let", next: "*" },
207
+ // allow const after const
208
+ { blankLine: "any", prev: "const", next: "const" },
209
+ // allow let after const
210
+ { blankLine: "any", prev: "const", next: "let" },
211
+ // allow const after let
212
+ { blankLine: "any", prev: "let", next: "const" },
213
+ // allow let after let
214
+ { blankLine: "any", prev: "let", next: "let" },
215
+ // add blank line before return statements
216
+ { blankLine: "always", prev: "*", next: "return" },
217
+ // new line between method declarations
218
+ { blankLine: "always", prev: "const", next: "block-like" }
219
+ ]
220
+ }
221
+ }`;return e?t+`,
222
+
223
+ `+vw():t},vw=()=>` // Style recommended config
224
+ {
225
+ files: ["**/*.{js,mjs,cjs,ts,tsx}"],
226
+ rules: {
227
+ // Style and formatting rules
228
+ "semi": ["error", "never"],
229
+ "quotes": ["error", "double", { "avoidEscape": true }],
230
+ "comma-dangle": ["error", "always-multiline"],
231
+ "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
232
+ "object-curly-spacing": ["error", "always"],
233
+ "array-bracket-spacing": ["error", "never"],
234
+ "computed-property-spacing": ["error", "never"],
235
+ "comma-spacing": ["error", { "before": false, "after": true }],
236
+ "eol-last": ["error", "always"],
237
+ "indent": ["error", 2],
238
+ "linebreak-style": ["error", "unix"],
239
+ "no-trailing-spaces": "error",
240
+ "dot-notation": ["error", { allowKeywords: true }],
241
+ "id-length": [
242
+ "error",
243
+ { min: 3, exceptions: ["i", "j", "a", "b", "fs", "id"], properties: "never" },
244
+ ],
245
+ }
246
+ }`;var ka=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?wa():[]],wa=()=>[],Df=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],Nf=(e=!1)=>{let t=` // React config
247
+ {
248
+ files: ["**/*.{jsx,tsx}"],
249
+ plugins: {
250
+ react,
251
+ 'react-hooks': reactHooks
252
+ },
253
+ rules: {
254
+ // Essential React rules
255
+ "react/jsx-uses-react": "error",
256
+ "react/jsx-uses-vars": "error",
257
+ "react-hooks/rules-of-hooks": "error",
258
+ "react-hooks/exhaustive-deps": "warn",
259
+
260
+ // Additional sensible React rules
261
+ "react/prop-types": "warn",
262
+ "react/jsx-no-duplicate-props": "error",
263
+ "react/jsx-no-undef": "error",
264
+ "react/jsx-pascal-case": "error",
265
+ "react/no-direct-mutation-state": "error",
266
+ "react/no-unescaped-entities": "error"
267
+ }
268
+ }`;return e?t+`,
269
+
270
+ `+bw():t},bw=()=>"";var Lf=(e=!1)=>["typescript-eslint",...e?Ca():[]],Ca=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],If=e=>{let t=["import tseslint from 'typescript-eslint';"];return e&&(t.push("import importPlugin from 'eslint-plugin-import';"),t.push("import preferArrow from 'eslint-plugin-prefer-arrow-functions';")),t},Ff=(e=!1)=>{let r=` // TypeScript config
271
+ {
272
+ files: ["**/*.{ts,tsx}"],
273
+ plugins: ${e?`{
274
+ '@typescript-eslint': tseslint.plugin,
275
+ 'import': importPlugin,
276
+ 'prefer-arrow': preferArrow
277
+ }`:`{
278
+ '@typescript-eslint': tseslint.plugin
279
+ }`},
280
+ languageOptions: {
281
+ parser: tseslint.parser,
282
+ parserOptions: {
283
+ ecmaVersion: 2022,
284
+ sourceType: 'module',
285
+ project: './tsconfig.json'
286
+ }
287
+ },
288
+ rules: {
289
+ // Basic TypeScript rules
290
+ 'no-unused-vars': 'off', // disable JS rule in favor of TS rule
291
+ '@typescript-eslint/no-unused-vars': ['warn', {
292
+ argsIgnorePattern: '^(_|error|config|options|args|props|params|fastify|req|request|res|reply)',
293
+ varsIgnorePattern: '^(_|error|config|options|args|props|params)',
294
+ caughtErrorsIgnorePattern: '^(_|error|config|options|args|props|params)'
295
+ }]
296
+ }
297
+ }`;return e?r+`,
298
+
299
+ `+_w():r},_w=()=>` // TypeScript recommended config
300
+ {
301
+ files: ["**/*.{ts,tsx}"],
302
+ rules: {
303
+ // More opinionated TypeScript rules
304
+ '@typescript-eslint/no-explicit-any': 'warn',
305
+ '@typescript-eslint/explicit-function-return-type': 'off',
306
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
307
+ '@typescript-eslint/no-non-null-assertion': 'warn',
308
+ '@typescript-eslint/no-inferrable-types': 'warn',
309
+ '@typescript-eslint/naming-convention': [
310
+ 'error',
311
+ {
312
+ selector: 'interface',
313
+ format: ['PascalCase'],
314
+ custom: {
315
+ regex: '^I[A-Z]',
316
+ match: false
317
+ }
318
+ },
319
+ {
320
+ selector: 'typeAlias',
321
+ format: ['PascalCase']
322
+ },
323
+ {
324
+ selector: 'enum',
325
+ format: ['PascalCase']
326
+ }
327
+ ],
328
+ '@typescript-eslint/consistent-type-imports': [
329
+ 'error',
330
+ {
331
+ prefer: 'type-imports',
332
+ disallowTypeAnnotations: false
333
+ }
334
+ ],
335
+ '@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
336
+ '@typescript-eslint/prefer-optional-chain': 'warn',
337
+ '@typescript-eslint/prefer-nullish-coalescing': 'warn',
338
+ '@typescript-eslint/prefer-ts-expect-error': 'warn',
339
+
340
+ // Import organization
341
+ 'import/order': ['error', {
342
+ 'groups': [
343
+ 'type',
344
+ ['builtin', 'external'],
345
+ ['internal', 'parent', 'sibling', 'index'],
346
+ ],
347
+ 'alphabetize': {
348
+ 'order': 'asc',
349
+ 'caseInsensitive': true,
350
+ },
351
+ 'pathGroups': [
352
+ // Handle all type imports first, from both external and internal
353
+ {
354
+ 'pattern': 'type',
355
+ 'group': 'type',
356
+ 'position': 'before',
357
+ },
358
+ {
359
+ 'pattern': '{type,types,Types}',
360
+ 'group': 'type',
361
+ 'position': 'before',
362
+ },
363
+ // Handle aliased paths as internal
364
+ {
365
+ 'pattern': '@/**',
366
+ 'group': 'internal',
367
+ }
368
+ ],
369
+ 'pathGroupsExcludedImportTypes': ['type'],
370
+ }],
371
+
372
+ // Arrow function preference
373
+ 'prefer-arrow/prefer-arrow-functions': [
374
+ 'error',
375
+ {
376
+ 'disallowPrototype': true,
377
+ 'singleReturnOnly': false,
378
+ 'classPropertiesAllowed': false,
379
+ }
380
+ ]
381
+ }
382
+ }`;var Aa=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser",...e?Sa():[]],Sa=()=>[],jf=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';"],Mf=(e=!1)=>{let t=` // Vue config
383
+ {
384
+ files: ["**/*.vue"],
385
+ // Manually add Vue plugin
386
+ plugins: {
387
+ vue
388
+ },
389
+ languageOptions: {
390
+ parser: vueEslintParser,
391
+ parserOptions: {
392
+ ecmaVersion: 2022,
393
+ sourceType: 'module',
394
+ parser: tseslint.parser,
395
+ extraFileExtensions: [".vue"]
396
+ }
397
+ },
398
+ rules: {
399
+ // Essential Vue rules (from ESLint plugin Vue)
400
+ "vue/multi-word-component-names": "off",
401
+ "vue/no-mutating-props": "error",
402
+ "vue/no-reserved-component-names": "error",
403
+ "vue/no-use-v-if-with-v-for": "error",
404
+ "vue/require-v-for-key": "error",
405
+ "vue/valid-template-root": "error",
406
+ "vue/valid-v-bind": "error",
407
+ "vue/valid-v-cloak": "error",
408
+ "vue/valid-v-else-if": "error",
409
+ "vue/valid-v-else": "error",
410
+ "vue/valid-v-for": "error",
411
+ "vue/valid-v-html": "error",
412
+ "vue/valid-v-if": "error",
413
+ "vue/valid-v-model": "error",
414
+ "vue/valid-v-on": "error",
415
+ "vue/valid-v-once": "error",
416
+ "vue/valid-v-pre": "error",
417
+ "vue/valid-v-show": "error",
418
+ "vue/valid-v-slot": "error",
419
+ "vue/valid-v-text": "error",
420
+ }
421
+ }`;return e?t+`,
422
+
423
+ `+Ew():t},Ew=()=>` // Vue recommended config
424
+ {
425
+ files: ["**/*.vue"],
426
+ rules: {
427
+ // Recommended Vue rules
428
+ "vue/component-name-in-template-casing": ["error", "PascalCase"],
429
+ "vue/match-component-file-name": [
430
+ "error",
431
+ {
432
+ extensions: ["vue"],
433
+ shouldMatchCase: true
434
+ }
435
+ ],
436
+ "vue/match-component-import-name": "error",
437
+ "vue/attribute-hyphenation": "error",
438
+ "vue/component-definition-name-casing": ["error", "PascalCase"],
439
+ "vue/html-closing-bracket-newline": "error",
440
+ "vue/html-closing-bracket-spacing": "error",
441
+ "vue/html-end-tags": "error",
442
+ "vue/html-indent": ["error", 2],
443
+ "vue/html-quotes": "error",
444
+ "vue/html-self-closing": ["error", {
445
+ "html": {
446
+ "void": "any",
447
+ "normal": "any",
448
+ "component": "always"
449
+ }
450
+ }],
451
+ "vue/max-attributes-per-line": ["error", {
452
+ "singleline": 3,
453
+ "multiline": 1
454
+ }],
455
+ "vue/no-multi-spaces": "error",
456
+ "vue/no-spaces-around-equal-signs-in-attribute": "error",
457
+ "vue/no-template-shadow": "error",
458
+ "vue/one-component-per-file": "error",
459
+ "vue/prop-name-casing": ["error", "camelCase"],
460
+ "vue/require-default-prop": "error",
461
+ "vue/require-prop-types": "error",
462
+ "vue/v-bind-style": "error",
463
+ "vue/v-on-style": "error",
464
+ "vue/v-slot-style": "error"
465
+ }
466
+ }`;var Bf=e=>{let t=e.eslint?.useRecommended!==!1,r=[...Tf(),...Lf()];return e.frontend?.framework==="vue"?r.push(...Aa()):e.frontend?.framework==="react"&&r.push(...ka()),t&&(r.push(...xa(),...Ca()),e.frontend?.framework==="vue"?r.push(...Sa()):e.frontend?.framework==="react"&&r.push(...wa())),[...new Set(r)]};import{existsSync as Ra}from"fs";import Oa from"path";var Hf=e=>{let t=[...e].sort(),r=Ra(Oa.join(process.cwd(),"yarn.lock")),n=Ra(Oa.join(process.cwd(),"pnpm-lock.yaml")),o=Ra(Oa.join(process.cwd(),"bun.lockb")),i="npm",s="install";return r?(i="yarn",s="add"):n?(i="pnpm",s="add"):o&&(i="bun",s="add"),`${i} ${s} -D ${t.join(" ")}`};var oo=async(e,t,r=!0)=>{let n=Vf.join(t,"eslint.config.mjs");f.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=xw(e,o),s=[];if(s.push(` // TS ESLint base rules
467
+ {
468
+ files: ["**/*.{ts,tsx}"],
469
+ plugins: {
470
+ '@typescript-eslint': tseslint.plugin
471
+ },
472
+ languageOptions: {
473
+ parser: tseslint.parser
474
+ },
475
+ rules: {
476
+ // Essential TypeScript syntax rules - equivalent to tseslint.configs.recommended
477
+ "@typescript-eslint/ban-ts-comment": "warn",
478
+ "@typescript-eslint/no-explicit-any": "warn",
479
+ "@typescript-eslint/no-var-requires": "error",
480
+ "@typescript-eslint/no-empty-interface": "warn",
481
+ "@typescript-eslint/no-inferrable-types": "warn",
482
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
483
+ "@typescript-eslint/no-non-null-assertion": "warn",
484
+ "@typescript-eslint/no-unnecessary-type-constraint": "error"
485
+ }
486
+ }`),s.push(` // Ignore patterns
487
+ {
488
+ ignores: [
489
+ "**/node_modules/**",
490
+ "**/dist/**",
491
+ "**/build/**",
492
+ "**/coverage/**",
493
+ "**/*.d.ts",
494
+ ".raclette/**",
495
+ ".gitignore"
496
+ ]
497
+ }`),s.push($f(o)),s.push(Ff(o)),e.frontend?.framework==="vue"&&s.push(Mf(o)),e.frontend?.framework==="react"&&s.push(Nf(o)),e.eslint?.rules&&Object.keys(e.eslint.rules).length>0){let c=JSON.stringify(e.eslint.rules,null,2).replace(/"([^"]+)":/g,"$1:");s.push(` // User custom rules
498
+ {
499
+ rules: ${c}
500
+ }`)}if(e.eslint?.ignores&&e.eslint.ignores.length>0){let c=JSON.stringify(e.eslint.ignores).replace(/^\[|\]$/g,"");s.push(` // User custom ignores
501
+ {
502
+ ignores: [${c}]
503
+ }`)}s.push(` // Prettier config (must be last)
504
+ {
505
+ rules: {
506
+ ...eslintConfigPrettier.rules
507
+ }
508
+ }`);let a=`/*#############################################################
509
+
510
+ Generated ESLint Configuration for ${e.name||"raclette"}
511
+ This file is auto-generated and should not be edited directly
512
+ Extend this config in your project's eslint.config.mjs
513
+
514
+ #############################################################*/
515
+
516
+ // Import required plugins and parsers
517
+ ${i.join(`
518
+ `)}
519
+
520
+ // Exported configuration that can be extended
521
+ export const racletteEslintConfig = [
522
+ ${s.join(`,
523
+
524
+ `)}
525
+ ]
526
+
527
+ // Helper function for extending the config
528
+ export const withRaclette = (...userConfigs) => {
529
+ // Simple array concatenation
530
+ return [...racletteEslintConfig, ...userConfigs.flat()];
531
+ }
532
+
533
+ // Default export for direct usage
534
+ export default racletteEslintConfig
535
+ `;await Gf.writeFile(n,a),r&&await kw(t,e),f.debug(`Generated eslint.config.mjs in ${t}`)},xw=(e,t)=>{let r=[];return r.push(...Pf()),r.push(...If(t)),e.frontend?.framework==="vue"?r.push(...jf()):e.frontend?.framework==="react"&&r.push(...Df()),r},kw=async(e,t)=>{let r=Vf.join(e,"ESLINT-README.md"),n=Bf(t),i=`# racletteJS ESLint Configuration
536
+
537
+ This directory contains an auto-generated ESLint configuration for your racletteJS project.
538
+
539
+ ## Required Dependencies
540
+
541
+ To use this ESLint configuration, you need to install the following dependencies:
542
+
543
+ \`\`\`bash
544
+ ${Hf(n)}
545
+ \`\`\`
546
+
547
+ ## How to Use
548
+
549
+ Create an \`eslint.config.mjs\` file in your project root with:
550
+
551
+ \`\`\`js
552
+ // eslint.config.mjs
553
+ import { withRaclette } from './.raclette/eslint.config.mjs'
554
+
555
+ export default withRaclette(
556
+ // Your custom configs here
557
+ {
558
+ // Example: Override a rule
559
+ rules: {
560
+ 'no-console': 'off'
561
+ }
562
+ },
563
+ // Add more config objects as needed
564
+ )
565
+ \`\`\`
566
+
567
+ ## Features
568
+
569
+ - Project-aware configuration that understands your racletteJS project structure
570
+ - Framework-specific rules (Vue, React) automatically included based on your project
571
+ - Seamless integration with your IDE
572
+ - Clean, modern approach using ESLint's flat config system
573
+
574
+ ## Editor Integration
575
+
576
+ For Visual Studio Code users, make sure to add this to your \`.vscode/settings.json\`:
577
+
578
+ \`\`\`json
579
+ {
580
+ "eslint.experimental.useFlatConfig": true
581
+ }
582
+ \`\`\`
583
+
584
+ This enables support for the flat config format in the ESLint extension.
585
+
586
+ ## Adding Custom Rules
587
+
588
+ You can customize the ESLint rules by:
589
+
590
+ 1. Adding rules in your \`eslint.config.mjs\` file:
591
+
592
+ \`\`\`js
593
+ export default withRaclette(
594
+ {
595
+ // Your custom rules
596
+ rules: {
597
+ 'indent': ['error', 4],
598
+ 'quotes': ['error', 'single']
599
+ }
600
+ }
601
+ )
602
+ \`\`\`
603
+
604
+ 2. Or by adding them to your \`raclette.config.js\` file:
605
+
606
+ \`\`\`js
607
+ export default {
608
+ // ...other racletteJS config
609
+ eslint: {
610
+ useRecommended: true, // Set to false to disable recommended rules
611
+ rules: {
612
+ 'indent': ['error', 4],
613
+ 'quotes': ['error', 'single']
614
+ },
615
+ ignores: [
616
+ 'legacy/**'
617
+ ]
618
+ }
619
+ }
620
+ \`\`\`
621
+ `;await Gf.writeFile(r,i)};import{execSync as Wf}from"child_process";import K from"fs-extra";import ne from"path";import{pathToFileURL as ww}from"url";var Cw=async(e,t,r=!1)=>{r&&f.progress(`Loading merged packages for ${e}...`);let n=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],o={},i={};for(let s of n)try{let a=await Aw(s);if(a.dependencies){o={...o,...a.dependencies};let c=Object.keys(a.dependencies).length;c>0&&r&&f.success(`Merged ${c} dependencies from ${s.file}:${s.key}`)}if(a.devDependencies){i={...i,...a.devDependencies};let c=Object.keys(a.devDependencies).length;c>0&&r&&f.success(`Merged ${c} devDependencies from ${s.file}:${s.key}`)}}catch(a){throw f.error(`Error loading package source ${s.file}:${s.key} - ${a.message}`),f.error(`Aborting package setup for ${e}`),a}return r&&f.raw(h.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(o).length} deps, ${Object.keys(i).length} devDeps`)),{dependencies:o,devDependencies:i}},Aw=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await K.pathExists(e.file))return f.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await K.readJson(e.file),r=e.key.split("."),n=t;for(let o of r)if(n&&typeof n=="object"&&o in n)n=n[o];else return f.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(f.warn(`Invalid package data at '${e.key}' in ${e.file}, skipping`),{}):{dependencies:n.dependencies||{},devDependencies:n.devDependencies||{}}}catch(t){throw new Error(`Failed to parse ${e.file}: ${t.message}`)}},io=(e,t)=>{let r=t.lockFiles?.[e];if(r)return f.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=ne.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},Ta=async(e,t)=>{let r=await hf();if(!t)try{t=await import(ww(ne.join(process.cwd(),"raclette.config.js")).href).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Ye.includes(e)&&await Uf(`services/${e}/package.json`,ne.join(r,e),e,t,!1),ho.includes(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},Sw=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=ne.join(process.cwd(),"package.json");if(!await K.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await K.readJson(t),n={...r.dependencies||{},...r.devDependencies||{}},o=e.plugins.map(s=>typeof s=="string"?s:s[0]),i={};for(let s of o)n[s]?(i[s]=n[s],f.debug(`Found plugin ${s}@${n[s]}`)):f.warn(`Plugin ${s} is enabled in config but not found in package.json`);return i}catch(r){return f.warn(`Error reading app package.json: ${r.message}`),{}}},Uf=async(e,t,r,n,o=!1)=>{let i=Nr();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await K.ensureDir(t);let s=ne.join(i,e),a=ne.dirname(s),c=ne.join(t,"package.json");if(!K.pathExistsSync(s))return f.warn(`Warning: Could not find package.json at ${s}`);o&&f.debug("Reading source package.json...");try{let u=await K.readJson(s),l=["frontend","backend"].includes(r)?await Cw(r,n,o):{dependencies:{},devDependencies:{}},p=await Sw(n),d={...u.dependencies,...l.dependencies,...p},y={...u.devDependencies,...l.devDependencies},g=bt(u,{dependencies:d,devDependencies:y});o&&f.debug("Writing merged package.json..."),await K.writeJson(c,g,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await $w(a,t,r,n)}catch(u){throw f.error(`Error setting up package.json for ${r}: ${u.message}`),u}},so=async e=>{let t=ne.join(process.cwd(),e.root);f.progress("Setting up node packages for services...");for(let r of Ye){if(!e.services[r]?.enabled)continue;let n=ne.join(t,r);await Uf(`services/${r}/package.json`,n,r,e,!0),await gf(io(r,e),ne.join(n,"yarn.lock"))}},Rw=async()=>{let e=ne.join(process.cwd(),"packages.json");if(await K.pathExists(e))try{return await K.readJson(e)}catch(t){f.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},Ow=async e=>{let t=ne.join(process.cwd(),"packages.json");await K.writeJson(t,e,{spaces:2})};var Tw=async(e,t,r=!1)=>{let n=ne.join(process.cwd(),"package.json");if(!await K.pathExists(n))throw new Error("No package.json found in project root");try{Wf("yarn --version",{stdio:"pipe"})}catch{throw new Error("Yarn is not available in PATH")}let o=e;t&&(o=`${e}@${t}`);let s=`yarn add ${o} ${r?"--dev":""}`.trim();f.progress(`Running: ${s}`);try{Wf(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await K.readJson(n),c=r?"devDependencies":"dependencies",u=a[c]?.[e];if(!u)throw new Error(`Package ${e} was not found in ${c} after installation`);return f.success(`Added ${e}@${u} to app package.json ${c}`),u}catch(a){throw new Error(`Failed to add ${e}${t?`@${t}`:""}: ${a.message}`)}},Pw=e=>{let t=e.match(/^(@[^/]+\/[^@]+)(?:@(.+))?$/);if(t)return{name:t[1],version:t[2]};let r=e.match(/^([^@]+)(?:@(.+))?$/);return r?{name:r[1],version:r[2]}:{name:e}},qf=async(e,t,r=!1)=>{let{name:n,version:o}=Pw(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await Tw(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await Rw(),a=[...e.split("."),r?"devDependencies":"dependencies"],c=s;for(let u of a)c[u]||(c[u]={}),c=c[u];c[n]=i,f.success(`Added ${n}@${i} to ${a.join(".")}`),a.length==3&&f.instruction("Note: Workbench packages are stored in packages.json but package.json files are not updated"),await Ow(s),f.success("Updated packages.json in project root")},ao=async e=>{let t=Nr();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=io("frontend",e);if(await K.pathExists(r))f.debug(`\u{1F512} ${ne.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=ne.join(t,"services","frontend","yarn.lock");await K.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await K.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await K.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
622
+ # yarn lockfile v1
623
+
624
+ `)),f.debug(`\u{1F512}\u2705 Created ${ne.basename(r)}`)}}if(e.services.backend?.enabled){let r=io("backend",e);if(await K.pathExists(r))f.debug(`\u{1F512} ${ne.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=ne.join(t,"services","backend","yarn.lock");await K.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await K.copy(n,r)):(f.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await K.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
625
+ # yarn lockfile v1
626
+
627
+ `)),f.debug(`\u{1F512}\u2705 Created ${ne.basename(r)}`)}}f.success("Lock files ready for volume mounting")},$w=async(e,t,r,n)=>{let o=ne.join(t,"yarn.lock");f.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=io(r,n)),i&&await K.pathExists(i))f.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await K.copy(i,o);else{let s=ne.join(e,"yarn.lock");await K.pathExists(s)?(f.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await K.copy(s,o)):(f.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await K.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
628
+ # yarn lockfile v1
629
+
630
+ `))}};import Yf from"fs-extra";import Kf from"path";var co=async(e,t)=>{let r=Kf.join(t,"tsconfig.json"),n={compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"node",esModuleInterop:!0,resolveJsonModule:!0,outDir:"dist",declaration:!0,emitDeclarationOnly:!0,strict:!0,paths:{"@app":["../services/frontend/src/app"],"@app/*":["../services/frontend/src/app/*"],"@shared/app/*":["../shared/*"],"@shared/*":["./virtual/backend/src/shared/*"],"@raclettejs/core/backend":["../node_modules/@raclettejs/core/services/backend/src"],"@raclettejs/core/backend/*":["../node_modules/@raclettejs/core/services/backend/src/*"],"@raclettejs/workbench/app/*":["../node_modules/@raclettejs/workbench/frontend/src/app/*"],"@raclettejs/workbench/*":["../node_modules/@raclettejs/workbench/*"],"@raclettejs/core/frontend":["../node_modules/@raclettejs/core/services/frontend/src/core"],"@raclettejs/core/frontend/*":["../node_modules/@raclettejs/core/services/frontend/src/core/*"],"@raclettejs/core/orchestrator":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator"],"@raclettejs/core/orchestrator/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/*"],"@raclettejs/core/orchestrator/components":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/components"],"@raclettejs/core/orchestrator/components/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/components/*"],"@raclettejs/core/orchestrator/composables":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/composables"],"@raclettejs/core/orchestrator/composables/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/composables/*"],"@raclettejs/core":["../node_modules/@raclettejs/core"]},typeRoots:["./node_modules/@types","./node_modules/@raclettejs/core/types"]},include:["./src/**/*","types/**/*","../**/*","../node_modules/@raclettejs/core/*"],exclude:["../node_modules","../dist","./**","../node_modules/@raclettejs/core/node_modules"]};e.typescript?.compilerOptions&&Object.assign(n.compilerOptions,e.typescript.compilerOptions),e?.frontend?.framework==="vue"&&(Dw(t),n.include.push("shims.vue.d.ts")),await Yf.writeFile(r,JSON.stringify(n,null,2)),f.debug(`Generated tsconfig.json in ${t}`)},Dw=async e=>{await Yf.writeFile(Kf.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
631
+ import { DefineComponent } from "vue"
632
+ const component: DefineComponent<{}, {}, any>
633
+ export default component
634
+ }`)};import Nw from"chokidar";import Pa from"fs-extra";import pt from"path";da();var Lw=[],zf=async(e,t)=>{let r=process.cwd(),n=pt.join(r,e.root),o=[`**/${e.root}/**`,...t.patterns.ignore],i={"":r,"/":n,".":xf(),undefined:".",null:".",$:process.env.RACLETTE_APP_PATH??r};typeof t?.watcher.ignored=="string"&&(t.watcher.ignored=new RegExp(t.watcher.ignored));let s=d=>d.reduce((y,g)=>y.concat(t.patterns[g]??[g]),[]),a=[],c=async(d,y,g)=>{let m=[];for(let E of y)for(let x of g){let S=pt.join(d,E),$=x.endsWith("/")?pt.join(x,E):x;a.push([E,pt.join(n,"vfs",E)]),m.push(Pa.ensureDir(pt.dirname($)).finally(()=>Pa.link(S,$).catch(oe=>oe.code!=="EEXIST"&&f.error(`Unexpected error" ${oe.code} linking ${S} \u2192 ${$}`))))}return Promise.all(m)},u=async(d,y,g)=>{let m=[];for(let E of y)for(let x of g){let S=x.endsWith("/")?pt.join(x,E):x;m.push(Pa.unlink(pt.join(S)))}return Promise.all(m)},l=async(d,y)=>{let g=Nw.watch(d,t.watcher??{});g.on("add",m=>c(d,[m],y)),g.on("unlink",m=>u(d,[m],y)),Lw.push(g)};return Promise.all(t.mappings.map(async d=>{let y=d.src??".",g=pt.join(i[y[0]]??r,y.replace(/^\$/,"")),m=(Array.isArray(d.dst)?d.dst:[d.dst??""]).map(x=>pt.join(e.root,"virtual/",x)),E=s(Array.isArray(d.get)?d.get:[d.get??"**"]);return g.startsWith(n)||l(g,m),pa(E,{cwd:g,ignore:o}).then(x=>c(g,x,m)).catch(x=>x.errno!=17&&console.log(x))}))};import dt from"fs-extra";import Mt from"path";var Xf=async(e,t)=>{try{await dt.ensureDir(Mt.dirname(e)),await dt.pathExists(e)&&(await dt.stat(e)).isDirectory()&&(console.warn(h.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await dt.remove(e)),await dt.writeFile(e,t)}catch(r){throw f.error(` Error writing file ${e}: ${r.message}`),r}},Jf=async(e,t)=>{f.debug("Generating service configuration files...");let r=Mt.join(t,"backend"),n=Mt.join(t,"frontend");await dt.ensureDir(r),await dt.ensureDir(n);let o={name:e.name,env:e.env,modules:e.modules,plugins:e.plugins,global:e.global},i={...o,service:"backend",...e.backend},s=`
635
+ // Generated racletteJS Backend Configuration
636
+ // This file is auto-generated, do not edit directly
637
+
638
+ export const racletteConfig = ${JSON.stringify(i,null,2)};
639
+
640
+ export default racletteConfig;
641
+ `;await Xf(Mt.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
642
+ // Generated racletteJS Frontend Configuration
643
+ // This file is auto-generated, do not edit directly
644
+
645
+ export const racletteConfig = ${JSON.stringify(a,null,2)};
646
+
647
+ export default racletteConfig;
648
+ `;await Xf(Mt.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var lo=e=>{if(!e||typeof e!="object")throw new Error("Workbench configuration must be an object");if(!e.frontend||typeof e.frontend!="object")throw new Error('Workbench configuration must have a "frontend" object');if(e.frontend.i18n!==void 0){if(typeof e.frontend.i18n!="object")throw new Error("frontend.i18n must be an object");if(e.frontend.i18n.locales!==void 0){if(!Array.isArray(e.frontend.i18n.locales))throw new Error("frontend.i18n.locales must be an array");if(!e.frontend.i18n.locales.every(t=>typeof t=="string"))throw new Error("All locales must be strings")}}return!0},uo=async(e,t=process.cwd())=>{let r=Mt.join(t,".raclette"),n=Mt.join(r,"raclette.config.workbench.js");await dt.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
649
+
650
+ export default defineRacletteConfig(${JSON.stringify(e,null,2)})
651
+ `;return await dt.writeFile(n,o,"utf8"),n};var Mr=new Map,Qf="yarn",Zf=process.platform==="win32",eh=async e=>{let t=Ie.join(e,".yarnrc.yml");if(!await Tt.pathExists(t))return!1;let n=(await Tt.readFile(t,"utf8")).match(/^\s*yarnPath\s*:\s*(.+)\s*$/m);if(!n)return!1;let i=n[1].trim().replace(/^['"]|['"]$/g,"");if(!i)return!1;let s=Ie.resolve(e,i);return await Tt.pathExists(s)?!1:(f.warn(`Configured yarnPath is missing (${s}). Falling back to global Yarn.`),!0)},th=async(e,t,r,n)=>{f.raclette("Starting development environment...");let o=Cf(Ef("fs.yml",{appDirName:Ie.basename(n.workingDir)})),i=Ie.dirname(n.dockerComposePath),s=r.name??Ie.basename(e),a=Af(e,t),c={kill:()=>(a(),!0)};Mr.set("originalConfigWatcher",c),await ao(r),await so(r),await zf(r,o),Jn("raclette_shared"),await Ea(r,n.workingDir,n.dockerComposePath,!1,"development",!0),await co(r,i),await oo(r,i);let u=await ro(r,i,n.forceRebuild??!1);u.length>0&&await no(r,i,u,{noCache:n.noCache});let l=jw(r),p=Mw(l);p.length>0&&f.info(`Found existing services: ${p.join(", ")}`);let d=Bw(r,s,n.dockerComposePath);["SIGINT","SIGTERM"].forEach(y=>{process.removeAllListeners(y),process.on(y,()=>d(y))}),n.quiet?(await rh(r,s,n.dockerComposePath,l,p,n.verbose??!1),console.log(h.green(`
652
+ \u2705 Development environment is ready!`)),l.frontend.enabled&&console.log(h.blue(`\u{1F30D} Frontend running at: http://localhost:${l.frontend.port}`)),l.backend.enabled&&console.log(h.blue(`\u{1F680} Server running at: http://localhost:${l.backend.port}`)),console.log(h.yellow(`
653
+ \u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await Hw(r,s,n.dockerComposePath,l,p,n.logFilter,n.verbose??!1)},jw=e=>{let t=e.name??Ie.basename(process.cwd());return{frontend:{name:"frontend",containerName:e.services.frontend?.name??`${t}-frontend`,port:e.services.frontend?.port??8081,enabled:e.services.frontend?.enabled??!1,isDatabaseService:!1},backend:{name:"backend",containerName:e.services.backend?.name??`${t}-backend`,port:e.services.backend?.port??8082,enabled:e.services.backend?.enabled??!1,isDatabaseService:!1},mongodb:{name:"mongodb",containerName:e.services.mongodb?.name??`${t}-mongodb`,port:e.services.mongodb?.port??27017,enabled:e.services.mongodb?.enabled??!1,volumeName:e.services.mongodb?.volume??`${t}-mongodb`,isDatabaseService:!0},cache:{name:"cache",containerName:e.services.cache?.name??`${t}-cache`,port:e.services.cache?.port??6379,enabled:e.services.cache?.enabled??!1,volumeName:e.services.cache?.volume??`${t}-cache`,isDatabaseService:!0}}},Mw=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&jr(n.containerName)&&t.push(r)}),t},Bw=(e,t,r)=>n=>{console.log(`
654
+ `+"=".repeat(80)),console.log(h.bold.yellow(` CLEANUP: Shutting down services after ${n}...`)),console.log("=".repeat(80)+`
655
+ `);for(let[o,i]of Mr.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(h.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{nh(e),Ee(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
656
+ `+"=".repeat(80)),console.log(h.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(h.red("Error stopping Docker services:"),o)}process.exit(0)},rh=async(e,t,r,n,o,i)=>{if(console.log(h.blue("\u{1F433} Starting Docker services...")),!await Tt.pathExists(r)){let a=`Docker compose file not found: ${r}`;throw f.error(a),new Error(a)}let s=[];if(Object.entries(n).forEach(([a,c])=>{let u=a;if(c.enabled){if(o.includes(u)){f.info(`Skipping existing service: ${u}`);return}s.push(u)}}),s.length===0){f.warn("No Docker services to start! All services either exist or are not enabled.");return}f.raw(h.blue(`\u{1F680} Starting following services: ${s.join(", ")}`));try{Ee(["-p",t,"-f",r,"up","-d",...s],{stdio:"inherit"}),f.success(`Docker services started: ${s.join(", ")}`)}catch(a){throw f.error(`Error starting Docker services: ${a.message}`),a}try{await Gw(e,i)}catch(a){f.error(`Error starting Workbench: ${a.message}`)}},Hw=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await rh(e,t,r,n,o,s);let a=i.filter(l=>o.includes(l)?!1:n[l]?.enabled);if(a.length===0){f.warn("No services to show logs for");return}f.raw(h.blue(`\u{1F4CB} Showing logs for: ${a.join(", ")} (press Ctrl+C to stop)...`));let c=Ie.resolve(r),u=["-p",t,"-f",c,"logs","--follow",...a];try{f.debug("Running Docker Compose logs...");let l=$a("docker",["compose",...u],{stdio:"inherit",shell:!0,cwd:Ie.dirname(c)});return Mr.set("dockerLogs",l),new Promise(p=>{l.on("close",d=>{l.killed||console.log(h.yellow(`
657
+ Log process ended with code ${d??0}`)),p()}),l.on("error",d=>{f.error(` Error with log process: ${d.message}`),p()})})}catch(l){throw f.error(`Error setting up log following: ${l.message}`),l}},po=async e=>{if(!e.services?.workbench?.enabled)return;let t=Ie.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await Tt.pathExists(t))throw f.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=Ie.join(t,"package.json");if(!await Tt.pathExists(r))throw f.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},Gw=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await po(e);if(!r)return;let n=r;try{n=await Tt.realpath(r)}catch{}let o=Ie.join(process.cwd(),"workbenchPlugins");await Fw(o)||(o=void 0);let i;if(e.workbench)try{lo(e.workbench),i=await uo(e.workbench)}catch(u){throw console.error(h.red("Workbench configuration error:"),u.message),u}let s=Object.fromEntries(Object.entries(e.env.development||{}).filter(([u])=>u.startsWith("RACLETTE_")).flatMap(([u,l])=>{let p=[[u,l]];if(u.startsWith("RACLETTE_WORKBENCH_")){let d=u.replace("RACLETTE_WORKBENCH_","RACLETTE_");p.push([d,l])}return p}));e.services?.workbench?.debugPort&&(s.ENABLE_DEBUG=!0,s.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let a={...process.env,NODE_ENV:"development",MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:`raclette-cache://localhost:${e.services.cache?.port||6379}${e.services.cache?.db?`/${e.services.cache.db}`:""}`,RACLETTE_CLIENT_PORT:String(e.services.workbench?.frontendPort||8083),RACLETTE_SERVER_PORT:String(e.services.workbench?.backendPort||8084),...s};return await eh(process.cwd())&&(a.YARN_IGNORE_PATH="1"),new Promise((u,l)=>{let p=`${e.name}-workbench`;f.progress("Starting workbench as "+p);let d=["dev",t?"-v":"","-p",p,...i?["-f",i]:[]].filter(x=>x!==""),y=["--cwd",n,...d],g=e.services?.workbench?.withLogs||t,m=$a(Qf,y,{cwd:process.cwd(),env:a,stdio:g?"pipe":"ignore",shell:Zf});Mr.set("workbench",m),g&&(m.stdout?.on("data",x=>{x.toString().trim().split(`
658
+ `).forEach($=>{console.log(h.magenta(`[Workbench] ${$}`))})}),m.stderr?.on("data",x=>{x.toString().trim().split(`
659
+ `).forEach($=>{console.error(h.red(`[Workbench] ${$}`))})}),m.stdout?.on("data",x=>{x.toString().includes("VITE v")&&(clearTimeout(E),u())}));let E=setTimeout(()=>{u()},g?1e3*60*5:5e3);m.on("close",x=>{clearTimeout(E),x!==0&&x!==null?(console.error(h.red(`Workbench process exited with code ${x}`)),l(new Error(`Workbench process exited with code ${x}`))):u()}),m.on("error",x=>{clearTimeout(E),console.error(h.red("Workbench process error:"),x),l(x)}),g||setTimeout(u,1e3)})},nh=async e=>{if(e.services?.workbench?.enabled)try{let t=await po(e);if(!t)return;let r=t;try{r=await Tt.realpath(t)}catch{}let n={...process.env};await eh(process.cwd())&&(n.YARN_IGNORE_PATH="1"),$a(Qf,["--cwd",r,"down","-p",`${e.name}-workbench`],{cwd:process.cwd(),env:n,stdio:"pipe",shell:Zf})}catch{f.debug("Workbench down command failed, forcing process termination");let r=Mr.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{Sf(n)}catch(o){f.warn(`Could not stop workbench containers: ${o.message}`)}}}},Da=(e,t)=>{let r=t?.name??Ie.basename(process.cwd());f.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),f.raclette("Stopping all Docker services...");try{nh(t),Ee(["-p",r,"-f",e,"down"],{stdio:"inherit"}),f.success("All Docker services stopped successfully")}catch(n){throw f.error("Error stopping Docker services:",n),n}};import ih from"fs-extra";import sh from"path";var Vw=e=>lr(e),Br=async(e,t,r)=>{let o=`${t?.name??sh.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await ih.readFile(r,"utf8"),s=new RegExp(`\\$\\{RACLETTE_${e.toUpperCase()}_CONTAINERNAME:-([^}]+)\\}`).exec(i);s&&s[1]&&(o=s[1])}catch(i){console.warn(h.yellow(`Warning: Could not read docker-compose file to determine container name: ${i.message}`))}return o},oh=async(e,t,r)=>{let n=await Br(e,t,r);if(!Vw(n))return!1;try{console.log(h.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),ba(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=ba(n,"cat /app/node_modules/.install-result",{stdio:"pipe"}).trim();return o==="0"?(console.log(h.green(`\u2705 Dependencies for ${e} updated successfully`)),!0):(console.error(h.red(`\u274C Dependency installation for ${e} failed with code ${o}`)),console.error(h.red("Some packages might be incompatible with your Node.js version or have other issues.")),console.error(h.yellow("Check the logs above for specific error messages.")),!1)}catch{return console.log(h.green(`\u2705 Dependencies for ${e} updated (status unknown)`)),!0}}catch(o){return console.error(h.red(`\u274C Error updating dependencies for ${e}: ${o.message}`)),!1}},Na=async(e,t,r)=>{console.log(h.blue("\u{1F9C0} Updating package dependencies..."));let n=sh.join(r,"docker-compose.yml");if(!await ih.pathExists(n))return console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running with racletteJS.")),!1;let o=!1,i=!0;if(e==="frontend"||e==="both"){let s=await oh("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await oh("backend",t,n);o=s||o,i=i&&s}return o&&!i&&(console.log(h.yellow("\u26A0\uFE0F Some services encountered errors during dependency installation.")),console.log(h.yellow("You may need to address compatibility issues in your package.json."))),o&&i};import{spawn as lh}from"child_process";import ah from"path";var uh=async(e,t,r,n)=>{if(e.includes("workbench")){await qw(r,t);return}let o=[];if(e.length===0)o=ch(r),console.log(h.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=ch(r),a=e.filter(c=>!s.includes(c));if(a.length>0)throw console.error(h.red(`\u274C Invalid services specified: ${a.join(", ")}`)),console.log(h.yellow(`Available services: ${s.join(", ")}`)),new Error("Invalid services specified");o=e,console.log(h.blue(`\u{1F4CB} Showing logs for: ${o.join(", ")}`))}let i=await Ww(o,r,n);if(i.length===0)throw console.error(h.red("\u274C None of the specified services appear to be running.")),console.log(h.yellow("\u{1F4A1} Try running 'raclette dev' first to start the services.")),new Error("No running services found");if(i.length<o.length){let s=o.filter(a=>!i.includes(a));console.warn(h.yellow(`\u26A0\uFE0F Some services are not running: ${s.join(", ")}`)),console.log(h.blue(`\u{1F4CB} Showing logs for running services: ${i.join(", ")}`)),o=i}await Uw(r,n,o,t)};function ch(e){let t=[];return e.services?.frontend?.enabled&&t.push("frontend"),e.services?.backend?.enabled&&t.push("backend"),e.services?.mongodb?.enabled&&t.push("mongodb"),e.services?.cache?.enabled&&t.push("cache"),e.services?.workbench?.enabled&&t.push("workbench"),e.services?.workbench?.enabled&&t.push("workbench"),t}async function Ww(e,t,r){let n=[];for(let o of e)try{let i=await Br(o,t,r);lr(i)&&n.push(o)}catch(i){console.warn(h.yellow(`\u26A0\uFE0F Could not check status of service '${o}': ${i.message}`))}return n}async function Uw(e,t,r,n){let o=e?.name??ah.basename(process.cwd());console.log(h.blue(`\u{1F4CB} Following logs for: ${r.join(", ")} ${n.follow?"(press Ctrl+C to stop)":""}`));let i=["-p",o,"-f",t,"logs"];n.follow&&i.push("--follow"),n.tail&&i.push("--tail",n.tail),i.push(...r);try{let s=lh("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:ah.dirname(t)});s.on("close",a=>{s.killed||console.log(h.yellow(`
660
+ Log process ended with code ${a??0}`))}),s.on("error",a=>{console.error(h.red(`\u274C Error with log process: ${a.message}`))}),process.on("SIGINT",()=>{console.log(h.yellow(`
661
+ \u{1F6D1} Stopping log following...`)),s.kill("SIGTERM"),process.exit(0)}),n.follow?await new Promise(()=>{}):await new Promise(a=>{s.on("close",()=>a())})}catch(s){throw console.error(h.red(`\u274C Error following logs: ${s.message}`)),s}}async function qw(e,t){console.log(h.blue("\u{1F527} Handling workbench logs..."));let r=po(e);f.debug("Calling yarn log frontend backend on workbench instance...");try{let n=["log","frontend","backend"];t.follow||n.push("--no-follow"),t.tail&&n.push("--tail",t.tail);let o=lh("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(h.yellow(`
662
+ Workbench log process ended with code ${i??0}`))}),o.on("error",i=>{console.error(h.red(`\u274C Error with workbench log process: ${i.message}`)),console.log(h.yellow("\u{1F4A1} Make sure the workbench package has the 'log' script in its package.json"))}),process.on("SIGINT",()=>{console.log(h.yellow(`
663
+ \u{1F6D1} Stopping workbench log following...`)),o.kill("SIGTERM"),process.exit(0)}),t.follow?await new Promise(()=>{}):await new Promise(i=>{o.on("close",()=>i())})}catch(n){throw console.error(h.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as dC}from"child_process";import V from"fs-extra";import G from"path";import Yw from"chokidar";import I from"fs-extra";import P from"path";var ph=[".prettierrc","eslint.config.js"],Kw=["bin/check-dependencies.sh"],hh=async(e,t,r)=>{let n=process.cwd(),o=P.join(n,".raclette"),i=P.join(o,"virtual"),s=Nr();f.debug(`\u{1F4E6} Using core package at: ${s}`),await eC(o,s,Kw),f.debug("[VFS] Cleaning virtual file system directory..."),await I.pathExists(i)&&await I.rm(i,{recursive:!0}),await I.ensureDir(i);let a=[{name:"generated-service-files",path:o,servicePathMap:{backend:".",frontend:"."},priority:1},{name:"app",path:n,servicePathMap:{backend:"services",frontend:"services"},folderMappings:{shared:"backend/src/shared/app",i18n:"frontend/src/orchestrator/i18n/app"},priority:10},{name:"core-types",path:s,servicePathMap:{backend:"",frontend:""},folderMappings:{"src/types.ts":["backend/types/index.ts","frontend/types/index.ts"]},priority:29},{name:"core",path:s,servicePathMap:{backend:"services",frontend:"services"},priority:30},...e?.sourceDirectories||[],...t??[]],c=new Map,u={backend:["/"],frontend:["/"]},l=[...a].sort((m,E)=>E.priority-m.priority).map(m=>{let E=m.path.startsWith(".")?P.join(process.cwd(),m.path):m.path;return{...m,path:E}});await Qw(l,c,i,u,ph,o),I.writeFileSync(P.join(o,"mappings.tsv"),Array.from(c.entries().map(m=>m.join(" "))).join(`
664
+ `),"utf8"),I.writeFileSync(P.join(o,"dirs.json"),JSON.stringify(l,null,2),"utf8");let p=[],d=m=>{let E=P.relative(n,m);return c.get(E)||m},y=()=>{p.forEach(E=>E.close()),p.length=0,zw(l,u,i).forEach(E=>{if(I.existsSync(E.sourcePath)){let x=Xw(E,l,c,ph);p.push(x)}})},g=()=>p.forEach(m=>m.close());return r||y(),{resolveFile:d,watchFiles:y,close:g}},zw=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",u=P.join(o.path,c,i,a);n.push({sourcePath:u,sourceDir:o,targetResolver:l=>P.join(r,i,a,l),mappingKeyResolver:l=>P.join(i,a,l)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=P.join(o.path,i);I.existsSync(a)&&I.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(l=>{n.push({sourcePath:P.dirname(a),sourceDir:o,targetResolver:p=>P.basename(a)===p?P.join(r,l):P.join(r,l,p),mappingKeyResolver:p=>P.basename(a)===p?i:P.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:u=>P.join(r,i,u),mappingKeyResolver:u=>P.join(i,u)})})}),n},Xw=(e,t,r,n)=>{f.debug(`[VFS] Setting up watcher for ${e.sourceDir.name}: ${e.sourcePath}`);let o=e.sourceDir.name==="generated-service-files"?["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss","**/package.json","**/yarn.lock","**/*.json"]:["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss"],i=Yw.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(Zw(a,n))return;let u=e.mappingKeyResolver(a),l=e.targetResolver(a);await Jw(t,r,u,l,a,c)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},Jw=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=dh(s,r,o);a?(await I.ensureDir(P.dirname(n)),await I.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await I.pathExists(n)&&await I.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`))}else{let a=dh(s,r,o);a&&(await I.ensureDir(P.dirname(n)),await I.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},dh=(e,t,r)=>{for(let n of e){let o={backend:["/"],frontend:["/"]};for(let[i,s]of Object.entries(o))for(let a of s)if(P.join(i,a,r)===t){let u=n.servicePathMap?.[i]||"",l=P.join(n.path,u,i,a,r);if(I.existsSync(l))return{sourceDir:n,fullPath:l}}if(n.folderMappings)for(let[i,s]of Object.entries(n.folderMappings)){let a=Array.isArray(s)?s:[s];for(let c of a){let u,l;if(i===t){if(l=P.join(n.path,i),I.existsSync(l))return{sourceDir:n,fullPath:l}}else if(u=P.join(i,r),u===t&&(l=P.join(n.path,i,r),I.existsSync(l)))return{sourceDir:n,fullPath:l}}}}return null},fh=async(e,t,r,n,o,i)=>{if(!I.pathExistsSync(t))return;await I.ensureDir(P.dirname(r));let s=e.name==="generated-service-files";await I.copy(t,r,{overwrite:!0,filter:u=>{let l=P.basename(u);if(i.includes(l))return!1;if(s&&(l==="package.json"||l==="yarn.lock"))return!0;if(!s&&(l==="package.json"||l==="yarn.lock"))return!1;let p=P.relative(t,u);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")}});let c=await mf(t,s?["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss","**/package.json","**/yarn.lock"]:["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss"]);for(let u of c){let l=P.basename(u);if(i.includes(l))continue;if(!(s&&(l==="package.json"||l==="yarn.lock"))){if(!s&&(l==="package.json"||l==="yarn.lock"))continue}let p=P.relative(t,u),d=P.join(o,p),y=P.join(r,p);n.set(d,y)}f.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},Qw=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await I.pathExists(s.path)){console.warn(h.yellow(`[VFS] Source directory not found: ${s.path}`));continue}for(let[a,c]of Object.entries(n))for(let u of c){let l=s.servicePathMap?.[a]||"";if(!l)continue;let p=P.join(s.path,l,a,u),d=P.join(r,a,u),y=P.join(a,u);await fh(s,p,d,t,y,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let u=P.join(s.path,a),l=(Array.isArray(c)?c:[c]).map(d=>P.join(r,d)),p=await I.pathExists(u)&&(await I.stat(u)).isFile();if(!p&&s.clear)for(let d of l)await I.rm(d,{recursive:!0,force:!0}),await I.ensureDir(d);if(p)for(let d of l)await I.ensureDir(P.dirname(d)),await I.copy(u,d),t.set(a,d),f.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of l)await fh(s,u,d,t,d,o)}}f.debug("[VFS] Built virtual file system")},Zw=(e,t)=>t.includes(P.basename(e));var eC=async(e,t,r)=>{let n=P.join(e,"dist");await I.ensureDir(n);for(let o of r){let i=P.join(t,o),s=P.basename(o),a=P.join(n,s);await I.pathExists(a)&&await I.remove(a),await I.pathExists(i)&&(await I.ensureDir(P.dirname(a)),await I.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await I.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}};import{execSync as tC}from"child_process";import H from"fs-extra";import U from"path";var La=async(e,t,r)=>{console.log(h.blue("\u{1F4E6} Creating production artifacts...")),await oC(t,e,r);let n=U.join(t,"docker-compose.yml");return await iC(e,t,n,r),await sC(e,t,r),await aC(t,r,e),console.log(h.green("\u2705 Production artifacts created")),n},mh=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=U.join(t,a),u=U.basename(a),l=U.join(r,u);if(await H.ensureDir(U.dirname(l)),await H.pathExists(c))await H.copy(c,l),o&&await H.chmod(l,493),console.log(h.gray(`${s} \u2705 Copied ${a}`));else{let p=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${p}`);console.log(h.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},rC=async(e,t,r)=>mh(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),nC=async(e,t,r,n)=>mh(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),oC=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
665
+ FROM nginx:alpine
666
+ COPY service/frontend /usr/share/nginx/html
667
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
668
+ COPY entrypoint.sh entrypoint.sh
669
+
670
+ RUN chmod +x /entrypoint.sh
671
+ RUN apk add --no-cache gettext curl
672
+ RUN chmod -R 755 /usr/share/nginx/html
673
+ RUN find /usr/share/nginx/html -type f -exec chmod 644 {} +
674
+
675
+ EXPOSE ${n}
676
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
677
+ CMD wget --no-verbose --tries=1 --spider http://localhost:${n}/ || exit 1
678
+ ENTRYPOINT ["/entrypoint.sh"]
679
+ CMD ["nginx", "-g", "daemon off;"]
680
+ `,s=`
681
+ FROM node:24.4-alpine
682
+
683
+ # Set working directory
684
+ WORKDIR /app
685
+
686
+ # Install system dependencies that might be needed
687
+ RUN apk add --no-cache tini curl ${(t.services.backend?.installPackages||[]).join(" ")}
688
+
689
+ # Copy package files first for better caching
690
+ COPY service/backend/package*.json ./
691
+ COPY service/backend/yarn.lock* ./
692
+
693
+ # Install only production dependencies
694
+ RUN yarn install --production --frozen-lockfile --silent
695
+
696
+ # Copy the built application (includes dist/ folder)
697
+ COPY service/backend/ ./
698
+
699
+ # Create non-root user for security
700
+ RUN addgroup -g 1001 -S nodejs && \\
701
+ adduser -S fastify -u 1001 && \\
702
+ chown -R fastify:nodejs /app
703
+ USER fastify
704
+
705
+ # Expose port (Fastify should listen on 0.0.0.0 for containers)
706
+ EXPOSE 3000
707
+
708
+ # Health check - point to the correct endpoint
709
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
710
+ CMD node -e "require('http').get('http://localhost:3000/health', (res) => process.exit(res.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"
711
+
712
+ # Use tini to handle signals properly
713
+ ENTRYPOINT ["/sbin/tini", "--"]
714
+
715
+ # Start the application - points to our built dist/src/server.js
716
+ CMD ["yarn", "start"]
717
+ `,a=`
718
+ server {
719
+ listen ${n};
720
+ server_name localhost;
721
+ root /usr/share/nginx/html;
722
+ index index.html;
723
+
724
+ # Security headers
725
+ add_header X-Frame-Options "SAMEORIGIN" always;
726
+ add_header X-Content-Type-Options "nosniff" always;
727
+ add_header Referrer-Policy "no-referrer-when-downgrade" always;
728
+
729
+ # Frontend static files
730
+ location / {
731
+ try_files $uri $uri/ /index.html;
732
+
733
+ # Cache static assets
734
+ location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
735
+ expires 1y;
736
+ add_header Cache-Control "public, immutable";
737
+ }
738
+ }
739
+
740
+ # API endpoints - proxy to backend on internal port 3000
741
+ location /api/ {
742
+ proxy_pass http://backend:3000/;
743
+ proxy_set_header Host $host;
744
+ proxy_set_header X-Real-IP $remote_addr;
745
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
746
+ proxy_set_header X-Forwarded-Proto $scheme;
747
+
748
+ # Timeout settings
749
+ proxy_connect_timeout 60s;
750
+ proxy_send_timeout 60s;
751
+ proxy_read_timeout 60s;
752
+ }
753
+
754
+ # WebSocket connections
755
+ location /socket.io/ {
756
+ proxy_pass http://backend:3000/socket.io/;
757
+ proxy_http_version 1.1;
758
+ proxy_set_header Upgrade $http_upgrade;
759
+ proxy_set_header Connection "upgrade";
760
+ proxy_set_header Host $host;
761
+ proxy_set_header X-Real-IP $remote_addr;
762
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
763
+ proxy_set_header X-Forwarded-Proto $scheme;
764
+ proxy_set_header Authorization $http_authorization;
765
+ }
766
+
767
+ # Health check endpoint
768
+ location /health {
769
+ proxy_pass http://backend:3000/health;
770
+ proxy_set_header Host $host;
771
+ }
772
+ }
773
+ `;if(await H.writeFile(U.join(e,"Dockerfile.frontend"),i),await H.writeFile(U.join(e,"Dockerfile.backend"),s),await H.writeFile(U.join(e,"nginx.conf"),a),await rC(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let u=`
774
+ FROM nginx:alpine
775
+ COPY workbench/frontend /usr/share/nginx/html
776
+ COPY nginx.workbench.conf /etc/nginx/conf.d/default.conf
777
+ COPY entrypoint.sh /entrypoint.sh
778
+
779
+ RUN chmod +x /entrypoint.sh
780
+ RUN apk add --no-cache gettext curl
781
+ RUN chmod -R 755 /usr/share/nginx/html
782
+ RUN find /usr/share/nginx/html -type f -exec chmod 644 {} +
783
+
784
+ EXPOSE ${o}
785
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
786
+ CMD wget --no-verbose --tries=1 --spider http://localhost:${o}/ || exit 1
787
+
788
+ ENTRYPOINT ["/entrypoint.sh"]
789
+ CMD ["nginx", "-g", "daemon off;"]
790
+ `,l=`
791
+ FROM node:24.4-alpine
792
+ WORKDIR /app
793
+
794
+ # Install dependencies
795
+ RUN apk add --no-cache tini curl
796
+
797
+ # Copy package files
798
+ COPY workbench/backend/package*.json ./
799
+ COPY workbench/backend/yarn.lock* ./
800
+
801
+ # Install production dependencies
802
+ RUN yarn install --production --frozen-lockfile --silent
803
+
804
+ # Copy application code (includes dist/ if built)
805
+ COPY workbench/backend/ ./
806
+
807
+ # Create non-root user
808
+ RUN addgroup -g 1001 -S nodejs && \\
809
+ adduser -S workbench -u 1001 && \\
810
+ chown -R workbench:nodejs /app
811
+ USER workbench
812
+
813
+ # Expose port (Fastify should listen on 0.0.0.0 for containers)
814
+ EXPOSE 3000
815
+
816
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
817
+ CMD node -e "require('http').get('http://localhost:3000/health', (res) => process.exit(res.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"
818
+
819
+ ENTRYPOINT ["/sbin/tini", "--"]
820
+ CMD ["yarn", "start"]
821
+ `,p=`
822
+ server {
823
+ listen ${o};
824
+ root /usr/share/nginx/html;
825
+ index index.html;
826
+
827
+ location / {
828
+ try_files $uri $uri/ /index.html;
829
+ }
830
+
831
+ location /api/ {
832
+ proxy_pass http://workbench-backend:3000/;
833
+ proxy_set_header Host $host;
834
+ proxy_set_header X-Real-IP $remote_addr;
835
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
836
+ proxy_set_header X-Forwarded-Proto $scheme;
837
+ }
838
+
839
+ location /socket.io/ {
840
+ proxy_pass http://workbench-backend:3000/socket.io/;
841
+ proxy_http_version 1.1;
842
+ proxy_set_header Upgrade $http_upgrade;
843
+ proxy_set_header Connection "upgrade";
844
+ proxy_set_header Host $host;
845
+ proxy_set_header X-Real-IP $remote_addr;
846
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
847
+ proxy_set_header X-Forwarded-Proto $scheme;
848
+ proxy_set_header Authorization $http_authorization;
849
+ }
850
+ }
851
+ `;await H.writeFile(U.join(e,"Dockerfile.workbench-frontend"),u),await H.writeFile(U.join(e,"Dockerfile.workbench-backend"),l),await H.writeFile(U.join(e,"nginx.workbench.conf"),p)}},iC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=e.env.production||{},a={services:{frontend:{build:{context:".",dockerfile:"Dockerfile.frontend"},ports:[`\${PORT:-${o}}:${o}`],depends_on:["backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(s).map(([u,l])=>`${u}=${l}`)],healthcheck:dr(o)},backend:{build:{context:".",dockerfile:"Dockerfile.backend"},depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-valkey://cache:6379${e.services.cache?.db?`/${e.services.cache?.db}`:""}}`,...Object.entries(s).map(([u,l])=>`${u}=${l}`)],healthcheck:tt.backend},database:{image:"mongo:8.2",restart:"unless-stopped",volumes:["mongodb_data:/data/db","mongodb_config:/data/config"],networks:["app-network"],environment:["MONGO_INITDB_DATABASE=${MONGO_DATABASE:-"+(e.services.mongodb?.databaseName||e.name)+"}"],healthcheck:{...tt.mongodb}},cache:{image:"valkey/valkey:9.0-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{...tt.cache}}},volumes:{mongodb_data:{},mongodb_config:{},cache_data:{}},networks:{"app-network":{driver:"bridge"}}},c=e.backend?.cache;if(c?.persistence){let u=c.RDB_OPTIONS||"3600 1 300 100 60 10000";switch(c.persistence){case"none":a.services.cache.command='valkey-server --save ""';break;case"aof":a.services.cache.command="valkey-server --appendonly yes";break;case"rdb":a.services.cache.command="valkey-server --save "+u;break;case"rdb+aof":a.services.cache.command="valkey-server --appendonly yes --save "+u;break}}if(n){let u=e.env.production||{};a.services["workbench-frontend"]={build:{context:".",dockerfile:"Dockerfile.workbench-frontend"},ports:[`\${WORKBENCH_PORT:-${i}}:${i}`],depends_on:["workbench-backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(u).map(([l,p])=>`${l}=${p}`)],healthcheck:dr(i)},a.services["workbench-backend"]={build:{context:".",dockerfile:"Dockerfile.workbench-backend"},depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-valkey://cache:6379${e.services.cache?.db?`/${e.services.cache?.db}`:""}}`,...Object.entries(u).map(([l,p])=>`${l}=${p}`)],healthcheck:tt.backend}}await H.writeFile(r,ke.dump(a))},sC=async(e,t,r)=>{let n=Ia(e,r);await H.writeFile(U.join(t,".env.example"),n)},Ia=(e,t)=>{let r=e.services.frontend?.port||8081,n=e.services.workbench?.frontendPort||8083;return`# Production Environment Variables
852
+ # Copy this file to .env and fill in your values
853
+
854
+ # Required - Generate a secure random string for this
855
+ SERVER_TOKEN_SECRET=your-secret-key-here
856
+
857
+ # Auto-generated docker variables, they should work for default configurations
858
+ NODE_ENV=production
859
+ MONGO_DATABASE=${e.services.mongodb?.databaseName||e.name}
860
+
861
+ # Frontend API Configuration
862
+ # In production, API calls should go through nginx proxy
863
+ VITE_API_BASE_URL=/api
864
+ REACT_APP_API_BASE_URL=/api
865
+
866
+ # Application URLs (for reference)
867
+ # Main App: http://localhost:${r}
868
+ ${t?`# Workbench: http://localhost:${n}`:""}
869
+
870
+ # Override database and cache connections (default values as set in docker-compose file)
871
+ # RACLETTE_MONGODB_HOST=mongodb://database:27017/\${MONGO_DATABASE}
872
+ # RACLETTE_CACHE_URL=valkey://cache:6379
873
+
874
+ # Frontend environment overrides (optional)
875
+ # RACLETTE_DEBUG_MODE=true # uncomment, if you want to see all the frontend logs in the console
876
+
877
+ # Backend environment overrides (optional)
878
+ # RACLETTE_DISABLE_PLUGIN_LOGS=true
879
+
880
+ # Add any custom environment variables from your config here:
881
+ ${Object.keys(e.env.production||{}).map(i=>`# ${i}=`).join(`
882
+ `)}
883
+
884
+ # MongoDB specific overrides (uncomment if using external MongoDB)
885
+ # RACLETTE_MONGODB_HOST=mongodb://your-external-mongodb:27017/your-database
886
+
887
+ # Cache specific overrides (uncomment if using external Valkey/Redis)
888
+ # RACLETTE_CACHE_URL=valkey://your-external-cache:6379
889
+ `},aC=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
890
+ # racletteJS Production Deployment Script
891
+
892
+ set -e
893
+
894
+ echo "\u{1F680} Deploying racletteJS application..."
895
+
896
+ # Check if .env file exists
897
+ if [ ! -f .env ]; then
898
+ echo "\u274C .env file not found. Copy .env.example and configure it first."
899
+ exit 1
900
+ fi
901
+
902
+ # Build and start services
903
+ echo "\u{1F433} Building Docker images..."
904
+ docker compose build --no-cache
905
+
906
+ echo "\u{1F7E2} Starting services..."
907
+ docker compose up -d
908
+
909
+ echo "\u23F3 Waiting for services to be healthy..."
910
+ sleep 30
911
+
912
+ # Check health
913
+ echo "\u{1F50D} Checking service health..."
914
+ docker compose ps
915
+
916
+ # Test endpoints
917
+ echo "\u{1F9EA} Testing application endpoints..."
918
+ if curl -f http://localhost:${n}/health > /dev/null 2>&1; then
919
+ echo "\u2705 Application health check passed"
920
+ else
921
+ echo "\u26A0\uFE0F Application health check failed, but services are running"
922
+ echo "\u{1F4A1} Make sure your Fastify backend has a /health endpoint and listens on 0.0.0.0:3000"
923
+ fi
924
+
925
+ echo "\u2705 Deployment complete!"
926
+ echo ""
927
+ echo "\u{1F30D} Application URLs:"
928
+ echo " Main App: http://localhost:${n}"
929
+ ${t?`echo " Workbench: http://localhost:${o}"`:""}
930
+ echo ""
931
+ echo "\u{1F4CA} Management commands:"
932
+ echo " View logs: docker compose logs -f"
933
+ echo " Stop: docker compose down"
934
+ echo " Restart: docker compose restart"
935
+ echo " Update images: ./load-images.sh && docker compose up -d"
936
+ echo ""
937
+ echo "\u{1F6E0}\uFE0F Backend info:"
938
+ echo " - Built with TypeScript and compiled to dist/src/server.js"
939
+ echo " - Runs on Node.js 24 Alpine with production dependencies only"
940
+ echo " - Should listen on 0.0.0.0:3000 for proper container networking"
941
+ echo " - Accessible via /api proxy on port ${n}"
942
+ `,s=U.join(e,"deploy.sh");await H.writeFile(s,i),await H.chmod(s,493)},gh=async(e,t,r)=>{let n={services:{},volumes:{},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},o=`${e.name}-build`;if(e.services.mongodb?.enabled){let i=`${o}-mongodb-data`;n.services.mongodb={container_name:`${o}-mongodb`,image:"mongo:8.2",ports:[`127.0.0.1:${e.services.mongodb.port}:27017`],volumes:[`${i}:/data/db`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},n.volumes[i]=null}if(e.services.redis?.enabled){let i=`${o}-redis-data`;n.services.redis={container_name:`${o}-redis`,image:"redis:7-alpine",ports:[`127.0.0.1:${e.services.redis.port}:6379`],command:"redis-server --appendonly yes",volumes:[`${i}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","redis-cli","ping"],interval:"10s",timeout:"5s",retries:3}},n.volumes[i]=null}if(e.services.backend?.enabled){let i=`${o}-backend_node_modules`;n.services.backend={container_name:`${o}-backend`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:"development"}},command:"yarn generate",environment:["NODE_ENV=development","RACLETTE_BUILD_MODE=generate",`MONGO_HOST=mongodb://mongodb:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,"SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}",`CACHE_URL=redis://redis:${e.services.redis?.port||6379}`,...Object.entries(e.env.development||{}).map(([s,a])=>`${s}=${a}`)],volumes:[`${i}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins","./.raclette/backend/raclette.config.js:/app/raclette.config.js","./.raclette/backend/package.json:/app/package.json","./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh",`${pr("backend",e)}:/app/yarn.lock`],networks:["raclette_shared"],depends_on:{...e.services.mongodb?.enabled&&{mongodb:{condition:"service_started"}},...e.services.redis?.enabled&&{redis:{condition:"service_healthy"}}},entrypoint:["/app/check-dependencies.sh"]},n.volumes[i]=null}e.services.backend?.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(i=>{let s=Ot(i,t);s&&n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=eo(i.volumes,t))}),await H.writeFile(r,ke.dump(n))},yh=async(e,t,r,n)=>{let o={services:{},volumes:{},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},i=`${e.name}-build`;if(e.services.frontend?.enabled){let s=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`;o.services.frontend={container_name:`${i}-frontend`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:"production"},target:"build"},command:["sh","-c","yarn install --production=false && yarn build && cp -r /app/dist/* /build-output/"],environment:[...Object.entries(e.env.production||{}).map(([a,c])=>`${a}=${c}`),"NODE_ENV=production"],volumes:["./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${s}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins","./.raclette/virtual/frontend/types:/app/types","./.raclette/frontend/raclette.config.js:/app/raclette.config.js","./.raclette/frontend/package.json:/app/package.json",`${pr("frontend",e)}:/app/yarn.lock`,`${U.resolve(n,"frontend")}:/build-output`],networks:["raclette_shared"]},o.volumes[s]=null;try{e.services.frontend?.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(a=>{let c=Ot(a,t);c&&o.services.frontend.volumes.push(c)})}catch{console.error(h.red("Could not add custom volumes to backend docker-compose file. This might lead to missing data."))}}if(e.services.backend?.enabled){let s=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;o.services.backend={container_name:`${i}-backend`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:"production"}},command:["sh","-c","yarn install --production=false && rm -rf ./dist && yarn build && cp -r /app/dist /build-output/ && cp /app/package.json /build-output/ && cp /app/yarn.lock /build-output/ || echo 'Backend build failed'"],environment:[...Object.entries(e.env.production||{}).map(([a,c])=>`${a}=${c}`),"NODE_ENV=production"],volumes:[`${s}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./.raclette/backend/raclette.config.js:/app/raclette.config.js","./plugins:/app/src/appPlugins","./.raclette/backend/package.json:/app/package.json",`${pr("backend",e)}:/app/yarn.lock`,"./.raclette/virtual/backend/types:/app/types",`${U.resolve(n,"backend")}:/build-output`],networks:["raclette_shared"]},o.volumes[s]=null;try{e.services.backend?.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(a=>{let c=Ot(a,t);c&&o.services.backend.volumes.push(c)})}catch{console.error(h.red("Could not add custom volumes to backend docker-compose file. This might lead to missing data."))}}Object.values(o.services).forEach(s=>{s.volumes&&(s.volumes=eo(s.volumes,t))}),await H.writeFile(r,ke.dump(o))},cC=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
943
+ # racletteJS Production Deployment Script with Image Loading
944
+
945
+ set -e
946
+
947
+ echo "\u{1F680} Deploying racletteJS application from packaged images..."
948
+
949
+ # Check if running from package directory
950
+ if [ ! -d "images" ]; then
951
+ echo "\u274C Images directory not found. Make sure you're running this from the extracted package directory."
952
+ exit 1
953
+ fi
954
+
955
+ # Check if .env file exists
956
+ if [ ! -f .env ]; then
957
+ echo "\u274C .env file not found. Copy .env.example and configure it first."
958
+ echo "\u{1F4A1} Run: cp .env.example .env && nano .env"
959
+ exit 1
960
+ fi
961
+
962
+ # Load Docker images
963
+ echo "\u{1F4E5} Loading Docker images..."
964
+ ./load-images.sh
965
+
966
+ # Build and start services (images are already loaded)
967
+ echo "\u{1F7E2} Starting services..."
968
+ docker compose up -d
969
+
970
+ echo "\u23F3 Waiting for services to be healthy..."
971
+ sleep 30
972
+
973
+ # Check health
974
+ echo "\u{1F50D} Checking service health..."
975
+ docker compose ps
976
+
977
+ # Test endpoints
978
+ echo "\u{1F9EA} Testing application endpoints..."
979
+ if curl -f http://localhost:${o}/health > /dev/null 2>&1; then
980
+ echo "\u2705 Application health check passed"
981
+ else
982
+ echo "\u26A0\uFE0F Application health check failed, but services are running"
983
+ echo "\u{1F4A1} Make sure your Fastify backend has a /health endpoint and listens on 0.0.0.0:3000"
984
+ fi
985
+
986
+ echo "\u2705 Deployment complete!"
987
+ echo ""
988
+ echo "\u{1F30D} Application URLs:"
989
+ echo " Main App: http://localhost:${o}"
990
+ ${r?`echo " Workbench: http://localhost:${i}"`:""}
991
+ echo ""
992
+ echo "\u{1F4CA} Management commands:"
993
+ echo " View logs: docker compose logs -f"
994
+ echo " Stop: docker compose down"
995
+ echo " Restart: docker compose restart"
996
+ echo " Update images: ./load-images.sh && docker compose up -d"
997
+ `;await H.writeFile(U.join(e,"deploy.sh"),s),await H.chmod(U.join(e,"deploy.sh"),493)},lC=async(e,t)=>{let r=`#!/bin/bash
998
+ # Load Docker Images Script
999
+
1000
+ set -e
1001
+
1002
+ echo "\u{1F4E5} Loading Docker images..."
1003
+
1004
+ if [ ! -d "images" ]; then
1005
+ echo "\u274C Images directory not found"
1006
+ exit 1
1007
+ fi
1008
+
1009
+ cd images
1010
+
1011
+ # Load each image
1012
+ ${t.map(n=>{let o=n.replace(/[:/]/g,"_");return`echo " \u{1F4E6} Loading ${n}..."
1013
+ if [ -f "${o}.tar" ]; then
1014
+ docker load -i "${o}.tar"
1015
+ echo " \u2705 Loaded ${n}"
1016
+ else
1017
+ echo " \u274C Image file ${o}.tar not found"
1018
+ exit 1
1019
+ fi`}).join(`
1020
+
1021
+ `)}
1022
+
1023
+ cd ..
1024
+
1025
+ echo "\u2705 All images loaded successfully!"
1026
+ echo ""
1027
+ echo "\u{1F433} Available images:"
1028
+ docker images | grep -E "${t.map(n=>n.split(":")[0]).join("|")}" || echo "No images found (this might be expected if tags changed)"
1029
+ `;await H.writeFile(U.join(e,"load-images.sh"),r),await H.chmod(U.join(e,"load-images.sh"),493)},uC=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
1030
+
1031
+ This package contains everything needed to deploy your racletteJS application.
1032
+
1033
+ ## Contents
1034
+
1035
+ - \`images/\` - Docker images as TAR files
1036
+ - \`docker-compose.yml\` - Production compose configuration
1037
+ - \`.env.example\` - Environment variables template
1038
+ - \`deploy.sh\` - Main deployment script
1039
+ - \`load-images.sh\` - Load Docker images script
1040
+ - \`nginx.conf\` - Nginx configuration
1041
+ ${n?"- `nginx.workbench.conf` - Workbench nginx configuration":""}
1042
+
1043
+ ## Quick Start
1044
+
1045
+ 1. **Extract the package:**
1046
+ \`\`\`bash
1047
+ tar -xzf ${t.name}-deployment-*.tar.gz
1048
+ cd ${t.name}-deployment-*
1049
+ \`\`\`
1050
+
1051
+ 2. **Configure environment:**
1052
+ \`\`\`bash
1053
+ cp .env.example .env
1054
+ nano .env # Edit your configuration
1055
+ \`\`\`
1056
+
1057
+ 3. **Deploy:**
1058
+ \`\`\`bash
1059
+ chmod +x deploy.sh load-images.sh
1060
+ ./deploy.sh
1061
+ \`\`\`
1062
+
1063
+ ## Manual Deployment
1064
+
1065
+ If you prefer manual control:
1066
+
1067
+ 1. **Load images:**
1068
+ \`\`\`bash
1069
+ ./load-images.sh
1070
+ \`\`\`
1071
+
1072
+ 2. **Start services:**
1073
+ \`\`\`bash
1074
+ docker compose up -d
1075
+ \`\`\`
1076
+
1077
+ ## Included Images
1078
+
1079
+ ${r.map(a=>`- \`${a}\``).join(`
1080
+ `)}
1081
+
1082
+ ## Environment Variables
1083
+
1084
+ Copy \`.env.example\` to \`.env\` and configure:
1085
+
1086
+ - \`SERVER_TOKEN_SECRET\` - **Required** - Generate a secure random string
1087
+ - \`MONGO_DATABASE\` - Database name (default: ${t.services.mongodb?.databaseName||t.name})
1088
+ - \`NODE_ENV=production\` - **Required for production**
1089
+
1090
+ ## Application URLs
1091
+
1092
+ After deployment:
1093
+ - Main Application: http://localhost:${o}
1094
+ ${n?`- Workbench: http://localhost:${i}`:""}
1095
+
1096
+ ## Management Commands
1097
+
1098
+ - **View logs:** \`docker compose logs -f\`
1099
+ - **Stop services:** \`docker compose down\`
1100
+ - **Restart services:** \`docker compose restart\`
1101
+ - **Update:** Re-run \`./load-images.sh && docker compose up -d\`
1102
+
1103
+ ## Troubleshooting
1104
+
1105
+ - **Health check fails:** Ensure your backend has a \`/health\` endpoint
1106
+ - **502 errors:** Check backend logs with \`docker compose logs backend\`
1107
+ - **Images not loading:** Verify Docker is running and you have sufficient disk space
1108
+
1109
+ ## System Requirements
1110
+
1111
+ - Docker and Docker Compose
1112
+ - At least 2GB free disk space
1113
+ - Ports ${o}${n?`, ${i}`:""} available
1114
+
1115
+ Generated on: ${new Date().toISOString()}
1116
+ `;await H.writeFile(U.join(e,"README.md"),s)},vh=async(e,t,r,n,o)=>{console.log(h.blue("\u{1F4E6} Packaging images for distribution..."));let i=U.join(t,"..","package"),s=`${e.name}-deployment-${n}`,a=U.join(i,`${s}.tar.gz`);await H.ensureDir(i),await H.emptyDir(i);let c=U.join(i,s);await H.ensureDir(c);try{console.log(h.gray(" \u{1F4BE} Exporting Docker images..."));let u=U.join(c,"images");await H.ensureDir(u);for(let p of r){let d=`${p.replace(/[:/]/g,"_")}.tar`,y=U.join(u,d);console.log(h.gray(` \u{1F4E6} Exporting ${p}...`)),pe(["save","-o",y,p],{stdio:"pipe"});let g=await H.stat(y);if(g.size===0)throw new Error(`Failed to export image ${p}`);console.log(h.gray(` \u2705 Exported ${p} (${(g.size/1024/1024).toFixed(1)}MB)`))}console.log(h.gray(" \u{1F4C4} Copying deployment files..."));let l=["docker-compose.yml",".env.example","deploy.sh","nginx.conf"];return o&&l.push("nginx.workbench.conf"),await nC(l,t,c,{required:!1,logPrefix:" "}),await cC(c,r,o,e),await lC(c,r),await uC(c,e,r,o),console.log(h.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await pC(c,a),await H.remove(c),console.log(h.green(` \u2705 Deployment package created: ${s}.tar.gz`)),{packagePath:a,imageNames:r}}catch(u){throw await H.remove(c).catch(()=>{}),u}},pC=async(e,t)=>{let r=U.dirname(e),n=U.basename(e);tC(`tar -czf "${t}" -C "${r}" "${n}"`,{stdio:"pipe"});let o=await H.stat(t);console.log(h.gray(` \u{1F4E6} Package size: ${(o.size/1024/1024).toFixed(1)}MB`))};var bh=240,Fa=7200,fC=()=>{let e=process.env.RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS,t,r;if(e===void 0||e==="")t=bh,r="default (env unset)";else{let n=Number.parseInt(e,10);!Number.isFinite(n)||n<1?(t=bh,r=`invalid env "${e}", using default`):(t=Math.min(n,Fa),r=n>Fa?`capped from ${n}s to max ${Fa}s`:`from env RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS=${e}`)}return console.log(h.gray(` \u23F1\uFE0F Generation mode wait: ${t}s (${r})`)),t},_h=async(e,t,r={})=>{let n=Date.now(),o=hC(r);console.log(h.blue(`\u{1F9C0} Starting racletteJS ${o} build...`)),Xn();let i=G.join(process.cwd(),".raclette"),s=G.resolve(r.outputDir||G.join(i,".build"));await V.ensureDir(s),await V.emptyDir(s);try{await xC(e,t,i),await kC(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await mC(e,i,s,r);break;case"images":a=await Eh(e,i,s,r);break;case"package":a=await gC(e,i,s,r);break}let c=(Date.now()-n)/1e3;return f.success(` ${o} build completed in ${c}s`),EC(a,e),a}catch(a){throw f.error(`${o} build failed: ${a.message}`),a}},hC=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),mC=async(e,t,r,n)=>{if(n.buildOnly){console.log(h.blue("\u{1F4C1} Building application files only...")),await ja(e,t,r,n);let i=await Ma(e,r,n);return console.log(h.green("\u2705 Build files ready")),{mode:"artifacts",buildDir:r,artifacts:{}}}else{console.log(h.blue("\u{1F4C1} Building local deployment artifacts..."));let i=G.join(r,"service");await ja(e,t,i,n);let s=await Ma(e,r,n),a=await La(e,r,s),c=await _C(e,r,s);return console.log(h.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:G.join(r,"deploy.sh"),readmeFile:c,envExampleFile:G.join(r,".env.example")}}}},Eh=async(e,t,r,n)=>{console.log(h.blue("\u{1F433} Building Docker images for CI/CD..."));let o=G.join(r,"service");await ja(e,t,o,n);let i=await Ma(e,r,n);await La(e,r,i);let s=await yC(e,r,i,n);return console.log(h.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},gC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4E6} Building offline deployment package..."));let o=await Eh(e,t,r,n),i=xh(),s=await vh(e,r,o.images.names,i,o.images.names.some(a=>a.includes("workbench")));return console.log(h.green("\u2705 Offline deployment package ready")),{...o,mode:"package",deploymentPackage:s.packagePath}},yC=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||xh(),s=n.platforms||"linux/amd64,linux/arm64",a=n.buildx||!1,c=[],u=[i];if(n.generateLatest&&!u.includes("latest")&&u.push("latest"),a)try{await vC(),console.log(h.blue(`\u{1F3D7}\uFE0F Building multi-architecture images for: ${s}`))}catch(l){console.warn(h.yellow("\u26A0\uFE0F Buildx not available, falling back to single-architecture builds")),console.warn(h.yellow(` ${l.message}`)),a=!1}if(a){let l=["frontend","backend"];r&&l.push("workbench-frontend","workbench-backend");for(let p of l){let d=`${o}/${p}`,y=G.join(t,`Dockerfile.${p}`);if(!await V.pathExists(y))throw new Error(`Dockerfile not found: ${y}`);let g=u.map(m=>`${d}:${m}`);c.push(...g),await bC({context:t,dockerfile:y,tags:g,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(h.gray(` \u2705 Built ${p} for ${s}`)),g.forEach(m=>{console.log(h.gray(` ${m}`))})}}else{console.log(h.gray(" \u{1F528} Building single-architecture images..."));let p=["-f",G.join(t,"docker-compose.yml"),"build"];n.noCache&&p.push("--no-cache"),Ee(p,{stdio:n.verbose?"inherit":"pipe",cwd:t});let d=["frontend","backend"];r&&d.push("workbench-frontend","workbench-backend");for(let y of d){let g=`${G.basename(t)}-${y}`.replace(/\./,""),m=`${o}/${y}`;u.forEach(E=>{let x=`${m}:${E}`;pe(["tag",g,x],{stdio:"pipe"}),c.push(x)}),console.log(h.gray(` \u2705 Tagged ${y}`))}}return console.log(h.green(" \u2705 Docker images built and tagged")),{names:c,tags:u}},vC=async()=>{try{pe(["buildx","version"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),pe(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Creating buildx builder...")),pe(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),pe(["buildx","inspect","--bootstrap"],{stdio:"pipe"}),console.log(h.gray(" \u2705 Buildx builder ready with QEMU emulation"))}catch(e){throw console.warn(h.yellow(" \u26A0\uFE0F Buildx setup failed, falling back to single-architecture builds")),console.warn(h.yellow(` ${e.message}`)),new Error("Buildx not available - use single-architecture builds instead")}},bC=async e=>{let t=["buildx","build","--platform",e.platforms,"--file",e.dockerfile];e.tags.forEach(n=>{t.push("--tag",n)});let r=e.platforms.split(",").length;e.push?t.push("--push"):r===1?t.push("--load"):(console.log(h.yellow(" \u26A0\uFE0F Multi-platform images cannot be loaded locally")),console.log(h.yellow(" \u2139\uFE0F Images built but not loaded to local Docker"))),e.noCache&&t.push("--no-cache"),t.push(e.context);try{pe(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},_C=async(e,t,r)=>{let n=G.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
1117
+
1118
+ This build contains everything needed to deploy ${e.name} locally using Docker.
1119
+
1120
+ ## Quick Start
1121
+
1122
+ 1. **Configure environment:**
1123
+ \`\`\`bash
1124
+ cp .env.example .env
1125
+ nano .env # Edit SERVER_TOKEN_SECRET and other settings
1126
+ \`\`\`
1127
+
1128
+ 2. **Deploy:**
1129
+ \`\`\`bash
1130
+ chmod +x deploy.sh
1131
+ ./deploy.sh
1132
+ \`\`\`
1133
+
1134
+ ## What happens during deployment:
1135
+
1136
+ - \u{1F433} Docker images are built from the included artifacts
1137
+ - \u{1F7E2} Services start: frontend, backend, database, cache${r?", workbench":""}
1138
+ - \u{1F9EA} Health checks verify everything is running
1139
+ - \u2705 Application becomes available
1140
+
1141
+ ## Application URLs
1142
+
1143
+ After deployment:
1144
+ - **Main Application:** http://localhost:${o}
1145
+ ${r?`- **Workbench:** http://localhost:${i}`:""}
1146
+
1147
+ ## Environment Configuration
1148
+
1149
+ **Required settings in .env:**
1150
+ - \`SERVER_TOKEN_SECRET\` - Generate a secure random string (required)
1151
+ - \`MONGO_DATABASE\` - Database name (default: ${e.name})
1152
+
1153
+ **Optional settings:**
1154
+ - \`RACLETTE_DEBUG_MODE\` - Enable debug logging (default: false)
1155
+ - \`RACLETTE_MONGODB_HOST\` - Custom MongoDB connection
1156
+ - \`RACLETTE_CACHE_URL\` - Custom cache connection
1157
+
1158
+ ## Management Commands
1159
+
1160
+ - **View logs:** \`docker compose logs -f\`
1161
+ - **Stop services:** \`docker compose down\`
1162
+ - **Restart services:** \`docker compose restart\`
1163
+ - **Remove everything:** \`docker compose down -v\` (\u26A0\uFE0F removes data)
1164
+
1165
+ ## Customization
1166
+
1167
+ Edit \`docker-compose.yml\` to:
1168
+ - Change port mappings
1169
+ - Add volume mounts for custom files
1170
+ - Modify environment variables
1171
+ - Add additional services
1172
+
1173
+ ## Troubleshooting
1174
+
1175
+ - **Health check fails:** Backend may need more time to start, check logs
1176
+ - **502 errors:** Backend not responding, verify database connection
1177
+ - **Permission issues:** Ensure deploy.sh is executable (\`chmod +x deploy.sh\`)
1178
+
1179
+ Built on: ${new Date().toISOString()}
1180
+ Build type: Local deployment artifacts
1181
+ `;return await V.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},EC=(e,t)=>{let r=t.services.frontend?.port||8081,n=t.services.workbench?.frontendPort||8083,o=e.images?.names.some(i=>i.includes("workbench"))||!1;switch(console.log(""),console.log(h.blue("\u{1F4E6} Build Summary:")),console.log(` Mode: ${h.cyan(e.mode)}`),console.log(` Build Directory: ${h.cyan(e.buildDir)}`),e.mode==="artifacts"&&(console.log(` Docker Compose: ${h.cyan(e.artifacts.composeFile||"N/A")}`),console.log(` Deploy Script: ${h.cyan(e.artifacts.deployScript||"N/A")}`),console.log(` README: ${h.cyan(e.artifacts.readmeFile||"N/A")}`)),e.images&&e.images.names.length>0&&(console.log(` Docker Images: ${h.cyan(e.images.names.length)} built`),e.images.names.forEach(i=>{console.log(` - ${h.gray(i)}`)})),e.deploymentPackage&&console.log(` Deployment Package: ${h.cyan(e.deploymentPackage)}`),console.log(""),console.log(h.blue("\u{1F680} Next steps:")),e.mode){case"artifacts":console.log(h.yellow(` 1. Go to Directory: cd ${e.buildDir}`)),console.log(h.yellow(" 2. Copy (and edit) .env: cp .env.example .env")),console.log(h.yellow(" 3. Deploy: chmod +x deploy.sh && ./deploy.sh")),console.log(h.yellow(` \u2192 App will be at http://localhost:${r}`)),o&&console.log(h.yellow(` \u2192 Workbench at http://localhost:${n}`));break;case"images":console.log(h.yellow(" Images ready for registry push:")),e.images?.names.forEach(i=>{console.log(h.yellow(` docker push ${i}`))}),console.log(""),console.log(h.gray(" \u{1F4A1} Example pipeline usage:")),console.log(h.gray(" docker push myregistry.com/myproject/frontend:v1.0.0")),console.log(h.gray(" docker push myregistry.com/myproject/backend:v1.0.0"));break;case"package":console.log(h.yellow(" 1. Transfer package to target system")),console.log(h.yellow(" 2. Extract: tar -xzf deployment-package.tar.gz")),console.log(h.yellow(" 3. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 4. Deploy: ./deploy.sh"));break}},xh=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),xC=async(e,t,r)=>{console.log(h.blue("\u{1F4C1} Setting up build environment...")),await ao(e),await so(e),await hh(e),await co(e,r),await oo(e,r),await Jf(e,r),console.log(h.green("\u2705 Build environment ready"))},kC=async(e,t,r)=>{console.log(h.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=G.join(r,"docker-compose.generate.yml");await to(e,r,"build"),await gh(e,t,o),Jn("raclette_shared");try{console.log(h.gray(" \u{1F433} Starting generation services...")),Ee(["-p",n,"-f",o,"up","-d"],{stdio:"pipe"}),console.log(h.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=fC();for(;i<s;)try{if(!(await Ee(["-p",n,"-f",o,"ps","-q","backend"],{stdio:"pipe"})).trim())break;await new Promise(c=>setTimeout(c,1e3)),i++}catch{break}if(i>=s)throw new Error(`Generation mode timed out after ${s}s (set RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS to increase)`);console.log(h.green(" \u2705 File generation completed"))}finally{try{Ee(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup generation services"))}}},ja=async(e,t,r,n)=>{console.log(h.blue("\u{1F3A8} Building main application...")),await V.ensureDir(r),await to(e,t,"build"),await wC(e,t,r,n)},wC=async(e,t,r,n)=>{console.log(h.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=G.join(t,"docker-compose.app-build.yml"),s=G.join(t,".temp-build");await V.ensureDir(s),await V.ensureDir(G.join(s,"frontend")),await V.ensureDir(G.join(s,"backend"));try{await yh(e,process.cwd(),i,s);let a=["-p",o,"-f",i,"up"];if(n.noCache&&a.push("--build","--force-recreate"),console.log(h.gray(" \u{1F528} Starting parallel build process...")),Ee(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=G.join(r,"frontend");await V.ensureDir(c);let u=G.join(s,"frontend");if(await V.pathExists(u)){if((await V.readdir(u)).length===0)throw new Error("Frontend build produced no output files");await V.copy(u,c),console.log(h.green(" \u2705 Frontend build complete"))}else throw new Error("Frontend build did not produce expected output directory")}if(e.services.backend?.enabled){let c=G.join(r,"backend");await V.ensureDir(c);let u=G.join(s,"backend");if(!await V.pathExists(u))throw new Error("Backend build did not produce expected output directory");await CC(e,t,c,s),console.log(h.green(" \u2705 Backend build complete"))}console.log(h.green(" \u2705 Application build completed"))}finally{try{Ee(["-p",o,"-f",i,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup build services"))}await V.remove(s),await V.remove(i)}},CC=async(e,t,r,n)=>{console.log(h.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=G.join(n,"backend");await V.ensureDir(r),await V.pathExists(o)&&(await V.copy(o,r),console.log(h.gray(" \u2705 Copied backend build artifacts")));let i=G.join(r,"dist");if(!await V.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=G.join(i,"src","server.js");if(!await V.pathExists(s))throw new Error("Backend build did not produce expected dist/src/server.js entry point");let a=G.join(r,"package.json");if(await V.pathExists(a)){let u=await V.readJson(a),l={...u,scripts:{start:"node dist/src/server.js",...u.scripts},devDependencies:void 0};await V.writeJson(a,l,{spaces:2}),console.log(h.gray(" \u2705 Updated package.json for production"))}else throw new Error("Backend build did not include package.json");let c=G.join(r,"yarn.lock");await V.pathExists(c)||console.warn(h.yellow(" \u26A0\uFE0F No yarn.lock found in backend build")),console.log(h.gray(" \u2705 Backend Node.js application structure created")),console.log(h.gray(" \u{1F4C1} Entry point: dist/src/server.js")),await AC(r)},AC=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=G.join(e,i);await V.pathExists(s)||r.push(i)}if(r.length>0)throw new Error(`Backend application is missing required files: ${r.join(", ")}`);let n=G.join(e,"package.json"),o=await V.readJson(n);(!o.scripts?.start||!o.scripts.start.includes("dist/src/server.js"))&&console.warn(h.yellow(" \u26A0\uFE0F package.json start script may not point to dist/src/server.js")),console.log(h.gray(" \u2705 Backend structure verified successfully"))},Ma=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await SC(e,t,r),!0),SC=async(e,t,r)=>{console.log(h.blue("\u{1F527} Building workbench..."));let n=G.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await V.pathExists(n)){f.warn("Workbench package not found, skipping workbench build");return}let o=G.join(t,"workbench"),i;if(e.workbench)try{lo(e.workbench),i=await uo(e.workbench)}catch(s){throw console.error(h.red("Workbench configuration error:"),s.message),s}try{let s={...process.env,MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:`redis://localhost:${e.services.redis?.port||6379}`,...e.env.development},a=`${e.name}-workbench`;console.log(h.gray(" \u{1F527} Running workbench build process as "+a)),await new Promise((c,u)=>{let l=["build","--output-dir",o,"--build-only",r.verbose?"-v":"","-p",a,...i?["-f",i]:[]].filter(d=>d!==""),p=dC("yarn",l,{cwd:n,stdio:r.verbose?"inherit":"ignore",env:s});p.on("close",d=>{f.raw(h.gray(` \u{1F3C1} Workbench build process exited with code ${d}`)),d===0?c():u(new Error(`Workbench build failed with exit code ${d}`))}),p.on("error",d=>{f.raw(h.red(` \u274C Workbench build process error: ${d.message}`)),u(d)})}),f.raw(h.green(" \u2705 Workbench build complete"))}catch(s){throw f.error("Workbench build failed: "+s.message),s}};import ht from"fs-extra";import ft from"path";var Ba=()=>[{description:"custom favicon",source:"./branding/favicon.png",target:"/usr/shared/nginx/html/favicon.png",service:"frontend"},{description:"custom logo in app",source:"./branding/custom-logo.png",target:"/usr/shared/nginx/html/logo.png",service:"frontend"},{description:"custom home icon (can be full logo or just an icon)",source:"./branding/custom-home-icon.png",target:"/usr/shared/nginx/html/home-icon.png",service:"frontend"},{description:"custom logo in login screen (not used, if not set)",source:"./branding/custom-login-logo.png",target:"/usr/shared/nginx/html/login-logo.png",service:"frontend"}];var kh=async(e,t={})=>{console.log(h.blue("\u{1F4CB} Generating deployment guide..."));let r=ft.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=Ah(e,n,o,i);return t.generateFiles?await TC(e,s,r,i):await PC(e,s,r,i)},wh=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=Ah(e,r,n,o);return await RC(e,i,n,o)},RC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await Rh(e,t,r,n),a=await Oh(),c=OC(e.name,r);return`# Deploy ${e.name} with Docker
1182
+
1183
+ Deploy ${e.name} using pre-built Docker images.
1184
+
1185
+ ## Quick Start
1186
+
1187
+ ### 1. Create docker-compose.yml
1188
+
1189
+ \`\`\`yaml
1190
+ ${s}
1191
+ \`\`\`
1192
+
1193
+ ### 2. Create .env file
1194
+
1195
+ \`\`\`bash
1196
+ ${c}
1197
+ \`\`\`
1198
+
1199
+ ### 3. Deploy
1200
+
1201
+ \`\`\`bash
1202
+ docker compose up -d
1203
+ \`\`\`
1204
+
1205
+ ## Application URLs
1206
+
1207
+ - **Main Application:** http://localhost:${o}
1208
+ ${t.hasWorkbench?`- **Workbench:** http://localhost:${i}`:""}
1209
+
1210
+ ## Customization
1211
+
1212
+ Create \`docker-compose.override.yml\` for customizations:
1213
+
1214
+ \`\`\`yaml
1215
+ ${a}
1216
+ \`\`\`
1217
+
1218
+ *Note for developers: The volume examples above can be customized based on
1219
+ your application's specific customization points. Update the paths and
1220
+ descriptions as needed for your project.*
1221
+
1222
+ ## Management
1223
+
1224
+ \`\`\`bash
1225
+ # View logs
1226
+ docker compose logs -f
1227
+
1228
+ # Update to latest images
1229
+ docker compose pull && docker compose up -d
1230
+
1231
+ # Stop services
1232
+ docker compose down
1233
+
1234
+ # Remove all data (\u26A0\uFE0F destructive)
1235
+ docker compose down -v
1236
+ \`\`\`
1237
+
1238
+ ## System Requirements
1239
+
1240
+ - Docker and Docker Compose
1241
+ - 2GB+ available RAM
1242
+ - Ports ${o}${t.hasWorkbench?`, ${i}`:""} available
1243
+
1244
+ ## Troubleshooting
1245
+
1246
+ - **502 errors:** Check backend logs with \`docker compose logs backend\`
1247
+ - **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
1248
+ - **Image pull errors:** Check registry access and IMAGE_TAG value
1249
+ `},OC=(e,t)=>["# Required","RACLETTE_SERVER_TOKEN_SECRET=your-secret-key-here","RACLETTE_FRONTEND_URLS=https://yourdomain.com,https://workbench.yourdomain.com # required to prevent CORS issues","","# Database Name",`RACLETTE_MONGO_DATABASE=${e}`,"","# Image Configuration",`IMAGE_TAG=${t}`,"","# Optional - Debug Mode","# RACLETTE_DEBUG_MODE=true # Uncomment to see frontend logs in console"].join(`
1250
+ `),Ch=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await Rh(e,t,"latest",r),s=await Oh();return`# Deploy ${e.name} with Docker
1251
+
1252
+ Deploy ${e.name} using pre-built Docker images.
1253
+
1254
+ ## Quick Start
1255
+
1256
+ ### 1. Create docker-compose.yml
1257
+
1258
+ \`\`\`yaml
1259
+ ${i}
1260
+ \`\`\`
1261
+
1262
+ ### 2. Create .env file
1263
+
1264
+ \`\`\`bash
1265
+ # Required
1266
+ SERVER_TOKEN_SECRET=your-secret-key-here
1267
+ NODE_ENV=production
1268
+
1269
+ # Database Configuration
1270
+ MONGO_DATABASE=${e.name}
1271
+
1272
+ # Image Configuration
1273
+ IMAGE_TAG=latest
1274
+
1275
+ # Optional - Override image registry
1276
+ # DOCKER_REGISTRY=your-registry.com/
1277
+
1278
+ # Optional - Debug Mode
1279
+ # RACLETTE_DEBUG_MODE=true # Uncomment to see frontend logs in console
1280
+
1281
+ # Optional - External Services
1282
+ # RACLETTE_MONGODB_HOST=mongodb://your-mongodb:27017/your-database
1283
+ # RACLETTE_CACHE_URL=valkey://your-cache:6379
1284
+ \`\`\`
1285
+
1286
+ ### 3. Deploy
1287
+
1288
+ \`\`\`bash
1289
+ docker compose up -d
1290
+ \`\`\`
1291
+
1292
+ ## Application URLs
1293
+
1294
+ - **Main Application:** http://localhost:${n}
1295
+ ${t.hasWorkbench?`- **Workbench:** http://localhost:${o}`:""}
1296
+
1297
+ ## Configuration
1298
+
1299
+ ### Environment Variables
1300
+
1301
+ | Variable | Description | Default |
1302
+ |----------|-------------|---------|
1303
+ | \`SERVER_TOKEN_SECRET\` | **Required** - JWT signing secret | - |
1304
+ | \`MONGO_DATABASE\` | Database name | \`${e.name}\` |
1305
+ | \`IMAGE_TAG\` | Image version | \`latest\` |
1306
+ | \`DOCKER_REGISTRY\` | Registry URL prefix | \`\` (Docker Hub) |
1307
+ | \`RACLETTE_DEBUG_MODE\` | Enable frontend debug logging | \`false\` |
1308
+
1309
+ ## Customization
1310
+
1311
+ Create \`docker-compose.override.yml\` for customizations:
1312
+
1313
+ \`\`\`yaml
1314
+ ${s}
1315
+ \`\`\`
1316
+
1317
+ *Note for developers: The volume examples above can be customized based on
1318
+ your application's specific customization points. Update the paths and
1319
+ descriptions as needed for your project.*
1320
+
1321
+ ## Registry Configuration
1322
+
1323
+ *Note for developers: When copying this guide to your README, update the
1324
+ image names in the docker-compose.yml above to match your actual registry location:*
1325
+
1326
+ - **Docker Hub**: \`myproject/frontend:latest\`
1327
+ - **GitLab Registry**: \`registry.gitlab.com/group/project/frontend:latest\`
1328
+ - **GitHub Registry**: \`ghcr.io/owner/repo/frontend:latest\`
1329
+ - **Private Registry**: \`your-registry.com/project/frontend:latest\`
1330
+
1331
+ ## Management
1332
+
1333
+ \`\`\`bash
1334
+ # View logs
1335
+ docker compose logs -f
1336
+
1337
+ # Update to latest images
1338
+ docker compose pull && docker compose up -d
1339
+
1340
+ # Stop services
1341
+ docker compose down
1342
+
1343
+ # Remove all data (\u26A0\uFE0F destructive)
1344
+ docker compose down -v
1345
+ \`\`\`
1346
+
1347
+ ## System Requirements
1348
+
1349
+ - Docker and Docker Compose
1350
+ - 2GB+ available RAM
1351
+ - Ports ${n}${t.hasWorkbench?`, ${o}`:""} available
1352
+
1353
+ ## Troubleshooting
1354
+
1355
+ - **502 errors:** Check backend logs with \`docker compose logs backend\`
1356
+ - **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
1357
+ - **Image pull errors:** Check registry access and IMAGE_TAG value
1358
+ `},Ah=(e,t,r,n)=>{let o=["frontend","backend"],i=e.services.workbench?.enabled||!1;return i&&o.push("workbench-frontend","workbench-backend"),{names:o.map(a=>{let c=`${t}/${a}`;return`${n?`${n}${c}`:c}:${r}`}),hasWorkbench:i}},TC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4C1} Generating deployment files..."));let o=ft.join(r,"deploy-guide");await ht.ensureDir(o);let i=ft.join(o,"docker-compose.yml");await Sh(e,t,i,"latest",n);let s=ft.join(o,"docker-compose.override.yml.example");await $C(e,s);let a=ft.join(o,".env.example");await DC(e,a,t.hasWorkbench);let c=ft.join(o,"README.md");await NC(e,t,c,n);let u=ft.join(o,"DEPLOY.md");return await LC(e,t,u,n),console.log(h.green("\u2705 Deployment files generated")),console.log(h.gray(` \u{1F4C1} Files created in: ${o}`)),{outputPath:o,mode:"files",deployGuideFile:u,additionalFiles:[i,s,a,c]}},PC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=ft.join(r,"DEPLOY.md");return await IC(e,t,o,n),console.log(h.green("\u2705 Deployment guide generated")),console.log(h.gray(` \u{1F4C4} Guide: ${o}`)),{outputPath:r,mode:"embedded",deployGuideFile:o}},Sh=async(e,t,r,n,o)=>{let i=e.services.frontend?.port||8081,s=e.services.workbench?.frontendPort||8083,a=u=>{let d=u.split(":")[0].replace(o,"");return o?`${o}${d}:\${IMAGE_TAG:-${n}}`:`\${DOCKER_REGISTRY:-}${d}:\${IMAGE_TAG:-${n}}`},c={name:e.name,services:{frontend:{image:a(t.names[0]),ports:[`\${FRONTEND_PORT:-${i}}:${i}`],depends_on:["backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}"],healthcheck:dr(i)},backend:{image:a(t.names[1]),depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:tt.backend},database:{image:"mongo:8.2",restart:"unless-stopped",volumes:["mongodb_data:/data/db"],networks:["app-network"],environment:[`MONGO_INITDB_DATABASE=\${MONGO_DATABASE:-${e.name}}`],healthcheck:tt.mongodb},cache:{image:"valkey/valkey:9.0-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:tt.cache}},volumes:{mongodb_data:{},cache_data:{}},networks:{"app-network":{driver:"bridge"}}};t.hasWorkbench&&t.names.length>=4&&(c.services["workbench-frontend"]={image:a(t.names[2]),ports:[`\${WORKBENCH_FRONTEND_PORT:-${s}}:${s}`],depends_on:["workbench-backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}"],healthcheck:dr(s)},c.services["workbench-backend"]={image:a(t.names[3]),depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","PORT=3000","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:tt.backend}),await ht.writeFile(r,ke.dump(c))},$C=async(e,t)=>{let r=Ba(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
1359
+ # Copy this file to docker-compose.override.yml and customize as needed
1360
+ # This file allows you to extend the main docker-compose.yml without modifying it
1361
+
1362
+ services:
1363
+ frontend:
1364
+ # Add custom volume mounts for branding and customization
1365
+ volumes:
1366
+ ${n.map(s=>` # ${s.description}
1367
+ # - ${s.source}:${s.target}`).join(`
1368
+ `)}
1369
+ # Override environment variables
1370
+ environment:
1371
+ # - CUSTOM_BRAND_NAME=My Company
1372
+
1373
+ backend:
1374
+ # Add custom volume mounts for configuration and files
1375
+ volumes:
1376
+ ${o.map(s=>` # ${s.description}
1377
+ # - ${s.source}:${s.target}`).join(`
1378
+ `)}
1379
+ # Override environment variables
1380
+ environment:
1381
+ # - CUSTOM_API_KEY=your-api-key-here
1382
+
1383
+ # Add additional services
1384
+ # custom-service:
1385
+ # image: some/custom-image
1386
+ # networks:
1387
+ # - app-network
1388
+
1389
+ # Add custom volumes
1390
+ # volumes:
1391
+ # custom_data:
1392
+
1393
+ # Add custom networks if needed
1394
+ # networks:
1395
+ # custom-network:
1396
+ `;await ht.writeFile(t,i)},DC=async(e,t,r)=>{let n=Ia(e,r);await ht.writeFile(t,n)},NC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
1397
+
1398
+ This folder contains deployment files for testing registry-based deployment locally.
1399
+
1400
+ ## Generated Files
1401
+
1402
+ - \`docker-compose.yml\` - Registry-based compose configuration
1403
+ - \`docker-compose.override.yml.example\` - Customization template
1404
+ - \`.env.example\` - Environment variables template
1405
+ - \`DEPLOY.md\` - User deployment guide (copy to your project README)
1406
+
1407
+ ## Local Testing Steps
1408
+
1409
+ ### 1. Configure Environment
1410
+ \`\`\`bash
1411
+ cp .env.example .env
1412
+ vi .env # Set SERVER_TOKEN_SECRET and other variables
1413
+ \`\`\`
1414
+
1415
+ ### 2. Test with Local Images
1416
+ Assuming you built the images locally, you can test without a registry:
1417
+
1418
+ \`\`\`bash
1419
+ # Start services using local images
1420
+ docker compose up -d
1421
+ \`\`\`
1422
+
1423
+ ### 3. Test with Registry Images
1424
+ To test the full registry workflow:
1425
+
1426
+ \`\`\`bash
1427
+ # Push your images to registry first
1428
+ ${t.names.map(a=>`docker push ${a}`).join(`
1429
+ `)}
1430
+
1431
+ # Pull and start services
1432
+ docker compose pull
1433
+ docker compose up -d
1434
+ \`\`\`
1435
+
1436
+ ## Application Access
1437
+
1438
+ After deployment:
1439
+ - **Main Application:** http://localhost:${o}
1440
+ ${t.hasWorkbench?`- **Workbench:** http://localhost:${i}`:""}
1441
+
1442
+ ## Built Images
1443
+
1444
+ This configuration expects these images:
1445
+ ${t.names.map(a=>`- \`${a}\``).join(`
1446
+ `)}
1447
+
1448
+ ## Management Commands
1449
+
1450
+ - **View logs:** \`docker compose logs -f\`
1451
+ - **Stop services:** \`docker compose down\`
1452
+ - **Update images:** \`docker compose pull && docker compose up -d\`
1453
+
1454
+ ## Next Steps
1455
+
1456
+ 1. **Test locally** with the steps above
1457
+ 2. **Copy DEPLOY.md** content to your project README
1458
+ 3. **Push images to registry** for production use
1459
+ 4. **Share deployment instructions** with your users
1460
+
1461
+ ## Registry Examples
1462
+
1463
+ *Note for developers: When copying this deployment guide to your project README,
1464
+ you can adjust these registry examples based on where your images will be hosted.*
1465
+
1466
+ ### Docker Hub (default)
1467
+ \`\`\`bash
1468
+ # Images: myproject/frontend:latest
1469
+ # No additional configuration needed
1470
+ \`\`\`
1471
+
1472
+ ### GitLab Container Registry
1473
+ \`\`\`bash
1474
+ # Images: registry.gitlab.com/group/project/frontend:latest
1475
+ # Update image names in docker-compose.yml to include registry prefix
1476
+ \`\`\`
1477
+
1478
+ ### GitHub Container Registry
1479
+ \`\`\`bash
1480
+ # Images: ghcr.io/owner/repo/frontend:latest
1481
+ # Update image names in docker-compose.yml to include registry prefix
1482
+ \`\`\`
1483
+
1484
+ Generated on: ${new Date().toISOString()}
1485
+ `;await ht.writeFile(r,s)},LC=async(e,t,r,n)=>{let o=await Ch(e,t,n);await ht.writeFile(r,o)},IC=async(e,t,r,n)=>{let o=await Ch(e,t,n),i=`# ${e.name} - Registry Deployment Guide
1486
+
1487
+ ## For Developers
1488
+
1489
+ This file contains registry deployment instructions generated from your build configuration.
1490
+
1491
+ **What to do with this:**
1492
+ 1. Copy the "User Deployment Section" below to your project README
1493
+ 2. Update the documentation as needed for your specific use case
1494
+ 3. Users can then deploy your application using the provided instructions
1495
+
1496
+ **Generated for images:**
1497
+ ${t.names.map(s=>`- \`${s}\``).join(`
1498
+ `)}
1499
+
1500
+ **Registry:** ${n||"Docker Hub (default)"}
1501
+
1502
+ ---
1503
+
1504
+ ## User Deployment Section
1505
+
1506
+ *Copy everything below this line to your project README or documentation*
1507
+
1508
+ ${o}
1509
+ `;await ht.writeFile(r,i)},Rh=async(e,t,r,n)=>{let o=ft.join(process.cwd(),"temp-compose.yml");await Sh(e,t,o,r,n);let i=await ht.readFile(o,"utf8");return await ht.remove(o),i},Oh=async()=>{let e=Ba(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
1510
+ frontend:
1511
+ volumes:
1512
+ ${t.map(n=>` # ${n.description}
1513
+ # - ${n.source}:${n.target}`).join(`
1514
+ `)}
1515
+ environment:
1516
+ # - CUSTOM_BRAND_NAME=My Company
1517
+
1518
+ backend:
1519
+ volumes:
1520
+ ${r.map(n=>` # ${n.description}
1521
+ # - ${n.source}:${n.target}`).join(`
1522
+ `)}
1523
+ environment:
1524
+ # - CUSTOM_API_KEY=your-key`};var Bt=process.cwd();process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=Bt);var fr=await wf(),Th=Object.keys(fr).length&&h.blue(`\u{1F4C4} Loaded ${Object.keys(fr).length} environment variables from ${Bt}/.env`);fr.RACLETTE_APP_PATH=process.env.RACLETTE_APP_PATH;var de=ga(await jt(),await jt("raclette.config.*",fr)),Ph=fr.RACLETTE_ROOT||de.root||".raclette",Fe=hr.join(Bt,Ph),mt=hr.join(Fe,"docker-compose.yml");de.root=Ph;var je=new pc,rt=(e,t)=>{Th&&f.raclette(Th),Pt.ensureDirSync(Fe)};je.version("0.1.0");je.command("dev").description("Start development environment").option("-q, --quiet","Run Docker Compose in detached mode without following logs").option("-v, --verbose","Get more information about what is happening").option("--filter <service>","Filter logs to specific services (comma-separated)","frontend,backend").option("--force-rebuild, --rebuild","Force rebuild of Docker images regardless of file changes").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").option("-r, --root <root>","Raclette tools root directory",".raclette").option("--no-cache","Force rebuild Docker images without using cache").hook("preAction",rt).action(async e=>{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment...");try{Xn();let t=ga(de,e.configFile?await jt(e.configFile):{});Pt.writeFile(hr.join(Fe,"raclette.config.yaml"),ke.dump(t)),e.projectName&&(f.raclette("Setting project name to "+e.projectName),t.name=e.projectName),ya(t,Fe),await th(Fe,fr,t,{workingDir:Bt,dockerComposePath:mt,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):Ye,forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});je.command("log [services...]").description("Follow logs for specified services (or all services if none specified)").option("-f, --follow","Follow log output (default: true)",!0).option("--no-follow","Don't follow log output").option("--tail <lines>","Number of lines to show from the end of the logs","100").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs..."),await Pt.pathExists(mt)||(f.error("No docker-compose.yml found. Services may not be running."),f.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await uh(e,t,de,mt)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});je.command("down").description("Stop Docker Compose services").option("--keep-shared","Don't stop shared services like DB and Cache").option("-p, --project-name <projectName>","Applies a specific project name").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=Bt;e.projectName&&(f.raclette("Setting project name to "+e.projectName),de.name=e.projectName);let r=hr.join(Fe,"docker-compose.full.yml");if(!await Pt.pathExists(mt)){console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(f.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Da(mt,de)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Rf(de,t,r,"development"),await Da(r,de),await Pt.remove(r)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});je.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").hook("preAction",rt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Restarting Raclette services..."),e.length===0){f.warn("No services specified. Please specify which services to restart."),f.instruction("Usage: raclette restart <service1> <service2> ..."),f.instruction("Common services: frontend, backend, mongodb, cache");return}let r=de?.name??hr.basename(Bt);if(!await Pt.pathExists(mt)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let n of e)try{let o=await Br(n,de,mt);if(!lr(o)){f.warn(`Service '${n}' (container: ${o}) doesn't appear to be running.`),f.instruction(" If you're sure it's running, it might have a different container name than expected."),f.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await Pt.pathExists(mt)?(f.progress(`Restarting service: ${n}...`),Ee(["-p",r,"-f",mt,"restart",n],{stdio:"inherit"})):(f.progress(` Restarting container: ${o}...`),pe(["restart",o],{stdio:"inherit"})),f.success(`Service '${n}' restarted successfully`)}catch(o){f.error(`Error restarting service '${n}': ${o.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});je.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e="both",t)=>{try{f.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(f.error("Target must be one of: frontend, backend, both"),process.exit(1)),await Ta(e,de),await Na(e,de,Fe)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});je.command("build").description("Build application with different modes").option("--mode <mode>","Build mode: artifacts (local deployment), images (CI/CD), package (offline)","artifacts").option("--image-tag <tag>","Image tag for registry (e.g., v1.0.0)").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--generate-latest","Also tag images as :latest").option("--output-dir <dir>","Output directory").option("--skip-workbench","Skip workbench build").option("--no-cache","Build without cache").option("-v, --verbose","Verbose output").option("--buildx","Use Docker buildx for multi-architecture builds").option("--platforms <platforms>","Target platforms for buildx","linux/amd64,linux/arm64").option("--build-only","Legacy: same as --mode artifacts").option("--build-images","Legacy: same as --mode images").option("--package-images","Legacy: same as --mode package").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").hook("preAction",rt).action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=Bt,r=bt(de,e.configFile?await jt(e.configFile):{});Pt.writeFileSync(hr.join(Fe,"raclette.config.yaml"),ke.dump(r)),ya(r,Fe),e.projectName&&(f.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let n={outputDir:e.outputDir,skipWorkbench:e.skipWorkbench,verbose:e.verbose,noCache:e.noCache,mode:e.mode,imageTag:e.imageTag,imagePrefix:e.imagePrefix,generateLatest:e.generateLatest,buildOnly:e.buildOnly,buildImages:e.buildImages,packageImages:e.packageImages,buildx:e.buildx,platforms:e.platforms},o=await _h(r,t,n);switch(f.success("Build complete!"),o.mode){case"artifacts":f.success(`Build files are in ${o.buildDir}!`),f.raw(h.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":f.success("Docker images built and tagged"),f.raw(h.green("\u{1F680} Ready for registry push"));break;case"package":f.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&f.raw(h.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){f.error("Error building application: "+t?.message),process.exit(1)}});je.command("add-package <target> <package...>").description(`Add a package to the project (target: ${Wr.join(", ")})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t,r)=>{f.setVerbose(r.verbose);try{Wr.includes(e)||(f.error(`Target must be one of: ${Wr.join(", ")}}`),process.exit(1)),f.raclette(`Adding package(s) to ${e}...`);for(let n of t)await qf(e,n,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder..."),await Ta(e,de),await Na(e,de,Fe)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});je.command("rebuild [services...]").description("Rebuild Docker images for specified services or all services").option("--no-cache","Force rebuild Docker images without using cache").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images..."),e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let n=await ro(de,Fe);if(n.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=n}let r=e.filter(n=>n==="frontend"||n==="backend"||n==="workbench");r.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await no(de,Fe,r,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${r.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});je.command("deploy-guide").description("Generate deployment guide and files for registry-based deployment").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--image-tag <tag>","Image tag (default: latest)").option("--registry <url>","Registry URL prefix (e.g., registry.gitlab.com/group/)").option("--output-dir <dir>","Output directory (default: current directory)").option("--generate-files","Generate separate files for local testing").option("--return-only","Output to stdout only (no file generation)").option("-v, --verbose","Verbose output").hook("preAction",rt).action(async e=>{try{if(f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),e.returnOnly){let n={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},o=await wh(de,n);console.log(o),process.exit(0)}let t={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},r=await kh(de,t);f.success("Deployment guide generated!"),r.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${r.outputPath}`)),f.raw(h.yellow("\u{1F4A1} Use these files for local testing")),f.raw(h.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(f.raw(h.cyan(`\u{1F4C4} Guide created: ${r.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch(t){f.error("Error generating deployment guide: "+t.message),process.exit(1)}});je.command("config").description("(Re)Configure Raclette Application").option("-c, --config <config>","configuration file","raclette.config.yaml").hook("preAction",rt).action(async e=>{console.log(h.bold.green("YO!")+h.bold.red(":"))});je.parse(process.argv);
1525
+ /*!
1526
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
1527
+ *
1528
+ * Copyright (c) 2014-2016, Jon Schlinkert.
1529
+ * Licensed under the MIT License.
1530
+ */
1531
+ /*!
1532
+ * is-glob <https://github.com/jonschlinkert/is-glob>
1533
+ *
1534
+ * Copyright (c) 2014-2017, Jon Schlinkert.
1535
+ * Released under the MIT License.
1536
+ */
1537
+ /*!
1538
+ * is-number <https://github.com/jonschlinkert/is-number>
1539
+ *
1540
+ * Copyright (c) 2014-present, Jon Schlinkert.
1541
+ * Released under the MIT License.
1542
+ */
1543
+ /*!
1544
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
1545
+ *
1546
+ * Copyright (c) 2015-present, Jon Schlinkert.
1547
+ * Released under the MIT License.
1548
+ */
1549
+ /*!
1550
+ * fill-range <https://github.com/jonschlinkert/fill-range>
1551
+ *
1552
+ * Copyright (c) 2014-present, Jon Schlinkert.
1553
+ * Licensed under the MIT License.
1554
+ */
1555
+ /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1556
+ /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1557
+ /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
1558
+ /*!
1559
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
1560
+ * http://github.com/janl/mustache.js
1561
+ */
1562
+ //# sourceMappingURL=cli.js.map