@raclettejs/core 0.1.19 → 0.1.20

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 (132) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/cli.js +1 -1
  3. package/dev/README.md +4 -0
  4. package/dist/cli.js +135 -124
  5. package/dist/cli.js.map +4 -4
  6. package/dist/index.js +9 -8
  7. package/dist/index.js.map +4 -4
  8. package/package.json +9 -5
  9. package/services/backend/delay-api-debugger.sh +0 -0
  10. package/services/backend/package.json +1 -0
  11. package/services/backend/src/app.ts +4 -0
  12. package/services/backend/src/core/config/configService.ts +10 -1
  13. package/services/backend/src/core/events/eventEmitter.ts +32 -7
  14. package/services/backend/src/core/http/request-params.plugin.ts +2 -2
  15. package/services/backend/src/core/pluginSystem/pluginFastifyInstance.ts +4 -1
  16. package/services/backend/src/core/pluginSystem/pluginTypes.ts +3 -1
  17. package/services/backend/src/core/sockets/createSystemEventHandlers.ts +7 -0
  18. package/services/backend/src/core/sockets/index.ts +61 -13
  19. package/services/backend/src/core/sockets/socketManager.ts +452 -105
  20. package/services/backend/src/core/sockets/socketTypes.ts +13 -1
  21. package/services/backend/src/core/sockets/workSessionJoinPayload.ts +106 -0
  22. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.get.ts +3 -1
  23. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.getAll.ts +3 -1
  24. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.hardDelete.ts +16 -19
  25. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.patch.ts +3 -1
  26. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.post.ts +3 -1
  27. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.remove.ts +3 -1
  28. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/composition.service.ts +2 -3
  29. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.get.ts +3 -1
  30. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.getAll.ts +3 -1
  31. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.hardDelete.ts +16 -19
  32. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.patch.ts +3 -1
  33. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.post.bulk.ts +3 -1
  34. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.post.ts +3 -1
  35. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.remove.ts +3 -1
  36. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.restore.ts +12 -15
  37. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/interactionLink.service.ts +2 -3
  38. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.get.ts +3 -1
  39. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.getAll.ts +4 -2
  40. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.hardDelete.ts +12 -17
  41. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.patch.ts +3 -1
  42. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.post.bulk.ts +3 -1
  43. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.post.ts +3 -1
  44. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.remove.ts +3 -1
  45. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.restore.ts +12 -15
  46. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/project.service.ts +1 -0
  47. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.get.ts +3 -1
  48. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.getAll.ts +4 -2
  49. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.hardDelete.ts +3 -1
  50. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.patch.ts +3 -1
  51. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.post.ts +4 -2
  52. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/routes/route.project.remove.ts +3 -1
  53. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.get.ts +1 -0
  54. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.getAll.ts +1 -0
  55. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.hardDelete.ts +10 -15
  56. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.patch.ts +3 -1
  57. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.post.bulk.ts +3 -1
  58. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.post.ts +3 -1
  59. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.remove.ts +3 -1
  60. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.restore.ts +12 -15
  61. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/tag.service.ts +1 -2
  62. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.get.ts +1 -0
  63. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.getAll.ts +1 -0
  64. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.hardDelete.ts +10 -15
  65. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.patch.ts +4 -6
  66. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.patchLastProject.ts +4 -2
  67. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.post.ts +3 -1
  68. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.remove.ts +3 -4
  69. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.restore.ts +12 -15
  70. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/events/index.ts +45 -0
  71. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/helpers/crud.ts +12 -0
  72. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/helpers/payload.ts +21 -0
  73. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/index.ts +55 -0
  74. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/index.ts +19 -0
  75. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/route.workSession.get.ts +53 -0
  76. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/route.workSession.getAll.ts +39 -0
  77. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/route.workSession.hardDelete.ts +53 -0
  78. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/route.workSession.patch.ts +58 -0
  79. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/route.workSession.post.ts +53 -0
  80. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/routes/route.workSession.remove.ts +52 -0
  81. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/workSession.model.ts +65 -0
  82. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/workSession.schema.ts +125 -0
  83. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/workSession/workSession.service.ts +351 -0
  84. package/services/backend/src/corePlugins/raclette__core/backend/index.ts +2 -0
  85. package/services/backend/src/corePlugins/raclette__core/frontend/generated-config.ts +159 -24
  86. package/services/backend/src/modules/authentication/index.ts +255 -4
  87. package/services/backend/src/modules/hooks/rate-limiter.ts +21 -0
  88. package/services/backend/src/types/custom-fastify.d.ts +17 -0
  89. package/services/backend/src/utils/request.utils.ts +4 -1
  90. package/services/backend/types/index.d.ts +15 -1
  91. package/services/backend/yarn.lock +13 -4
  92. package/services/frontend/index.html +1 -1
  93. package/services/frontend/provision/entrypoint.sh +0 -0
  94. package/services/frontend/src/core/lib/configService.ts +1 -1
  95. package/services/frontend/src/core/lib/dataHelper.ts +1 -1
  96. package/services/frontend/src/core/lib/eggs/snow.ts +49 -20
  97. package/services/frontend/src/core/lib/helpers/index.ts +1 -0
  98. package/services/frontend/src/core/lib/helpers/removeEmpty.ts +69 -0
  99. package/services/frontend/src/core/lib/httpClient.ts +19 -0
  100. package/services/frontend/src/core/main.ts +20 -10
  101. package/services/frontend/src/core/setup/socket.ts +4 -3
  102. package/services/frontend/src/core/setup/socketClient.ts +31 -3
  103. package/services/frontend/src/core/setup/socketEvents.ts +92 -8
  104. package/services/frontend/src/core/store/index.ts +5 -1
  105. package/services/frontend/src/core/store/reducers/compositions/index.ts +2 -2
  106. package/services/frontend/src/core/store/reducers/interactionLinks/index.ts +1 -1
  107. package/services/frontend/src/core/store/reducers/widgets/reducers.ts +1 -2
  108. package/services/frontend/src/core/store/types/index.ts +0 -1
  109. package/services/frontend/src/core/types/PluginRegistrar.ts +8 -6
  110. package/services/frontend/src/core/types/Store.ts +1 -0
  111. package/services/frontend/src/orchestrator/components/composition/WidgetsLayoutLoader.vue +68 -8
  112. package/services/frontend/src/orchestrator/components/menu/UserMenu.vue +17 -5
  113. package/services/frontend/src/orchestrator/components/welcomeScreen/AdminWelcomeScreen.vue +1 -1
  114. package/services/frontend/src/orchestrator/composables/index.ts +1 -0
  115. package/services/frontend/src/orchestrator/composables/usePluginApi.ts +0 -3
  116. package/services/frontend/src/orchestrator/composables/useRouteState.ts +23 -4
  117. package/services/frontend/src/orchestrator/composables/useWidgetLifecycle.ts +166 -0
  118. package/services/frontend/src/orchestrator/helpers/index.ts +1 -0
  119. package/services/frontend/src/orchestrator/i18n/de-DE.json +1 -1
  120. package/services/frontend/src/orchestrator/i18n/en-EU.json +1 -1
  121. package/services/frontend/src/orchestrator/i18n/sk.json +1 -1
  122. package/services/frontend/src/orchestrator/index.ts +34 -4
  123. package/services/frontend/src/orchestrator/router/routeParserHelper.ts +106 -1
  124. package/services/frontend/src/orchestrator/types/Widgets.ts +2 -0
  125. package/services/frontend/types.ts +1 -0
  126. package/src/README.md +404 -0
  127. package/src/types.ts +19 -5
  128. package/templates/README.md +0 -0
  129. package/types/index.ts +18 -4
  130. package/services/backend/.gitignore +0 -17
  131. package/services/frontend/.gitignore +0 -35
  132. package/yarn.lock +0 -2937
package/dist/cli.js CHANGED
@@ -1,101 +1,88 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
- var gf=Object.create;var Hn=Object.defineProperty;var yf=Object.getOwnPropertyDescriptor;var bf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,_f=Object.prototype.hasOwnProperty;var I=(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 rt=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ef=(e,t)=>{for(var r in t)Hn(e,r,{get:t[r],enumerable:!0})},kf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bf(t))!_f.call(e,o)&&o!==r&&Hn(e,o,{get:()=>t[o],enumerable:!(n=yf(t,o))||n.enumerable});return e};var Yt=(e,t,r)=>(r=e!=null?gf(vf(e)):{},kf(t||!e||!e.__esModule?Hn(r,"default",{value:e,enumerable:!0}):r,e));var zt=E(Yn=>{var Ar=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}},qn=class extends Ar{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Yn.CommanderError=Ar;Yn.InvalidArgumentError=qn});var Sr=E(Xn=>{var{InvalidArgumentError:Ff}=zt(),Kn=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 Ff(`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 Mf(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Xn.Argument=Kn;Xn.humanReadableArgName=Mf});var Jn=E(Qn=>{var{humanReadableArgName:Bf}=Sr(),zn=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=>Bf(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(d,p){return r.formatItem(d,n,p,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(d=>i(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,p)=>{let g=d.map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(p,g,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(p=>i(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,p)=>{let g=d.map(m=>i(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(p,g,r))}),s.join(`
4
- `)}displayWidth(t){return ia(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,d;return l<this.minWidthToWrap||o.preformatted(n)?d=n:d=o.boxWrap(n,l).replace(/\n/g,`
5
- `+" ".repeat(r+c)),s+a+" ".repeat(c)+d.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 d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}i.push(c.join(""));let p=l.trimStart();c=[p],u=this.displayWidth(p)}),i.push(c.join(""))}),i.join(`
7
- `)}};function ia(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Qn.Help=zn;Qn.stripColor=ia});var ro=E(to=>{var{InvalidArgumentError:Hf}=zt(),Zn=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=Vf(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 Hf(`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?sa(this.name().replace(/^no-/,"")):sa(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}},eo=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 sa(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Vf(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}
3
+ var jf=Object.create;var Zn=Object.defineProperty;var Ff=Object.getOwnPropertyDescriptor;var Mf=Object.getOwnPropertyNames;var Bf=Object.getPrototypeOf,Hf=Object.prototype.hasOwnProperty;var F=(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 ct=(e,t)=>()=>(e&&(t=e(e=0)),t);var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vf=(e,t)=>{for(var r in t)Zn(e,r,{get:t[r],enumerable:!0})},Gf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Mf(t))!Hf.call(e,o)&&o!==r&&Zn(e,o,{get:()=>t[o],enumerable:!(n=Ff(t,o))||n.enumerable});return e};var ir=(e,t,r)=>(r=e!=null?jf(Bf(e)):{},Gf(t||!e||!e.__esModule?Zn(r,"default",{value:e,enumerable:!0}):r,e));var cr=x(so=>{var Mr=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}},io=class extends Mr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};so.CommanderError=Mr;so.InvalidArgumentError=io});var Br=x(co=>{var{InvalidArgumentError:ih}=cr(),ao=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 ih(`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 sh(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}co.Argument=ao;co.humanReadableArgName=sh});var po=x(uo=>{var{humanReadableArgName:ah}=Br(),lo=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=>ah(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(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));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(m=>i(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(d,y,r))}),s.join(`
4
+ `)}displayWidth(t){return _a(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 _a(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}uo.Help=lo;uo.stripColor=_a});var go=x(mo=>{var{InvalidArgumentError:ch}=cr(),fo=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=lh(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 ch(`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?Ea(this.name().replace(/^no-/,"")):Ea(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}},ho=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 Ea(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function lh(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
8
  - a short flag is a single dash and a single character
9
9
  - either use a single dash and a single character (for a short flag)
10
10
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
11
11
  - too many short flags`):o.test(s)?new Error(`${a}
12
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}}to.Option=Zn;to.DualOptions=eo});var ca=E(aa=>{function Gf(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 Wf(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=Gf(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?`
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}}mo.Option=fo;mo.DualOptions=ho});var ka=x(xa=>{function uh(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 ph(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=uh(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
14
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
15
- (Did you mean ${n[0]}?)`:""}aa.suggestSimilar=Wf});var pa=E(ao=>{var Uf=I("node:events").EventEmitter,no=I("node:child_process"),We=I("node:path"),Rr=I("node:fs"),F=I("node:process"),{Argument:qf,humanReadableArgName:Yf}=Sr(),{CommanderError:oo}=zt(),{Help:Kf,stripColor:Xf}=Jn(),{Option:la,DualOptions:zf}=ro(),{suggestSimilar:ua}=ca(),io=class e extends Uf{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=>F.stdout.write(r),writeErr:r=>F.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>F.stdout.isTTY?F.stdout.columns:void 0,getErrHelpWidth:()=>F.stderr.isTTY?F.stderr.columns:void 0,getOutHasColors:()=>so()??(F.stdout.isTTY&&F.stdout.hasColors?.()),getErrHasColors:()=>so()??(F.stderr.isTTY&&F.stderr.hasColors?.()),stripColor:r=>Xf(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 Kf,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 qf(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 oo(t,r,n)),F.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 la(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 la)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){F.versions?.electron&&(r.from="electron");let o=F.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=F.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":F.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(Rr.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
15
+ (Did you mean ${n[0]}?)`:""}xa.suggestSimilar=ph});var Sa=x(Eo=>{var dh=F("node:events").EventEmitter,yo=F("node:child_process"),Xe=F("node:path"),Hr=F("node:fs"),M=F("node:process"),{Argument:fh,humanReadableArgName:hh}=Br(),{CommanderError:vo}=cr(),{Help:mh,stripColor:gh}=po(),{Option:wa,DualOptions:yh}=go(),{suggestSimilar:Ca}=ka(),bo=class e extends dh{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=>M.stdout.write(r),writeErr:r=>M.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>M.stdout.isTTY?M.stdout.columns:void 0,getErrHelpWidth:()=>M.stderr.isTTY?M.stderr.columns:void 0,getOutHasColors:()=>_o()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>_o()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:r=>gh(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 mh,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 fh(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 vo(t,r,n)),M.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 wa(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 wa)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){M.versions?.electron&&(r.from="electron");let o=M.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=M.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":M.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(Hr.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
20
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
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,d){let p=We.resolve(l,d);if(Rr.existsSync(p))return p;if(o.includes(We.extname(d)))return;let g=o.find(m=>Rr.existsSync(`${p}${m}`));if(g)return`${p}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Rr.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=We.resolve(We.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!t._executableFile&&this._scriptPath){let d=We.basename(this._scriptPath,We.extname(this._scriptPath));d!==this._name&&(l=i(a,`${d}-${t._name}`))}s=l||s}n=o.includes(We.extname(s));let c;F.platform!=="win32"?n?(r.unshift(s),r=da(F.execArgv).concat(r),c=no.spawn(F.argv[0],r,{stdio:"inherit"})):c=no.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=da(F.execArgv).concat(r),c=no.spawn(F.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{F.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new oo(l,"commander.executeSubCommandAsync","(close)")):F.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)F.exit(1);else{let d=new oo(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),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+(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!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 d=this._findOption(l);if(d){if(d.required){let p=t[u++];p===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,p)}else if(d.optional){let p=null;u<t.length&&(!i(t[u])||s(t[u]))&&(p=t[u++]),this.emit(`option:${d.name()}`,p)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),p=this._findOption(l.slice(0,d));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,l.slice(d+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}
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=Xe.resolve(l,p);if(Hr.existsSync(d))return d;if(o.includes(Xe.extname(p)))return;let y=o.find(m=>Hr.existsSync(`${d}${m}`));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=Hr.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=Xe.resolve(Xe.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!t._executableFile&&this._scriptPath){let p=Xe.basename(this._scriptPath,Xe.extname(this._scriptPath));p!==this._name&&(l=i(a,`${p}-${t._name}`))}s=l||s}n=o.includes(Xe.extname(s));let c;M.platform!=="win32"?n?(r.unshift(s),r=Aa(M.execArgv).concat(r),c=yo.spawn(M.argv[0],r,{stdio:"inherit"})):c=yo.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=Aa(M.execArgv).concat(r),c=yo.spawn(M.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{M.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 vo(l,"commander.executeSubCommandAsync","(close)")):M.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)M.exit(1);else{let p=new vo(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+(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
23
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
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 F.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()}`,F.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new zf(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(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.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=ua(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=ua(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=>Yf(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=We.basename(t,We.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(F.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.
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 M.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()}`,M.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new yh(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=Ca(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=Ca(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=>hh(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=Xe.basename(t,Xe.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(M.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
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 da(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 so(){if(F.env.NO_COLOR||F.env.FORCE_COLOR==="0"||F.env.FORCE_COLOR==="false")return!1;if(F.env.FORCE_COLOR||F.env.CLICOLOR_FORCE!==void 0)return!0}ao.Command=io;ao.useColor=so});var ga=E(Ce=>{var{Argument:fa}=Sr(),{Command:co}=pa(),{CommanderError:Qf,InvalidArgumentError:ha}=zt(),{Help:Jf}=Jn(),{Option:ma}=ro();Ce.program=new co;Ce.createCommand=e=>new co(e);Ce.createOption=(e,t)=>new ma(e,t);Ce.createArgument=(e,t)=>new fa(e,t);Ce.Command=co;Ce.Option=ma;Ce.Argument=fa;Ce.Help=Jf;Ce.CommanderError=Qf;Ce.InvalidArgumentError=ha;Ce.InvalidOptionArgumentError=ha});var va=E((ew,Zf)=>{Zf.exports={name:"dotenv",version:"17.2.2",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 --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --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 Ca=E((tw,Ue)=>{var lo=I("fs"),Or=I("path"),eh=I("os"),th=I("crypto"),rh=va(),uo=rh.version,_a=["\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{1F4E1} observe env with Radar: https://dotenvx.com/radar","\u{1F4E1} auto-backup env with Radar: https://dotenvx.com/radar","\u{1F4E1} version env with Radar: https://dotenvx.com/radar","\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 nh(){return _a[Math.floor(Math.random()*_a.length)]}function wt(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function oh(){return process.stdout.isTTY}function ih(e){return oh()?`\x1B[2m${e}\x1B[0m`:e}var sh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ah(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
29
- `);let n;for(;(n=sh.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 ch(e){e=e||{};let t=wa(e);e.path=t;let r=se.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=xa(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=uh(r,a);i=se.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return se.parse(i)}function lh(e){console.error(`[dotenv@${uo}][WARN] ${e}`)}function Qt(e){console.log(`[dotenv@${uo}][DEBUG] ${e}`)}function ka(e){console.log(`[dotenv@${uo}] ${e}`)}function xa(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 uh(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 wa(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)lo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Or.resolve(process.cwd(),".env.vault");return lo.existsSync(t)?t:null}function Ea(e){return e[0]==="~"?Or.join(eh.homedir(),e.slice(1)):e}function dh(e){let t=wt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=wt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&ka("Loading env from encrypted .env.vault");let n=se._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),se.populate(o,n,e),{parsed:n}}function ph(e){let t=Or.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=wt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=wt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&Qt("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[Ea(e.path)];else{s=[];for(let l of e.path)s.push(Ea(l))}let a,c={};for(let l of s)try{let d=se.parse(lo.readFileSync(l,{encoding:r}));se.populate(c,d,e)}catch(d){o&&Qt(`Failed to load ${l} ${d.message}`),a=d}let u=se.populate(n,c,e);if(o=wt(n.DOTENV_CONFIG_DEBUG||o),i=wt(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,d=[];for(let p of s)try{let g=Or.relative(process.cwd(),p);d.push(g)}catch(g){o&&Qt(`Failed to load ${p} ${g.message}`),a=g}ka(`injecting env (${l}) from ${d.join(",")} ${ih(`-- tip: ${nh()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function fh(e){if(xa(e).length===0)return se.configDotenv(e);let t=wa(e);return t?se._configVault(e):(lh(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),se.configDotenv(e))}function hh(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=th.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 mh(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&&Qt(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 se={configDotenv:ph,_configVault:dh,_parseVault:ch,config:fh,decrypt:hh,parse:ah,populate:mh};Ue.exports.configDotenv=se.configDotenv;Ue.exports._configVault=se._configVault;Ue.exports._parseVault=se._parseVault;Ue.exports.config=se.config;Ue.exports.decrypt=se.decrypt;Ue.exports.parse=se.parse;Ue.exports.populate=se.populate;Ue.exports=se});import{on as sy,once as ay}from"node:events";import{PassThrough as cy}from"node:stream";import{finished as rl}from"node:stream/promises";function Io(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)No(o);let t=e.some(({readableObjectMode:o})=>o),r=ly(e,t),n=new Do({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&il(n),n}var ly,Do,uy,dy,py,No,fy,nl,hy,my,gy,ol,il,Lo,sl,yy,Jr,el,tl,al=rt(()=>{ly=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Do=class extends cy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){No(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=uy(this,this.#e),fy({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return No(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},uy=async(e,t)=>{Jr(e,el);let r=new AbortController;try{await Promise.race([dy(e,r),py(e,t,r)])}finally{r.abort(),Jr(e,-el)}},dy=async(e,{signal:t})=>{await rl(e,{signal:t,cleanup:!0})},py=async(e,t,{signal:r})=>{for await(let[n]of sy(e,"unpipe",{signal:r}))t.has(n)&&n.emit(ol)},No=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},fy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{Jr(e,tl);let s=new AbortController;try{await Promise.race([hy(i,t),my({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),gy({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),Jr(e,-tl)}r.size===n.size+o.size&&(n.size===0&&o.size>0?Lo(e):il(e))},nl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",hy=async(e,t)=>{try{await e,Lo(t)}catch(r){nl(r)?Lo(t):sl(t,r)}},my=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;nl(s)?o.add(t):sl(e,s)}},gy=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await ay(e,ol,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},ol=Symbol("unpipe"),il=e=>{e.writable&&e.end()},Lo=e=>{(e.readable||e.writable)&&e.destroy()},sl=(e,t)=>{e.destroyed||(e.once("error",yy),e.destroy(t))},yy=()=>{},Jr=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},el=2,tl=1});var cl=E(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.splitWhen=Dt.flatten=void 0;function by(e){return e.reduce((t,r)=>[].concat(t,r),[])}Dt.flatten=by;function vy(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Dt.splitWhen=vy});var ll=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isEnoentCodeError=void 0;function _y(e){return e.code==="ENOENT"}Zr.isEnoentCodeError=_y});var ul=E(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.createDirentFromStats=void 0;var jo=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 Ey(e,t){return new jo(e,t)}en.createDirentFromStats=Ey});var hl=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.convertPosixPathToPattern=oe.convertWindowsPathToPattern=oe.convertPathToPattern=oe.escapePosixPath=oe.escapeWindowsPath=oe.escape=oe.removeLeadingDotSegment=oe.makeAbsolute=oe.unixify=void 0;var ky=I("os"),xy=I("path"),dl=ky.platform()==="win32",wy=2,Cy=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Ay=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Sy=/^\\\\([.?])/,Ry=/\\(?![!()+@[\]{}])/g;function Oy(e){return e.replace(/\\/g,"/")}oe.unixify=Oy;function Ty(e,t){return xy.resolve(e,t)}oe.makeAbsolute=Ty;function Py(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(wy)}return e}oe.removeLeadingDotSegment=Py;oe.escape=dl?Fo:Mo;function Fo(e){return e.replace(Ay,"\\$2")}oe.escapeWindowsPath=Fo;function Mo(e){return e.replace(Cy,"\\$2")}oe.escapePosixPath=Mo;oe.convertPathToPattern=dl?pl:fl;function pl(e){return Fo(e).replace(Sy,"//$1").replace(Ry,"/")}oe.convertWindowsPathToPattern=pl;function fl(e){return Mo(e)}oe.convertPosixPathToPattern=fl});var gl=E((PC,ml)=>{ml.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 vl=E(($C,bl)=>{var $y=gl(),yl={"{":"}","(":")","[":"]"},Dy=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=yl[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},Ny=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=yl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};bl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if($y(t))return!0;var n=Dy;return r&&r.strict===!1&&(n=Ny),n(t)}});var El=E((DC,_l)=>{"use strict";var Ly=vl(),Iy=I("path").posix.dirname,jy=I("os").platform()==="win32",Bo="/",Fy=/\\/g,My=/[\{\[].*[\}\]]$/,By=/(^|[^\\])([\{\[]|\([^\)]+$)/,Hy=/\\([\!\*\?\|\[\]\(\)\{\}])/g;_l.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&jy&&t.indexOf(Bo)<0&&(t=t.replace(Fy,Bo)),My.test(t)&&(t+=Bo),t+="a";do t=Iy(t);while(Ly(t)||By.test(t));return t.replace(Hy,"$1")}});var tn=E(Ae=>{"use strict";Ae.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Ae.find=(e,t)=>e.nodes.find(r=>r.type===t);Ae.exceedsLimit=(e,t,r=1,n)=>n===!1||!Ae.isInteger(e)||!Ae.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Ae.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)};Ae.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Ae.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;Ae.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Ae.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Ae.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 rn=E((LC,xl)=>{"use strict";var kl=tn();xl.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&kl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&kl.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 Cl=E((IC,wl)=>{"use strict";wl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Nl=E((jC,Dl)=>{"use strict";var Al=Cl(),vt=(e,t,r)=>{if(Al(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Al(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(vt.cache.hasOwnProperty(c))return vt.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let y=e+"|"+t;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let d=$l(e)||$l(t),p={min:e,max:t,a:u,b:l},g=[],m=[];if(d&&(p.isPadded=d,p.maxLen=String(p.max).length),u<0){let y=l<0?Math.abs(l):1;m=Sl(y,Math.abs(u),p,n),u=p.a=0}return l>=0&&(g=Sl(u,l,p,n)),p.negatives=m,p.positives=g,p.result=Vy(m,g,n),n.capture===!0?p.result=`(${p.result})`:n.wrap!==!1&&g.length+m.length>1&&(p.result=`(?:${p.result})`),vt.cache[c]=p,p.result};function Vy(e,t,r){let n=Ho(e,t,"-",!1,r)||[],o=Ho(t,e,"",!1,r)||[],i=Ho(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Gy(e,t){let r=1,n=1,o=Ol(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=Ol(e,r);for(o=Tl(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Tl(t+1,n)-1;return i=[...i],i.sort(qy),i}function Wy(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Uy(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+=Yy(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Sl(e,t,r,n){let o=Gy(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Wy(String(s),String(u),n),d="";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+Pl(a.count),s=u+1;continue}r.isPadded&&(d=Ky(u,r,n)),l.string=d+l.pattern+Pl(l.count),i.push(l),s=u+1,a=l}return i}function Ho(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Rl(t,"string",a)&&i.push(r+a),n&&Rl(t,"string",a)&&i.push(r+a)}return i}function Uy(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function qy(e,t){return e>t?1:t>e?-1:0}function Rl(e,t,r){return e.some(n=>n[t]===r)}function Ol(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Tl(e,t){return e-e%Math.pow(10,t)}function Pl(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Yy(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function $l(e){return/^-?(0+)\d/.test(e)}function Ky(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}}`}}vt.cache={};vt.clearCache=()=>vt.cache={};Dl.exports=vt});var Wo=E((FC,Hl)=>{"use strict";var Xy=I("util"),Il=Nl(),Ll=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),zy=e=>t=>e===!0?Number(t):String(t),Vo=e=>typeof e=="number"||typeof e=="string"&&e!=="",sr=e=>Number.isInteger(+e),Go=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Qy=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Jy=(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},on=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Zy=(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=>on(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>on(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},jl=(e,t,r,n)=>{if(r)return Il(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},Fl=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Il(e,t,r)},Ml=(...e)=>new RangeError("Invalid range arguments: "+Xy.inspect(...e)),Bl=(e,t,r)=>{if(r.strictRanges===!0)throw Ml([e,t]);return[]},eb=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},tb=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw Ml([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=Go(a)||Go(c)||Go(u),d=l?Math.max(a.length,c.length,u.length):0,p=l===!1&&Qy(e,t,n)===!1,g=n.transform||zy(p);if(n.toRegex&&r===1)return jl(on(e,d),on(t,d),!0,n);let m={negatives:[],positives:[]},y=O=>m[O<0?"negatives":"positives"].push(Math.abs(O)),k=[],R=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?y(o):k.push(Jy(g(o,R),d,p)),o=s?o-r:o+r,R++;return n.toRegex===!0?r>1?Zy(m,n,d):Fl(k,null,{wrap:!1,...n}):k},rb=(e,t,r=1,n={})=>{if(!sr(e)&&e.length>1||!sr(t)&&t.length>1)return Bl(e,t,n);let o=n.transform||(p=>String.fromCharCode(p)),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 jl(c,u,!1,n);let l=[],d=0;for(;a?i>=s:i<=s;)l.push(o(i,d)),i=a?i-r:i+r,d++;return n.toRegex===!0?Fl(l,null,{wrap:!1,options:n}):l},nn=(e,t,r,n={})=>{if(t==null&&Vo(e))return[e];if(!Vo(e)||!Vo(t))return Bl(e,t,n);if(typeof r=="function")return nn(e,t,1,{transform:r});if(Ll(r))return nn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,sr(r)?sr(e)&&sr(t)?tb(e,t,r,o):rb(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Ll(r)?eb(r,o):nn(e,t,1,r)};Hl.exports=nn});var Wl=E((MC,Gl)=>{"use strict";var nb=Wo(),Vl=tn(),ob=(e,t={})=>{let r=(n,o={})=>{let i=Vl.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=Vl.reduce(n.nodes),d=nb(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(e)};Gl.exports=ob});var Yl=E((BC,ql)=>{"use strict";var ib=Wo(),Ul=rn(),Nt=tn(),_t=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Nt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(_t(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?_t(o,i,r):o+i);return Nt.flatten(n)},sb=(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(_t(a.pop(),Ul(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(_t(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let d=Nt.reduce(o.nodes);if(Nt.exceedsLimit(...d,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=ib(...d,t);p.length===0&&(p=Ul(o,t)),a.push(_t(a.pop(),p)),o.nodes=[];return}let c=Nt.encloseBrace(o),u=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let d=0;d<o.nodes.length;d++){let p=o.nodes[d];if(p.type==="comma"&&o.type==="brace"){d===1&&u.push(""),u.push("");continue}if(p.type==="close"){a.push(_t(a.pop(),u,c));continue}if(p.value&&p.type!=="open"){u.push(_t(u.pop(),p.value));continue}p.nodes&&n(p,o)}return u};return Nt.flatten(n(e))};ql.exports=sb});var Xl=E((HC,Kl)=>{"use strict";Kl.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 eu=E((VC,Zl)=>{"use strict";var ab=rn(),{MAX_LENGTH:zl,CHAR_BACKSLASH:Uo,CHAR_BACKTICK:cb,CHAR_COMMA:lb,CHAR_DOT:ub,CHAR_LEFT_PARENTHESES:db,CHAR_RIGHT_PARENTHESES:pb,CHAR_LEFT_CURLY_BRACE:fb,CHAR_RIGHT_CURLY_BRACE:hb,CHAR_LEFT_SQUARE_BRACKET:Ql,CHAR_RIGHT_SQUARE_BRACKET:Jl,CHAR_DOUBLE_QUOTE:mb,CHAR_SINGLE_QUOTE:gb,CHAR_NO_BREAK_SPACE:yb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:bb}=Xl(),vb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(zl,r.maxLength):zl;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,d=0,p,g=()=>e[l++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return s.nodes.push(y),y.parent=s,y.prev=a,a=y,y};for(m({type:"bos"});l<u;)if(s=i[i.length-1],p=g(),!(p===bb||p===yb)){if(p===Uo){m({type:"text",value:(t.keepEscaping?p:"")+g()});continue}if(p===Jl){m({type:"text",value:"\\"+p});continue}if(p===Ql){c++;let y;for(;l<u&&(y=g());){if(p+=y,y===Ql){c++;continue}if(y===Uo){p+=g();continue}if(y===Jl&&(c--,c===0))break}m({type:"text",value:p});continue}if(p===db){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:p});continue}if(p===pb){if(s.type!=="paren"){m({type:"text",value:p});continue}s=i.pop(),m({type:"text",value:p}),s=i[i.length-1];continue}if(p===mb||p===gb||p===cb){let y=p,k;for(t.keepQuotes!==!0&&(p="");l<u&&(k=g());){if(k===Uo){p+=k+g();continue}if(k===y){t.keepQuotes===!0&&(p+=k);break}p+=k}m({type:"text",value:p});continue}if(p===fb){d++;let k={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=m(k),i.push(s),m({type:"open",value:p});continue}if(p===hb){if(s.type!=="brace"){m({type:"text",value:p});continue}let y="close";s=i.pop(),s.close=!0,m({type:y,value:p}),d--,s=i[i.length-1];continue}if(p===lb&&d>0){if(s.ranges>0){s.ranges=0;let y=s.nodes.shift();s.nodes=[y,{type:"text",value:ab(s)}]}m({type:"comma",value:p}),s.commas++;continue}if(p===ub&&d>0&&s.commas===0){let y=s.nodes;if(d===0||y.length===0){m({type:"text",value:p});continue}if(a.type==="dot"){if(s.range=[],a.value+=p,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"){y.pop();let k=y[y.length-1];k.value+=a.value+p,a=k,s.ranges--;continue}m({type:"dot",value:p});continue}m({type:"text",value:p})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let y=i[i.length-1],k=y.nodes.indexOf(s);y.nodes.splice(k,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};Zl.exports=vb});var nu=E((GC,ru)=>{"use strict";var tu=rn(),_b=Wl(),Eb=Yl(),kb=eu(),Ee=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ee.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ee.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.parse=(e,t={})=>kb(e,t);Ee.stringify=(e,t={})=>tu(typeof e=="string"?Ee.parse(e,t):e,t);Ee.compile=(e,t={})=>(typeof e=="string"&&(e=Ee.parse(e,t)),_b(e,t));Ee.expand=(e,t={})=>{typeof e=="string"&&(e=Ee.parse(e,t));let r=Eb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ee.compile(e,t):Ee.expand(e,t);ru.exports=Ee});var ar=E((WC,cu)=>{"use strict";var xb=I("path"),Be="\\\\/",ou=`[^${Be}]`,Xe="\\.",wb="\\+",Cb="\\?",sn="\\/",Ab="(?=.)",iu="[^/]",qo=`(?:${sn}|$)`,su=`(?:^|${sn})`,Yo=`${Xe}{1,2}${qo}`,Sb=`(?!${Xe})`,Rb=`(?!${su}${Yo})`,Ob=`(?!${Xe}{0,1}${qo})`,Tb=`(?!${Yo})`,Pb=`[^.${sn}]`,$b=`${iu}*?`,au={DOT_LITERAL:Xe,PLUS_LITERAL:wb,QMARK_LITERAL:Cb,SLASH_LITERAL:sn,ONE_CHAR:Ab,QMARK:iu,END_ANCHOR:qo,DOTS_SLASH:Yo,NO_DOT:Sb,NO_DOTS:Rb,NO_DOT_SLASH:Ob,NO_DOTS_SLASH:Tb,QMARK_NO_DOT:Pb,STAR:$b,START_ANCHOR:su},Db={...au,SLASH_LITERAL:`[${Be}]`,QMARK:ou,STAR:`${ou}*?`,DOTS_SLASH:`${Xe}{1,2}(?:[${Be}]|$)`,NO_DOT:`(?!${Xe})`,NO_DOTS:`(?!(?:^|[${Be}])${Xe}{1,2}(?:[${Be}]|$))`,NO_DOT_SLASH:`(?!${Xe}{0,1}(?:[${Be}]|$))`,NO_DOTS_SLASH:`(?!${Xe}{1,2}(?:[${Be}]|$))`,QMARK_NO_DOT:`[^.${Be}]`,START_ANCHOR:`(?:^|[${Be}])`,END_ANCHOR:`(?:[${Be}]|$)`},Nb={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"};cu.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Nb,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:xb.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?Db:au}}});var cr=E(ve=>{"use strict";var Lb=I("path"),Ib=process.platform==="win32",{REGEX_BACKSLASH:jb,REGEX_REMOVE_BACKSLASH:Fb,REGEX_SPECIAL_CHARS:Mb,REGEX_SPECIAL_CHARS_GLOBAL:Bb}=ar();ve.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ve.hasRegexChars=e=>Mb.test(e);ve.isRegexChar=e=>e.length===1&&ve.hasRegexChars(e);ve.escapeRegex=e=>e.replace(Bb,"\\$1");ve.toPosixSlashes=e=>e.replace(jb,"/");ve.removeBackslashes=e=>e.replace(Fb,t=>t==="\\"?"":t);ve.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ve.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Ib===!0||Lb.sep==="\\";ve.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ve.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ve.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ve.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var gu=E((qC,mu)=>{"use strict";var lu=cr(),{CHAR_ASTERISK:Ko,CHAR_AT:Hb,CHAR_BACKWARD_SLASH:lr,CHAR_COMMA:Vb,CHAR_DOT:Xo,CHAR_EXCLAMATION_MARK:zo,CHAR_FORWARD_SLASH:hu,CHAR_LEFT_CURLY_BRACE:Qo,CHAR_LEFT_PARENTHESES:Jo,CHAR_LEFT_SQUARE_BRACKET:Gb,CHAR_PLUS:Wb,CHAR_QUESTION_MARK:uu,CHAR_RIGHT_CURLY_BRACE:Ub,CHAR_RIGHT_PARENTHESES:du,CHAR_RIGHT_SQUARE_BRACKET:qb}=ar(),pu=e=>e===hu||e===lr,fu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Yb=(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,d=0,p=!1,g=!1,m=!1,y=!1,k=!1,R=!1,O=!1,X=!1,xe=!1,N=!1,z=0,P,T,M={value:"",depth:0,isGlob:!1},le=()=>u>=n,_=()=>c.charCodeAt(u+1),Q=()=>(P=T,c.charCodeAt(++u));for(;u<n;){T=Q();let he;if(T===lr){O=M.backslashes=!0,T=Q(),T===Qo&&(R=!0);continue}if(R===!0||T===Qo){for(z++;le()!==!0&&(T=Q());){if(T===lr){O=M.backslashes=!0,Q();continue}if(T===Qo){z++;continue}if(R!==!0&&T===Xo&&(T=Q())===Xo){if(p=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(R!==!0&&T===Vb){if(p=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Ub&&(z--,z===0)){R=!1,p=M.isBrace=!0,N=!0;break}}if(o===!0)continue;break}if(T===hu){if(i.push(u),s.push(M),M={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===Xo&&u===l+1){l+=2;continue}d=u+1;continue}if(r.noext!==!0&&(T===Wb||T===Hb||T===Ko||T===uu||T===zo)===!0&&_()===Jo){if(m=M.isGlob=!0,y=M.isExtglob=!0,N=!0,T===zo&&u===l&&(xe=!0),o===!0){for(;le()!==!0&&(T=Q());){if(T===lr){O=M.backslashes=!0,T=Q();continue}if(T===du){m=M.isGlob=!0,N=!0;break}}continue}break}if(T===Ko){if(P===Ko&&(k=M.isGlobstar=!0),m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===uu){if(m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Gb){for(;le()!==!0&&(he=Q());){if(he===lr){O=M.backslashes=!0,Q();continue}if(he===qb){g=M.isBracket=!0,m=M.isGlob=!0,N=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&T===zo&&u===l){X=M.negated=!0,l++;continue}if(r.noparen!==!0&&T===Jo){if(m=M.isGlob=!0,o===!0){for(;le()!==!0&&(T=Q());){if(T===Jo){O=M.backslashes=!0,T=Q();continue}if(T===du){N=!0;break}}continue}break}if(m===!0){if(N=!0,o===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let q=c,tt="",b="";l>0&&(tt=c.slice(0,l),c=c.slice(l),d-=l),q&&m===!0&&d>0?(q=c.slice(0,d),b=c.slice(d)):m===!0?(q="",b=c):q=c,q&&q!==""&&q!=="/"&&q!==c&&pu(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(b&&(b=lu.removeBackslashes(b)),q&&O===!0&&(q=lu.removeBackslashes(q)));let v={prefix:tt,input:e,start:l,base:q,glob:b,isBrace:p,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:k,negated:X,negatedExtglob:xe};if(r.tokens===!0&&(v.maxDepth=0,pu(T)||s.push(M),v.tokens=s),r.parts===!0||r.tokens===!0){let he;for(let j=0;j<i.length;j++){let Le=he?he+1:l,Ie=i[j],_e=e.slice(Le,Ie);r.tokens&&(j===0&&l!==0?(s[j].isPrefix=!0,s[j].value=tt):s[j].value=_e,fu(s[j]),v.maxDepth+=s[j].depth),(j!==0||_e!=="")&&a.push(_e),he=Ie}if(he&&he+1<e.length){let j=e.slice(he+1);a.push(j),r.tokens&&(s[s.length-1].value=j,fu(s[s.length-1]),v.maxDepth+=s[s.length-1].depth)}v.slashes=i,v.parts=a}return v};mu.exports=Yb});var vu=E((YC,bu)=>{"use strict";var an=ar(),ke=cr(),{MAX_LENGTH:cn,POSIX_REGEX_SOURCE:Kb,REGEX_NON_SPECIAL_CHARS:Xb,REGEX_SPECIAL_CHARS_BACKREF:zb,REPLACEMENTS:yu}=an,Qb=(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=>ke.escapeRegex(o)).join("..")}return r},Lt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Zo=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=yu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(cn,r.maxLength):cn,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=ke.isWindows(t),u=an.globChars(c),l=an.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:k,NO_DOT_SLASH:R,NO_DOTS_SLASH:O,QMARK:X,QMARK_NO_DOT:xe,STAR:N,START_ANCHOR:z}=u,P=w=>`(${a}(?:(?!${z}${w.dot?y:d}).)*?)`,T=r.dot?"":k,M=r.dot?X:xe,le=r.bash===!0?P(r):N;r.capture&&(le=`(${le})`),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=ke.removePrefix(e,_),o=e.length;let Q=[],q=[],tt=[],b=i,v,he=()=>_.index===o-1,j=_.peek=(w=1)=>e[_.index+w],Le=_.advance=()=>e[++_.index]||"",Ie=()=>e.slice(_.index+1),_e=(w="",Y=0)=>{_.consumed+=w,_.index+=Y},_r=w=>{_.output+=w.output!=null?w.output:w.value,_e(w.value)},hf=()=>{let w=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Le(),_.start++,w++;return w%2===0?!1:(_.negated=!0,_.start++,!0)},Er=w=>{_[w]++,tt.push(w)},ht=w=>{_[w]--,tt.pop()},L=w=>{if(b.type==="globstar"){let Y=_.braces>0&&(w.type==="comma"||w.type==="brace"),x=w.extglob===!0||Q.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!Y&&!x&&(_.output=_.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=le,_.output+=b.output)}if(Q.length&&w.type!=="paren"&&(Q[Q.length-1].inner+=w.value),(w.value||w.output)&&_r(w),b&&b.type==="text"&&w.type==="text"){b.value+=w.value,b.output=(b.output||"")+w.value;return}w.prev=b,s.push(w),b=w},kr=(w,Y)=>{let x={...l[Y],conditions:1,inner:""};x.prev=b,x.parens=_.parens,x.output=_.output;let D=(r.capture?"(":"")+x.open;Er("parens"),L({type:w,value:Y,output:_.output?"":m}),L({type:"paren",extglob:!0,value:Le(),output:D}),Q.push(x)},mf=w=>{let Y=w.close+(r.capture?")":""),x;if(w.type==="negate"){let D=le;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(D=P(r)),(D!==le||he()||/^\)+$/.test(Ie()))&&(Y=w.close=`)$))${D}`),w.inner.includes("*")&&(x=Ie())&&/^\.[^\\/.]+$/.test(x)){let ee=Zo(x,{...t,fastpaths:!1}).output;Y=w.close=`)${ee})${D})`}w.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:v,output:Y}),ht("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let w=!1,Y=e.replace(zb,(x,D,ee,me,ie,Bn)=>me==="\\"?(w=!0,x):me==="?"?D?D+me+(ie?X.repeat(ie.length):""):Bn===0?M+(ie?X.repeat(ie.length):""):X.repeat(ee.length):me==="."?d.repeat(ee.length):me==="*"?D?D+me+(ie?le:""):le:D?x:`\\${x}`);return w===!0&&(r.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,x=>x.length%2===0?"\\\\":x?"\\":"")),Y===e&&r.contains===!0?(_.output=e,_):(_.output=ke.wrapOutput(Y,_,t),_)}for(;!he();){if(v=Le(),v==="\0")continue;if(v==="\\"){let x=j();if(x==="/"&&r.bash!==!0||x==="."||x===";")continue;if(!x){v+="\\",L({type:"text",value:v});continue}let D=/^\\+/.exec(Ie()),ee=0;if(D&&D[0].length>2&&(ee=D[0].length,_.index+=ee,ee%2!==0&&(v+="\\")),r.unescape===!0?v=Le():v+=Le(),_.brackets===0){L({type:"text",value:v});continue}}if(_.brackets>0&&(v!=="]"||b.value==="["||b.value==="[^")){if(r.posix!==!1&&v===":"){let x=b.value.slice(1);if(x.includes("[")&&(b.posix=!0,x.includes(":"))){let D=b.value.lastIndexOf("["),ee=b.value.slice(0,D),me=b.value.slice(D+2),ie=Kb[me];if(ie){b.value=ee+ie,_.backtrack=!0,Le(),!i.output&&s.indexOf(b)===1&&(i.output=m);continue}}}(v==="["&&j()!==":"||v==="-"&&j()==="]")&&(v=`\\${v}`),v==="]"&&(b.value==="["||b.value==="[^")&&(v=`\\${v}`),r.posix===!0&&v==="!"&&b.value==="["&&(v="^"),b.value+=v,_r({value:v});continue}if(_.quotes===1&&v!=='"'){v=ke.escapeRegex(v),b.value+=v,_r({value:v});continue}if(v==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:v});continue}if(v==="("){Er("parens"),L({type:"paren",value:v});continue}if(v===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Lt("opening","("));let x=Q[Q.length-1];if(x&&_.parens===x.parens+1){mf(Q.pop());continue}L({type:"paren",value:v,output:_.parens?")":"\\)"}),ht("parens");continue}if(v==="["){if(r.nobracket===!0||!Ie().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Lt("closing","]"));v=`\\${v}`}else Er("brackets");L({type:"bracket",value:v});continue}if(v==="]"){if(r.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){L({type:"text",value:v,output:`\\${v}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Lt("opening","["));L({type:"text",value:v,output:`\\${v}`});continue}ht("brackets");let x=b.value.slice(1);if(b.posix!==!0&&x[0]==="^"&&!x.includes("/")&&(v=`/${v}`),b.value+=v,_r({value:v}),r.literalBrackets===!1||ke.hasRegexChars(x))continue;let D=ke.escapeRegex(b.value);if(_.output=_.output.slice(0,-b.value.length),r.literalBrackets===!0){_.output+=D,b.value=D;continue}b.value=`(${a}${D}|${b.value})`,_.output+=b.value;continue}if(v==="{"&&r.nobrace!==!0){Er("braces");let x={type:"brace",value:v,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};q.push(x),L(x);continue}if(v==="}"){let x=q[q.length-1];if(r.nobrace===!0||!x){L({type:"text",value:v,output:v});continue}let D=")";if(x.dots===!0){let ee=s.slice(),me=[];for(let ie=ee.length-1;ie>=0&&(s.pop(),ee[ie].type!=="brace");ie--)ee[ie].type!=="dots"&&me.unshift(ee[ie].value);D=Qb(me,r),_.backtrack=!0}if(x.comma!==!0&&x.dots!==!0){let ee=_.output.slice(0,x.outputIndex),me=_.tokens.slice(x.tokensIndex);x.value=x.output="\\{",v=D="\\}",_.output=ee;for(let ie of me)_.output+=ie.output||ie.value}L({type:"brace",value:v,output:D}),ht("braces"),q.pop();continue}if(v==="|"){Q.length>0&&Q[Q.length-1].conditions++,L({type:"text",value:v});continue}if(v===","){let x=v,D=q[q.length-1];D&&tt[tt.length-1]==="braces"&&(D.comma=!0,x="|"),L({type:"comma",value:v,output:x});continue}if(v==="/"){if(b.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),b=i;continue}L({type:"slash",value:v,output:g});continue}if(v==="."){if(_.braces>0&&b.type==="dot"){b.value==="."&&(b.output=d);let x=q[q.length-1];b.type="dots",b.output+=v,b.value+=v,x.dots=!0;continue}if(_.braces+_.parens===0&&b.type!=="bos"&&b.type!=="slash"){L({type:"text",value:v,output:d});continue}L({type:"dot",value:v,output:d});continue}if(v==="?"){if(!(b&&b.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){kr("qmark",v);continue}if(b&&b.type==="paren"){let D=j(),ee=v;if(D==="<"&&!ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ee=`\\${v}`),L({type:"text",value:v,output:ee});continue}if(r.dot!==!0&&(b.type==="slash"||b.type==="bos")){L({type:"qmark",value:v,output:xe});continue}L({type:"qmark",value:v,output:X});continue}if(v==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){kr("negate",v);continue}if(r.nonegate!==!0&&_.index===0){hf();continue}}if(v==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){kr("plus",v);continue}if(b&&b.value==="("||r.regex===!1){L({type:"plus",value:v,output:p});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||_.parens>0){L({type:"plus",value:v});continue}L({type:"plus",value:p});continue}if(v==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){L({type:"at",extglob:!0,value:v,output:""});continue}L({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let x=Xb.exec(Ie());x&&(v+=x[0],_.index+=x[0].length),L({type:"text",value:v});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=v,b.output=le,_.backtrack=!0,_.globstar=!0,_e(v);continue}let w=Ie();if(r.noextglob!==!0&&/^\([^?]/.test(w)){kr("star",v);continue}if(b.type==="star"){if(r.noglobstar===!0){_e(v);continue}let x=b.prev,D=x.prev,ee=x.type==="slash"||x.type==="bos",me=D&&(D.type==="star"||D.type==="globstar");if(r.bash===!0&&(!ee||w[0]&&w[0]!=="/")){L({type:"star",value:v,output:""});continue}let ie=_.braces>0&&(x.type==="comma"||x.type==="brace"),Bn=Q.length&&(x.type==="pipe"||x.type==="paren");if(!ee&&x.type!=="paren"&&!ie&&!Bn){L({type:"star",value:v,output:""});continue}for(;w.slice(0,3)==="/**";){let xr=e[_.index+4];if(xr&&xr!=="/")break;w=w.slice(3),_e("/**",3)}if(x.type==="bos"&&he()){b.type="globstar",b.value+=v,b.output=P(r),_.output=b.output,_.globstar=!0,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&!me&&he()){_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=P(r)+(r.strictSlashes?")":"|$)"),b.value+=v,_.globstar=!0,_.output+=x.output+b.output,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&w[0]==="/"){let xr=w[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=`${P(r)}${g}|${g}${xr})`,b.value+=v,_.output+=x.output+b.output,_.globstar=!0,_e(v+Le()),L({type:"slash",value:"/",output:""});continue}if(x.type==="bos"&&w[0]==="/"){b.type="globstar",b.value+=v,b.output=`(?:^|${g}|${P(r)}${g})`,_.output=b.output,_.globstar=!0,_e(v+Le()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-b.output.length),b.type="globstar",b.output=P(r),b.value+=v,_.output+=b.output,_.globstar=!0,_e(v);continue}let Y={type:"star",value:v,output:le};if(r.bash===!0){Y.output=".*?",(b.type==="bos"||b.type==="slash")&&(Y.output=T+Y.output),L(Y);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&r.regex===!0){Y.output=v,L(Y);continue}(_.index===_.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(_.output+=R,b.output+=R):r.dot===!0?(_.output+=O,b.output+=O):(_.output+=T,b.output+=T),j()!=="*"&&(_.output+=m,b.output+=m)),L(Y)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lt("closing","]"));_.output=ke.escapeLast(_.output,"["),ht("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lt("closing",")"));_.output=ke.escapeLast(_.output,"("),ht("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lt("closing","}"));_.output=ke.escapeLast(_.output,"{"),ht("braces")}if(r.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${g}?`}),_.backtrack===!0){_.output="";for(let w of _.tokens)_.output+=w.output!=null?w.output:w.value,w.suffix&&(_.output+=w.suffix)}return _};Zo.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(cn,r.maxLength):cn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=yu[e]||e;let i=ke.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:g,START_ANCHOR:m}=an.globChars(i),y=r.dot?d:l,k=r.dot?p:l,R=r.capture?"":"?:",O={negated:!1,prefix:""},X=r.bash===!0?".*?":g;r.capture&&(X=`(${X})`);let xe=T=>T.noglobstar===!0?X:`(${R}(?:(?!${m}${T.dot?u:s}).)*?)`,N=T=>{switch(T){case"*":return`${y}${c}${X}`;case".*":return`${s}${c}${X}`;case"*.*":return`${y}${X}${s}${c}${X}`;case"*/*":return`${y}${X}${a}${c}${k}${X}`;case"**":return y+xe(r);case"**/*":return`(?:${y}${xe(r)}${a})?${k}${c}${X}`;case"**/*.*":return`(?:${y}${xe(r)}${a})?${k}${X}${s}${c}${X}`;case"**/.*":return`(?:${y}${xe(r)}${a})?${s}${c}${X}`;default:{let M=/^(.*?)\.(\w+)$/.exec(T);if(!M)return;let le=N(M[1]);return le?le+s+M[2]:void 0}}},z=ke.removePrefix(e,O),P=N(z);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};bu.exports=Zo});var Eu=E((KC,_u)=>{"use strict";var Jb=I("path"),Zb=gu(),ei=vu(),ti=cr(),ev=ar(),tv=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(p=>re(p,t,r));return p=>{for(let g of l){let m=g(p);if(m)return m}return!1}}let n=tv(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=ti.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,d=!1)=>{let{isMatch:p,match:g,output:m}=re.test(l,s,t,{glob:e,posix:i}),y={glob:e,state:a,regex:s,posix:i,input:l,output:m,match:g,isMatch:p};return typeof o.onResult=="function"&&o.onResult(y),p===!1?(y.isMatch=!1,d?y:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,d?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),d?y:!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?ti.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=ti.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(Jb.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)=>Zb(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=ev;_u.exports=re});var xu=E((XC,ku)=>{"use strict";ku.exports=Eu()});var Ou=E((zC,Ru)=>{"use strict";var Cu=I("util"),Au=nu(),He=xu(),ri=cr(),wu=e=>e===""||e==="./",Su=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},K=(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 d=He(String(t[l]),{...r,onResult:a},!0),p=d.state.negated||d.state.negatedExtglob;p&&s++;for(let g of e){let m=d(g,!0);(p?!m.isMatch:m.isMatch)&&(p?n.add(m.output):(n.delete(m.output),o.add(m.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};K.match=K;K.matcher=(e,t)=>He(e,t);K.isMatch=(e,t,r)=>He(t,r)(e);K.any=K.isMatch;K.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(K(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};K.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Cu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>K.contains(e,n,r));if(typeof t=="string"){if(wu(e)||wu(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return K.isMatch(e,t,{...r,contains:!0})};K.matchKeys=(e,t,r)=>{if(!ri.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=K(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};K.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=He(String(o),r);if(n.some(s=>i(s)))return!0}return!1};K.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=He(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};K.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Cu.inspect(e)}"`);return[].concat(t).every(n=>He(n,r)(e))};K.capture=(e,t,r)=>{let n=ri.isWindows(r),i=He.makeRe(String(e),{...r,capture:!0}).exec(n?ri.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};K.makeRe=(...e)=>He.makeRe(...e);K.scan=(...e)=>He.scan(...e);K.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of Au(String(n),t))r.push(He.parse(o,t));return r};K.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Su(e)?[e]:Au(e,t)};K.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return K.braces(e,{...t,expand:!0})};K.hasBraces=Su;Ru.exports=K});var Mu=E(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.isAbsolute=S.partitionAbsoluteAndRelative=S.removeDuplicateSlashes=S.matchAny=S.convertPatternsToRe=S.makeRe=S.getPatternParts=S.expandBraceExpansion=S.expandPatternsWithBraceExpansion=S.isAffectDepthOfReadingPattern=S.endsWithSlashGlobStar=S.hasGlobStar=S.getBaseDirectory=S.isPatternRelatedToParentDirectory=S.getPatternsOutsideCurrentDirectory=S.getPatternsInsideCurrentDirectory=S.getPositivePatterns=S.getNegativePatterns=S.isPositivePattern=S.isNegativePattern=S.convertToNegativePattern=S.convertToPositivePattern=S.isDynamicPattern=S.isStaticPattern=void 0;var Tu=I("path"),rv=El(),ni=Ou(),Pu="**",nv="\\",ov=/[*?]|^!/,iv=/\[[^[]*]/,sv=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,av=/[!*+?@]\([^(]*\)/,cv=/,|\.\./,lv=/(?!^)\/{2,}/g;function $u(e,t={}){return!Du(e,t)}S.isStaticPattern=$u;function Du(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(nv)||ov.test(e)||iv.test(e)||sv.test(e)||t.extglob!==!1&&av.test(e)||t.braceExpansion!==!1&&uv(e))}S.isDynamicPattern=Du;function uv(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 cv.test(n)}function dv(e){return ln(e)?e.slice(1):e}S.convertToPositivePattern=dv;function pv(e){return"!"+e}S.convertToNegativePattern=pv;function ln(e){return e.startsWith("!")&&e[1]!=="("}S.isNegativePattern=ln;function Nu(e){return!ln(e)}S.isPositivePattern=Nu;function fv(e){return e.filter(ln)}S.getNegativePatterns=fv;function hv(e){return e.filter(Nu)}S.getPositivePatterns=hv;function mv(e){return e.filter(t=>!oi(t))}S.getPatternsInsideCurrentDirectory=mv;function gv(e){return e.filter(oi)}S.getPatternsOutsideCurrentDirectory=gv;function oi(e){return e.startsWith("..")||e.startsWith("./..")}S.isPatternRelatedToParentDirectory=oi;function yv(e){return rv(e,{flipBackslashes:!1})}S.getBaseDirectory=yv;function bv(e){return e.includes(Pu)}S.hasGlobStar=bv;function Lu(e){return e.endsWith("/"+Pu)}S.endsWithSlashGlobStar=Lu;function vv(e){let t=Tu.basename(e);return Lu(e)||$u(t)}S.isAffectDepthOfReadingPattern=vv;function _v(e){return e.reduce((t,r)=>t.concat(Iu(r)),[])}S.expandPatternsWithBraceExpansion=_v;function Iu(e){let t=ni.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}S.expandBraceExpansion=Iu;function Ev(e,t){let{parts:r}=ni.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}S.getPatternParts=Ev;function ju(e,t){return ni.makeRe(e,t)}S.makeRe=ju;function kv(e,t){return e.map(r=>ju(r,t))}S.convertPatternsToRe=kv;function xv(e,t){return t.some(r=>r.test(e))}S.matchAny=xv;function wv(e){return e.replace(lv,"/")}S.removeDuplicateSlashes=wv;function Cv(e){let t=[],r=[];for(let n of e)Fu(n)?t.push(n):r.push(n);return[t,r]}S.partitionAbsoluteAndRelative=Cv;function Fu(e){return Tu.isAbsolute(e)}S.isAbsolute=Fu});var Gu=E((JC,Vu)=>{"use strict";var Av=I("stream"),Bu=Av.PassThrough,Sv=Array.prototype.slice;Vu.exports=Rv;function Rv(){let e=[],t=Sv.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=Bu(n);function a(){for(let l=0,d=arguments.length;l<d;l++)e.push(Hu(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 d=l.length+1;function p(){--d>0||(r=!1,c())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",k),p()}function k(R){s.emit("error",R)}if(m._readableState.endEmitted)return p();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",k),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)g(l[m]);p()}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 Hu(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=Hu(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Bu(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var Uu=E(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.merge=void 0;var Ov=Gu();function Tv(e){let t=Ov(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Wu(e)),t.once("end",()=>Wu(e)),t}un.merge=Tv;function Wu(e){e.forEach(t=>t.emit("close"))}});var qu=E(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.isEmpty=It.isString=void 0;function Pv(e){return typeof e=="string"}It.isString=Pv;function $v(e){return e===""}It.isEmpty=$v});var ze=E(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.string=pe.stream=pe.pattern=pe.path=pe.fs=pe.errno=pe.array=void 0;var Dv=cl();pe.array=Dv;var Nv=ll();pe.errno=Nv;var Lv=ul();pe.fs=Lv;var Iv=hl();pe.path=Iv;var jv=Mu();pe.pattern=jv;var Fv=Uu();pe.stream=Fv;var Mv=qu();pe.string=Mv});var zu=E(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.convertPatternGroupToTask=fe.convertPatternGroupsToTasks=fe.groupPatternsByBaseDirectory=fe.getNegativePatternsAsPositive=fe.getPositivePatterns=fe.convertPatternsToTasks=fe.generate=void 0;var $e=ze();function Bv(e,t){let r=Yu(e,t),n=Yu(t.ignore,t),o=Ku(r),i=Xu(r,n),s=o.filter(l=>$e.pattern.isStaticPattern(l,t)),a=o.filter(l=>$e.pattern.isDynamicPattern(l,t)),c=ii(s,i,!1),u=ii(a,i,!0);return c.concat(u)}fe.generate=Bv;function Yu(e,t){let r=e;return t.braceExpansion&&(r=$e.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>$e.pattern.removeDuplicateSlashes(n))}function ii(e,t,r){let n=[],o=$e.pattern.getPatternsOutsideCurrentDirectory(e),i=$e.pattern.getPatternsInsideCurrentDirectory(e),s=si(o),a=si(i);return n.push(...ai(s,t,r)),"."in a?n.push(ci(".",i,t,r)):n.push(...ai(a,t,r)),n}fe.convertPatternsToTasks=ii;function Ku(e){return $e.pattern.getPositivePatterns(e)}fe.getPositivePatterns=Ku;function Xu(e,t){return $e.pattern.getNegativePatterns(e).concat(t).map($e.pattern.convertToPositivePattern)}fe.getNegativePatternsAsPositive=Xu;function si(e){let t={};return e.reduce((r,n)=>{let o=$e.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}fe.groupPatternsByBaseDirectory=si;function ai(e,t,r){return Object.keys(e).map(n=>ci(n,e[n],t,r))}fe.convertPatternGroupsToTasks=ai;function ci(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map($e.pattern.convertToNegativePattern))}}fe.convertPatternGroupToTask=ci});var Ju=E(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.read=void 0;function Hv(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Qu(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){li(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Qu(r,i);return}li(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),li(r,s)})})}dn.read=Hv;function Qu(e,t){e(t)}function li(e,t){e(null,t)}});var Zu=E(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.read=void 0;function Vv(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}}pn.read=Vv});var ed=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.createFileSystemAdapter=at.FILE_SYSTEM_ADAPTER=void 0;var fn=I("fs");at.FILE_SYSTEM_ADAPTER={lstat:fn.lstat,stat:fn.stat,lstatSync:fn.lstatSync,statSync:fn.statSync};function Gv(e){return e===void 0?at.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},at.FILE_SYSTEM_ADAPTER),e)}at.createFileSystemAdapter=Gv});var td=E(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});var Wv=ed(),ui=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=Wv.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}};di.default=ui});var Et=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.statSync=ct.stat=ct.Settings=void 0;var rd=Ju(),Uv=Zu(),pi=td();ct.Settings=pi.default;function qv(e,t,r){if(typeof t=="function"){rd.read(e,fi(),t);return}rd.read(e,fi(t),r)}ct.stat=qv;function Yv(e,t){let r=fi(t);return Uv.read(e,r)}ct.statSync=Yv;function fi(e={}){return e instanceof pi.default?e:new pi.default(e)}});var id=E((cA,od)=>{var nd;od.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(nd||(nd=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var ad=E((lA,sd)=>{sd.exports=Xv;var Kv=id();function Xv(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?Kv(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,d){a(u,l,d)})}):s(null),i=!1}});var hi=E(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var hn=process.versions.node.split(".");if(hn[0]===void 0||hn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var cd=Number.parseInt(hn[0],10),zv=Number.parseInt(hn[1],10),ld=10,Qv=10,Jv=cd>ld,Zv=cd===ld&&zv>=Qv;mn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Jv||Zv});var ud=E(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.createDirentFromStats=void 0;var mi=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 e_(e,t){return new mi(e,t)}gn.createDirentFromStats=e_});var gi=E(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.fs=void 0;var t_=ud();yn.fs=t_});var yi=E(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.joinPathSegments=void 0;function r_(e,t,r){return e.endsWith(r)?e+t:e+r+t}bn.joinPathSegments=r_});var gd=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.readdir=lt.readdirWithFileTypes=lt.read=void 0;var n_=Et(),dd=ad(),o_=hi(),pd=gi(),fd=yi();function i_(e,t,r){if(!t.stats&&o_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){hd(e,t,r);return}md(e,t,r)}lt.read=i_;function hd(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){vn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:fd.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){bi(r,i);return}let s=i.map(a=>s_(a,t));dd(s,(a,c)=>{if(a!==null){vn(r,a);return}bi(r,c)})})}lt.readdirWithFileTypes=hd;function s_(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=pd.fs.createDirentFromStats(e.name,o),r(null,e)})}}function md(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){vn(r,n);return}let i=o.map(s=>{let a=fd.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{n_.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let d={name:s,path:a,dirent:pd.fs.createDirentFromStats(s,l)};t.stats&&(d.stats=l),c(null,d)})}});dd(i,(s,a)=>{if(s!==null){vn(r,s);return}bi(r,a)})})}lt.readdir=md;function vn(e,t){e(t)}function bi(e,t){e(null,t)}});var Ed=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.readdir=ut.readdirWithFileTypes=ut.read=void 0;var a_=Et(),c_=hi(),yd=gi(),bd=yi();function l_(e,t){return!t.stats&&c_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?vd(e,t):_d(e,t)}ut.read=l_;function vd(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:bd.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=yd.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}ut.readdirWithFileTypes=vd;function _d(e,t){return t.fs.readdirSync(e).map(n=>{let o=bd.joinPathSegments(e,n,t.pathSegmentSeparator),i=a_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:yd.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}ut.readdir=_d});var kd=E(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.createFileSystemAdapter=dt.FILE_SYSTEM_ADAPTER=void 0;var jt=I("fs");dt.FILE_SYSTEM_ADAPTER={lstat:jt.lstat,stat:jt.stat,lstatSync:jt.lstatSync,statSync:jt.statSync,readdir:jt.readdir,readdirSync:jt.readdirSync};function u_(e){return e===void 0?dt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},dt.FILE_SYSTEM_ADAPTER),e)}dt.createFileSystemAdapter=u_});var xd=E(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var d_=I("path"),p_=Et(),f_=kd(),vi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=f_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,d_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new p_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};_i.default=vi});var _n=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.Settings=pt.scandirSync=pt.scandir=void 0;var wd=gd(),h_=Ed(),Ei=xd();pt.Settings=Ei.default;function m_(e,t,r){if(typeof t=="function"){wd.read(e,ki(),t);return}wd.read(e,ki(t),r)}pt.scandir=m_;function g_(e,t){let r=ki(t);return h_.read(e,r)}pt.scandirSync=g_;function ki(e={}){return e instanceof Ei.default?e:new Ei.default(e)}});var Ad=E((vA,Cd)=>{"use strict";function y_(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}}Cd.exports=y_});var Rd=E((_A,xi)=>{"use strict";var b_=Ad();function Sd(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=b_(v_),o=null,i=null,s=0,a=null,c={push:y,drain:Se,saturated:Se,pause:l,paused:!1,get concurrency(){return r},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=N,!c.paused)for(;o&&s<r;)s++,R()},running:u,resume:g,idle:m,length:d,getQueue:p,unshift:k,empty:Se,kill:O,killAndDrain:X,error:xe};return c;function u(){return s}function l(){c.paused=!0}function d(){for(var N=o,z=0;N;)N=N.next,z++;return z}function p(){for(var N=o,z=[];N;)z.push(N.value),N=N.next;return z}function g(){if(c.paused){if(c.paused=!1,o===null){s++,R();return}for(;o&&s<r;)s++,R()}}function m(){return s===0&&c.length()===0}function y(N,z){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=z||Se,P.errorHandler=a,s>=r||c.paused?i?(i.next=P,i=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function k(N,z){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=z||Se,P.errorHandler=a,s>=r||c.paused?o?(P.next=o,o=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function R(N){N&&n.release(N);var z=o;z&&s<=r?c.paused?s--:(i===o&&(i=null),o=z.next,z.next=null,t.call(e,z.value,z.worked),i===null&&c.empty()):--s===0&&c.drain()}function O(){o=null,i=null,c.drain=Se}function X(){o=null,i=null,c.drain(),c.drain=Se}function xe(N){a=N}}function Se(){}function v_(){this.value=null,this.callback=Se,this.next=null,this.release=Se,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=Se,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function __(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,d){t.call(this,l).then(function(p){d(null,p)},d)}var o=Sd(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=u,o;function a(l){var d=new Promise(function(p,g){i(l,function(m,y){if(m){g(m);return}p(y)})});return d.catch(Se),d}function c(l){var d=new Promise(function(p,g){s(l,function(m,y){if(m){g(m);return}p(y)})});return d.catch(Se),d}function u(){var l=new Promise(function(d){process.nextTick(function(){if(o.idle())d();else{var p=o.drain;o.drain=function(){typeof p=="function"&&p(),d(),o.drain=p}}})});return l}}xi.exports=Sd;xi.exports.promise=__});var En=E(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.joinPathSegments=Ve.replacePathSegmentSeparator=Ve.isAppliedFilter=Ve.isFatalError=void 0;function E_(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ve.isFatalError=E_;function k_(e,t){return e===null||e(t)}Ve.isAppliedFilter=k_;function x_(e,t){return e.split(/[/\\]/).join(t)}Ve.replacePathSegmentSeparator=x_;function w_(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ve.joinPathSegments=w_});var Ai=E(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});var C_=En(),wi=class{constructor(t,r){this._root=t,this._settings=r,this._root=C_.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Ci.default=wi});var Oi=E(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});var A_=I("events"),S_=_n(),R_=Rd(),kn=En(),O_=Ai(),Si=class extends O_.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=S_.scandir,this._emitter=new A_.EventEmitter,this._queue=R_(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||!kn.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=kn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),kn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&kn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};Ri.default=Si});var Od=E(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});var T_=Oi(),Ti=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new T_.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{P_(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{$_(t,this._storage)}),this._reader.read()}};Pi.default=Ti;function P_(e,t){e(t)}function $_(e,t){e(null,t)}});var Td=E(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});var D_=I("stream"),N_=Oi(),$i=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new N_.default(this._root,this._settings),this._stream=new D_.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}};Di.default=$i});var Pd=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var L_=_n(),xn=En(),I_=Ai(),Ni=class extends I_.default{constructor(){super(...arguments),this._scandir=L_.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(xn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=xn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),xn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&xn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Li.default=Ni});var $d=E(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});var j_=Pd(),Ii=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new j_.default(this._root,this._settings)}read(){return this._reader.read()}};ji.default=Ii});var Dd=E(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var F_=I("path"),M_=_n(),Fi=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,F_.sep),this.fsScandirSettings=new M_.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}};Mi.default=Fi});var Cn=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.Settings=Ge.walkStream=Ge.walkSync=Ge.walk=void 0;var Nd=Od(),B_=Td(),H_=$d(),Bi=Dd();Ge.Settings=Bi.default;function V_(e,t,r){if(typeof t=="function"){new Nd.default(e,wn()).read(t);return}new Nd.default(e,wn(t)).read(r)}Ge.walk=V_;function G_(e,t){let r=wn(t);return new H_.default(e,r).read()}Ge.walkSync=G_;function W_(e,t){let r=wn(t);return new B_.default(e,r).read()}Ge.walkStream=W_;function wn(e={}){return e instanceof Bi.default?e:new Bi.default(e)}});var An=E(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var U_=I("path"),q_=Et(),Ld=ze(),Hi=class{constructor(t){this._settings=t,this._fsStatSettings=new q_.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return U_.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Ld.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Ld.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};Vi.default=Hi});var Ui=E(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var Y_=I("stream"),K_=Et(),X_=Cn(),z_=An(),Gi=class extends z_.default{constructor(){super(...arguments),this._walkStream=X_.walkStream,this._stat=K_.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new Y_.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))})}};Wi.default=Gi});var Id=E(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Q_=Cn(),J_=An(),Z_=Ui(),qi=class extends J_.default{constructor(){super(...arguments),this._walkAsync=Q_.walk,this._readerStream=new Z_.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))})}};Yi.default=qi});var jd=E(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var ur=ze(),Ki=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 ur.pattern.getPatternParts(t,this._micromatchOptions).map(n=>ur.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:ur.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return ur.array.splitWhen(t,r=>r.dynamic&&ur.pattern.hasGlobStar(r.pattern))}};Xi.default=Ki});var Fd=E(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var eE=jd(),zi=class extends eE.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}};Qi.default=zi});var Md=E(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var Sn=ze(),tE=Fd(),Ji=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 tE.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(Sn.pattern.isAffectDepthOfReadingPattern);return Sn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Sn.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!Sn.pattern.matchAny(t,r)}};Zi.default=Ji});var Bd=E(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var ft=ze(),es=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=ft.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:ft.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:ft.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:ft.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=ft.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=ft.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=ft.pattern.matchAny(t,r);return!o&&n?ft.pattern.matchAny(t+"/",r):o}};ts.default=es});var Hd=E(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var rE=ze(),rs=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return rE.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};ns.default=rs});var Gd=E(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var Vd=ze(),os=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=Vd.path.makeAbsolute(this._settings.cwd,r),r=Vd.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};is.default=os});var Rn=E(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var nE=I("path"),oE=Md(),iE=Bd(),sE=Hd(),aE=Gd(),ss=class{constructor(t){this._settings=t,this.errorFilter=new sE.default(this._settings),this.entryFilter=new iE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new oE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new aE.default(this._settings)}_getRootDirectory(t){return nE.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}}};as.default=ss});var Wd=E(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var cE=Id(),lE=Rn(),cs=class extends lE.default{constructor(){super(...arguments),this._reader=new cE.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)}};ls.default=cs});var Ud=E(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var uE=I("stream"),dE=Ui(),pE=Rn(),us=class extends pE.default{constructor(){super(...arguments),this._reader=new dE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new uE.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)}};ds.default=us});var qd=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var fE=Et(),hE=Cn(),mE=An(),ps=class extends mE.default{constructor(){super(...arguments),this._walkSync=hE.walkSync,this._statSync=fE.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)}};fs.default=ps});var Yd=E(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var gE=qd(),yE=Rn(),hs=class extends yE.default{constructor(){super(...arguments),this._reader=new gE.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)}};ms.default=hs});var Kd=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var Ft=I("fs"),bE=I("os"),vE=Math.max(bE.cpus().length,1);Mt.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Ft.lstat,lstatSync:Ft.lstatSync,stat:Ft.stat,statSync:Ft.statSync,readdir:Ft.readdir,readdirSync:Ft.readdirSync};var gs=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,vE),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({},Mt.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};Mt.default=gs});var _s=E((UA,zd)=>{"use strict";var Xd=zu(),_E=Wd(),EE=Ud(),kE=Yd(),ys=Kd(),Re=ze();async function bs(e,t){De(e);let r=vs(e,_E.default,t),n=await Promise.all(r);return Re.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){De(u);let d=vs(u,kE.default,l);return Re.array.flatten(d)}e.sync=t;function r(u,l){De(u);let d=vs(u,EE.default,l);return Re.stream.merge(d)}e.stream=r;function n(u,l){De(u);let d=[].concat(u),p=new ys.default(l);return Xd.generate(d,p)}e.generateTasks=n;function o(u,l){De(u);let d=new ys.default(l);return Re.pattern.isDynamicPattern(u,d)}e.isDynamicPattern=o;function i(u){return De(u),Re.path.escape(u)}e.escapePath=i;function s(u){return De(u),Re.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(p){return De(p),Re.path.escapePosixPath(p)}u.escapePath=l;function d(p){return De(p),Re.path.convertPosixPathToPattern(p)}u.convertPathToPattern=d})(a=e.posix||(e.posix={}));let c;(function(u){function l(p){return De(p),Re.path.escapeWindowsPath(p)}u.escapePath=l;function d(p){return De(p),Re.path.convertWindowsPathToPattern(p)}u.convertPathToPattern=d})(c=e.win32||(e.win32={}))})(bs||(bs={}));function vs(e,t,r){let n=[].concat(e),o=new ys.default(r),i=Xd.generate(n,o),s=new t(o);return i.map(s.read,s)}function De(e){if(![].concat(e).every(n=>Re.string.isString(n)&&!Re.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}zd.exports=bs});import xE from"node:fs";import wE from"node:fs/promises";async function Es(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await wE[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function ks(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return xE[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var KA,Qd,XA,zA,Jd,QA,Zd=rt(()=>{KA=Es.bind(void 0,"stat","isFile"),Qd=Es.bind(void 0,"stat","isDirectory"),XA=Es.bind(void 0,"lstat","isSymbolicLink"),zA=ks.bind(void 0,"statSync","isFile"),Jd=ks.bind(void 0,"statSync","isDirectory"),QA=ks.bind(void 0,"lstatSync","isSymbolicLink")});var ep=rt(()=>{});import{promisify as CE}from"node:util";import{execFile as AE,execFileSync as r0}from"node:child_process";import{fileURLToPath as SE}from"node:url";function dr(e){return e instanceof URL?SE(e):e}var o0,i0,xs=rt(()=>{ep();o0=CE(AE);i0=10*1024*1024});var lp=E((c0,Pn)=>{function np(e){return Array.isArray(e)?e:[e]}var RE=void 0,Cs="",tp=" ",ws="\\",OE=/^\s+$/,TE=/(?:[^\\]|^)\\$/,PE=/^\\!/,$E=/^\\#/,DE=/\r?\n/g,NE=/^\.{0,2}\/|^\.{1,2}$/,LE=/\/$/,Bt="/",op="node-ignore";typeof Symbol<"u"&&(op=Symbol.for("node-ignore"));var ip=op,Ht=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),IE=/([0-z])-([0-z])/g,sp=()=>!1,jE=e=>e.replace(IE,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Cs),FE=e=>{let{length:t}=e;return e.slice(0,t-t%2)},ME=[[/^\uFEFF/,()=>Cs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?tp:Cs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+tp}],[/[\\$.|*+(){^]/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,()=>ws],[/\\\\/g,()=>ws],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===ws?`\\[${r}${FE(n)}${o}`:o==="]"&&n.length%2===0?`[${jE(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],BE=/(^|\\\/)?\\\*$/,pr="regex",On="checkRegex",rp="_",HE={[pr](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[On](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},VE=e=>ME.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Tn=e=>typeof e=="string",GE=e=>e&&Tn(e)&&!OE.test(e)&&!TE.test(e)&&e.indexOf("#")!==0,WE=e=>e.split(DE).filter(Boolean),As=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Ht(this,"body",n),Ht(this,"ignoreCase",o),Ht(this,"regexPrefix",s)}get regex(){let t=rp+pr;return this[t]?this[t]:this._make(pr,t)}get checkRegex(){let t=rp+On;return this[t]?this[t]:this._make(On,t)}_make(t,r){let n=this.regexPrefix.replace(BE,HE[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Ht(this,r,o)}},UE=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(PE,"!").replace($E,"#");let i=VE(o);return new As(e,t,o,r,n,i)},Ss=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[ip]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Tn(t)&&(t={pattern:t}),GE(t.pattern)){let r=UE(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,np(Tn(t)?WE(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?RE:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},qE=(e,t)=>{throw new t(e)},Qe=(e,t,r)=>Tn(e)?e?Qe.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),ap=e=>NE.test(e);Qe.isNotRelative=ap;Qe.convert=e=>e;var Rs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Ht(this,ip,!0),this._rules=new Ss(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&&Qe.convert(t);return Qe(i,t,this._strictPathCheck?qE:sp),this._t(i,r,n,o)}checkIgnore(t){if(!LE.test(t))return this.test(t);let r=t.split(Bt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Bt)+Bt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,On)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Bt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,pr);let i=this._t(o.join(Bt)+Bt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,pr)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return np(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Os=e=>new Rs(e),YE=e=>Qe(e&&Qe.convert(e),e,sp),cp=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qe.convert=e;let t=/^[a-z]:\//i;Qe.isNotRelative=r=>t.test(r)||ap(r)};typeof process<"u"&&process.platform==="win32"&&cp();Pn.exports=Os;Os.default=Os;Pn.exports.isPathValid=YE;Ht(Pn.exports,Symbol.for("setupWindows"),cp)});function Vt(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var up=rt(()=>{});var fr,Ts=rt(()=>{fr=e=>e[0]==="!"});import KE from"node:process";import XE from"node:fs";import zE from"node:fs/promises";import Gt from"node:path";var Ps,dp,QE,pp,$n,JE,ZE,ek,fp,hp,hr,mr,mp,gp,$s=rt(()=>{Ps=Yt(_s(),1),dp=Yt(lp(),1);up();xs();Ts();QE=["**/node_modules","**/flow-typed","**/coverage","**/.git"],pp={absolute:!0,dot:!0},$n="**/.gitignore",JE=(e,t)=>fr(e)?"!"+Gt.posix.join(t,e.slice(1)):Gt.posix.join(t,e),ZE=(e,t)=>{let r=Vt(Gt.relative(t,Gt.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>JE(n,r))},ek=(e,t)=>{if(t=Vt(t),Gt.isAbsolute(e)){if(Vt(e).startsWith(t))return Gt.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},fp=(e,t)=>{let r=e.flatMap(o=>ZE(o,t)),n=(0,dp.default)().add(r);return o=>(o=dr(o),o=ek(o,t),o?n.ignores(Vt(o)):!1)},hp=(e={})=>({cwd:dr(e.cwd)??KE.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...QE]}),hr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=hp(t),s=await(0,Ps.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...pp}),a=await Promise.all(s.map(async c=>({filePath:c,content:await zE.readFile(c,"utf8")})));return fp(a,r)},mr=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=hp(t),a=Ps.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...pp}).map(c=>({filePath:c,content:XE.readFileSync(c,"utf8")}));return fp(a,r)},mp=e=>hr($n,e),gp=e=>mr($n,e)});var Pp={};Ef(Pp,{convertPathToPattern:()=>dk,generateGlobTasks:()=>lk,generateGlobTasksSync:()=>uk,globby:()=>ik,globbyStream:()=>ak,globbySync:()=>sk,isDynamicPattern:()=>ck,isGitIgnored:()=>mp,isGitIgnoredSync:()=>gp,isIgnoredByIgnoreFiles:()=>hr,isIgnoredByIgnoreFilesSync:()=>mr});import vp from"node:process";import tk from"node:fs";import Wt from"node:path";var Ut,rk,_p,Ep,yp,bp,Ds,nk,kp,xp,Dn,wp,ok,Cp,Ap,Sp,Rp,Op,Tp,Ns,ik,sk,ak,ck,lk,uk,dk,$p=rt(()=>{al();Ut=Yt(_s(),1);Zd();xs();$s();Ts();$s();rk=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},_p=(e,t)=>{let r=fr(e)?e.slice(1):e;return Wt.isAbsolute(r)?r:Wt.join(t,r)},Ep=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>Wt.posix.join(e,`**/${Wt.extname(o)?o:`${o}${n}`}`)):[Wt.posix.join(e,`**${n?`/*${n}`:""}`)]},yp=async(e,{cwd:t=vp.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await Qd(_p(i,t))?Ep({directoryPath:i,files:r,extensions:n}):i))).flat(),bp=(e,{cwd:t=vp.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>Jd(_p(o,t))?Ep({directoryPath:o,files:r,extensions:n}):o),Ds=e=>(e=[...new Set([e].flat())],rk(e),e),nk=e=>{if(!e)return;let t;try{t=tk.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},kp=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:dr(e.cwd)},nk(e.cwd),e),xp=e=>async(t,r)=>e(Ds(t),kp(r)),Dn=e=>(t,r)=>e(Ds(t),kp(r)),wp=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?Ds(t):[];return r&&n.push($n),n},ok=async e=>{let t=wp(e);return Ap(t.length>0&&await hr(t,e))},Cp=e=>{let t=wp(e);return Ap(t.length>0&&mr(t,e))},Ap=e=>{let t=new Set;return r=>{let n=Wt.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Sp=(e,t)=>e.flat().filter(r=>t(r)),Rp=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>fr(i));if(n===-1){r.push({patterns:e,options:t});break}let o=e[n].slice(1);for(let i of r)i.options.ignore.push(o);n!==0&&r.push({patterns:e.slice(0,n),options:{...t,ignore:[...t.ignore,o]}}),e=e.slice(n+1)}return r},Op=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Tp=async(e,t)=>{let r=Rp(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Op(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([yp(a,i),yp(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Ns=(e,t)=>{let r=Rp(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Op(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=bp(a,i),c.ignore=bp(c.ignore,{cwd:n}),{patterns:a,options:c}})},ik=xp(async(e,t)=>{let[r,n]=await Promise.all([Tp(e,t),ok(t)]),o=await Promise.all(r.map(i=>(0,Ut.default)(i.patterns,i.options)));return Sp(o,n)}),sk=Dn((e,t)=>{let r=Ns(e,t),n=Cp(t),o=r.map(i=>Ut.default.sync(i.patterns,i.options));return Sp(o,n)}),ak=Dn((e,t)=>{let r=Ns(e,t),n=Cp(t),o=r.map(s=>Ut.default.stream(s.patterns,s.options));return Io(o).filter(s=>n(s))}),ck=Dn((e,t)=>e.some(r=>Ut.default.isDynamicPattern(r,t))),lk=xp(Tp),uk=Dn(Ns),{convertPathToPattern:dk}=Ut.default});var Ks=(e=0)=>t=>`\x1B[${t+e}m`,Xs=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,zs=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,J={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]}},xx=Object.keys(J.modifier),xf=Object.keys(J.color),wf=Object.keys(J.bgColor),wx=[...xf,...wf];function Cf(){let e=new Map;for(let[t,r]of Object.entries(J)){for(let[n,o]of Object.entries(r))J[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=J[n],e.set(o[0],o[1]);Object.defineProperty(J,t,{value:r,enumerable:!1})}return Object.defineProperty(J,"codes",{value:e,enumerable:!1}),J.color.close="\x1B[39m",J.bgColor.close="\x1B[49m",J.color.ansi=Ks(),J.color.ansi256=Xs(),J.color.ansi16m=zs(),J.bgColor.ansi=Ks(10),J.bgColor.ansi256=Xs(10),J.bgColor.ansi16m=zs(10),Object.defineProperties(J,{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=>J.rgbToAnsi256(...J.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)=>J.ansi256ToAnsi(J.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>J.ansi256ToAnsi(J.hexToAnsi256(t)),enumerable:!1}}),J}var Af=Cf(),Te=Af;import Vn from"node:process";import Sf from"node:os";import Qs from"node:tty";function we(e,t=globalThis.Deno?globalThis.Deno.args:Vn.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:Z}=Vn,wr;we("no-color")||we("no-colors")||we("color=false")||we("color=never")?wr=0:(we("color")||we("colors")||we("color=true")||we("color=always"))&&(wr=1);function Rf(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function Of(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Tf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Rf();n!==void 0&&(wr=n);let o=r?wr:n;if(o===0)return 0;if(r){if(we("color=16m")||we("color=full")||we("color=truecolor"))return 3;if(we("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(Z.TERM==="dumb")return i;if(Vn.platform==="win32"){let s=Sf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Z)||Z.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let s=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:i}function Js(e,t={}){let r=Tf(e,{streamIsTTY:e&&e.isTTY,...t});return Of(r)}var Pf={stdout:Js({isTTY:Qs.isatty(1)}),stderr:Js({isTTY:Qs.isatty(2)})},Zs=Pf;function ea(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 ta(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
28
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Aa(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 _o(){if(M.env.NO_COLOR||M.env.FORCE_COLOR==="0"||M.env.FORCE_COLOR==="false")return!1;if(M.env.FORCE_COLOR||M.env.CLICOLOR_FORCE!==void 0)return!0}Eo.Command=bo;Eo.useColor=_o});var Pa=x(Oe=>{var{Argument:Ra}=Br(),{Command:xo}=Sa(),{CommanderError:vh,InvalidArgumentError:Oa}=cr(),{Help:bh}=po(),{Option:Ta}=go();Oe.program=new xo;Oe.createCommand=e=>new xo(e);Oe.createOption=(e,t)=>new Ta(e,t);Oe.createArgument=(e,t)=>new Ra(e,t);Oe.Command=xo;Oe.Option=Ta;Oe.Argument=Ra;Oe.Help=bh;Oe.CommanderError=vh;Oe.InvalidArgumentError=Oa;Oe.InvalidOptionArgumentError=Oa});var Fc=x((mC,Gg)=>{Gg.exports={name:"dotenv",version:"17.2.2",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 --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --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 Uc=x((gC,Je)=>{var jo=F("fs"),Xr=F("path"),Ug=F("os"),Wg=F("crypto"),qg=Fc(),Fo=qg.version,Mc=["\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{1F4E1} observe env with Radar: https://dotenvx.com/radar","\u{1F4E1} auto-backup env with Radar: https://dotenvx.com/radar","\u{1F4E1} version env with Radar: https://dotenvx.com/radar","\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 Yg(){return Mc[Math.floor(Math.random()*Mc.length)]}function Ft(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function Kg(){return process.stdout.isTTY}function Xg(e){return Kg()?`\x1B[2m${e}\x1B[0m`:e}var zg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Jg(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
29
+ `);let n;for(;(n=zg.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 Qg(e){e=e||{};let t=Gc(e);e.path=t;let r=ce.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=Vc(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=ey(r,a);i=ce.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return ce.parse(i)}function Zg(e){console.error(`[dotenv@${Fo}][WARN] ${e}`)}function mr(e){console.log(`[dotenv@${Fo}][DEBUG] ${e}`)}function Hc(e){console.log(`[dotenv@${Fo}] ${e}`)}function Vc(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 ey(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 Gc(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)jo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Xr.resolve(process.cwd(),".env.vault");return jo.existsSync(t)?t:null}function Bc(e){return e[0]==="~"?Xr.join(Ug.homedir(),e.slice(1)):e}function ty(e){let t=Ft(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Ft(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&Hc("Loading env from encrypted .env.vault");let n=ce._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),ce.populate(o,n,e),{parsed:n}}function ry(e){let t=Xr.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=Ft(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=Ft(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&mr("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[Bc(e.path)];else{s=[];for(let l of e.path)s.push(Bc(l))}let a,c={};for(let l of s)try{let p=ce.parse(jo.readFileSync(l,{encoding:r}));ce.populate(c,p,e)}catch(p){o&&mr(`Failed to load ${l} ${p.message}`),a=p}let u=ce.populate(n,c,e);if(o=Ft(n.DOTENV_CONFIG_DEBUG||o),i=Ft(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,p=[];for(let d of s)try{let y=Xr.relative(process.cwd(),d);p.push(y)}catch(y){o&&mr(`Failed to load ${d} ${y.message}`),a=y}Hc(`injecting env (${l}) from ${p.join(",")} ${Xg(`-- tip: ${Yg()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function ny(e){if(Vc(e).length===0)return ce.configDotenv(e);let t=Gc(e);return t?ce._configVault(e):(Zg(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ce.configDotenv(e))}function oy(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=Wg.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 iy(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&&mr(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 ce={configDotenv:ry,_configVault:ty,_parseVault:Qg,config:ny,decrypt:oy,parse:Jg,populate:iy};Je.exports.configDotenv=ce.configDotenv;Je.exports._configVault=ce._configVault;Je.exports._parseVault=ce._parseVault;Je.exports.config=ce.config;Je.exports.decrypt=ce.decrypt;Je.exports.parse=ce.parse;Je.exports.populate=ce.populate;Je.exports=ce});var Mo=x((yC,sy)=>{sy.exports={name:"@raclettejs/core",version:"0.1.20",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:{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"],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.2.0","@types/mustache":"4.2.6",chalk:"5.6.2",chokidar:"3.6.0","cli-highlight":"2.1.11",commander:"14.0.1",dotenv:"17.2.2",esbuild:"0.25.9","fs-extra":"11.3.2",globby:"14.1.0","js-yaml":"4.1.0",mustache:"4.2.0",ramda:"0.31.3","tsc-alias":"1.8.16"},devDependencies:{"@eslint/js":"9.35.0","@raclettejs/types":"workspace:^","@types/fs-extra":"11.0.4","@types/js-yaml":"4.0.9","@types/node":"24.5.1","@types/ramda":"0.31.1",eslint:"9.35.0","eslint-config-prettier":"10.1.8","eslint-flat-config-utils":"2.1.1","eslint-plugin-import":"2.32.0","eslint-plugin-prefer-arrow-functions":"3.8.1","eslint-plugin-prettier":"5.5.4","eslint-plugin-vue":"10.4.0",globals:"16.4.0",husky:"9.1.7",prettier:"3.6.2",typescript:"5.9.2","typescript-eslint":"8.44.0","vue-eslint-parser":"10.2.0"}}});import{on as zy,once as Jy}from"node:events";import{PassThrough as Qy}from"node:stream";import{finished as bl}from"node:stream/promises";function ei(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Qo(o);let t=e.some(({readableObjectMode:o})=>o),r=Zy(e,t),n=new Jo({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&xl(n),n}var Zy,Jo,ev,tv,rv,Qo,nv,_l,ov,iv,sv,El,xl,Zo,kl,av,cn,yl,vl,wl=ct(()=>{Zy=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Jo=class extends Qy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){Qo(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=ev(this,this.#e),nv({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return Qo(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},ev=async(e,t)=>{cn(e,yl);let r=new AbortController;try{await Promise.race([tv(e,r),rv(e,t,r)])}finally{r.abort(),cn(e,-yl)}},tv=async(e,{signal:t})=>{await bl(e,{signal:t,cleanup:!0})},rv=async(e,t,{signal:r})=>{for await(let[n]of zy(e,"unpipe",{signal:r}))t.has(n)&&n.emit(El)},Qo=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},nv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{cn(e,vl);let s=new AbortController;try{await Promise.race([ov(i,t),iv({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),sv({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),cn(e,-vl)}r.size===n.size+o.size&&(n.size===0&&o.size>0?Zo(e):xl(e))},_l=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",ov=async(e,t)=>{try{await e,Zo(t)}catch(r){_l(r)?Zo(t):kl(t,r)}},iv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await bl(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;_l(s)?o.add(t):kl(e,s)}},sv=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await Jy(e,El,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},El=Symbol("unpipe"),xl=e=>{e.writable&&e.end()},Zo=e=>{(e.readable||e.writable)&&e.destroy()},kl=(e,t)=>{e.destroyed||(e.once("error",av),e.destroy(t))},av=()=>{},cn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},yl=2,vl=1});var Cl=x(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.splitWhen=Ut.flatten=void 0;function cv(e){return e.reduce((t,r)=>[].concat(t,r),[])}Ut.flatten=cv;function lv(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Ut.splitWhen=lv});var Al=x(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.isEnoentCodeError=void 0;function uv(e){return e.code==="ENOENT"}ln.isEnoentCodeError=uv});var Sl=x(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.createDirentFromStats=void 0;var ti=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 pv(e,t){return new ti(e,t)}un.createDirentFromStats=pv});var Pl=x(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.convertPosixPathToPattern=oe.convertWindowsPathToPattern=oe.convertPathToPattern=oe.escapePosixPath=oe.escapeWindowsPath=oe.escape=oe.removeLeadingDotSegment=oe.makeAbsolute=oe.unixify=void 0;var dv=F("os"),fv=F("path"),Rl=dv.platform()==="win32",hv=2,mv=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,gv=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,yv=/^\\\\([.?])/,vv=/\\(?![!()+@[\]{}])/g;function bv(e){return e.replace(/\\/g,"/")}oe.unixify=bv;function _v(e,t){return fv.resolve(e,t)}oe.makeAbsolute=_v;function Ev(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(hv)}return e}oe.removeLeadingDotSegment=Ev;oe.escape=Rl?ri:ni;function ri(e){return e.replace(gv,"\\$2")}oe.escapeWindowsPath=ri;function ni(e){return e.replace(mv,"\\$2")}oe.escapePosixPath=ni;oe.convertPathToPattern=Rl?Ol:Tl;function Ol(e){return ri(e).replace(yv,"//$1").replace(vv,"/")}oe.convertWindowsPathToPattern=Ol;function Tl(e){return ni(e)}oe.convertPosixPathToPattern=Tl});var Dl=x((PA,$l)=>{$l.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 Il=x(($A,Ll)=>{var xv=Dl(),Nl={"{":"}","(":")","[":"]"},kv=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=Nl[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},wv=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=Nl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};Ll.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(xv(t))return!0;var n=kv;return r&&r.strict===!1&&(n=wv),n(t)}});var Fl=x((DA,jl)=>{"use strict";var Cv=Il(),Av=F("path").posix.dirname,Sv=F("os").platform()==="win32",oi="/",Rv=/\\/g,Ov=/[\{\[].*[\}\]]$/,Tv=/(^|[^\\])([\{\[]|\([^\)]+$)/,Pv=/\\([\!\*\?\|\[\]\(\)\{\}])/g;jl.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Sv&&t.indexOf(oi)<0&&(t=t.replace(Rv,oi)),Ov.test(t)&&(t+=oi),t+="a";do t=Av(t);while(Cv(t)||Tv.test(t));return t.replace(Pv,"$1")}});var pn=x(Te=>{"use strict";Te.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Te.find=(e,t)=>e.nodes.find(r=>r.type===t);Te.exceedsLimit=(e,t,r=1,n)=>n===!1||!Te.isInteger(e)||!Te.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Te.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)};Te.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Te.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;Te.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Te.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Te.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 dn=x((LA,Bl)=>{"use strict";var Ml=pn();Bl.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&Ml.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&Ml.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 Vl=x((IA,Hl)=>{"use strict";Hl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Jl=x((jA,zl)=>{"use strict";var Gl=Vl(),Ct=(e,t,r)=>{if(Gl(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Gl(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(Ct.cache.hasOwnProperty(c))return Ct.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let g=e+"|"+t;return n.capture?`(${g})`:n.wrap===!1?g:`(?:${g})`}let p=Xl(e)||Xl(t),d={min:e,max:t,a:u,b:l},y=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let g=l<0?Math.abs(l):1;m=Ul(g,Math.abs(u),d,n),u=d.a=0}return l>=0&&(y=Ul(u,l,d,n)),d.negatives=m,d.positives=y,d.result=$v(m,y,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&y.length+m.length>1&&(d.result=`(?:${d.result})`),Ct.cache[c]=d,d.result};function $v(e,t,r){let n=ii(e,t,"-",!1,r)||[],o=ii(t,e,"",!1,r)||[],i=ii(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Dv(e,t){let r=1,n=1,o=ql(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=ql(e,r);for(o=Yl(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Yl(t+1,n)-1;return i=[...i],i.sort(Iv),i}function Nv(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Lv(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+=jv(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Ul(e,t,r,n){let o=Dv(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Nv(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+Kl(a.count),s=u+1;continue}r.isPadded&&(p=Fv(u,r,n)),l.string=p+l.pattern+Kl(l.count),i.push(l),s=u+1,a=l}return i}function ii(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Wl(t,"string",a)&&i.push(r+a),n&&Wl(t,"string",a)&&i.push(r+a)}return i}function Lv(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Iv(e,t){return e>t?1:t>e?-1:0}function Wl(e,t,r){return e.some(n=>n[t]===r)}function ql(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Yl(e,t){return e-e%Math.pow(10,t)}function Kl(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function jv(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Xl(e){return/^-?(0+)\d/.test(e)}function Fv(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}}`}}Ct.cache={};Ct.clearCache=()=>Ct.cache={};zl.exports=Ct});var ci=x((FA,ou)=>{"use strict";var Mv=F("util"),Zl=Jl(),Ql=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Bv=e=>t=>e===!0?Number(t):String(t),si=e=>typeof e=="number"||typeof e=="string"&&e!=="",_r=e=>Number.isInteger(+e),ai=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Hv=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Vv=(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},hn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Gv=(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=>hn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>hn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},eu=(e,t,r,n)=>{if(r)return Zl(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},tu=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Zl(e,t,r)},ru=(...e)=>new RangeError("Invalid range arguments: "+Mv.inspect(...e)),nu=(e,t,r)=>{if(r.strictRanges===!0)throw ru([e,t]);return[]},Uv=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Wv=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw ru([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=ai(a)||ai(c)||ai(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&Hv(e,t,n)===!1,y=n.transform||Bv(d);if(n.toRegex&&r===1)return eu(hn(e,p),hn(t,p),!0,n);let m={negatives:[],positives:[]},g=S=>m[S<0?"negatives":"positives"].push(Math.abs(S)),E=[],A=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?g(o):E.push(Vv(y(o,A),p,d)),o=s?o-r:o+r,A++;return n.toRegex===!0?r>1?Gv(m,n,p):tu(E,null,{wrap:!1,...n}):E},qv=(e,t,r=1,n={})=>{if(!_r(e)&&e.length>1||!_r(t)&&t.length>1)return nu(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 eu(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?tu(l,null,{wrap:!1,options:n}):l},fn=(e,t,r,n={})=>{if(t==null&&si(e))return[e];if(!si(e)||!si(t))return nu(e,t,n);if(typeof r=="function")return fn(e,t,1,{transform:r});if(Ql(r))return fn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,_r(r)?_r(e)&&_r(t)?Wv(e,t,r,o):qv(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Ql(r)?Uv(r,o):fn(e,t,1,r)};ou.exports=fn});var au=x((MA,su)=>{"use strict";var Yv=ci(),iu=pn(),Kv=(e,t={})=>{let r=(n,o={})=>{let i=iu.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=iu.reduce(n.nodes),p=Yv(...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)};su.exports=Kv});var uu=x((BA,lu)=>{"use strict";var Xv=ci(),cu=dn(),Wt=pn(),At=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Wt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(At(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?At(o,i,r):o+i);return Wt.flatten(n)},zv=(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(At(a.pop(),cu(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(At(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Wt.reduce(o.nodes);if(Wt.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=Xv(...p,t);d.length===0&&(d=cu(o,t)),a.push(At(a.pop(),d)),o.nodes=[];return}let c=Wt.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(At(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(At(u.pop(),d.value));continue}d.nodes&&n(d,o)}return u};return Wt.flatten(n(e))};lu.exports=zv});var du=x((HA,pu)=>{"use strict";pu.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 yu=x((VA,gu)=>{"use strict";var Jv=dn(),{MAX_LENGTH:fu,CHAR_BACKSLASH:li,CHAR_BACKTICK:Qv,CHAR_COMMA:Zv,CHAR_DOT:eb,CHAR_LEFT_PARENTHESES:tb,CHAR_RIGHT_PARENTHESES:rb,CHAR_LEFT_CURLY_BRACE:nb,CHAR_RIGHT_CURLY_BRACE:ob,CHAR_LEFT_SQUARE_BRACKET:hu,CHAR_RIGHT_SQUARE_BRACKET:mu,CHAR_DOUBLE_QUOTE:ib,CHAR_SINGLE_QUOTE:sb,CHAR_NO_BREAK_SPACE:ab,CHAR_ZERO_WIDTH_NOBREAK_SPACE:cb}=du(),lb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(fu,r.maxLength):fu;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++],m=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return s.nodes.push(g),g.parent=s,g.prev=a,a=g,g};for(m({type:"bos"});l<u;)if(s=i[i.length-1],d=y(),!(d===cb||d===ab)){if(d===li){m({type:"text",value:(t.keepEscaping?d:"")+y()});continue}if(d===mu){m({type:"text",value:"\\"+d});continue}if(d===hu){c++;let g;for(;l<u&&(g=y());){if(d+=g,g===hu){c++;continue}if(g===li){d+=y();continue}if(g===mu&&(c--,c===0))break}m({type:"text",value:d});continue}if(d===tb){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:d});continue}if(d===rb){if(s.type!=="paren"){m({type:"text",value:d});continue}s=i.pop(),m({type:"text",value:d}),s=i[i.length-1];continue}if(d===ib||d===sb||d===Qv){let g=d,E;for(t.keepQuotes!==!0&&(d="");l<u&&(E=y());){if(E===li){d+=E+y();continue}if(E===g){t.keepQuotes===!0&&(d+=E);break}d+=E}m({type:"text",value:d});continue}if(d===nb){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=m(E),i.push(s),m({type:"open",value:d});continue}if(d===ob){if(s.type!=="brace"){m({type:"text",value:d});continue}let g="close";s=i.pop(),s.close=!0,m({type:g,value:d}),p--,s=i[i.length-1];continue}if(d===Zv&&p>0){if(s.ranges>0){s.ranges=0;let g=s.nodes.shift();s.nodes=[g,{type:"text",value:Jv(s)}]}m({type:"comma",value:d}),s.commas++;continue}if(d===eb&&p>0&&s.commas===0){let g=s.nodes;if(p===0||g.length===0){m({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"){g.pop();let E=g[g.length-1];E.value+=a.value+d,a=E,s.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(A=>{A.nodes||(A.type==="open"&&(A.isOpen=!0),A.type==="close"&&(A.isClose=!0),A.nodes||(A.type="text"),A.invalid=!0)});let g=i[i.length-1],E=g.nodes.indexOf(s);g.nodes.splice(E,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};gu.exports=lb});var _u=x((GA,bu)=>{"use strict";var vu=dn(),ub=au(),pb=uu(),db=yu(),Ae=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ae.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ae.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ae.parse=(e,t={})=>db(e,t);Ae.stringify=(e,t={})=>vu(typeof e=="string"?Ae.parse(e,t):e,t);Ae.compile=(e,t={})=>(typeof e=="string"&&(e=Ae.parse(e,t)),ub(e,t));Ae.expand=(e,t={})=>{typeof e=="string"&&(e=Ae.parse(e,t));let r=pb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ae.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ae.compile(e,t):Ae.expand(e,t);bu.exports=Ae});var Er=x((UA,Cu)=>{"use strict";var fb=F("path"),Ue="\\\\/",Eu=`[^${Ue}]`,Ze="\\.",hb="\\+",mb="\\?",mn="\\/",gb="(?=.)",xu="[^/]",ui=`(?:${mn}|$)`,ku=`(?:^|${mn})`,pi=`${Ze}{1,2}${ui}`,yb=`(?!${Ze})`,vb=`(?!${ku}${pi})`,bb=`(?!${Ze}{0,1}${ui})`,_b=`(?!${pi})`,Eb=`[^.${mn}]`,xb=`${xu}*?`,wu={DOT_LITERAL:Ze,PLUS_LITERAL:hb,QMARK_LITERAL:mb,SLASH_LITERAL:mn,ONE_CHAR:gb,QMARK:xu,END_ANCHOR:ui,DOTS_SLASH:pi,NO_DOT:yb,NO_DOTS:vb,NO_DOT_SLASH:bb,NO_DOTS_SLASH:_b,QMARK_NO_DOT:Eb,STAR:xb,START_ANCHOR:ku},kb={...wu,SLASH_LITERAL:`[${Ue}]`,QMARK:Eu,STAR:`${Eu}*?`,DOTS_SLASH:`${Ze}{1,2}(?:[${Ue}]|$)`,NO_DOT:`(?!${Ze})`,NO_DOTS:`(?!(?:^|[${Ue}])${Ze}{1,2}(?:[${Ue}]|$))`,NO_DOT_SLASH:`(?!${Ze}{0,1}(?:[${Ue}]|$))`,NO_DOTS_SLASH:`(?!${Ze}{1,2}(?:[${Ue}]|$))`,QMARK_NO_DOT:`[^.${Ue}]`,START_ANCHOR:`(?:^|[${Ue}])`,END_ANCHOR:`(?:[${Ue}]|$)`},wb={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"};Cu.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:wb,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:fb.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?kb:wu}}});var xr=x(xe=>{"use strict";var Cb=F("path"),Ab=process.platform==="win32",{REGEX_BACKSLASH:Sb,REGEX_REMOVE_BACKSLASH:Rb,REGEX_SPECIAL_CHARS:Ob,REGEX_SPECIAL_CHARS_GLOBAL:Tb}=Er();xe.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);xe.hasRegexChars=e=>Ob.test(e);xe.isRegexChar=e=>e.length===1&&xe.hasRegexChars(e);xe.escapeRegex=e=>e.replace(Tb,"\\$1");xe.toPosixSlashes=e=>e.replace(Sb,"/");xe.removeBackslashes=e=>e.replace(Rb,t=>t==="\\"?"":t);xe.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};xe.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Ab===!0||Cb.sep==="\\";xe.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?xe.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};xe.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};xe.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Du=x((qA,$u)=>{"use strict";var Au=xr(),{CHAR_ASTERISK:di,CHAR_AT:Pb,CHAR_BACKWARD_SLASH:kr,CHAR_COMMA:$b,CHAR_DOT:fi,CHAR_EXCLAMATION_MARK:hi,CHAR_FORWARD_SLASH:Pu,CHAR_LEFT_CURLY_BRACE:mi,CHAR_LEFT_PARENTHESES:gi,CHAR_LEFT_SQUARE_BRACKET:Db,CHAR_PLUS:Nb,CHAR_QUESTION_MARK:Su,CHAR_RIGHT_CURLY_BRACE:Lb,CHAR_RIGHT_PARENTHESES:Ru,CHAR_RIGHT_SQUARE_BRACKET:Ib}=Er(),Ou=e=>e===Pu||e===kr,Tu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},jb=(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,m=!1,g=!1,E=!1,A=!1,S=!1,B=!1,pe=!1,q=!1,T=0,L,k,I={value:"",depth:0,isGlob:!1},ie=()=>u>=n,_=()=>c.charCodeAt(u+1),J=()=>(L=k,c.charCodeAt(++u));for(;u<n;){k=J();let ge;if(k===kr){S=I.backslashes=!0,k=J(),k===mi&&(A=!0);continue}if(A===!0||k===mi){for(T++;ie()!==!0&&(k=J());){if(k===kr){S=I.backslashes=!0,J();continue}if(k===mi){T++;continue}if(A!==!0&&k===fi&&(k=J())===fi){if(d=I.isBrace=!0,m=I.isGlob=!0,q=!0,o===!0)continue;break}if(A!==!0&&k===$b){if(d=I.isBrace=!0,m=I.isGlob=!0,q=!0,o===!0)continue;break}if(k===Lb&&(T--,T===0)){A=!1,d=I.isBrace=!0,q=!0;break}}if(o===!0)continue;break}if(k===Pu){if(i.push(u),s.push(I),I={value:"",depth:0,isGlob:!1},q===!0)continue;if(L===fi&&u===l+1){l+=2;continue}p=u+1;continue}if(r.noext!==!0&&(k===Nb||k===Pb||k===di||k===Su||k===hi)===!0&&_()===gi){if(m=I.isGlob=!0,g=I.isExtglob=!0,q=!0,k===hi&&u===l&&(pe=!0),o===!0){for(;ie()!==!0&&(k=J());){if(k===kr){S=I.backslashes=!0,k=J();continue}if(k===Ru){m=I.isGlob=!0,q=!0;break}}continue}break}if(k===di){if(L===di&&(E=I.isGlobstar=!0),m=I.isGlob=!0,q=!0,o===!0)continue;break}if(k===Su){if(m=I.isGlob=!0,q=!0,o===!0)continue;break}if(k===Db){for(;ie()!==!0&&(ge=J());){if(ge===kr){S=I.backslashes=!0,J();continue}if(ge===Ib){y=I.isBracket=!0,m=I.isGlob=!0,q=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&k===hi&&u===l){B=I.negated=!0,l++;continue}if(r.noparen!==!0&&k===gi){if(m=I.isGlob=!0,o===!0){for(;ie()!==!0&&(k=J());){if(k===gi){S=I.backslashes=!0,k=J();continue}if(k===Ru){q=!0;break}}continue}break}if(m===!0){if(q=!0,o===!0)continue;break}}r.noext===!0&&(g=!1,m=!1);let K=c,at="",v="";l>0&&(at=c.slice(0,l),c=c.slice(l),p-=l),K&&m===!0&&p>0?(K=c.slice(0,p),v=c.slice(p)):m===!0?(K="",v=c):K=c,K&&K!==""&&K!=="/"&&K!==c&&Ou(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),r.unescape===!0&&(v&&(v=Au.removeBackslashes(v)),K&&S===!0&&(K=Au.removeBackslashes(K)));let b={prefix:at,input:e,start:l,base:K,glob:v,isBrace:d,isBracket:y,isGlob:m,isExtglob:g,isGlobstar:E,negated:B,negatedExtglob:pe};if(r.tokens===!0&&(b.maxDepth=0,Ou(k)||s.push(I),b.tokens=s),r.parts===!0||r.tokens===!0){let ge;for(let j=0;j<i.length;j++){let Fe=ge?ge+1:l,Me=i[j],we=e.slice(Fe,Me);r.tokens&&(j===0&&l!==0?(s[j].isPrefix=!0,s[j].value=at):s[j].value=we,Tu(s[j]),b.maxDepth+=s[j].depth),(j!==0||we!=="")&&a.push(we),ge=Me}if(ge&&ge+1<e.length){let j=e.slice(ge+1);a.push(j),r.tokens&&(s[s.length-1].value=j,Tu(s[s.length-1]),b.maxDepth+=s[s.length-1].depth)}b.slashes=i,b.parts=a}return b};$u.exports=jb});var Iu=x((YA,Lu)=>{"use strict";var gn=Er(),Se=xr(),{MAX_LENGTH:yn,POSIX_REGEX_SOURCE:Fb,REGEX_NON_SPECIAL_CHARS:Mb,REGEX_SPECIAL_CHARS_BACKREF:Bb,REPLACEMENTS:Nu}=gn,Hb=(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=>Se.escapeRegex(o)).join("..")}return r},qt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,yi=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Nu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(yn,r.maxLength):yn,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=Se.isWindows(t),u=gn.globChars(c),l=gn.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:y,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:E,NO_DOT_SLASH:A,NO_DOTS_SLASH:S,QMARK:B,QMARK_NO_DOT:pe,STAR:q,START_ANCHOR:T}=u,L=C=>`(${a}(?:(?!${T}${C.dot?g:p}).)*?)`,k=r.dot?"":E,I=r.dot?B:pe,ie=r.bash===!0?L(r):q;r.capture&&(ie=`(${ie})`),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=Se.removePrefix(e,_),o=e.length;let J=[],K=[],at=[],v=i,b,ge=()=>_.index===o-1,j=_.peek=(C=1)=>e[_.index+C],Fe=_.advance=()=>e[++_.index]||"",Me=()=>e.slice(_.index+1),we=(C="",X=0)=>{_.consumed+=C,_.index+=X},$r=C=>{_.output+=C.output!=null?C.output:C.value,we(C.value)},Lf=()=>{let C=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Fe(),_.start++,C++;return C%2===0?!1:(_.negated=!0,_.start++,!0)},Dr=C=>{_[C]++,at.push(C)},Et=C=>{_[C]--,at.pop()},N=C=>{if(v.type==="globstar"){let X=_.braces>0&&(C.type==="comma"||C.type==="brace"),w=C.extglob===!0||J.length&&(C.type==="pipe"||C.type==="paren");C.type!=="slash"&&C.type!=="paren"&&!X&&!w&&(_.output=_.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=ie,_.output+=v.output)}if(J.length&&C.type!=="paren"&&(J[J.length-1].inner+=C.value),(C.value||C.output)&&$r(C),v&&v.type==="text"&&C.type==="text"){v.value+=C.value,v.output=(v.output||"")+C.value;return}C.prev=v,s.push(C),v=C},Nr=(C,X)=>{let w={...l[X],conditions:1,inner:""};w.prev=v,w.parens=_.parens,w.output=_.output;let $=(r.capture?"(":"")+w.open;Dr("parens"),N({type:C,value:X,output:_.output?"":m}),N({type:"paren",extglob:!0,value:Fe(),output:$}),J.push(w)},If=C=>{let X=C.close+(r.capture?")":""),w;if(C.type==="negate"){let $=ie;if(C.inner&&C.inner.length>1&&C.inner.includes("/")&&($=L(r)),($!==ie||ge()||/^\)+$/.test(Me()))&&(X=C.close=`)$))${$}`),C.inner.includes("*")&&(w=Me())&&/^\.[^\\/.]+$/.test(w)){let ee=yi(w,{...t,fastpaths:!1}).output;X=C.close=`)${ee})${$})`}C.prev.type==="bos"&&(_.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:b,output:X}),Et("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let C=!1,X=e.replace(Bb,(w,$,ee,ye,se,Qn)=>ye==="\\"?(C=!0,w):ye==="?"?$?$+ye+(se?B.repeat(se.length):""):Qn===0?I+(se?B.repeat(se.length):""):B.repeat(ee.length):ye==="."?p.repeat(ee.length):ye==="*"?$?$+ye+(se?ie:""):ie:$?w:`\\${w}`);return C===!0&&(r.unescape===!0?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,w=>w.length%2===0?"\\\\":w?"\\":"")),X===e&&r.contains===!0?(_.output=e,_):(_.output=Se.wrapOutput(X,_,t),_)}for(;!ge();){if(b=Fe(),b==="\0")continue;if(b==="\\"){let w=j();if(w==="/"&&r.bash!==!0||w==="."||w===";")continue;if(!w){b+="\\",N({type:"text",value:b});continue}let $=/^\\+/.exec(Me()),ee=0;if($&&$[0].length>2&&(ee=$[0].length,_.index+=ee,ee%2!==0&&(b+="\\")),r.unescape===!0?b=Fe():b+=Fe(),_.brackets===0){N({type:"text",value:b});continue}}if(_.brackets>0&&(b!=="]"||v.value==="["||v.value==="[^")){if(r.posix!==!1&&b===":"){let w=v.value.slice(1);if(w.includes("[")&&(v.posix=!0,w.includes(":"))){let $=v.value.lastIndexOf("["),ee=v.value.slice(0,$),ye=v.value.slice($+2),se=Fb[ye];if(se){v.value=ee+se,_.backtrack=!0,Fe(),!i.output&&s.indexOf(v)===1&&(i.output=m);continue}}}(b==="["&&j()!==":"||b==="-"&&j()==="]")&&(b=`\\${b}`),b==="]"&&(v.value==="["||v.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&v.value==="["&&(b="^"),v.value+=b,$r({value:b});continue}if(_.quotes===1&&b!=='"'){b=Se.escapeRegex(b),v.value+=b,$r({value:b});continue}if(b==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&N({type:"text",value:b});continue}if(b==="("){Dr("parens"),N({type:"paren",value:b});continue}if(b===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(qt("opening","("));let w=J[J.length-1];if(w&&_.parens===w.parens+1){If(J.pop());continue}N({type:"paren",value:b,output:_.parens?")":"\\)"}),Et("parens");continue}if(b==="["){if(r.nobracket===!0||!Me().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(qt("closing","]"));b=`\\${b}`}else Dr("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}Et("brackets");let w=v.value.slice(1);if(v.posix!==!0&&w[0]==="^"&&!w.includes("/")&&(b=`/${b}`),v.value+=b,$r({value:b}),r.literalBrackets===!1||Se.hasRegexChars(w))continue;let $=Se.escapeRegex(v.value);if(_.output=_.output.slice(0,-v.value.length),r.literalBrackets===!0){_.output+=$,v.value=$;continue}v.value=`(${a}${$}|${v.value})`,_.output+=v.value;continue}if(b==="{"&&r.nobrace!==!0){Dr("braces");let w={type:"brace",value:b,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};K.push(w),N(w);continue}if(b==="}"){let w=K[K.length-1];if(r.nobrace===!0||!w){N({type:"text",value:b,output:b});continue}let $=")";if(w.dots===!0){let ee=s.slice(),ye=[];for(let se=ee.length-1;se>=0&&(s.pop(),ee[se].type!=="brace");se--)ee[se].type!=="dots"&&ye.unshift(ee[se].value);$=Hb(ye,r),_.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){let ee=_.output.slice(0,w.outputIndex),ye=_.tokens.slice(w.tokensIndex);w.value=w.output="\\{",b=$="\\}",_.output=ee;for(let se of ye)_.output+=se.output||se.value}N({type:"brace",value:b,output:$}),Et("braces"),K.pop();continue}if(b==="|"){J.length>0&&J[J.length-1].conditions++,N({type:"text",value:b});continue}if(b===","){let w=b,$=K[K.length-1];$&&at[at.length-1]==="braces"&&($.comma=!0,w="|"),N({type:"comma",value:b,output:w});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 w=K[K.length-1];v.type="dots",v.output+=b,v.value+=b,w.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)!=="?"){Nr("qmark",b);continue}if(v&&v.type==="paren"){let $=j(),ee=b;if($==="<"&&!Se.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test($)||$==="<"&&!/<([!=]|\w+>)/.test(Me()))&&(ee=`\\${b}`),N({type:"text",value:b,output:ee});continue}if(r.dot!==!0&&(v.type==="slash"||v.type==="bos")){N({type:"qmark",value:b,output:pe});continue}N({type:"qmark",value:b,output:B});continue}if(b==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){Nr("negate",b);continue}if(r.nonegate!==!0&&_.index===0){Lf();continue}}if(b==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Nr("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 w=Mb.exec(Me());w&&(b+=w[0],_.index+=w[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=ie,_.backtrack=!0,_.globstar=!0,we(b);continue}let C=Me();if(r.noextglob!==!0&&/^\([^?]/.test(C)){Nr("star",b);continue}if(v.type==="star"){if(r.noglobstar===!0){we(b);continue}let w=v.prev,$=w.prev,ee=w.type==="slash"||w.type==="bos",ye=$&&($.type==="star"||$.type==="globstar");if(r.bash===!0&&(!ee||C[0]&&C[0]!=="/")){N({type:"star",value:b,output:""});continue}let se=_.braces>0&&(w.type==="comma"||w.type==="brace"),Qn=J.length&&(w.type==="pipe"||w.type==="paren");if(!ee&&w.type!=="paren"&&!se&&!Qn){N({type:"star",value:b,output:""});continue}for(;C.slice(0,3)==="/**";){let Lr=e[_.index+4];if(Lr&&Lr!=="/")break;C=C.slice(3),we("/**",3)}if(w.type==="bos"&&ge()){v.type="globstar",v.value+=b,v.output=L(r),_.output=v.output,_.globstar=!0,we(b);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!ye&&ge()){_.output=_.output.slice(0,-(w.output+v.output).length),w.output=`(?:${w.output}`,v.type="globstar",v.output=L(r)+(r.strictSlashes?")":"|$)"),v.value+=b,_.globstar=!0,_.output+=w.output+v.output,we(b);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&C[0]==="/"){let Lr=C[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(w.output+v.output).length),w.output=`(?:${w.output}`,v.type="globstar",v.output=`${L(r)}${y}|${y}${Lr})`,v.value+=b,_.output+=w.output+v.output,_.globstar=!0,we(b+Fe()),N({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&C[0]==="/"){v.type="globstar",v.value+=b,v.output=`(?:^|${y}|${L(r)}${y})`,_.output=v.output,_.globstar=!0,we(b+Fe()),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,we(b);continue}let X={type:"star",value:b,output:ie};if(r.bash===!0){X.output=".*?",(v.type==="bos"||v.type==="slash")&&(X.output=k+X.output),N(X);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&r.regex===!0){X.output=b,N(X);continue}(_.index===_.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(_.output+=A,v.output+=A):r.dot===!0?(_.output+=S,v.output+=S):(_.output+=k,v.output+=k),j()!=="*"&&(_.output+=m,v.output+=m)),N(X)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(qt("closing","]"));_.output=Se.escapeLast(_.output,"["),Et("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(qt("closing",")"));_.output=Se.escapeLast(_.output,"("),Et("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(qt("closing","}"));_.output=Se.escapeLast(_.output,"{"),Et("braces")}if(r.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let C of _.tokens)_.output+=C.output!=null?C.output:C.value,C.suffix&&(_.output+=C.suffix)}return _};yi.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(yn,r.maxLength):yn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=Nu[e]||e;let i=Se.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:m}=gn.globChars(i),g=r.dot?p:l,E=r.dot?d:l,A=r.capture?"":"?:",S={negated:!1,prefix:""},B=r.bash===!0?".*?":y;r.capture&&(B=`(${B})`);let pe=k=>k.noglobstar===!0?B:`(${A}(?:(?!${m}${k.dot?u:s}).)*?)`,q=k=>{switch(k){case"*":return`${g}${c}${B}`;case".*":return`${s}${c}${B}`;case"*.*":return`${g}${B}${s}${c}${B}`;case"*/*":return`${g}${B}${a}${c}${E}${B}`;case"**":return g+pe(r);case"**/*":return`(?:${g}${pe(r)}${a})?${E}${c}${B}`;case"**/*.*":return`(?:${g}${pe(r)}${a})?${E}${B}${s}${c}${B}`;case"**/.*":return`(?:${g}${pe(r)}${a})?${s}${c}${B}`;default:{let I=/^(.*?)\.(\w+)$/.exec(k);if(!I)return;let ie=q(I[1]);return ie?ie+s+I[2]:void 0}}},T=Se.removePrefix(e,S),L=q(T);return L&&r.strictSlashes!==!0&&(L+=`${a}?`),L};Lu.exports=yi});var Fu=x((KA,ju)=>{"use strict";var Vb=F("path"),Gb=Du(),vi=Iu(),bi=xr(),Ub=Er(),Wb=e=>e&&typeof e=="object"&&!Array.isArray(e),te=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>te(d,t,r));return d=>{for(let y of l){let m=y(d);if(m)return m}return!1}}let n=Wb(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=bi.isWindows(t),s=n?te.compileRe(e,t):te.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=te(o.ignore,l,r)}let u=(l,p=!1)=>{let{isMatch:d,match:y,output:m}=te.test(l,s,t,{glob:e,posix:i}),g={glob:e,state:a,regex:s,posix:i,input:l,output:m,match:y,isMatch:d};return typeof o.onResult=="function"&&o.onResult(g),d===!1?(g.isMatch=!1,p?g:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(g),g.isMatch=!1,p?g:!1):(typeof o.onMatch=="function"&&o.onMatch(g),p?g:!0)};return r&&(u.state=a),u};te.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?bi.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=te.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};te.matchBase=(e,t,r,n=bi.isWindows(r))=>(t instanceof RegExp?t:te.makeRe(t,r)).test(Vb.basename(e));te.isMatch=(e,t,r)=>te(t,r)(e);te.parse=(e,t)=>Array.isArray(e)?e.map(r=>te.parse(r,t)):vi(e,{...t,fastpaths:!1});te.scan=(e,t)=>Gb(e,t);te.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=te.toRegex(a,t);return n===!0&&(c.state=e),c};te.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=vi.fastpaths(e,t)),o.output||(o=vi(e,t)),te.compileRe(o,t,r,n)};te.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/$^/}};te.constants=Ub;ju.exports=te});var Bu=x((XA,Mu)=>{"use strict";Mu.exports=Fu()});var qu=x((zA,Wu)=>{"use strict";var Vu=F("util"),Gu=_u(),We=Bu(),_i=xr(),Hu=e=>e===""||e==="./",Uu=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},z=(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=We(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let y of e){let m=p(y,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.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};z.match=z;z.matcher=(e,t)=>We(e,t);z.isMatch=(e,t,r)=>We(t,r)(e);z.any=z.isMatch;z.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(z(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};z.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Vu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>z.contains(e,n,r));if(typeof t=="string"){if(Hu(e)||Hu(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return z.isMatch(e,t,{...r,contains:!0})};z.matchKeys=(e,t,r)=>{if(!_i.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=z(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};z.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=We(String(o),r);if(n.some(s=>i(s)))return!0}return!1};z.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=We(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};z.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Vu.inspect(e)}"`);return[].concat(t).every(n=>We(n,r)(e))};z.capture=(e,t,r)=>{let n=_i.isWindows(r),i=We.makeRe(String(e),{...r,capture:!0}).exec(n?_i.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};z.makeRe=(...e)=>We.makeRe(...e);z.scan=(...e)=>We.scan(...e);z.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of Gu(String(n),t))r.push(We.parse(o,t));return r};z.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Uu(e)?[e]:Gu(e,t)};z.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return z.braces(e,{...t,expand:!0})};z.hasBraces=Uu;Wu.exports=z});var rp=x(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 Yu=F("path"),qb=Fl(),Ei=qu(),Ku="**",Yb="\\",Kb=/[*?]|^!/,Xb=/\[[^[]*]/,zb=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Jb=/[!*+?@]\([^(]*\)/,Qb=/,|\.\./,Zb=/(?!^)\/{2,}/g;function Xu(e,t={}){return!zu(e,t)}O.isStaticPattern=Xu;function zu(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(Yb)||Kb.test(e)||Xb.test(e)||zb.test(e)||t.extglob!==!1&&Jb.test(e)||t.braceExpansion!==!1&&e_(e))}O.isDynamicPattern=zu;function e_(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 Qb.test(n)}function t_(e){return vn(e)?e.slice(1):e}O.convertToPositivePattern=t_;function r_(e){return"!"+e}O.convertToNegativePattern=r_;function vn(e){return e.startsWith("!")&&e[1]!=="("}O.isNegativePattern=vn;function Ju(e){return!vn(e)}O.isPositivePattern=Ju;function n_(e){return e.filter(vn)}O.getNegativePatterns=n_;function o_(e){return e.filter(Ju)}O.getPositivePatterns=o_;function i_(e){return e.filter(t=>!xi(t))}O.getPatternsInsideCurrentDirectory=i_;function s_(e){return e.filter(xi)}O.getPatternsOutsideCurrentDirectory=s_;function xi(e){return e.startsWith("..")||e.startsWith("./..")}O.isPatternRelatedToParentDirectory=xi;function a_(e){return qb(e,{flipBackslashes:!1})}O.getBaseDirectory=a_;function c_(e){return e.includes(Ku)}O.hasGlobStar=c_;function Qu(e){return e.endsWith("/"+Ku)}O.endsWithSlashGlobStar=Qu;function l_(e){let t=Yu.basename(e);return Qu(e)||Xu(t)}O.isAffectDepthOfReadingPattern=l_;function u_(e){return e.reduce((t,r)=>t.concat(Zu(r)),[])}O.expandPatternsWithBraceExpansion=u_;function Zu(e){let t=Ei.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}O.expandBraceExpansion=Zu;function p_(e,t){let{parts:r}=Ei.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=p_;function ep(e,t){return Ei.makeRe(e,t)}O.makeRe=ep;function d_(e,t){return e.map(r=>ep(r,t))}O.convertPatternsToRe=d_;function f_(e,t){return t.some(r=>r.test(e))}O.matchAny=f_;function h_(e){return e.replace(Zb,"/")}O.removeDuplicateSlashes=h_;function m_(e){let t=[],r=[];for(let n of e)tp(n)?t.push(n):r.push(n);return[t,r]}O.partitionAbsoluteAndRelative=m_;function tp(e){return Yu.isAbsolute(e)}O.isAbsolute=tp});var sp=x((QA,ip)=>{"use strict";var g_=F("stream"),np=g_.PassThrough,y_=Array.prototype.slice;ip.exports=v_;function v_(){let e=[],t=y_.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=np(n);function a(){for(let l=0,p=arguments.length;l<p;l++)e.push(op(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(m){function g(){m.removeListener("merge2UnpipeEnd",g),m.removeListener("end",g),i&&m.removeListener("error",E),d()}function E(A){s.emit("error",A)}if(m._readableState.endEmitted)return d();m.on("merge2UnpipeEnd",g),m.on("end",g),i&&m.on("error",E),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)y(l[m]);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 op(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=op(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(np(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var cp=x(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.merge=void 0;var b_=sp();function __(e){let t=b_(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>ap(e)),t.once("end",()=>ap(e)),t}bn.merge=__;function ap(e){e.forEach(t=>t.emit("close"))}});var lp=x(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.isEmpty=Yt.isString=void 0;function E_(e){return typeof e=="string"}Yt.isString=E_;function x_(e){return e===""}Yt.isEmpty=x_});var et=x(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.string=he.stream=he.pattern=he.path=he.fs=he.errno=he.array=void 0;var k_=Cl();he.array=k_;var w_=Al();he.errno=w_;var C_=Sl();he.fs=C_;var A_=Pl();he.path=A_;var S_=rp();he.pattern=S_;var R_=cp();he.stream=R_;var O_=lp();he.string=O_});var fp=x(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.convertPatternGroupToTask=me.convertPatternGroupsToTasks=me.groupPatternsByBaseDirectory=me.getNegativePatternsAsPositive=me.getPositivePatterns=me.convertPatternsToTasks=me.generate=void 0;var Ie=et();function T_(e,t){let r=up(e,t),n=up(t.ignore,t),o=pp(r),i=dp(r,n),s=o.filter(l=>Ie.pattern.isStaticPattern(l,t)),a=o.filter(l=>Ie.pattern.isDynamicPattern(l,t)),c=ki(s,i,!1),u=ki(a,i,!0);return c.concat(u)}me.generate=T_;function up(e,t){let r=e;return t.braceExpansion&&(r=Ie.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Ie.pattern.removeDuplicateSlashes(n))}function ki(e,t,r){let n=[],o=Ie.pattern.getPatternsOutsideCurrentDirectory(e),i=Ie.pattern.getPatternsInsideCurrentDirectory(e),s=wi(o),a=wi(i);return n.push(...Ci(s,t,r)),"."in a?n.push(Ai(".",i,t,r)):n.push(...Ci(a,t,r)),n}me.convertPatternsToTasks=ki;function pp(e){return Ie.pattern.getPositivePatterns(e)}me.getPositivePatterns=pp;function dp(e,t){return Ie.pattern.getNegativePatterns(e).concat(t).map(Ie.pattern.convertToPositivePattern)}me.getNegativePatternsAsPositive=dp;function wi(e){let t={};return e.reduce((r,n)=>{let o=Ie.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}me.groupPatternsByBaseDirectory=wi;function Ci(e,t,r){return Object.keys(e).map(n=>Ai(n,e[n],t,r))}me.convertPatternGroupsToTasks=Ci;function Ai(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(Ie.pattern.convertToNegativePattern))}}me.convertPatternGroupToTask=Ai});var mp=x(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.read=void 0;function P_(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){hp(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){Si(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){hp(r,i);return}Si(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),Si(r,s)})})}_n.read=P_;function hp(e,t){e(t)}function Si(e,t){e(null,t)}});var gp=x(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.read=void 0;function $_(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}}En.read=$_});var yp=x(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.createFileSystemAdapter=ft.FILE_SYSTEM_ADAPTER=void 0;var xn=F("fs");ft.FILE_SYSTEM_ADAPTER={lstat:xn.lstat,stat:xn.stat,lstatSync:xn.lstatSync,statSync:xn.statSync};function D_(e){return e===void 0?ft.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ft.FILE_SYSTEM_ADAPTER),e)}ft.createFileSystemAdapter=D_});var vp=x(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var N_=yp(),Ri=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=N_.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}};Oi.default=Ri});var St=x(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.statSync=ht.stat=ht.Settings=void 0;var bp=mp(),L_=gp(),Ti=vp();ht.Settings=Ti.default;function I_(e,t,r){if(typeof t=="function"){bp.read(e,Pi(),t);return}bp.read(e,Pi(t),r)}ht.stat=I_;function j_(e,t){let r=Pi(t);return L_.read(e,r)}ht.statSync=j_;function Pi(e={}){return e instanceof Ti.default?e:new Ti.default(e)}});var xp=x((cS,Ep)=>{var _p;Ep.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(_p||(_p=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var wp=x((lS,kp)=>{kp.exports=M_;var F_=xp();function M_(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?F_(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 $i=x(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var kn=process.versions.node.split(".");if(kn[0]===void 0||kn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Cp=Number.parseInt(kn[0],10),B_=Number.parseInt(kn[1],10),Ap=10,H_=10,V_=Cp>Ap,G_=Cp===Ap&&B_>=H_;wn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=V_||G_});var Sp=x(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.createDirentFromStats=void 0;var Di=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 U_(e,t){return new Di(e,t)}Cn.createDirentFromStats=U_});var Ni=x(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.fs=void 0;var W_=Sp();An.fs=W_});var Li=x(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.joinPathSegments=void 0;function q_(e,t,r){return e.endsWith(r)?e+t:e+r+t}Sn.joinPathSegments=q_});var Dp=x(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.readdir=mt.readdirWithFileTypes=mt.read=void 0;var Y_=St(),Rp=wp(),K_=$i(),Op=Ni(),Tp=Li();function X_(e,t,r){if(!t.stats&&K_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Pp(e,t,r);return}$p(e,t,r)}mt.read=X_;function Pp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){Rn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:Tp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){Ii(r,i);return}let s=i.map(a=>z_(a,t));Rp(s,(a,c)=>{if(a!==null){Rn(r,a);return}Ii(r,c)})})}mt.readdirWithFileTypes=Pp;function z_(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=Op.fs.createDirentFromStats(e.name,o),r(null,e)})}}function $p(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){Rn(r,n);return}let i=o.map(s=>{let a=Tp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{Y_.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let p={name:s,path:a,dirent:Op.fs.createDirentFromStats(s,l)};t.stats&&(p.stats=l),c(null,p)})}});Rp(i,(s,a)=>{if(s!==null){Rn(r,s);return}Ii(r,a)})})}mt.readdir=$p;function Rn(e,t){e(t)}function Ii(e,t){e(null,t)}});var Fp=x(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.readdir=gt.readdirWithFileTypes=gt.read=void 0;var J_=St(),Q_=$i(),Np=Ni(),Lp=Li();function Z_(e,t){return!t.stats&&Q_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Ip(e,t):jp(e,t)}gt.read=Z_;function Ip(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:Lp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=Np.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}gt.readdirWithFileTypes=Ip;function jp(e,t){return t.fs.readdirSync(e).map(n=>{let o=Lp.joinPathSegments(e,n,t.pathSegmentSeparator),i=J_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:Np.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}gt.readdir=jp});var Mp=x(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.createFileSystemAdapter=yt.FILE_SYSTEM_ADAPTER=void 0;var Kt=F("fs");yt.FILE_SYSTEM_ADAPTER={lstat:Kt.lstat,stat:Kt.stat,lstatSync:Kt.lstatSync,statSync:Kt.statSync,readdir:Kt.readdir,readdirSync:Kt.readdirSync};function eE(e){return e===void 0?yt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},yt.FILE_SYSTEM_ADAPTER),e)}yt.createFileSystemAdapter=eE});var Bp=x(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var tE=F("path"),rE=St(),nE=Mp(),ji=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=nE.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,tE.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new rE.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Fi.default=ji});var On=x(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.Settings=vt.scandirSync=vt.scandir=void 0;var Hp=Dp(),oE=Fp(),Mi=Bp();vt.Settings=Mi.default;function iE(e,t,r){if(typeof t=="function"){Hp.read(e,Bi(),t);return}Hp.read(e,Bi(t),r)}vt.scandir=iE;function sE(e,t){let r=Bi(t);return oE.read(e,r)}vt.scandirSync=sE;function Bi(e={}){return e instanceof Mi.default?e:new Mi.default(e)}});var Gp=x((bS,Vp)=>{"use strict";function aE(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}}Vp.exports=aE});var Wp=x((_S,Hi)=>{"use strict";var cE=Gp();function Up(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=cE(lE),o=null,i=null,s=0,a=null,c={push:g,drain:ke,saturated:ke,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++,A()},running:u,resume:y,idle:m,length:p,getQueue:d,unshift:E,empty:ke,kill:S,killAndDrain:B,error:q,abort:pe};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++,A();return}for(;o&&s<r;)s++,A()}}function m(){return s===0&&c.length()===0}function g(T,L){var k=n.get();k.context=e,k.release=A,k.value=T,k.callback=L||ke,k.errorHandler=a,s>=r||c.paused?i?(i.next=k,i=k):(o=k,i=k,c.saturated()):(s++,t.call(e,k.value,k.worked))}function E(T,L){var k=n.get();k.context=e,k.release=A,k.value=T,k.callback=L||ke,k.errorHandler=a,s>=r||c.paused?o?(k.next=o,o=k):(o=k,i=k,c.saturated()):(s++,t.call(e,k.value,k.worked))}function A(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=ke}function B(){o=null,i=null,c.drain(),c.drain=ke}function pe(){var T=o;for(o=null,i=null;T;){var L=T.next,k=T.callback,I=T.errorHandler,ie=T.value,_=T.context;T.value=null,T.callback=ke,T.errorHandler=null,I&&I(new Error("abort"),ie),k.call(_,new Error("abort")),T.release(T),T=L}c.drain=ke}function q(T){a=T}}function ke(){}function lE(){this.value=null,this.callback=ke,this.next=null,this.release=ke,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=ke,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function uE(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=Up(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(m,g){if(m){y(m);return}d(g)})});return p.catch(ke),p}function c(l){var p=new Promise(function(d,y){s(l,function(m,g){if(m){y(m);return}d(g)})});return p.catch(ke),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}}Hi.exports=Up;Hi.exports.promise=uE});var Tn=x(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.joinPathSegments=qe.replacePathSegmentSeparator=qe.isAppliedFilter=qe.isFatalError=void 0;function pE(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}qe.isFatalError=pE;function dE(e,t){return e===null||e(t)}qe.isAppliedFilter=dE;function fE(e,t){return e.split(/[/\\]/).join(t)}qe.replacePathSegmentSeparator=fE;function hE(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}qe.joinPathSegments=hE});var Ui=x(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var mE=Tn(),Vi=class{constructor(t,r){this._root=t,this._settings=r,this._root=mE.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Gi.default=Vi});var Yi=x(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var gE=F("events"),yE=On(),vE=Wp(),Pn=Tn(),bE=Ui(),Wi=class extends bE.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=yE.scandir,this._emitter=new gE.EventEmitter,this._queue=vE(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||!Pn.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=Pn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Pn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Pn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};qi.default=Wi});var qp=x(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var _E=Yi(),Ki=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new _E.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{EE(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{xE(t,this._storage)}),this._reader.read()}};Xi.default=Ki;function EE(e,t){e(t)}function xE(e,t){e(null,t)}});var Yp=x(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var kE=F("stream"),wE=Yi(),zi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new wE.default(this._root,this._settings),this._stream=new kE.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}};Ji.default=zi});var Kp=x(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var CE=On(),$n=Tn(),AE=Ui(),Qi=class extends AE.default{constructor(){super(...arguments),this._scandir=CE.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($n.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=$n.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),$n.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&$n.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Zi.default=Qi});var Xp=x(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var SE=Kp(),es=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new SE.default(this._root,this._settings)}read(){return this._reader.read()}};ts.default=es});var zp=x(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var RE=F("path"),OE=On(),rs=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,RE.sep),this.fsScandirSettings=new OE.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}};ns.default=rs});var Nn=x(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Settings=Ye.walkStream=Ye.walkSync=Ye.walk=void 0;var Jp=qp(),TE=Yp(),PE=Xp(),os=zp();Ye.Settings=os.default;function $E(e,t,r){if(typeof t=="function"){new Jp.default(e,Dn()).read(t);return}new Jp.default(e,Dn(t)).read(r)}Ye.walk=$E;function DE(e,t){let r=Dn(t);return new PE.default(e,r).read()}Ye.walkSync=DE;function NE(e,t){let r=Dn(t);return new TE.default(e,r).read()}Ye.walkStream=NE;function Dn(e={}){return e instanceof os.default?e:new os.default(e)}});var Ln=x(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var LE=F("path"),IE=St(),Qp=et(),is=class{constructor(t){this._settings=t,this._fsStatSettings=new IE.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return LE.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Qp.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Qp.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};ss.default=is});var ls=x(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var jE=F("stream"),FE=St(),ME=Nn(),BE=Ln(),as=class extends BE.default{constructor(){super(...arguments),this._walkStream=ME.walkStream,this._stat=FE.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))})}};cs.default=as});var Zp=x(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var HE=Nn(),VE=Ln(),GE=ls(),us=class extends VE.default{constructor(){super(...arguments),this._walkAsync=HE.walk,this._readerStream=new GE.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))})}};ps.default=us});var ed=x(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var wr=et(),ds=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 wr.pattern.getPatternParts(t,this._micromatchOptions).map(n=>wr.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:wr.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return wr.array.splitWhen(t,r=>r.dynamic&&wr.pattern.hasGlobStar(r.pattern))}};fs.default=ds});var td=x(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var UE=ed(),hs=class extends UE.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}};ms.default=hs});var rd=x(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});var In=et(),WE=td(),gs=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 WE.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(In.pattern.isAffectDepthOfReadingPattern);return In.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=In.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!In.pattern.matchAny(t,r)}};ys.default=gs});var nd=x(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var bt=et(),vs=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=bt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:bt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:bt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:bt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=bt.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=bt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=bt.pattern.matchAny(t,r);return!o&&n?bt.pattern.matchAny(t+"/",r):o}};bs.default=vs});var od=x(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});var qE=et(),_s=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return qE.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};Es.default=_s});var sd=x(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var id=et(),xs=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=id.path.makeAbsolute(this._settings.cwd,r),r=id.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};ks.default=xs});var jn=x(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});var YE=F("path"),KE=rd(),XE=nd(),zE=od(),JE=sd(),ws=class{constructor(t){this._settings=t,this.errorFilter=new zE.default(this._settings),this.entryFilter=new XE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new KE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new JE.default(this._settings)}_getRootDirectory(t){return YE.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}}};Cs.default=ws});var ad=x(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});var QE=Zp(),ZE=jn(),As=class extends ZE.default{constructor(){super(...arguments),this._reader=new QE.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)}};Ss.default=As});var cd=x(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var ex=F("stream"),tx=ls(),rx=jn(),Rs=class extends rx.default{constructor(){super(...arguments),this._reader=new tx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new ex.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)}};Os.default=Rs});var ld=x(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var nx=St(),ox=Nn(),ix=Ln(),Ts=class extends ix.default{constructor(){super(...arguments),this._walkSync=ox.walkSync,this._statSync=nx.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)}};Ps.default=Ts});var ud=x(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});var sx=ld(),ax=jn(),$s=class extends ax.default{constructor(){super(...arguments),this._reader=new sx.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)}};Ds.default=$s});var pd=x(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var Xt=F("fs"),cx=F("os"),lx=Math.max(cx.cpus().length,1);zt.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Xt.lstat,lstatSync:Xt.lstatSync,stat:Xt.stat,statSync:Xt.statSync,readdir:Xt.readdir,readdirSync:Xt.readdirSync};var Ns=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,lx),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({},zt.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};zt.default=Ns});var Fs=x((WS,fd)=>{"use strict";var dd=fp(),ux=ad(),px=cd(),dx=ud(),Ls=pd(),Pe=et();async function Is(e,t){je(e);let r=js(e,ux.default,t),n=await Promise.all(r);return Pe.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){je(u);let p=js(u,dx.default,l);return Pe.array.flatten(p)}e.sync=t;function r(u,l){je(u);let p=js(u,px.default,l);return Pe.stream.merge(p)}e.stream=r;function n(u,l){je(u);let p=[].concat(u),d=new Ls.default(l);return dd.generate(p,d)}e.generateTasks=n;function o(u,l){je(u);let p=new Ls.default(l);return Pe.pattern.isDynamicPattern(u,p)}e.isDynamicPattern=o;function i(u){return je(u),Pe.path.escape(u)}e.escapePath=i;function s(u){return je(u),Pe.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(d){return je(d),Pe.path.escapePosixPath(d)}u.escapePath=l;function p(d){return je(d),Pe.path.convertPosixPathToPattern(d)}u.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(u){function l(d){return je(d),Pe.path.escapeWindowsPath(d)}u.escapePath=l;function p(d){return je(d),Pe.path.convertWindowsPathToPattern(d)}u.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(Is||(Is={}));function js(e,t,r){let n=[].concat(e),o=new Ls.default(r),i=dd.generate(n,o),s=new t(o);return i.map(s.read,s)}function je(e){if(![].concat(e).every(n=>Pe.string.isString(n)&&!Pe.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}fd.exports=Is});import fx from"node:fs";import hx from"node:fs/promises";async function Ms(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await hx[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Bs(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return fx[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var KS,hd,XS,zS,md,JS,gd=ct(()=>{KS=Ms.bind(void 0,"stat","isFile"),hd=Ms.bind(void 0,"stat","isDirectory"),XS=Ms.bind(void 0,"lstat","isSymbolicLink"),zS=Bs.bind(void 0,"statSync","isFile"),md=Bs.bind(void 0,"statSync","isDirectory"),JS=Bs.bind(void 0,"lstatSync","isSymbolicLink")});var yd=ct(()=>{});import{promisify as mx}from"node:util";import{execFile as gx,execFileSync as r0}from"node:child_process";import{fileURLToPath as yx}from"node:url";function Cr(e){return e instanceof URL?yx(e):e}var o0,i0,Hs=ct(()=>{yd();o0=mx(gx);i0=10*1024*1024});var Ad=x((c0,Bn)=>{function _d(e){return Array.isArray(e)?e:[e]}var vx=void 0,Gs="",vd=" ",Vs="\\",bx=/^\s+$/,_x=/(?:[^\\]|^)\\$/,Ex=/^\\!/,xx=/^\\#/,kx=/\r?\n/g,wx=/^\.{0,2}\/|^\.{1,2}$/,Cx=/\/$/,Jt="/",Ed="node-ignore";typeof Symbol<"u"&&(Ed=Symbol.for("node-ignore"));var xd=Ed,Qt=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),Ax=/([0-z])-([0-z])/g,kd=()=>!1,Sx=e=>e.replace(Ax,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Gs),Rx=e=>{let{length:t}=e;return e.slice(0,t-t%2)},Ox=[[/^\uFEFF/,()=>Gs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?vd:Gs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+vd}],[/[\\$.|*+(){^]/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,()=>Vs],[/\\\\/g,()=>Vs],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===Vs?`\\[${r}${Rx(n)}${o}`:o==="]"&&n.length%2===0?`[${Sx(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],Tx=/(^|\\\/)?\\\*$/,Ar="regex",Fn="checkRegex",bd="_",Px={[Ar](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Fn](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},$x=e=>Ox.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Mn=e=>typeof e=="string",Dx=e=>e&&Mn(e)&&!bx.test(e)&&!_x.test(e)&&e.indexOf("#")!==0,Nx=e=>e.split(kx).filter(Boolean),Us=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Qt(this,"body",n),Qt(this,"ignoreCase",o),Qt(this,"regexPrefix",s)}get regex(){let t=bd+Ar;return this[t]?this[t]:this._make(Ar,t)}get checkRegex(){let t=bd+Fn;return this[t]?this[t]:this._make(Fn,t)}_make(t,r){let n=this.regexPrefix.replace(Tx,Px[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Qt(this,r,o)}},Lx=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(Ex,"!").replace(xx,"#");let i=$x(o);return new Us(e,t,o,r,n,i)},Ws=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[xd]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Mn(t)&&(t={pattern:t}),Dx(t.pattern)){let r=Lx(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,_d(Mn(t)?Nx(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?vx:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},Ix=(e,t)=>{throw new t(e)},tt=(e,t,r)=>Mn(e)?e?tt.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),wd=e=>wx.test(e);tt.isNotRelative=wd;tt.convert=e=>e;var qs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Qt(this,xd,!0),this._rules=new Ws(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&&tt.convert(t);return tt(i,t,this._strictPathCheck?Ix:kd),this._t(i,r,n,o)}checkIgnore(t){if(!Cx.test(t))return this.test(t);let r=t.split(Jt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Jt)+Jt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Fn)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Jt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,Ar);let i=this._t(o.join(Jt)+Jt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,Ar)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return _d(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Ys=e=>new qs(e),jx=e=>tt(e&&tt.convert(e),e,kd),Cd=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");tt.convert=e;let t=/^[a-z]:\//i;tt.isNotRelative=r=>t.test(r)||wd(r)};typeof process<"u"&&process.platform==="win32"&&Cd();Bn.exports=Ys;Ys.default=Ys;Bn.exports.isPathValid=jx;Qt(Bn.exports,Symbol.for("setupWindows"),Cd)});function Zt(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var Sd=ct(()=>{});var Sr,Ks=ct(()=>{Sr=e=>e[0]==="!"});import Fx from"node:process";import Mx from"node:fs";import Bx from"node:fs/promises";import er from"node:path";var Xs,Rd,Hx,Od,Hn,Vx,Gx,Ux,Td,Pd,Rr,Or,$d,Dd,zs=ct(()=>{Xs=ir(Fs(),1),Rd=ir(Ad(),1);Sd();Hs();Ks();Hx=["**/node_modules","**/flow-typed","**/coverage","**/.git"],Od={absolute:!0,dot:!0},Hn="**/.gitignore",Vx=(e,t)=>Sr(e)?"!"+er.posix.join(t,e.slice(1)):er.posix.join(t,e),Gx=(e,t)=>{let r=Zt(er.relative(t,er.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>Vx(n,r))},Ux=(e,t)=>{if(t=Zt(t),er.isAbsolute(e)){if(Zt(e).startsWith(t))return er.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},Td=(e,t)=>{let r=e.flatMap(o=>Gx(o,t)),n=(0,Rd.default)().add(r);return o=>(o=Cr(o),o=Ux(o,t),o?n.ignores(Zt(o)):!1)},Pd=(e={})=>({cwd:Cr(e.cwd)??Fx.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...Hx]}),Rr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=Pd(t),s=await(0,Xs.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...Od}),a=await Promise.all(s.map(async c=>({filePath:c,content:await Bx.readFile(c,"utf8")})));return Td(a,r)},Or=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=Pd(t),a=Xs.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...Od}).map(c=>({filePath:c,content:Mx.readFileSync(c,"utf8")}));return Td(a,r)},$d=e=>Rr(Hn,e),Dd=e=>Or(Hn,e)});var Kd={};Vf(Kd,{convertPathToPattern:()=>tk,generateGlobTasks:()=>Zx,generateGlobTasksSync:()=>ek,globby:()=>Xx,globbyStream:()=>Jx,globbySync:()=>zx,isDynamicPattern:()=>Qx,isGitIgnored:()=>$d,isGitIgnoredSync:()=>Dd,isIgnoredByIgnoreFiles:()=>Rr,isIgnoredByIgnoreFilesSync:()=>Or});import Id from"node:process";import Wx from"node:fs";import tr from"node:path";var rr,qx,jd,Fd,Nd,Ld,Js,Yx,Md,Bd,Vn,Hd,Kx,Vd,Gd,Ud,Wd,qd,Yd,Qs,Xx,zx,Jx,Qx,Zx,ek,tk,Xd=ct(()=>{wl();rr=ir(Fs(),1);gd();Hs();zs();Ks();zs();qx=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},jd=(e,t)=>{let r=Sr(e)?e.slice(1):e;return tr.isAbsolute(r)?r:tr.join(t,r)},Fd=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>tr.posix.join(e,`**/${tr.extname(o)?o:`${o}${n}`}`)):[tr.posix.join(e,`**${n?`/*${n}`:""}`)]},Nd=async(e,{cwd:t=Id.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await hd(jd(i,t))?Fd({directoryPath:i,files:r,extensions:n}):i))).flat(),Ld=(e,{cwd:t=Id.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>md(jd(o,t))?Fd({directoryPath:o,files:r,extensions:n}):o),Js=e=>(e=[...new Set([e].flat())],qx(e),e),Yx=e=>{if(!e)return;let t;try{t=Wx.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},Md=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:Cr(e.cwd)},Yx(e.cwd),e),Bd=e=>async(t,r)=>e(Js(t),Md(r)),Vn=e=>(t,r)=>e(Js(t),Md(r)),Hd=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?Js(t):[];return r&&n.push(Hn),n},Kx=async e=>{let t=Hd(e);return Gd(t.length>0&&await Rr(t,e))},Vd=e=>{let t=Hd(e);return Gd(t.length>0&&Or(t,e))},Gd=e=>{let t=new Set;return r=>{let n=tr.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Ud=(e,t)=>e.flat().filter(r=>t(r)),Wd=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>Sr(i));if(n===-1){r.push({patterns:e,options:t});break}let o=e[n].slice(1);for(let i of r)i.options.ignore.push(o);n!==0&&r.push({patterns:e.slice(0,n),options:{...t,ignore:[...t.ignore,o]}}),e=e.slice(n+1)}return r},qd=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Yd=async(e,t)=>{let r=Wd(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=qd(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([Nd(a,i),Nd(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Qs=(e,t)=>{let r=Wd(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=qd(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=Ld(a,i),c.ignore=Ld(c.ignore,{cwd:n}),{patterns:a,options:c}})},Xx=Bd(async(e,t)=>{let[r,n]=await Promise.all([Yd(e,t),Kx(t)]),o=await Promise.all(r.map(i=>(0,rr.default)(i.patterns,i.options)));return Ud(o,n)}),zx=Vn((e,t)=>{let r=Qs(e,t),n=Vd(t),o=r.map(i=>rr.default.sync(i.patterns,i.options));return Ud(o,n)}),Jx=Vn((e,t)=>{let r=Qs(e,t),n=Vd(t),o=r.map(s=>rr.default.stream(s.patterns,s.options));return ei(o).filter(s=>n(s))}),Qx=Vn((e,t)=>e.some(r=>rr.default.isDynamicPattern(r,t))),Zx=Bd(Yd),ek=Vn(Qs),{convertPathToPattern:tk}=rr.default});var Be=["frontend","backend"],eo=["workbench.frontend","workbench.backend"],Ir=[...Be,...eo];var la=(e=0)=>t=>`\x1B[${t+e}m`,ua=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,pa=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Q={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]}},fw=Object.keys(Q.modifier),Uf=Object.keys(Q.color),Wf=Object.keys(Q.bgColor),hw=[...Uf,...Wf];function qf(){let e=new Map;for(let[t,r]of Object.entries(Q)){for(let[n,o]of Object.entries(r))Q[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Q[n],e.set(o[0],o[1]);Object.defineProperty(Q,t,{value:r,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:e,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=la(),Q.color.ansi256=ua(),Q.color.ansi16m=pa(),Q.bgColor.ansi=la(10),Q.bgColor.ansi256=ua(10),Q.bgColor.ansi16m=pa(10),Object.defineProperties(Q,{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=>Q.rgbToAnsi256(...Q.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)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>Q.ansi256ToAnsi(Q.hexToAnsi256(t)),enumerable:!1}}),Q}var Yf=qf(),Ne=Yf;import to from"node:process";import Kf from"node:os";import da from"node:tty";function Re(e,t=globalThis.Deno?globalThis.Deno.args:to.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:Z}=to,jr;Re("no-color")||Re("no-colors")||Re("color=false")||Re("color=never")?jr=0:(Re("color")||Re("colors")||Re("color=true")||Re("color=always"))&&(jr=1);function Xf(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function zf(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Jf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Xf();n!==void 0&&(jr=n);let o=r?jr:n;if(o===0)return 0;if(r){if(Re("color=16m")||Re("color=full")||Re("color=truecolor"))return 3;if(Re("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(Z.TERM==="dumb")return i;if(to.platform==="win32"){let s=Kf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Z)||Z.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let s=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:i}function fa(e,t={}){let r=Jf(e,{streamIsTTY:e&&e.isTTY,...t});return zf(r)}var Qf={stdout:fa({isTTY:da.isatty(1)}),stderr:fa({isTTY:da.isatty(2)})},ha=Qf;function ma(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 ga(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
32
  `:`
33
33
  `)+r,o=n+1,n=e.indexOf(`
34
- `,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:ra,stderr:na}=Zs,Gn=Symbol("GENERATOR"),kt=Symbol("STYLER"),Kt=Symbol("IS_EMPTY"),oa=["ansi","ansi","ansi256","ansi16m"],xt=Object.create(null),$f=(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=ra?ra.level:0;e.level=t.level===void 0?r:t.level};var Df=e=>{let t=(...r)=>r.join(" ");return $f(t,e),Object.setPrototypeOf(t,Xt.prototype),t};function Xt(e){return Df(e)}Object.setPrototypeOf(Xt.prototype,Function.prototype);for(let[e,t]of Object.entries(Te))xt[e]={get(){let r=Cr(this,Un(t.open,t.close,this[kt]),this[Kt]);return Object.defineProperty(this,e,{value:r}),r}};xt.visible={get(){let e=Cr(this,this[kt],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Wn=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Te[r].ansi16m(...n):t==="ansi256"?Te[r].ansi256(Te.rgbToAnsi256(...n)):Te[r].ansi(Te.rgbToAnsi(...n)):e==="hex"?Wn("rgb",t,r,...Te.hexToRgb(...n)):Te[r][e](...n),Nf=["rgb","hex","ansi256"];for(let e of Nf){xt[e]={get(){let{level:r}=this;return function(...n){let o=Un(Wn(e,oa[r],"color",...n),Te.color.close,this[kt]);return Cr(this,o,this[Kt])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);xt[t]={get(){let{level:r}=this;return function(...n){let o=Un(Wn(e,oa[r],"bgColor",...n),Te.bgColor.close,this[kt]);return Cr(this,o,this[Kt])}}}}var Lf=Object.defineProperties(()=>{},{...xt,level:{enumerable:!0,get(){return this[Gn].level},set(e){this[Gn].level=e}}}),Un=(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}},Cr=(e,t,r)=>{let n=(...o)=>If(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Lf),n[Gn]=e,n[kt]=t,n[Kt]=r,n},If=(e,t)=>{if(e.level<=0||!t)return e[Kt]?"":t;let r=e[kt];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=ea(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
35
- `);return i!==-1&&(t=ta(t,o,n,i)),n+t+o};Object.defineProperties(Xt.prototype,xt);var jf=Xt(),Nx=Xt({level:na?na.level:0});var h=jf;var ya=Yt(ga(),1),{program:Gx,createCommand:Wx,createArgument:Ux,createOption:qx,CommanderError:Yx,InvalidArgumentError:Kx,InvalidOptionArgumentError:Xx,Command:ba,Argument:zx,Option:Qx,Help:Jx}=ya.default;import vr from"fs-extra";import qt from"path";var Pa=Yt(Ca(),1);import vh from"chokidar";import Nr from"fs-extra";import Zt from"path";import qe from"fs-extra";import mt from"path";var po=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 po;var Aa=async(e,t)=>{try{await qe.ensureDir(mt.dirname(e)),await qe.pathExists(e)&&(await qe.stat(e)).isDirectory()&&(console.warn(h.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await qe.remove(e)),await qe.writeFile(e,t)}catch(r){throw f.error(` Error writing file ${e}: ${r.message}`),r}},Tr=async(e,t)=>{f.debug("Generating service configuration files...");let r=mt.join(t,"backend"),n=mt.join(t,"frontend");await qe.ensureDir(r),await qe.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=`
36
- // Generated Raclette Backend Configuration
37
- // This file is auto-generated, do not edit directly
38
-
39
- export const racletteConfig = ${JSON.stringify(i,null,2)};
40
-
41
- export default racletteConfig;
42
- `;await Aa(mt.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
43
- // Generated Raclette Frontend Configuration
44
- // This file is auto-generated, do not edit directly
45
-
46
- export const racletteConfig = ${JSON.stringify(a,null,2)};
34
+ `,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:ya,stderr:va}=ha,ro=Symbol("GENERATOR"),Pt=Symbol("STYLER"),sr=Symbol("IS_EMPTY"),ba=["ansi","ansi","ansi256","ansi16m"],$t=Object.create(null),Zf=(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=ya?ya.level:0;e.level=t.level===void 0?r:t.level};var eh=e=>{let t=(...r)=>r.join(" ");return Zf(t,e),Object.setPrototypeOf(t,ar.prototype),t};function ar(e){return eh(e)}Object.setPrototypeOf(ar.prototype,Function.prototype);for(let[e,t]of Object.entries(Ne))$t[e]={get(){let r=Fr(this,oo(t.open,t.close,this[Pt]),this[sr]);return Object.defineProperty(this,e,{value:r}),r}};$t.visible={get(){let e=Fr(this,this[Pt],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var no=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Ne[r].ansi16m(...n):t==="ansi256"?Ne[r].ansi256(Ne.rgbToAnsi256(...n)):Ne[r].ansi(Ne.rgbToAnsi(...n)):e==="hex"?no("rgb",t,r,...Ne.hexToRgb(...n)):Ne[r][e](...n),th=["rgb","hex","ansi256"];for(let e of th){$t[e]={get(){let{level:r}=this;return function(...n){let o=oo(no(e,ba[r],"color",...n),Ne.color.close,this[Pt]);return Fr(this,o,this[sr])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);$t[t]={get(){let{level:r}=this;return function(...n){let o=oo(no(e,ba[r],"bgColor",...n),Ne.bgColor.close,this[Pt]);return Fr(this,o,this[sr])}}}}var rh=Object.defineProperties(()=>{},{...$t,level:{enumerable:!0,get(){return this[ro].level},set(e){this[ro].level=e}}}),oo=(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}},Fr=(e,t,r)=>{let n=(...o)=>nh(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,rh),n[ro]=e,n[Pt]=t,n[sr]=r,n},nh=(e,t)=>{if(e.level<=0||!t)return e[sr]?"":t;let r=e[Pt];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=ma(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
35
+ `);return i!==-1&&(t=ga(t,o,n,i)),n+t+o};Object.defineProperties(ar.prototype,$t);var oh=ar(),ww=ar({level:va?va.level:0});var h=oh;var $a=ir(Pa(),1),{program:Dw,createCommand:Nw,createArgument:Lw,createOption:Iw,CommanderError:jw,InvalidArgumentError:Fw,InvalidOptionArgumentError:Mw,Command:Da,Argument:Bw,Option:Hw,Help:Vw}=$a.default;function U(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function He(e){return function t(r){return arguments.length===0||U(r)?t:e.apply(this,arguments)}}function Ve(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return U(r)?t:He(function(o){return e(r,o)});default:return U(r)&&U(n)?t:U(r)?He(function(o){return e(o,n)}):U(n)?He(function(o){return e(r,o)}):e(r,n)}}}function lr(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return U(r)?t:Ve(function(i,s){return e(r,i,s)});case 2:return U(r)&&U(n)?t:U(r)?Ve(function(i,s){return e(i,n,s)}):U(n)?Ve(function(i,s){return e(r,i,s)}):He(function(i){return e(r,n,i)});default:return U(r)&&U(n)&&U(o)?t:U(r)&&U(n)?Ve(function(i,s){return e(i,s,o)}):U(r)&&U(o)?Ve(function(i,s){return e(i,n,s)}):U(n)&&U(o)?Ve(function(i,s){return e(r,i,s)}):U(r)?He(function(i){return e(i,n,o)}):U(n)?He(function(i){return e(r,i,o)}):U(o)?He(function(i){return e(r,n,i)}):e(r,n,o)}}}function Dt(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Vr(e){return Object.prototype.toString.call(e)==="[object Object]"}var _h=lr(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)Dt(i,r)&&(o[i]=Dt(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)Dt(i,n)&&!Dt(i,o)&&(o[i]=n[i]);return o}),Na=_h;var Eh=lr(function e(t,r,n){return Na(function(o,i,s){return Vr(i)&&Vr(s)?e(t,i,s):t(o,i,s)},r,n)}),La=Eh;var xh=Ve(function(t,r){return La(function(n,o,i){return i},t,r)}),lt=xh;import _t from"fs-extra";import or from"path";function Ja(e){return typeof e>"u"||e===null}function kh(e){return typeof e=="object"&&e!==null}function wh(e){return Array.isArray(e)?e:Ja(e)?[]:[e]}function Ch(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 Ah(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Sh(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Rh=Ja,Oh=kh,Th=wh,Ph=Ah,$h=Sh,Dh=Ch,ae={isNothing:Rh,isObject:Oh,toArray:Th,repeat:Ph,isNegativeZero:$h,extend:Dh};function Qa(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+=`
47
36
 
48
- export default racletteConfig;
49
- `;await Aa(mt.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var Pr=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},$r=async(e,t=process.cwd())=>{let r=mt.join(t,".raclette"),n=mt.join(r,"raclette.config.workbench.js");await qe.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
50
-
51
- export default defineRacletteConfig(${JSON.stringify(e,null,2)})
52
- `;return await qe.writeFile(n,o,"utf8"),n};function G(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function je(e){return function t(r){return arguments.length===0||G(r)?t:e.apply(this,arguments)}}function Fe(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return G(r)?t:je(function(o){return e(r,o)});default:return G(r)&&G(n)?t:G(r)?je(function(o){return e(o,n)}):G(n)?je(function(o){return e(r,o)}):e(r,n)}}}function Jt(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return G(r)?t:Fe(function(i,s){return e(r,i,s)});case 2:return G(r)&&G(n)?t:G(r)?Fe(function(i,s){return e(i,n,s)}):G(n)?Fe(function(i,s){return e(r,i,s)}):je(function(i){return e(r,n,i)});default:return G(r)&&G(n)&&G(o)?t:G(r)&&G(n)?Fe(function(i,s){return e(i,s,o)}):G(r)&&G(o)?Fe(function(i,s){return e(i,n,s)}):G(n)&&G(o)?Fe(function(i,s){return e(r,i,s)}):G(r)?je(function(i){return e(i,n,o)}):G(n)?je(function(i){return e(r,i,o)}):G(o)?je(function(i){return e(r,n,i)}):e(r,n,o)}}}function Ct(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Dr(e){return Object.prototype.toString.call(e)==="[object Object]"}var gh=Jt(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)Ct(i,r)&&(o[i]=Ct(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)Ct(i,n)&&!Ct(i,o)&&(o[i]=n[i]);return o}),Sa=gh;var yh=Jt(function e(t,r,n){return Sa(function(o,i,s){return Dr(i)&&Dr(s)?e(t,i,s):t(o,i,s)},r,n)}),Ra=yh;var bh=Fe(function(t,r){return Ra(function(n,o,i){return i},t,r)}),gt=bh;var Oa={name:"raclette-app",services:{frontend:{enabled:!0,port:8081,installPackages:[]},backend:{enabled:!0,port:8082,enableDebug:!1,installPackages:[]},mongodb:{enabled:!0,port:27017},cache:{enabled:!0,port:6379},workbench:{enabled:!1,frontendPort:8083,backendPort:8084}},modules:[],plugins:[],env:{development:{},production:{NODE_ENV:"production"}},global:{requireAuthentication:!0},frontend:{framework:"vue",i18n:{locales:["en-EU"],priorities:{app:10,".":30}},vue:{plugins:[]}},backend:{sockets:{autoSend:{compositions:!0,interactionLinks:!0,projectConfig:!0},security:{requireAuth:!0,tokenValidation:"jwt"},options:{adapter:"memory",connectionTimeout:3e3,pingInterval:1500,pingTimeout:1e3}}},sourceDirectories:[],packageMerging:{frontend:[{file:"./packages.json",key:"frontend"}],backend:[{file:"./packages.json",key:"backend"}]},lockFiles:{frontend:"./app.frontend.yarn.lock",backend:"./app.backend.yarn.lock"}},_h=async e=>{let t=e==="production"?".env.production":".env",r=Zt.join(process.cwd(),t);if(process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=process.cwd()),await Nr.pathExists(r)){let n=await Nr.readFile(r,"utf-8"),o=Pa.parse(n);return Object.entries(o).forEach(([i,s])=>{process.env[i]=s}),console.log(h.blue(`\u{1F4C4} Loaded ${Object.keys(o).length} environment variables from ${t}`)),{...o,RACLETTE_APP_PATH:process.env.RACLETTE_APP_PATH}}return{}},Ta=async e=>{try{let{pathToFileURL:t}=await import("url"),n=`${t(e).href}?t=${Date.now()}`;I.cache[e]&&delete I.cache[e];let o=await import(n);return o.default||o}catch(t){throw console.error(h.red(`Error loading config from ${e}:`),t),t}},Lr=e=>{if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e)){let t=Number(e);if(!isNaN(t))return t}if(/^\d+\.\d+$/.test(e)){let t=Number(e);if(!isNaN(t))return t}return e}if(Array.isArray(e))return e.map(t=>Lr(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=Lr(n);return t}return e},Pe=async(e="",t="development")=>{let r=Zt.join(process.cwd(),"raclette.config.js"),n=Zt.join(process.cwd(),".raclette");if(!await Nr.pathExists(r))return console.warn("No raclette.config.js found, using default configuration"),Oa;let o=await _h(t),i=await Ta(r),s=Lr(i),a={env:{}};if(e){let u=await Ta(e);a=Lr(u)}let c=gt(gt(Oa,s),gt(a,{env:{[t]:o}}));return await Eh(c,n),await Tr(c,n),c},Eh=async(e,t)=>{let r=`// Generated Raclette Configuration
53
- // This file is auto-generated from the merged configuration
54
- // Do not edit directly
55
-
56
- export default ${JSON.stringify(e,null,2)};
57
- `;await Nr.writeFile(Zt.join(t,"raclette.config.js"),r),f.success("raclette Configuration file generated")},$a=()=>{let e=Zt.join(process.cwd(),"raclette.config.js");f.progress(`\u{1F50D} Watching for changes in original config: ${e}`);let t=vh.watch(e,{ignored:/(^|[/\\])\../,persistent:!0});return t.on("change",async r=>{f.progress(`\u{1F4DD} Original config file changed: ${r}`);try{await Pe()}catch(n){f.error("Error reloading configuration: "+n.message)}}),()=>t.close()};import{spawn as Ms}from"child_process";import Fs,{pathExists as Tk}from"fs-extra";import Je from"path";import Ur from"fs-extra";function Ka(e){return typeof e>"u"||e===null}function kh(e){return typeof e=="object"&&e!==null}function xh(e){return Array.isArray(e)?e:Ka(e)?[]:[e]}function wh(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 Ch(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Ah(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Sh=Ka,Rh=kh,Oh=xh,Th=Ch,Ph=Ah,$h=wh,ae={isNothing:Sh,isObject:Rh,toArray:Oh,repeat:Th,isNegativeZero:Ph,extend:$h};function Xa(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+=`
58
-
59
- `+e.mark.snippet),n+" "+r):n}function tr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Xa(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}tr.prototype=Object.create(Error.prototype);tr.prototype.constructor=tr;tr.prototype.toString=function(t){return this.name+": "+Xa(this,t)};var ge=tr;function fo(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 ho(e,t){return ae.repeat(" ",t-e.length)+e}function Dh(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,d=t.maxLength-(t.indent+l+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)u=fo(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),d),a=ae.repeat(" ",t.indent)+ho((e.line-c+1).toString(),l)+" | "+u.str+`
60
- `+a;for(u=fo(e.buffer,n[s],o[s],e.position,d),a+=ae.repeat(" ",t.indent)+ho((e.line+1).toString(),l)+" | "+u.str+`
37
+ `+e.mark.snippet),n+" "+r):n}function pr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Qa(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}pr.prototype=Object.create(Error.prototype);pr.prototype.constructor=pr;pr.prototype.toString=function(t){return this.name+": "+Qa(this,t)};var ve=pr;function ko(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 wo(e,t){return ae.repeat(" ",t-e.length)+e}function Nh(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=ko(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),p),a=ae.repeat(" ",t.indent)+wo((e.line-c+1).toString(),l)+" | "+u.str+`
38
+ `+a;for(u=ko(e.buffer,n[s],o[s],e.position,p),a+=ae.repeat(" ",t.indent)+wo((e.line+1).toString(),l)+" | "+u.str+`
61
39
  `,a+=ae.repeat("-",t.indent+l+3+u.pos)+`^
62
- `,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=fo(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),d),a+=ae.repeat(" ",t.indent)+ho((e.line+c+1).toString(),l)+" | "+u.str+`
63
- `;return a.replace(/\n$/,"")}var Nh=Dh,Lh=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ih=["scalar","sequence","mapping"];function jh(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Fh(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Lh.indexOf(r)===-1)throw new ge('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=jh(t.styleAliases||null),Ih.indexOf(this.kind)===-1)throw new ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ue=Fh;function Da(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 Mh(){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 go(e){return this.extend(e)}go.prototype.extend=function(t){var r=[],n=[];if(t instanceof ue)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 ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof ue))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new ge("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 ge("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 ue))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(go.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=Da(o,"implicit"),o.compiledExplicit=Da(o,"explicit"),o.compiledTypeMap=Mh(o.compiledImplicit,o.compiledExplicit),o};var za=go,Qa=new ue("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ja=new ue("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Za=new ue("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),ec=new za({explicit:[Qa,Ja,Za]});function Bh(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Hh(){return null}function Vh(e){return e===null}var tc=new ue("tag:yaml.org,2002:null",{kind:"scalar",resolve:Bh,construct:Hh,predicate:Vh,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Gh(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 Wh(e){return e==="true"||e==="True"||e==="TRUE"}function Uh(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var rc=new ue("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Gh,construct:Wh,predicate:Uh,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 qh(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Yh(e){return 48<=e&&e<=55}function Kh(e){return 48<=e&&e<=57}function Xh(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(!qh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Yh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Kh(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function zh(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 Qh(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ae.isNegativeZero(e)}var nc=new ue("tag:yaml.org,2002:int",{kind:"scalar",resolve:Xh,construct:zh,predicate:Qh,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"]}}),Jh=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Zh(e){return!(e===null||!Jh.test(e)||e[e.length-1]==="_")}function em(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 tm=/^[-+]?[0-9]+e/;function rm(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(ae.isNegativeZero(e))return"-0.0";return r=e.toString(10),tm.test(r)?r.replace("e",".e"):r}function nm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ae.isNegativeZero(e))}var oc=new ue("tag:yaml.org,2002:float",{kind:"scalar",resolve:Zh,construct:em,predicate:nm,represent:rm,defaultStyle:"lowercase"}),ic=ec.extend({implicit:[tc,rc,nc,oc]}),sc=ic,ac=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cc=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 om(e){return e===null?!1:ac.exec(e)!==null||cc.exec(e)!==null}function im(e){var t,r,n,o,i,s,a,c=0,u=null,l,d,p;if(t=ac.exec(e),t===null&&(t=cc.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],d=+(t[11]||0),u=(l*60+d)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&p.setTime(p.getTime()-u),p}function sm(e){return e.toISOString()}var lc=new ue("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:om,construct:im,instanceOf:Date,represent:sm});function am(e){return e==="<<"||e===null}var uc=new ue("tag:yaml.org,2002:merge",{kind:"scalar",resolve:am}),Eo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
64
- \r`;function cm(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Eo;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 lm(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Eo,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 um(e){var t="",r=0,n,o,i=e.length,s=Eo;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 dm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var dc=new ue("tag:yaml.org,2002:binary",{kind:"scalar",resolve:cm,construct:lm,predicate:dm,represent:um}),pm=Object.prototype.hasOwnProperty,fm=Object.prototype.toString;function hm(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,fm.call(o)!=="[object Object]")return!1;for(i in o)if(pm.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 mm(e){return e!==null?e:[]}var pc=new ue("tag:yaml.org,2002:omap",{kind:"sequence",resolve:hm,construct:mm}),gm=Object.prototype.toString;function ym(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],gm.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function bm(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 fc=new ue("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ym,construct:bm}),vm=Object.prototype.hasOwnProperty;function _m(e){if(e===null)return!0;var t,r=e;for(t in r)if(vm.call(r,t)&&r[t]!==null)return!1;return!0}function Em(e){return e!==null?e:{}}var hc=new ue("tag:yaml.org,2002:set",{kind:"mapping",resolve:_m,construct:Em}),ko=sc.extend({implicit:[lc,uc],explicit:[dc,pc,fc,hc]}),ot=Object.prototype.hasOwnProperty,Ir=1,mc=2,gc=3,jr=4,mo=1,km=2,Na=3,xm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,wm=/[\x85\u2028\u2029]/,Cm=/[,\[\]\{\}]/,yc=/^(?:!|!!|![a-z\-]+!)$/i,bc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function La(e){return Object.prototype.toString.call(e)}function Me(e){return e===10||e===13}function bt(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function St(e){return e===44||e===91||e===93||e===123||e===125}function Am(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Sm(e){return e===120?2:e===117?4:e===85?8:0}function Rm(e){return 48<=e&&e<=57?e-48:-1}function Ia(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
65
- `: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 Om(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var vc=new Array(256),_c=new Array(256);for(yt=0;yt<256;yt++)vc[yt]=Ia(yt)?1:0,_c[yt]=Ia(yt);var yt;function Tm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ko,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 Ec(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=Nh(r),new ge(t,r)}function C(e,t){throw Ec(e,t)}function Fr(e,t){e.onWarning&&e.onWarning.call(null,Ec(e,t))}var ja={YAML:function(t,r,n){var o,i,s;t.version!==null&&C(t,"duplication of %YAML directive"),n.length!==1&&C(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&C(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&C(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Fr(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&C(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],yc.test(o)||C(t,"ill-formed tag handle (first argument) of the TAG directive"),ot.call(t.tagMap,o)&&C(t,'there is a previously declared suffix for "'+o+'" tag handle'),bc.test(i)||C(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{C(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};function nt(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||C(e,"expected valid JSON character");else xm.test(a)&&C(e,"the stream contains non-printable characters");e.result+=a}}function Fa(e,t,r,n){var o,i,s,a;for(ae.isObject(r)||C(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],ot.call(t,i)||(t[i]=r[i],n[i]=!0)}function Rt(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])&&C(e,"nested arrays are not supported inside keys"),typeof o=="object"&&La(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&La(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)Fa(e,t,i[u],r);else Fa(e,t,i,r);else!e.json&&!ot.call(r,o)&&ot.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,C(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:i}):t[o]=i,delete r[o];return t}function xo(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++):C(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ne(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;bt(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(Me(o))for(xo(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&&Fr(e,"deficient indentation"),n}function Hr(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||be(r)))}function wo(e,t){t===1?e.result+=" ":t>1&&(e.result+=ae.repeat(`
66
- `,t-1))}function Pm(e,t,r){var n,o,i,s,a,c,u,l,d=e.kind,p=e.result,g;if(g=e.input.charCodeAt(e.position),be(g)||St(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(o=e.input.charCodeAt(e.position+1),be(o)||r&&St(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;g!==0;){if(g===58){if(o=e.input.charCodeAt(e.position+1),be(o)||r&&St(o))break}else if(g===35){if(n=e.input.charCodeAt(e.position-1),be(n))break}else{if(e.position===e.lineStart&&Hr(e)||r&&St(g))break;if(Me(g))if(c=e.line,u=e.lineStart,l=e.lineIndent,ne(e,!1,-1),e.lineIndent>=t){a=!0,g=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=l;break}}a&&(nt(e,i,s,!1),wo(e,e.line-c),i=s=e.position,a=!1),bt(g)||(s=e.position+1),g=e.input.charCodeAt(++e.position)}return nt(e,i,s,!1),e.result?!0:(e.kind=d,e.result=p,!1)}function $m(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(nt(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 Me(r)?(nt(e,n,o,!0),wo(e,ne(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Hr(e)?C(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);C(e,"unexpected end of the stream within a single quoted scalar")}function Dm(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 nt(e,r,e.position,!0),e.position++,!0;if(a===92){if(nt(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Me(a))ne(e,!1,t);else if(a<256&&vc[a])e.result+=_c[a],e.position++;else if((s=Sm(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=Am(a))>=0?i=(i<<4)+s:C(e,"expected hexadecimal character");e.result+=Om(i),e.position++}else C(e,"unknown escape sequence");r=n=e.position}else Me(a)?(nt(e,r,n,!0),wo(e,ne(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Hr(e)?C(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}C(e,"unexpected end of the stream within a double quoted scalar")}function Nm(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,l,d,p,g,m=Object.create(null),y,k,R,O;if(O=e.input.charCodeAt(e.position),O===91)l=93,g=!1,a=[];else if(O===123)l=125,g=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(ne(e,!0,t),O=e.input.charCodeAt(e.position),O===l)return e.position++,e.tag=s,e.anchor=c,e.kind=g?"mapping":"sequence",e.result=a,!0;r?O===44&&C(e,"expected the node content, but found ','"):C(e,"missed comma between flow collection entries"),k=y=R=null,d=p=!1,O===63&&(u=e.input.charCodeAt(e.position+1),be(u)&&(d=p=!0,e.position++,ne(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,Ot(e,t,Ir,!1,!0),k=e.tag,y=e.result,ne(e,!0,t),O=e.input.charCodeAt(e.position),(p||e.line===n)&&O===58&&(d=!0,O=e.input.charCodeAt(++e.position),ne(e,!0,t),Ot(e,t,Ir,!1,!0),R=e.result),g?Rt(e,a,m,k,y,R,n,o,i):d?a.push(Rt(e,null,m,k,y,R,n,o,i)):a.push(y),ne(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(r=!0,O=e.input.charCodeAt(++e.position)):r=!1}C(e,"unexpected end of the stream within a flow collection")}function Lm(e,t){var r,n,o=mo,i=!1,s=!1,a=t,c=0,u=!1,l,d;if(d=e.input.charCodeAt(e.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)mo===o?o=d===43?Na:km:C(e,"repeat of a chomping mode identifier");else if((l=Rm(d))>=0)l===0?C(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?C(e,"repeat of an indentation width identifier"):(a=t+l-1,s=!0);else break;if(bt(d)){do d=e.input.charCodeAt(++e.position);while(bt(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Me(d)&&d!==0)}for(;d!==0;){for(xo(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Me(d)){c++;continue}if(e.lineIndent<a){o===Na?e.result+=ae.repeat(`
67
- `,i?1+c:c):o===mo&&i&&(e.result+=`
68
- `);break}for(n?bt(d)?(u=!0,e.result+=ae.repeat(`
40
+ `,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=ko(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),p),a+=ae.repeat(" ",t.indent)+wo((e.line+c+1).toString(),l)+" | "+u.str+`
41
+ `;return a.replace(/\n$/,"")}var Lh=Nh,Ih=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],jh=["scalar","sequence","mapping"];function Fh(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Mh(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Ih.indexOf(r)===-1)throw new ve('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=Fh(t.styleAliases||null),jh.indexOf(this.kind)===-1)throw new ve('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var de=Mh;function Ia(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 Bh(){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 Ao(e){return this.extend(e)}Ao.prototype.extend=function(t){var r=[],n=[];if(t instanceof de)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 ve("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof de))throw new ve("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new ve("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 ve("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 de))throw new ve("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(Ao.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=Ia(o,"implicit"),o.compiledExplicit=Ia(o,"explicit"),o.compiledTypeMap=Bh(o.compiledImplicit,o.compiledExplicit),o};var Za=Ao,ec=new de("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),tc=new de("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),rc=new de("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),nc=new Za({explicit:[ec,tc,rc]});function Hh(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Vh(){return null}function Gh(e){return e===null}var oc=new de("tag:yaml.org,2002:null",{kind:"scalar",resolve:Hh,construct:Vh,predicate:Gh,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Uh(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 Wh(e){return e==="true"||e==="True"||e==="TRUE"}function qh(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ic=new de("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Uh,construct:Wh,predicate:qh,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 Yh(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Kh(e){return 48<=e&&e<=55}function Xh(e){return 48<=e&&e<=57}function zh(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(!Yh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Kh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Xh(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function Jh(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 Qh(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ae.isNegativeZero(e)}var sc=new de("tag:yaml.org,2002:int",{kind:"scalar",resolve:zh,construct:Jh,predicate:Qh,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"]}}),Zh=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function em(e){return!(e===null||!Zh.test(e)||e[e.length-1]==="_")}function tm(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 rm=/^[-+]?[0-9]+e/;function nm(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(ae.isNegativeZero(e))return"-0.0";return r=e.toString(10),rm.test(r)?r.replace("e",".e"):r}function om(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ae.isNegativeZero(e))}var ac=new de("tag:yaml.org,2002:float",{kind:"scalar",resolve:em,construct:tm,predicate:om,represent:nm,defaultStyle:"lowercase"}),cc=nc.extend({implicit:[oc,ic,sc,ac]}),lc=cc,uc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),pc=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 im(e){return e===null?!1:uc.exec(e)!==null||pc.exec(e)!==null}function sm(e){var t,r,n,o,i,s,a,c=0,u=null,l,p,d;if(t=uc.exec(e),t===null&&(t=pc.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 am(e){return e.toISOString()}var dc=new de("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:im,construct:sm,instanceOf:Date,represent:am});function cm(e){return e==="<<"||e===null}var fc=new de("tag:yaml.org,2002:merge",{kind:"scalar",resolve:cm}),Po=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
42
+ \r`;function lm(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Po;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 um(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Po,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 pm(e){var t="",r=0,n,o,i=e.length,s=Po;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 dm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var hc=new de("tag:yaml.org,2002:binary",{kind:"scalar",resolve:lm,construct:um,predicate:dm,represent:pm}),fm=Object.prototype.hasOwnProperty,hm=Object.prototype.toString;function mm(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,hm.call(o)!=="[object Object]")return!1;for(i in o)if(fm.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 gm(e){return e!==null?e:[]}var mc=new de("tag:yaml.org,2002:omap",{kind:"sequence",resolve:mm,construct:gm}),ym=Object.prototype.toString;function vm(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],ym.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function bm(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 gc=new de("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:vm,construct:bm}),_m=Object.prototype.hasOwnProperty;function Em(e){if(e===null)return!0;var t,r=e;for(t in r)if(_m.call(r,t)&&r[t]!==null)return!1;return!0}function xm(e){return e!==null?e:{}}var yc=new de("tag:yaml.org,2002:set",{kind:"mapping",resolve:Em,construct:xm}),$o=lc.extend({implicit:[dc,fc],explicit:[hc,mc,gc,yc]}),pt=Object.prototype.hasOwnProperty,Gr=1,vc=2,bc=3,Ur=4,Co=1,km=2,ja=3,wm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cm=/[\x85\u2028\u2029]/,Am=/[,\[\]\{\}]/,_c=/^(?:!|!!|![a-z\-]+!)$/i,Ec=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Fa(e){return Object.prototype.toString.call(e)}function Ge(e){return e===10||e===13}function kt(e){return e===9||e===32}function Ee(e){return e===9||e===32||e===10||e===13}function Lt(e){return e===44||e===91||e===93||e===123||e===125}function Sm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Rm(e){return e===120?2:e===117?4:e===85?8:0}function Om(e){return 48<=e&&e<=57?e-48:-1}function Ma(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 Tm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var xc=new Array(256),kc=new Array(256);for(xt=0;xt<256;xt++)xc[xt]=Ma(xt)?1:0,kc[xt]=Ma(xt);var xt;function Pm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||$o,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 wc(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=Lh(r),new ve(t,r)}function R(e,t){throw wc(e,t)}function Wr(e,t){e.onWarning&&e.onWarning.call(null,wc(e,t))}var Ba={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&&Wr(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],_c.test(o)||R(t,"ill-formed tag handle (first argument) of the TAG directive"),pt.call(t.tagMap,o)&&R(t,'there is a previously declared suffix for "'+o+'" tag handle'),Ec.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 ut(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 wm.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function Ha(e,t,r,n){var o,i,s,a;for(ae.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],pt.call(t,i)||(t[i]=r[i],n[i]=!0)}function It(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"&&Fa(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&Fa(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)Ha(e,t,i[u],r);else Ha(e,t,i,r);else!e.json&&!pt.call(r,o)&&pt.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,R(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:i}):t[o]=i,delete r[o];return t}function Do(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 ne(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;kt(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(Ge(o))for(Do(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&&Wr(e,"deficient indentation"),n}function Kr(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||Ee(r)))}function No(e,t){t===1?e.result+=" ":t>1&&(e.result+=ae.repeat(`
44
+ `,t-1))}function $m(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),Ee(y)||Lt(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),Ee(o)||r&&Lt(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),Ee(o)||r&&Lt(o))break}else if(y===35){if(n=e.input.charCodeAt(e.position-1),Ee(n))break}else{if(e.position===e.lineStart&&Kr(e)||r&&Lt(y))break;if(Ge(y))if(c=e.line,u=e.lineStart,l=e.lineIndent,ne(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&&(ut(e,i,s,!1),No(e,e.line-c),i=s=e.position,a=!1),kt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return ut(e,i,s,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function Dm(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(ut(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 Ge(r)?(ut(e,n,o,!0),No(e,ne(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Kr(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 Nm(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 ut(e,r,e.position,!0),e.position++,!0;if(a===92){if(ut(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Ge(a))ne(e,!1,t);else if(a<256&&xc[a])e.result+=kc[a],e.position++;else if((s=Rm(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=Sm(a))>=0?i=(i<<4)+s:R(e,"expected hexadecimal character");e.result+=Tm(i),e.position++}else R(e,"unknown escape sequence");r=n=e.position}else Ge(a)?(ut(e,r,n,!0),No(e,ne(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Kr(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 Lm(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,l,p,d,y,m=Object.create(null),g,E,A,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(ne(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=g=A=null,p=d=!1,S===63&&(u=e.input.charCodeAt(e.position+1),Ee(u)&&(p=d=!0,e.position++,ne(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,jt(e,t,Gr,!1,!0),E=e.tag,g=e.result,ne(e,!0,t),S=e.input.charCodeAt(e.position),(d||e.line===n)&&S===58&&(p=!0,S=e.input.charCodeAt(++e.position),ne(e,!0,t),jt(e,t,Gr,!1,!0),A=e.result),y?It(e,a,m,E,g,A,n,o,i):p?a.push(It(e,null,m,E,g,A,n,o,i)):a.push(g),ne(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 Im(e,t){var r,n,o=Co,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)Co===o?o=p===43?ja:km:R(e,"repeat of a chomping mode identifier");else if((l=Om(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(kt(p)){do p=e.input.charCodeAt(++e.position);while(kt(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Ge(p)&&p!==0)}for(;p!==0;){for(Do(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),Ge(p)){c++;continue}if(e.lineIndent<a){o===ja?e.result+=ae.repeat(`
45
+ `,i?1+c:c):o===Co&&i&&(e.result+=`
46
+ `);break}for(n?kt(p)?(u=!0,e.result+=ae.repeat(`
69
47
  `,i?1+c:c)):u?(u=!1,e.result+=ae.repeat(`
70
48
  `,c+1)):c===0?i&&(e.result+=" "):e.result+=ae.repeat(`
71
49
  `,c):e.result+=ae.repeat(`
72
- `,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Me(d)&&d!==0;)d=e.input.charCodeAt(++e.position);nt(e,r,e.position,!1)}return!0}function Ma(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,C(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!be(s))));){if(a=!0,e.position++,ne(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Ot(e,t,gc,!1,!0),i.push(e.result),ne(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)C(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 Im(e,t,r){var n,o,i,s,a,c,u=e.tag,l=e.anchor,d={},p=Object.create(null),g=null,m=null,y=null,k=!1,R=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),O=e.input.charCodeAt(e.position);O!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(O===63||O===58)&&be(n))O===63?(k&&(Rt(e,d,p,g,m,null,s,a,c),g=m=y=null),R=!0,k=!0,o=!0):k?(k=!1,o=!0):C(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=n;else{if(s=e.line,a=e.lineStart,c=e.position,!Ot(e,r,mc,!1,!0))break;if(e.line===i){for(O=e.input.charCodeAt(e.position);bt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),be(O)||C(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Rt(e,d,p,g,m,null,s,a,c),g=m=y=null),R=!0,k=!1,o=!1,g=e.tag,m=e.result;else if(R)C(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=l,!0}else if(R)C(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)&&(k&&(s=e.line,a=e.lineStart,c=e.position),Ot(e,t,jr,!0,o)&&(k?m=e.result:y=e.result),k||(Rt(e,d,p,g,m,y,s,a,c),g=m=y=null),ne(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&O!==0)C(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Rt(e,d,p,g,m,null,s,a,c),R&&(e.tag=u,e.anchor=l,e.kind="mapping",e.result=d),R}function jm(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&&C(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)):C(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!be(s);)s===33&&(n?C(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),yc.test(o)||C(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),Cm.test(i)&&C(e,"tag suffix cannot contain flow indicator characters")}i&&!bc.test(i)&&C(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{C(e,"tag name is malformed: "+i)}return r?e.tag=i:ot.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:C(e,'undeclared tag handle "'+o+'"'),!0}function Fm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&C(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!St(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Mm(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&&!be(n)&&!St(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),ot.call(e.anchorMap,r)||C(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ne(e,!0,-1),!0}function Ot(e,t,r,n,o){var i,s,a,c=1,u=!1,l=!1,d,p,g,m,y,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=jr===r||gc===r,n&&ne(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;jm(e)||Fm(e);)ne(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||jr===r)&&(Ir===r||mc===r?y=t:y=t+1,k=e.position-e.lineStart,c===1?a&&(Ma(e,k)||Im(e,k,y))||Nm(e,y)?l=!0:(s&&Lm(e,y)||$m(e,y)||Dm(e,y)?l=!0:Mm(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&C(e,"alias node should not have any properties")):Pm(e,y,Ir===r)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=a&&Ma(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&C(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,p=e.implicitTypes.length;d<p;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ot.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,g=e.typeMap.multi[e.kind||"fallback"],d=0,p=g.length;d<p;d+=1)if(e.tag.slice(0,g[d].tag.length)===g[d].tag){m=g[d];break}m||C(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&C(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):C(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 Bm(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&&(ne(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&&!be(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&C(e,"directive name must not be less than one character in length");s!==0;){for(;bt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Me(s));break}if(Me(s))break;for(r=e.position;s!==0&&!be(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&xo(e),ot.call(ja,n)?ja[n](e,n,o):Fr(e,'unknown document directive "'+n+'"')}if(ne(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,ne(e,!0,-1)):i&&C(e,"directives end mark is expected"),Ot(e,e.lineIndent-1,jr,!1,!0),ne(e,!0,-1),e.checkLineBreaks&&wm.test(e.input.slice(t,e.position))&&Fr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Hr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ne(e,!0,-1));return}if(e.position<e.length-1)C(e,"end of the stream or a document separator is expected");else return}function kc(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
73
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Tm(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,C(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;)Bm(r);return r.documents}function Hm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=kc(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Vm(e,t){var r=kc(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ge("expected a single document in the stream, but found more")}}var Gm=Hm,Wm=Vm,xc={loadAll:Gm,load:Wm},wc=Object.prototype.toString,Cc=Object.prototype.hasOwnProperty,Co=65279,Um=9,rr=10,qm=13,Ym=32,Km=33,Xm=34,yo=35,zm=37,Qm=38,Jm=39,Zm=42,Ac=44,eg=45,Mr=58,tg=61,rg=62,ng=63,og=64,Sc=91,Rc=93,ig=96,Oc=123,sg=124,Tc=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var ag=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],cg=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function lg(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&&Cc.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function ug(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 ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ae.repeat("0",n-t.length)+t}var dg=1,nr=2;function pg(e){this.schema=e.schema||ko,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ae.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=lg(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==='"'?nr:dg,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 Ba(e,t){for(var r=ae.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
50
+ `,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Ge(p)&&p!==0;)p=e.input.charCodeAt(++e.position);ut(e,r,e.position,!1)}return!0}function Va(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),!Ee(s))));){if(a=!0,e.position++,ne(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,jt(e,t,bc,!1,!0),i.push(e.result),ne(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 jm(e,t,r){var n,o,i,s,a,c,u=e.tag,l=e.anchor,p={},d=Object.create(null),y=null,m=null,g=null,E=!1,A=!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)&&Ee(n))S===63?(E&&(It(e,p,d,y,m,null,s,a,c),y=m=g=null),A=!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,!jt(e,r,vc,!1,!0))break;if(e.line===i){for(S=e.input.charCodeAt(e.position);kt(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),Ee(S)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(It(e,p,d,y,m,null,s,a,c),y=m=g=null),A=!0,E=!1,o=!1,y=e.tag,m=e.result;else if(A)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=l,!0}else if(A)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),jt(e,t,Ur,!0,o)&&(E?m=e.result:g=e.result),E||(It(e,p,d,y,m,g,s,a,c),y=m=g=null),ne(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&&It(e,p,d,y,m,null,s,a,c),A&&(e.tag=u,e.anchor=l,e.kind="mapping",e.result=p),A}function Fm(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&&!Ee(s);)s===33&&(n?R(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),_c.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),Am.test(i)&&R(e,"tag suffix cannot contain flow indicator characters")}i&&!Ec.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:pt.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 Mm(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&&!Ee(r)&&!Lt(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 Bm(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&&!Ee(n)&&!Lt(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),pt.call(e.anchorMap,r)||R(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ne(e,!0,-1),!0}function jt(e,t,r,n,o){var i,s,a,c=1,u=!1,l=!1,p,d,y,m,g,E;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Ur===r||bc===r,n&&ne(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Fm(e)||Mm(e);)ne(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||Ur===r)&&(Gr===r||vc===r?g=t:g=t+1,E=e.position-e.lineStart,c===1?a&&(Va(e,E)||jm(e,E,g))||Lm(e,g)?l=!0:(s&&Im(e,g)||Dm(e,g)||Nm(e,g)?l=!0:Bm(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):$m(e,g,Gr===r)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=a&&Va(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(m=e.implicitTypes[p],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(pt.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=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){m=y[p];break}m||R(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.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 Hm(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&&(ne(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&&!Ee(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(;kt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Ge(s));break}if(Ge(s))break;for(r=e.position;s!==0&&!Ee(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&Do(e),pt.call(Ba,n)?Ba[n](e,n,o):Wr(e,'unknown document directive "'+n+'"')}if(ne(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,ne(e,!0,-1)):i&&R(e,"directives end mark is expected"),jt(e,e.lineIndent-1,Ur,!1,!0),ne(e,!0,-1),e.checkLineBreaks&&Cm.test(e.input.slice(t,e.position))&&Wr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Kr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ne(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 Cc(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 Pm(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;)Hm(r);return r.documents}function Vm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=Cc(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Gm(e,t){var r=Cc(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ve("expected a single document in the stream, but found more")}}var Um=Vm,Wm=Gm,Ac={loadAll:Um,load:Wm},Sc=Object.prototype.toString,Rc=Object.prototype.hasOwnProperty,Lo=65279,qm=9,dr=10,Ym=13,Km=32,Xm=33,zm=34,So=35,Jm=37,Qm=38,Zm=39,eg=42,Oc=44,tg=45,qr=58,rg=61,ng=62,og=63,ig=64,Tc=91,Pc=93,sg=96,$c=123,ag=124,Dc=125,fe={};fe[0]="\\0";fe[7]="\\a";fe[8]="\\b";fe[9]="\\t";fe[10]="\\n";fe[11]="\\v";fe[12]="\\f";fe[13]="\\r";fe[27]="\\e";fe[34]='\\"';fe[92]="\\\\";fe[133]="\\N";fe[160]="\\_";fe[8232]="\\L";fe[8233]="\\P";var cg=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],lg=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ug(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&&Rc.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function pg(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 ve("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ae.repeat("0",n-t.length)+t}var dg=1,fr=2;function fg(e){this.schema=e.schema||$o,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ae.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ug(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==='"'?fr:dg,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 Ga(e,t){for(var r=ae.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
74
52
  `,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
75
- `&&(i+=r),i+=s;return i}function bo(e,t){return`
76
- `+ae.repeat(" ",e.indent*t)}function fg(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 Br(e){return e===Ym||e===Um}function or(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Co||65536<=e&&e<=1114111}function Ha(e){return or(e)&&e!==Co&&e!==qm&&e!==rr}function Va(e,t,r){var n=Ha(e),o=n&&!Br(e);return(r?n:n&&e!==Ac&&e!==Sc&&e!==Rc&&e!==Oc&&e!==Tc)&&e!==yo&&!(t===Mr&&!o)||Ha(t)&&!Br(t)&&e===yo||t===Mr&&o}function hg(e){return or(e)&&e!==Co&&!Br(e)&&e!==eg&&e!==ng&&e!==Mr&&e!==Ac&&e!==Sc&&e!==Rc&&e!==Oc&&e!==Tc&&e!==yo&&e!==Qm&&e!==Zm&&e!==Km&&e!==sg&&e!==tg&&e!==rg&&e!==Jm&&e!==Xm&&e!==zm&&e!==og&&e!==ig}function mg(e){return!Br(e)&&e!==Mr}function er(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 Pc(e){var t=/^\n* /;return t.test(e)}var $c=1,vo=2,Dc=3,Nc=4,At=5;function gg(e,t,r,n,o,i,s,a){var c,u=0,l=null,d=!1,p=!1,g=n!==-1,m=-1,y=hg(er(e,0))&&mg(er(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=er(e,c),!or(u))return At;y=y&&Va(u,l,a),l=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=er(e,c),u===rr)d=!0,g&&(p=p||c-m-1>n&&e[m+1]!==" ",m=c);else if(!or(u))return At;y=y&&Va(u,l,a),l=u}p=p||g&&c-m-1>n&&e[m+1]!==" "}return!d&&!p?y&&!s&&!o(e)?$c:i===nr?At:vo:r>9&&Pc(e)?At:s?i===nr?At:vo:p?Nc:Dc}function yg(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===nr?'""':"''";if(!e.noCompatMode&&(ag.indexOf(t)!==-1||cg.test(t)))return e.quotingType===nr?'"'+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 fg(e,u)}switch(gg(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case $c:return t;case vo:return"'"+t.replace(/'/g,"''")+"'";case Dc:return"|"+Ga(t,e.indent)+Wa(Ba(t,i));case Nc:return">"+Ga(t,e.indent)+Wa(Ba(bg(t,s),i));case At:return'"'+vg(t)+'"';default:throw new ge("impossible error: invalid scalar style")}})()}function Ga(e,t){var r=Pc(e)?String(t):"",n=e[e.length-1]===`
53
+ `&&(i+=r),i+=s;return i}function Ro(e,t){return`
54
+ `+ae.repeat(" ",e.indent*t)}function hg(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 Yr(e){return e===Km||e===qm}function hr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Lo||65536<=e&&e<=1114111}function Ua(e){return hr(e)&&e!==Lo&&e!==Ym&&e!==dr}function Wa(e,t,r){var n=Ua(e),o=n&&!Yr(e);return(r?n:n&&e!==Oc&&e!==Tc&&e!==Pc&&e!==$c&&e!==Dc)&&e!==So&&!(t===qr&&!o)||Ua(t)&&!Yr(t)&&e===So||t===qr&&o}function mg(e){return hr(e)&&e!==Lo&&!Yr(e)&&e!==tg&&e!==og&&e!==qr&&e!==Oc&&e!==Tc&&e!==Pc&&e!==$c&&e!==Dc&&e!==So&&e!==Qm&&e!==eg&&e!==Xm&&e!==ag&&e!==rg&&e!==ng&&e!==Zm&&e!==zm&&e!==Jm&&e!==ig&&e!==sg}function gg(e){return!Yr(e)&&e!==qr}function ur(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 Nc(e){var t=/^\n* /;return t.test(e)}var Lc=1,Oo=2,Ic=3,jc=4,Nt=5;function yg(e,t,r,n,o,i,s,a){var c,u=0,l=null,p=!1,d=!1,y=n!==-1,m=-1,g=mg(ur(e,0))&&gg(ur(e,e.length-1));if(t||s)for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=ur(e,c),!hr(u))return Nt;g=g&&Wa(u,l,a),l=u}else{for(c=0;c<e.length;u>=65536?c+=2:c++){if(u=ur(e,c),u===dr)p=!0,y&&(d=d||c-m-1>n&&e[m+1]!==" ",m=c);else if(!hr(u))return Nt;g=g&&Wa(u,l,a),l=u}d=d||y&&c-m-1>n&&e[m+1]!==" "}return!p&&!d?g&&!s&&!o(e)?Lc:i===fr?Nt:Oo:r>9&&Nc(e)?Nt:s?i===fr?Nt:Oo:d?jc:Ic}function vg(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===fr?'""':"''";if(!e.noCompatMode&&(cg.indexOf(t)!==-1||lg.test(t)))return e.quotingType===fr?'"'+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 hg(e,u)}switch(yg(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case Lc:return t;case Oo:return"'"+t.replace(/'/g,"''")+"'";case Ic:return"|"+qa(t,e.indent)+Ya(Ga(t,i));case jc:return">"+qa(t,e.indent)+Ya(Ga(bg(t,s),i));case Nt:return'"'+_g(t)+'"';default:throw new ve("impossible error: invalid scalar style")}})()}function qa(e,t){var r=Nc(e)?String(t):"",n=e[e.length-1]===`
77
55
  `,o=n&&(e[e.length-2]===`
78
56
  `||e===`
79
57
  `),i=o?"+":n?"":"-";return r+i+`
80
- `}function Wa(e){return e[e.length-1]===`
58
+ `}function Ya(e){return e[e.length-1]===`
81
59
  `?e.slice(0,-1):e}function bg(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
82
- `);return u=u!==-1?u:e.length,r.lastIndex=u,Ua(e.slice(0,u),t)})(),o=e[0]===`
60
+ `);return u=u!==-1?u:e.length,r.lastIndex=u,Ka(e.slice(0,u),t)})(),o=e[0]===`
83
61
  `||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
84
- `:"")+Ua(c,t),o=i}return n}function Ua(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+=`
62
+ `:"")+Ka(c,t),o=i}return n}function Ka(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+=`
85
63
  `+e.slice(o,i),o=i+1),s=a;return c+=`
86
64
  `,e.length-o>t&&s>o?c+=e.slice(o,s)+`
87
- `+e.slice(s+1):c+=e.slice(o),c.slice(1)}function vg(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=er(e,o),n=de[r],!n&&or(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||ug(r);return t}function _g(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)),(Ye(e,t,a,!1,!1)||typeof a>"u"&&Ye(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function qa(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)),(Ye(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ye(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=bo(e,t)),e.dump&&rr===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function Eg(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)),Ye(e,t,c,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ye(e,t,u,!1,!1)&&(l+=e.dump,n+=l));e.tag=o,e.dump="{"+n+"}"}function kg(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,l,d,p;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ge("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)p="",(!n||o!=="")&&(p+=bo(e,t)),u=s[a],l=r[u],e.replacer&&(l=e.replacer.call(r,u,l)),Ye(e,t+1,u,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&rr===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,d&&(p+=bo(e,t)),Ye(e,t+1,l,!0,d)&&(e.dump&&rr===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,o+=p));e.tag=i,e.dump=o||"{}"}function Ya(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,wc.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(Cc.call(a.represent,c))n=a.represent[c](t,c);else throw new ge("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function Ye(e,t,r,n,o,i,s){e.tag=null,e.dump=r,Ya(e,r,!1)||Ya(e,r,!0);var a=wc.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var l=a==="[object Object]"||a==="[object Array]",d,p;if(l&&(d=e.duplicates.indexOf(r),p=d!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(o=!1),p&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(l&&p&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(kg(e,t,e.dump,o),p&&(e.dump="&ref_"+d+e.dump)):(Eg(e,t,e.dump),p&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?qa(e,t-1,e.dump,o):qa(e,t,e.dump,o),p&&(e.dump="&ref_"+d+e.dump)):(_g(e,t,e.dump),p&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&yg(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ge("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 xg(e,t){var r=[],n=[],o,i;for(_o(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function _o(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)_o(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)_o(e[n[o]],t,r)}function wg(e,t){t=t||{};var r=new pg(t);r.noRefs||xg(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ye(r,0,n,!0,!0)?r.dump+`
88
- `:""}var Cg=wg,Ag={dump:Cg};function Ao(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 Sg=ue,Rg=za,Og=ec,Tg=ic,Pg=sc,$g=ko,Dg=xc.load,Ng=xc.loadAll,Lg=Ag.dump,Ig=ge,jg={binary:dc,float:oc,map:Za,null:tc,pairs:fc,set:hc,timestamp:lc,bool:rc,int:nc,merge:uc,omap:pc,seq:Ja,str:Qa},Fg=Ao("safeLoad","load"),Mg=Ao("safeLoadAll","loadAll"),Bg=Ao("safeDump","dump"),Hg={Type:Sg,Schema:Rg,FAILSAFE_SCHEMA:Og,JSON_SCHEMA:Tg,CORE_SCHEMA:Pg,DEFAULT_SCHEMA:$g,load:Dg,loadAll:Ng,dump:Lg,YAMLException:Ig,types:jg,safeLoad:Fg,safeLoadAll:Mg,safeDump:Bg},it=Hg;import Pt from"path";import{execSync as Ke}from"child_process";import Vg from"fs-extra";var Vr=null,So=()=>{if(Vr)return Vr;let e=Gg(),t=Wg(e),r=e,n=!0,o=Ug(t);return Vr={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},Vr};var Gg=()=>{try{let e;process.platform==="win32"?e=Ke("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
89
- `)[0]:e=Ke("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return Ke(`"${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(Vg.existsSync(r))try{return Ke(`"${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")}},Wg=e=>{try{return Ke(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(h.yellow("Could not determine Docker version")),"unknown"}},Ug=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},Gr=()=>{f.raw(h.blue("\u{1F433} Checking Docker installation..."));try{let e=So();f.debug(`\u2705 Docker found at: ${e.dockerPath}`),f.debug(`Docker version: ${e.version}`);try{Ke(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),f.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(h.red(`
65
+ `+e.slice(s+1):c+=e.slice(o),c.slice(1)}function _g(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=ur(e,o),n=fe[r],!n&&hr(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||pg(r);return t}function Eg(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)),(ze(e,t,a,!1,!1)||typeof a>"u"&&ze(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function Xa(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)),(ze(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&ze(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=Ro(e,t)),e.dump&&dr===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function xg(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)),ze(e,t,c,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ze(e,t,u,!1,!1)&&(l+=e.dump,n+=l));e.tag=o,e.dump="{"+n+"}"}function kg(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 ve("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=Ro(e,t)),u=s[a],l=r[u],e.replacer&&(l=e.replacer.call(r,u,l)),ze(e,t+1,u,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&dr===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=Ro(e,t)),ze(e,t+1,l,!0,p)&&(e.dump&&dr===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function za(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,Sc.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(Rc.call(a.represent,c))n=a.represent[c](t,c);else throw new ve("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function ze(e,t,r,n,o,i,s){e.tag=null,e.dump=r,za(e,r,!1)||za(e,r,!0);var a=Sc.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?(kg(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(xg(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?Xa(e,t-1,e.dump,o):Xa(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(Eg(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&vg(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ve("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 wg(e,t){var r=[],n=[],o,i;for(To(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function To(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)To(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)To(e[n[o]],t,r)}function Cg(e,t){t=t||{};var r=new fg(t);r.noRefs||wg(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),ze(r,0,n,!0,!0)?r.dump+`
66
+ `:""}var Ag=Cg,Sg={dump:Ag};function Io(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 Rg=de,Og=Za,Tg=nc,Pg=cc,$g=lc,Dg=$o,Ng=Ac.load,Lg=Ac.loadAll,Ig=Sg.dump,jg=ve,Fg={binary:hc,float:ac,map:rc,null:oc,pairs:gc,set:yc,timestamp:dc,bool:ic,int:sc,merge:fc,omap:mc,seq:tc,str:ec},Mg=Io("safeLoad","load"),Bg=Io("safeLoadAll","loadAll"),Hg=Io("safeDump","dump"),Vg={Type:Rg,Schema:Og,FAILSAFE_SCHEMA:Tg,JSON_SCHEMA:Pg,CORE_SCHEMA:$g,DEFAULT_SCHEMA:Dg,load:Ng,loadAll:Lg,dump:Ig,YAMLException:jg,types:Fg,safeLoad:Mg,safeLoadAll:Bg,safeDump:Hg},Ce=Vg;import zr from"fs-extra";import vr from"path";import{extname as Cy,resolve as Ay,join as Sy}from"path";var Xc=ir(Uc(),1);import Ry from"chokidar";import ay from"fs-extra";var bC=Mo().name,Wc=(e,t=["js","yaml","yml"])=>{for(let r of t){let n=e+"."+r;if(ay.existsSync(n))return n}throw new Error(`Could not find any of ${e+"{"+t.join(",")+"}"}`)};import wC from"fs-extra";import AC from"path";var cy=Object.prototype.toString,Bt=Array.isArray||function(t){return cy.call(t)==="[object Array]"};function Ho(e){return typeof e=="function"}function ly(e){return Bt(e)?"array":typeof e}function Bo(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function qc(e,t){return e!=null&&typeof e=="object"&&t in e}function uy(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var py=RegExp.prototype.test;function dy(e,t){return py.call(e,t)}var fy=/\S/;function hy(e){return!dy(fy,e)}var my={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function gy(e){return String(e).replace(/[&<>"'`=\/]/g,function(r){return my[r]})}var yy=/\s*/,vy=/\s+/,Yc=/\s*=/,by=/\s*\}/,_y=/#|\^|\/|>|\{|&|=|!/;function Ey(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 m(k){if(typeof k=="string"&&(k=k.split(vy,2)),!Bt(k)||k.length!==2)throw new Error("Invalid tags: "+k);p=new RegExp(Bo(k[0])+"\\s*"),d=new RegExp("\\s*"+Bo(k[1])),y=new RegExp("\\s*"+Bo("}"+k[1]))}m(t||Le.tags);for(var g=new yr(e),E,A,S,B,pe,q;!g.eos();){if(E=g.pos,S=g.scanUntil(p),S)for(var T=0,L=S.length;T<L;++T)B=S.charAt(T),hy(B)?(i.push(o.length),c+=B):(a=!0,r=!0,c+=" "),o.push(["text",B,E,E+1]),E+=1,B===`
67
+ `&&(l(),c="",u=0,r=!1);if(!g.scan(p))break;if(s=!0,A=g.scan(_y)||"name",g.scan(yy),A==="="?(S=g.scanUntil(Yc),g.scan(Yc),g.scanUntil(d)):A==="{"?(S=g.scanUntil(y),g.scan(by),g.scanUntil(d),A="&"):S=g.scanUntil(d),!g.scan(d))throw new Error("Unclosed tag at "+g.pos);if(A==">"?pe=[A,S,E,g.pos,c,u,r]:pe=[A,S,E,g.pos],u++,o.push(pe),A==="#"||A==="^")n.push(pe);else if(A==="/"){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 A==="name"||A==="{"||A==="&"?a=!0:A==="="&&m(S)}if(l(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+g.pos);return ky(xy(o))}function xy(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 ky(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 yr(e){this.string=e,this.tail=e,this.pos=0}yr.prototype.eos=function(){return this.tail===""};yr.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};yr.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 Mt(e,t){this.view=e,this.cache={".":this.view},this.parent=t}Mt.prototype.push=function(t){return new Mt(t,this)};Mt.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=qc(i,s[a])||uy(i,s[a])),i=i[s[a++]];else i=o.view[t],c=qc(o.view,t);if(c){n=i;break}o=o.parent}r[t]=n}return Ho(n)&&(n=n.call(this.view)),n};function be(){this.templateCache={_cache:{},set:function(t,r){this._cache[t]=r},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}be.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};be.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=Ey(t,r),i&&n.set(o,s)),s};be.prototype.render=function(t,r,n,o){var i=this.getConfigTags(o),s=this.parse(t,i),a=r instanceof Mt?r:new Mt(r,void 0);return this.renderTokens(s,a,n,t,o)};be.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};be.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(Bt(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(Ho(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}};be.prototype.renderInverted=function(t,r,n,o,i){var s=r.lookup(t[1]);if(!s||Bt(s)&&s.length===0)return this.renderTokens(t[4],r,n,o,i)};be.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
+ `)};be.prototype.renderPartial=function(t,r,n,o){if(n){var i=this.getConfigTags(o),s=Ho(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)}}};be.prototype.unescapedValue=function(t,r){var n=r.lookup(t[1]);if(n!=null)return n};be.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)};be.prototype.rawValue=function(t){return t[1]};be.prototype.getConfigTags=function(t){return Bt(t)?t:t&&typeof t=="object"?t.tags:void 0};be.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!Bt(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){gr.templateCache=e},get templateCache(){return gr.templateCache}},gr=new be;Le.clearCache=function(){return gr.clearCache()};Le.parse=function(t,r){return gr.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 "'+ly(t)+'" was given as the first argument for mustache#render(template, view, partials)');return gr.render(t,r,n,o)};Le.escape=gy;Le.Scanner=yr;Le.Context=Mt;Le.Writer=be;import{findPackageJSON as wy}from"node:module";var Kc=()=>wy(new URL(import.meta.resolve(".")));var Vo=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 Vo;var Oy=["js","mjs","ts","yaml","yml"],zc=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,Xc.config)({path:Sy(process.cwd(),".env")}).parsed;return e(t)},Ty=vr.join(vr.dirname(Kc()),"raclette.default.config.yaml"),wt=async(e=Ty,t={})=>{let n={env:{[process.env?.environment||"development"]:t}},o=Ay(e),i=o,s;try{switch(Cy(e)){case".*":let a=e.slice(0,-1);s=await wt(a+Oy.find(c=>zr.existsSync(a+c)));break;case".yaml":case".yml":s=Ce.load(zr.readFileSync(o,"utf8"),{filename:e});break;case".ts":case".mjs":case".js":s=(await import(o+`?t=${Date.now()}`)).default;break;default:throw new TypeError(`config.load() does not support ${e} file extension.`)}}catch(a){throw new Error(`Failed to load config ${o}: ${a?.message}`)}return lt(s,n)},Go=(...e)=>{let t=e[0];for(let r of e.slice(1))t=lt(t,r);return t},Uo=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 Be){let o=vr.join(t,n);zr.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
+ `;zr.writeFileSync(vr.join(o,"raclette.config.js"),s)}},Jc=(e,t)=>{let r=Wc(vr.join(e,"raclette.config"));f.progress(`\u{1F50D} Watching for changes in original config: ${r}`);let n=Ry.watch(r,{ignored:/(^|[/\\])\../,persistent:!0});return n.on("change",async o=>{f.progress(`\u{1F4DD} Original config file changed: ${o}`);try{await wt(r,t)}catch(i){f.error("Error reloading configuration: "+i.message)}}),()=>n.close()};import{spawn as ta}from"child_process";import ea,{pathExists as _k}from"fs-extra";import nt from"path";import en from"fs-extra";import Vt from"path";import{execSync as Qe}from"child_process";import $y from"fs-extra";var Jr=null,Wo=()=>{if(Jr)return Jr;let e=Dy(),t=Ny(e),r=e,n=!0,o=Ly(t);return Jr={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},Jr};var Dy=()=>{try{let e;process.platform==="win32"?e=Qe("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
76
+ `)[0]:e=Qe("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return Qe(`"${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($y.existsSync(r))try{return Qe(`"${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")}},Ny=e=>{try{return Qe(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(h.yellow("Could not determine Docker version")),"unknown"}},Ly=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},Qr=()=>{f.raw(h.blue("\u{1F433} Checking Docker installation..."));try{let e=Wo();f.debug(`\u2705 Docker found at: ${e.dockerPath}`),f.debug(`Docker version: ${e.version}`);try{Qe(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),f.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(h.red(`
90
77
  \u274C Modern Docker Compose is not available`)),console.warn(h.yellow(`
91
- \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{Ke(`"${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(`
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{Qe(`"${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(`
92
79
  macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(h.yellow(`
93
80
  Windows: Start Docker Desktop from the Start menu`)):console.log(h.yellow(`
94
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(`
95
- \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"))}},ce=(e,t={})=>{let n=`"${So().dockerPath}" ${e.join(" ")}`;try{let o=Ke(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}
96
- Error: ${o.message}`)}},ye=(e,t={})=>{let n=`"${So().composeCommand}" compose ${e.join(" ")}`;f.debug(`Execute Docker Command: ${n}`);try{let o=Ke(n,{stdio:"pipe",encoding:"utf8",shell:!0,...t});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker Compose command failed: ${n}
97
- Error: ${o.message}`)}},ir=e=>{try{return ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Tt=e=>{try{return ce(["ps","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Wr=e=>{f.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{if(ce(["network","ls","--format",'"{{.Name}}"',"|","grep",e]).trim()===e){f.debug(`\u2705 Network '${e}' already exists`);return}}catch{f.debug(`\u{1F310} Creating Docker network '${e}'...`);try{ce(["network","create",e],{stdio:"inherit"}),f.debug(`\u2705 Network '${e}' created`)}catch(r){throw f.error("Failed to create network: "+r.message),r}}},Ro=(e,t,r={})=>ce(["exec",e,"sh","-c",`"${t}"`],r),qg=e=>{try{let t=ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}"`]);return t.trim()?t.trim().split(`
98
- `).filter(r=>r.trim().length>0):[]}catch{return[]}},Lc=e=>{let t=qg(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..."),ce(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),ce(["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 Yg="raclette-public-shared",Kg=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),Oo=(e,t)=>Pt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Pt.resolve(t,e):Pt.resolve(t,e),qr=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>qr(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=Oo(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=Kg(o):o&&typeof o=="object"?r[n]=qr(o,t):r[n]=o;return r},st=(e,t)=>{let r=qr(e,t);if(r.source&&r.source.includes("/")&&(r.source=Oo(r.source,t)),r.mustExist&&!Ur.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},Xg=(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=Oo(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},Yr=(e,t)=>e.map(r=>typeof r=="string"?Xg(r,t):r).map(r=>r),To=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[Yg]=null,e.volumes&&Object.entries(e.volumes).forEach(([d,p])=>{p===null?a.volumes[d]=null:a.volumes[d]=qr(p,t)});let u=!1,l=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let d=e.services.mongodb.name;ir(d)&&(f.debug(`MongoDB container '${d}' already exists, will be skipped`),u=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let d=e.services.cache.name;ir(d)&&(f.debug(`Cache container '${d}' already exists, will be skipped`),l=!0)}}if(e.services.mongodb?.enabled&&!u){let p=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,g=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,m=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${p}}`,image:"mongo:5.0.6",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${g}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${m}}:/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(y=>{let k=st(y,t);a.services.mongodb.volumes.push(k)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null),!m.startsWith("/")&&!m.startsWith("./")&&(a.volumes[m]=null)}if(e.services.cache?.enabled&&!l){let p=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,g=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${p}}`,image:"valkey/valkey:8.1-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${g}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let m=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",y=e?.backend?.cache?.persistence||"none";y==="none"&&(a.services.cache.command='valkey-server --save ""'),y==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),y==="rdb"&&(a.services.cache.command="valkey-server --save "+m),y==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+m),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(k=>{let R=st(k,t);a.services.cache.volumes.push(R)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(!n){let d=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let p=e.services.backend.name??`${e.name}-backend`,g=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${p}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:d?"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(([m,y])=>`${m}=${y}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${g}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${$t("backend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...d?[`${d||"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(m=>{let y=st(m,t);y&&a.services.backend.volumes.push(y)}),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[g]=null}if(e.services.frontend?.enabled){let p=e.services.frontend.name??`${e.name}-frontend`,g=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,m=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${p}}`,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(([y,k])=>`${y}=${k}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${g}:/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",`${$t("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(y=>{let k=st(y,t);k&&a.services.frontend.volumes.push(k)}),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[g]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let p=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,g=p&&!p.endsWith("/")?p+"/":p;a.services.backend?.volumes?.push(`${g}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${g}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(d=>{d.volumes&&(d.volumes=Yr(d.volumes,t))}),await Ur.writeFile(r,it.dump(a)),await Kr(e,Pt.dirname(r),o)},$t=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Ic=async(e,t,r,n="development")=>{await To(e,t,r,!1,n,!1,!1)},Kr=async(e,t,r)=>{let n=Pt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
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"))}},le=(e,t={})=>{let n=`"${Wo().dockerPath}" ${e.join(" ")}`;try{let o=Qe(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}`)}},_e=(e,t={})=>{let n=`"${Wo().composeCommand}" compose ${e.join(" ")}`;f.debug(`Execute Docker Command: ${n}`);try{let o=Qe(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}`)}},br=e=>{try{return le(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Ht=e=>{try{return le(["ps","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Zr=e=>{f.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{if(le(["network","ls","--format",'"{{.Name}}"',"|","grep",e]).trim()===e){f.debug(`\u2705 Network '${e}' already exists`);return}}catch{f.debug(`\u{1F310} Creating Docker network '${e}'...`);try{le(["network","create",e],{stdio:"inherit"}),f.debug(`\u2705 Network '${e}' created`)}catch(r){throw f.error("Failed to create network: "+r.message),r}}},qo=(e,t,r={})=>le(["exec",e,"sh","-c",`"${t}"`],r),Iy=e=>{try{let t=le(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}"`]);return t.trim()?t.trim().split(`
85
+ `).filter(r=>r.trim().length>0):[]}catch{return[]}},Qc=e=>{let t=Iy(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..."),le(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),le(["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 jy="raclette-public-shared",Fy=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),Yo=(e,t)=>Vt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Vt.resolve(t,e):Vt.resolve(t,e),tn=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>tn(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=Yo(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=Fy(o):o&&typeof o=="object"?r[n]=tn(o,t):r[n]=o;return r},dt=(e,t)=>{let r=tn(e,t);if(r.source&&r.source.includes("/")&&(r.source=Yo(r.source,t)),r.mustExist&&!en.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},My=(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=Yo(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},rn=(e,t)=>e.map(r=>typeof r=="string"?My(r,t):r).map(r=>r),Ko=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[jy]=null,e.volumes&&Object.entries(e.volumes).forEach(([p,d])=>{d===null?a.volumes[p]=null:a.volumes[p]=tn(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;br(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;br(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`,m=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:-${m}}:/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(g=>{let E=dt(g,t);a.services.mongodb.volumes.push(E)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=null),!m.startsWith("/")&&!m.startsWith("./")&&(a.volumes[m]=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 m=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",g=e?.backend?.cache?.persistence||"none";g==="none"&&(a.services.cache.command='valkey-server --save ""'),g==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),g==="rdb"&&(a.services.cache.command="valkey-server --save "+m),g==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+m),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(E=>{let A=dt(E,t);a.services.cache.volumes.push(A)}),!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(([m,g])=>`${m}=${g}`)],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",`${Gt("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(m=>{let g=dt(m,t);g&&a.services.backend.volumes.push(g)}),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`,m=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(([g,E])=>`${g}=${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",`${Gt("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(g=>{let E=dt(g,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=rn(p.volumes,t))}),await en.writeFile(r,Ce.dump(a)),await nn(e,Vt.dirname(r),o)},Gt=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Zc=async(e,t,r,n="development")=>{await Ko(e,t,r,!1,n,!1,!1)},nn=async(e,t,r)=>{let n=Vt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
99
86
  WORKDIR /app
100
87
 
101
88
  # add bash since alpine doesn't come with a shell
@@ -131,7 +118,7 @@ EXPOSE 9229
131
118
 
132
119
  # default command
133
120
  CMD ["yarn", "run", "${r==="production"?"build":"dev"}"]
134
- `;await Ur.writeFile(n,o);let i=Pt.join(t,"frontend.Dockerfile"),s=`FROM node:24-alpine3.21 AS build
121
+ `;await en.writeFile(n,o);let i=Vt.join(t,"frontend.Dockerfile"),s=`FROM node:24-alpine3.21 AS build
135
122
  WORKDIR /app
136
123
 
137
124
  RUN apk update && apk add bash curl ${(e.services.frontend?.installPackages||[]).join(" ")}
@@ -186,7 +173,7 @@ RUN chmod +x /docker-entrypoint.d/entrypoint.sh
186
173
  ENV PORT 80
187
174
  EXPOSE 80
188
175
 
189
- CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path";var Xr=async(e,t,r)=>{let n=[];return r&&(console.log(h.blue("\u{1F504} Force rebuild enabled - rebuilding all services")),e.services.frontend?.enabled&&n.push("frontend"),e.services.backend?.enabled&&n.push("backend"),e.services.workbench?.enabled&&n.push("workbench")),n},zr=async(e,t,r,n={})=>{if(r.length===0)return;console.log(h.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=jc.join(t,"docker-compose.yml"),i=e.name??jc.basename(process.cwd());for(let s of r)try{console.log(h.blue(`\u{1F504} Rebuilding ${s} service...`));let a=["-p",i,"-f",o,"build"];n.noCache&&a.push("--no-cache"),a.push(s),ye(a,{stdio:"inherit"}),f.success(` Service ${s} rebuilt successfully`)}catch(a){f.error(`Error rebuilding service ${s}: ${a.message}`)}};import Jc from"fs-extra";import Zc from"path";var Fc=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?zg():[]],zg=()=>[],Mc=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],Bc=(e=!1)=>{let t=` // JavaScript config
176
+ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path";var on=async(e,t,r)=>Be.filter(n=>r||e.services[n]?.enabled),sn=async(e,t,r,n={})=>{if(r.length===0)return;console.log(h.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=el.join(t,"docker-compose.yml"),s=["-p",e.name??el.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...`)),_e([...s,a],{stdio:"inherit"}),f.success(` Service ${a} rebuilt successfully`)}catch(c){f.error(`Error rebuilding service ${a}: ${c.message}`)}};import ml from"fs-extra";import gl from"path";var tl=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?By():[]],By=()=>[],rl=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],nl=(e=!1)=>{let t=` // JavaScript config
190
177
  {
191
178
  files: ["**/*.{js,mjs,cjs}"],
192
179
  languageOptions: {
@@ -231,7 +218,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
231
218
  }
232
219
  }`;return e?t+`,
233
220
 
234
- `+Qg():t},Qg=()=>` // Style recommended config
221
+ `+Hy():t},Hy=()=>` // Style recommended config
235
222
  {
236
223
  files: ["**/*.{js,mjs,cjs,ts,tsx}"],
237
224
  rules: {
@@ -254,7 +241,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
254
241
  { min: 3, exceptions: ["i", "j", "a", "b", "fs", "id"], properties: "never" },
255
242
  ],
256
243
  }
257
- }`;var Hc=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?Jg():[]],Jg=()=>[],Vc=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],Gc=(e=!1)=>{let t=` // React config
244
+ }`;var ol=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?Vy():[]],Vy=()=>[],il=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],sl=(e=!1)=>{let t=` // React config
258
245
  {
259
246
  files: ["**/*.{jsx,tsx}"],
260
247
  plugins: {
@@ -278,7 +265,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
278
265
  }
279
266
  }`;return e?t+`,
280
267
 
281
- `+Zg():t},Zg=()=>"";var Wc=(e=!1)=>["typescript-eslint",...e?ey():[]],ey=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],Uc=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},qc=(e=!1)=>{let r=` // TypeScript config
268
+ `+Gy():t},Gy=()=>"";var al=(e=!1)=>["typescript-eslint",...e?Uy():[]],Uy=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],cl=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},ll=(e=!1)=>{let r=` // TypeScript config
282
269
  {
283
270
  files: ["**/*.{ts,tsx}"],
284
271
  plugins: ${e?`{
@@ -307,7 +294,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
307
294
  }
308
295
  }`;return e?r+`,
309
296
 
310
- `+ty():r},ty=()=>` // TypeScript recommended config
297
+ `+Wy():r},Wy=()=>` // TypeScript recommended config
311
298
  {
312
299
  files: ["**/*.{ts,tsx}"],
313
300
  rules: {
@@ -390,7 +377,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
390
377
  }
391
378
  ]
392
379
  }
393
- }`;var Yc=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser","tailwindcss",...e?ry():[]],ry=()=>[],Kc=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';","import tailwindcss from 'eslint-plugin-tailwindcss';"],Xc=(e=!1)=>{let t=` // Vue config
380
+ }`;var ul=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser","tailwindcss",...e?qy():[]],qy=()=>[],pl=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';","import tailwindcss from 'eslint-plugin-tailwindcss';"],dl=(e=!1)=>{let t=` // Vue config
394
381
  {
395
382
  files: ["**/*.vue"],
396
383
  // Manually add Vue plugin
@@ -432,7 +419,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
432
419
  }
433
420
  }`;return e?t+`,
434
421
 
435
- `+ny():t},ny=()=>` // Vue recommended config
422
+ `+Yy():t},Yy=()=>` // Vue recommended config
436
423
  {
437
424
  files: ["**/*.vue"],
438
425
  rules: {
@@ -475,7 +462,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
475
462
  "vue/v-on-style": "error",
476
463
  "vue/v-slot-style": "error"
477
464
  }
478
- }`;import{existsSync as Po}from"fs";import $o from"path";var zc=e=>{let t=e?.eslint?.useRecommended;return e.frontend?.framework==="vue"?Yc(t):e.frontend?.framework==="react"?Hc(t):[]},Qc=e=>{let t=[...e].sort(),r=Po($o.join(process.cwd(),"yarn.lock")),n=Po($o.join(process.cwd(),"pnpm-lock.yaml")),o=Po($o.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 Qr=async(e,t,r=!0)=>{let n=Zc.join(t,"eslint.config.mjs");f.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=oy(e,o),s=[];if(s.push(` // TS ESLint base rules
465
+ }`;import{existsSync as Xo}from"fs";import zo from"path";var fl=e=>{let t=e?.eslint?.useRecommended;return e.frontend?.framework==="vue"?ul(t):e.frontend?.framework==="react"?ol(t):[]},hl=e=>{let t=[...e].sort(),r=Xo(zo.join(process.cwd(),"yarn.lock")),n=Xo(zo.join(process.cwd(),"pnpm-lock.yaml")),o=Xo(zo.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 an=async(e,t,r=!0)=>{let n=gl.join(t,"eslint.config.mjs");f.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=Ky(e,o),s=[];if(s.push(` // TS ESLint base rules
479
466
  {
480
467
  files: ["**/*.{ts,tsx}"],
481
468
  plugins: {
@@ -506,7 +493,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import jc from"path
506
493
  ".raclette/**",
507
494
  ".gitignore"
508
495
  ]
509
- }`),s.push(Bc(o)),s.push(qc(o)),e.frontend?.framework==="vue"&&s.push(Xc(o)),e.frontend?.framework==="react"&&s.push(Gc(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
496
+ }`),s.push(nl(o)),s.push(ll(o)),e.frontend?.framework==="vue"&&s.push(dl(o)),e.frontend?.framework==="react"&&s.push(sl(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
510
497
  {
511
498
  rules: ${c}
512
499
  }`)}if(e.eslint?.ignores&&e.eslint.ignores.length>0){let c=JSON.stringify(e.eslint.ignores).replace(/^\[|\]$/g,"");s.push(` // User custom ignores
@@ -544,16 +531,16 @@ export const withRaclette = (...userConfigs) => {
544
531
 
545
532
  // Default export for direct usage
546
533
  export default racletteEslintConfig
547
- `;await Jc.writeFile(n,a),r&&await iy(t,e),f.debug(`Generated eslint.config.mjs in ${t}`)},oy=(e,t)=>{let r=[];return r.push(...Mc()),r.push(...Uc(t)),e.frontend?.framework==="vue"?r.push(...Kc()):e.frontend?.framework==="react"&&r.push(...Vc()),r},iy=async(e,t)=>{let r=Zc.join(e,"ESLINT-README.md"),n=t.eslint?.useRecommended!==!1,o=Fc(n),i=Wc(n),s=zc(t),a=[...o,...i,...s],u=`# Raclette ESLint Configuration
534
+ `;await ml.writeFile(n,a),r&&await Xy(t,e),f.debug(`Generated eslint.config.mjs in ${t}`)},Ky=(e,t)=>{let r=[];return r.push(...rl()),r.push(...cl(t)),e.frontend?.framework==="vue"?r.push(...pl()):e.frontend?.framework==="react"&&r.push(...il()),r},Xy=async(e,t)=>{let r=gl.join(e,"ESLINT-README.md"),n=t.eslint?.useRecommended!==!1,o=tl(n),i=al(n),s=fl(t),a=[...o,...i,...s],u=`# racletteJS ESLint Configuration
548
535
 
549
- This directory contains an auto-generated ESLint configuration for your Raclette project.
536
+ This directory contains an auto-generated ESLint configuration for your racletteJS project.
550
537
 
551
538
  ## Required Dependencies
552
539
 
553
540
  To use this ESLint configuration, you need to install the following dependencies:
554
541
 
555
542
  \`\`\`bash
556
- ${Qc(a)}
543
+ ${hl(a)}
557
544
  \`\`\`
558
545
 
559
546
  ## How to Use
@@ -578,7 +565,7 @@ export default withRaclette(
578
565
 
579
566
  ## Features
580
567
 
581
- - Project-aware configuration that understands your Raclette project structure
568
+ - Project-aware configuration that understands your racletteJS project structure
582
569
  - Framework-specific rules (Vue, React) automatically included based on your project
583
570
  - Seamless integration with your IDE
584
571
  - Clean, modern approach using ESLint's flat config system
@@ -617,7 +604,7 @@ export default withRaclette(
617
604
 
618
605
  \`\`\`js
619
606
  export default {
620
- // ...other Raclette config
607
+ // ...other racletteJS config
621
608
  eslint: {
622
609
  useRecommended: true, // Set to false to disable recommended rules
623
610
  rules: {
@@ -630,32 +617,49 @@ export default {
630
617
  }
631
618
  }
632
619
  \`\`\`
633
- `;await Jc.writeFile(r,u)};import{execSync as Ip}from"child_process";import U from"fs-extra";import te from"path";import pk from"chokidar";import $ from"fs-extra";import A from"path";var Dp=[".prettierrc","eslint.config.js"],fk=["bin/check-dependencies.sh"],Oe=async()=>{let e=A.join(process.cwd(),".raclette");return await $.ensureDir(e),e},Nn=async(e,t,r)=>{let n=process.cwd(),o=A.join(n,".raclette"),i=A.join(o,"virtual"),s=Ln();f.debug(`\u{1F4E6} Using core package at: ${s}`),await vk(o,s,fk),f.debug("[VFS] Cleaning virtual file system directory..."),await $.pathExists(i)&&await $.rm(i,{recursive:!0}),await $.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((y,k)=>k.priority-y.priority).map(y=>{let k=y.path.startsWith(".")?A.join(process.cwd(),y.path):y.path;return{...y,path:k}});await yk(l,c,i,u,Dp,o);let d=[],p=y=>{let k=A.relative(n,y);return c.get(k)||y},g=()=>{d.forEach(k=>k.close()),d.length=0,hk(l,u,i).forEach(k=>{if($.existsSync(k.sourcePath)){let R=mk(k,l,c,Dp);d.push(R)}})},m=()=>d.forEach(y=>y.close());return r||g(),{resolveFile:p,watchFiles:g,close:m}},hk=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",u=A.join(o.path,c,i,a);n.push({sourcePath:u,sourceDir:o,targetResolver:l=>A.join(r,i,a,l),mappingKeyResolver:l=>A.join(i,a,l)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=A.join(o.path,i);$.existsSync(a)&&$.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(l=>{n.push({sourcePath:A.dirname(a),sourceDir:o,targetResolver:d=>A.basename(a)===d?A.join(r,l):A.join(r,l,d),mappingKeyResolver:d=>A.basename(a)===d?i:A.join(i,d)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:u=>A.join(r,i,u),mappingKeyResolver:u=>A.join(i,u)})})}),n},mk=(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=pk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(bk(a,n))return;let u=e.mappingKeyResolver(a),l=e.targetResolver(a);await gk(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},gk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=Np(s,r,o);a?(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await $.pathExists(n)&&await $.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`))}else{let a=Np(s,r,o);a&&(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},Np=(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(A.join(i,a,r)===t){let u=n.servicePathMap?.[i]||"",l=A.join(n.path,u,i,a,r);if($.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=A.join(n.path,i),$.existsSync(l))return{sourceDir:n,fullPath:l}}else if(u=A.join(i,r),u===t&&(l=A.join(n.path,i,r),$.existsSync(l)))return{sourceDir:n,fullPath:l}}}}return null},Lp=async(e,t,r,n,o,i)=>{if(!await $.pathExists(t))return;await $.ensureDir(A.dirname(r));let s=e.name==="generated-service-files";await $.copy(t,r,{overwrite:!0,filter:u=>{let l=A.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 d=A.relative(t,u);return!d.startsWith("node_modules")&&!d.startsWith(".git")&&!d.startsWith("dist")}});let c=await _k(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=A.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 d=A.relative(t,u),p=A.join(o,d),g=A.join(r,d);n.set(p,g)}f.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},yk=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await $.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 d=A.join(s.path,l,a,u),p=A.join(r,a,u),g=A.join(a,u);await Lp(s,d,p,t,g,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let u=A.join(s.path,a),l=(Array.isArray(c)?c:[c]).map(p=>A.join(r,p)),d=await $.pathExists(u)&&(await $.stat(u)).isFile();if(!d&&s.clear)for(let p of l)await $.rm(p,{recursive:!0,force:!0}),await $.ensureDir(p);if(d)for(let p of l)await $.ensureDir(A.dirname(p)),await $.copy(u,p),t.set(a,p),f.debug(`[VFS] Mapped individual file ${a} -> ${p}`);else for(let p of l)await Lp(s,u,p,t,p,o)}}f.debug("[VFS] Built virtual file system")},bk=(e,t)=>t.includes(A.basename(e));var vk=async(e,t,r)=>{let n=A.join(e,"dist");await $.ensureDir(n);for(let o of r){let i=A.join(t,o),s=A.basename(o),a=A.join(n,s);await $.pathExists(a)&&await $.remove(a),await $.pathExists(i)&&(await $.ensureDir(A.dirname(a)),await $.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await $.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}},_k=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>($p(),Pp));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Ln=()=>{let e=process.cwd();f.debug("process.cwd(): "+process.cwd());let r=e.includes("node_modules")?[A.join(e.match(/(.*node_modules)/)?.[1]||"","@raclettejs/core"),A.join(e,"node_modules","@raclettejs/core"),A.join(e,"..","..","..","@raclettejs/core")]:[A.join(e,"node_modules","@raclettejs/core"),A.resolve(e,"..","..","raclette"),A.resolve(e,"..","..","@raclettejs/core"),A.resolve(e,"..","..","core"),A.resolve(e,"..","raclette"),A.resolve(e,"..","@raclettejs/core"),A.resolve(e,"..","core")];for(let n of r)if($.existsSync(n)){let o=A.join(n,"package.json");if($.existsSync(o))try{if(JSON.parse($.readFileSync(o,"utf8")).name==="@raclettejs/core")return n}catch{}}throw f.error("Could not determine core package path to set up VFS. Canceling..."),new Error("Could not determine core package path to set up VFS. Canceling...")},Ls=async(e,t)=>await $.pathExists(e)?(await $.ensureDir(A.dirname(t)),await $.copy(e,t),f.debug(`\u2705 Copied ${A.basename(e)} to ${t}`),!0):(f.warn(h.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var jp=e=>e==="frontend"||e==="backend",Fp=e=>e==="workbench.frontend"||e==="workbench.backend",Ek=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 kk(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}},kk=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await U.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 U.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}`)}},gr=(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=te.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},js=async(e,t)=>{let r=await Oe();if(!t)try{t=await import(te.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}jp(e)&&await Is(`services/${e}/package.json`,te.join(r,e),e,t,!1),Fp(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},xk=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=te.join(process.cwd(),"package.json");if(!await U.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await U.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}`),{}}},Is=async(e,t,r,n,o=!1)=>{let i=Ln();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await U.ensureDir(t);let s=te.join(i,e),a=te.dirname(s),c=te.join(t,"package.json");if(await U.pathExists(s))try{o&&f.debug("Reading source package.json...");let u=await U.readJson(s),l={dependencies:{},devDependencies:{}};(r==="frontend"||r==="backend")&&(l=await Ek(r,n,o));let d=await xk(n),p={...u.dependencies,...l.dependencies,...d},g={...u.devDependencies,...l.devDependencies},m=gt(u,{dependencies:p,devDependencies:g});o&&f.debug("Writing merged package.json..."),await U.writeJson(c,m,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await Rk(a,t,r,n)}catch(u){throw f.error(`Error setting up package.json for ${r}: ${u.message}`),u}else f.warn(`Warning: Could not find package.json at ${s}`)},In=async e=>{let t=te.join(process.cwd(),".raclette");if(f.progress("Setting up node packages for services..."),e.services.backend?.enabled){let r=te.join(t,"backend");await Is("services/backend/package.json",r,"backend",e,!0);let n=gr("backend",e),o=te.join(r,"yarn.lock");await Ls(n,o)}if(e.services.frontend?.enabled){let r=te.join(t,"frontend");await Is("services/frontend/package.json",r,"frontend",e,!0);let n=gr("frontend",e),o=te.join(r,"yarn.lock");await Ls(n,o)}},wk=async()=>{let e=te.join(process.cwd(),"packages.json");if(await U.pathExists(e))try{return await U.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:{}}}}},Ck=async e=>{let t=te.join(process.cwd(),"packages.json");await U.writeJson(t,e,{spaces:2})};var Ak=async(e,t,r=!1)=>{let n=te.join(process.cwd(),"package.json");if(!await U.pathExists(n))throw new Error("No package.json found in project root");try{Ip("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{Ip(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await U.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}`)}},Sk=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}},Mp=async(e,t,r=!1)=>{let{name:n,version:o}=Sk(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await Ak(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await wk(),a=r?"devDependencies":"dependencies";if(jp(e))s[e]||(s[e]={}),s[e][a]||(s[e][a]={}),s[e][a][n]=i,f.success(`Added ${n}@${i} to ${e} ${a}`);else if(Fp(e)){let c=e==="workbench.frontend"?"frontend":"backend";s.workbench||(s.workbench={}),s.workbench[c]||(s.workbench[c]={}),s.workbench[c][a]||(s.workbench[c][a]={}),s.workbench[c][a][n]=i,f.success(`Added ${n}@${i} to ${e} ${a}`),f.instruction("Note: Workbench packages are stored in packages.json but package.json files are not updated")}await Ck(s),f.success("Updated packages.json in project root")},jn=async e=>{let t=Ln();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=gr("frontend",e);if(await U.pathExists(r))f.debug(`\u{1F512} ${te.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"services","frontend","yarn.lock");await U.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await U.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await U.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
620
+ `;await ml.writeFile(r,u)};import{execSync as tf}from"child_process";import Y from"fs-extra";import re from"path";import rk from"chokidar";import D from"fs-extra";import P from"path";var Rt=Mo().name,zd=[".prettierrc","eslint.config.js"],nk=["bin/check-dependencies.sh"],Zd=async()=>{let e=P.join(process.cwd(),".raclette");return await D.ensureDir(e),e},Gn=async(e,t,r)=>{let n=process.cwd(),o=P.join(n,".raclette"),i=P.join(o,"virtual"),s=Un();f.debug(`\u{1F4E6} Using core package at: ${s}`),await lk(o,s,nk),f.debug("[VFS] Cleaning virtual file system directory..."),await D.pathExists(i)&&await D.rm(i,{recursive:!0}),await D.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((g,E)=>E.priority-g.priority).map(g=>{let E=g.path.startsWith(".")?P.join(process.cwd(),g.path):g.path;return{...g,path:E}});await ak(l,c,i,u,zd,o);let p=[],d=g=>{let E=P.relative(n,g);return c.get(E)||g},y=()=>{p.forEach(E=>E.close()),p.length=0,ok(l,u,i).forEach(E=>{if(D.existsSync(E.sourcePath)){let A=ik(E,l,c,zd);p.push(A)}})},m=()=>p.forEach(g=>g.close());return r||y(),{resolveFile:d,watchFiles:y,close:m}},ok=(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);D.existsSync(a)&&D.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},ik=(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=rk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(ck(a,n))return;let u=e.mappingKeyResolver(a),l=e.targetResolver(a);await sk(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},sk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=Jd(s,r,o);a?(await D.ensureDir(P.dirname(n)),await D.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await D.pathExists(n)&&await D.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`))}else{let a=Jd(s,r,o);a&&(await D.ensureDir(P.dirname(n)),await D.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},Jd=(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(D.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),D.existsSync(l))return{sourceDir:n,fullPath:l}}else if(u=P.join(i,r),u===t&&(l=P.join(n.path,i,r),D.existsSync(l)))return{sourceDir:n,fullPath:l}}}}return null},Qd=async(e,t,r,n,o,i)=>{if(!D.pathExistsSync(t))return;await D.ensureDir(P.dirname(r));let s=e.name==="generated-service-files";await D.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 uk(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}`)},ak=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await D.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 Qd(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 D.pathExists(u)&&(await D.stat(u)).isFile();if(!p&&s.clear)for(let d of l)await D.rm(d,{recursive:!0,force:!0}),await D.ensureDir(d);if(p)for(let d of l)await D.ensureDir(P.dirname(d)),await D.copy(u,d),t.set(a,d),f.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of l)await Qd(s,u,d,t,d,o)}}f.debug("[VFS] Built virtual file system")},ck=(e,t)=>t.includes(P.basename(e));var lk=async(e,t,r)=>{let n=P.join(e,"dist");await D.ensureDir(n);for(let o of r){let i=P.join(t,o),s=P.basename(o),a=P.join(n,s);await D.pathExists(a)&&await D.remove(a),await D.pathExists(i)&&(await D.ensureDir(P.dirname(a)),await D.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await D.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}},uk=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(Xd(),Kd));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Un=()=>{let e=process.cwd(),r=(e.includes("node_modules")?[[e.match(/(.*node_modules)/)?.[1]||"",Rt],[e,"node_modules",Rt],[e,"../../..",Rt]]:[[e,"node_modules",Rt],[e,"../..","raclette"],[e,"../..",Rt],[e,"../..","core"],[e,"..","raclette"],[e,"..",Rt],[e,"..","core"]]).map(o=>P.resolve(...o,"package.json")).find(o=>D.readJsonSync(o,{throws:!1})?.name===Rt);if(r)return r.slice(0,-12);let n="Could not determine core package path to set up VFS. Canceling...";throw f.error(n),new Error(n)},ef=async(e,t)=>await D.pathExists(e)?(await D.ensureDir(P.dirname(t)),await D.copy(e,t),f.debug(`\u2705 Copied ${P.basename(e)} to ${t}`),!0):(f.warn(h.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var pk=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 dk(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}},dk=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await Y.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 Y.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}`)}},Wn=(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=re.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},Zs=async(e,t)=>{let r=await Zd();if(!t)try{t=await import(re.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Be.includes(e)&&await rf(`services/${e}/package.json`,re.join(r,e),e,t,!1),eo.includes(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},fk=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=re.join(process.cwd(),"package.json");if(!await Y.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await Y.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}`),{}}},rf=async(e,t,r,n,o=!1)=>{let i=Un();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await Y.ensureDir(t);let s=re.join(i,e),a=re.dirname(s),c=re.join(t,"package.json");if(!Y.pathExistsSync(s))return f.warn(`Warning: Could not find package.json at ${s}`);o&&f.debug("Reading source package.json...");try{let u=await Y.readJson(s),l=["frontend","backend"].includes(r)?await pk(r,n,o):{dependencies:{},devDependencies:{}},p=await fk(n),d={...u.dependencies,...l.dependencies,...p},y={...u.devDependencies,...l.devDependencies},m=lt(u,{dependencies:d,devDependencies:y});o&&f.debug("Writing merged package.json..."),await Y.writeJson(c,m,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await vk(a,t,r,n)}catch(u){throw f.error(`Error setting up package.json for ${r}: ${u.message}`),u}},qn=async e=>{let t=re.join(process.cwd(),e.root);f.progress("Setting up node packages for services...");for(let r of Be){if(!e.services[r]?.enabled)continue;let n=re.join(t,r);await rf(`services/${r}/package.json`,n,r,e,!0),await ef(Wn(r,e),re.join(n,"yarn.lock"))}},hk=async()=>{let e=re.join(process.cwd(),"packages.json");if(await Y.pathExists(e))try{return await Y.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:{}}}}},mk=async e=>{let t=re.join(process.cwd(),"packages.json");await Y.writeJson(t,e,{spaces:2})};var gk=async(e,t,r=!1)=>{let n=re.join(process.cwd(),"package.json");if(!await Y.pathExists(n))throw new Error("No package.json found in project root");try{tf("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{tf(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await Y.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}`)}},yk=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}},nf=async(e,t,r=!1)=>{let{name:n,version:o}=yk(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await gk(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await hk(),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 mk(s),f.success("Updated packages.json in project root")},Yn=async e=>{let t=Un();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=Wn("frontend",e);if(await Y.pathExists(r))f.debug(`\u{1F512} ${re.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=re.join(t,"services","frontend","yarn.lock");await Y.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await Y.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await Y.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
634
621
  # yarn lockfile v1
635
622
 
636
- `)),f.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}if(e.services.backend?.enabled){let r=gr("backend",e);if(await U.pathExists(r))f.debug(`\u{1F512} ${te.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"services","backend","yarn.lock");await U.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await U.copy(n,r)):(f.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await U.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
623
+ `)),f.debug(`\u{1F512}\u2705 Created ${re.basename(r)}`)}}if(e.services.backend?.enabled){let r=Wn("backend",e);if(await Y.pathExists(r))f.debug(`\u{1F512} ${re.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=re.join(t,"services","backend","yarn.lock");await Y.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await Y.copy(n,r)):(f.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await Y.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
637
624
  # yarn lockfile v1
638
625
 
639
- `)),f.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}f.success("Lock files ready for volume mounting")},Rk=async(e,t,r,n)=>{let o=te.join(t,"yarn.lock");f.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=gr(r,n)),i&&await U.pathExists(i))f.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await U.copy(i,o);else{let s=te.join(e,"yarn.lock");await U.pathExists(s)?(f.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await U.copy(s,o)):(f.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await U.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
626
+ `)),f.debug(`\u{1F512}\u2705 Created ${re.basename(r)}`)}}f.success("Lock files ready for volume mounting")},vk=async(e,t,r,n)=>{let o=re.join(t,"yarn.lock");f.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=Wn(r,n)),i&&await Y.pathExists(i))f.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await Y.copy(i,o);else{let s=re.join(e,"yarn.lock");await Y.pathExists(s)?(f.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await Y.copy(s,o)):(f.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await Y.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
640
627
  # yarn lockfile v1
641
628
 
642
- `))}};import Bp from"fs-extra";import Hp from"path";var Fn=async(e,t)=>{let r=Hp.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"&&(Ok(t),n.include.push("shims.vue.d.ts")),await Bp.writeFile(r,JSON.stringify(n,null,2)),f.debug(`Generated tsconfig.json in ${t}`)},Ok=async e=>{await Bp.writeFile(Hp.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
629
+ `))}};import of from"fs-extra";import sf from"path";var Kn=async(e,t)=>{let r=sf.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"&&(bk(t),n.include.push("shims.vue.d.ts")),await of.writeFile(r,JSON.stringify(n,null,2)),f.debug(`Generated tsconfig.json in ${t}`)},bk=async e=>{await of.writeFile(sf.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
643
630
  import { DefineComponent } from "vue"
644
631
  const component: DefineComponent<{}, {}, any>
645
632
  export default component
646
- }`)};var yr=new Map,Vp=async(e,t)=>{f.raclette("Starting development environment...");let r=Je.dirname(t.dockerComposePath),n=e.name??Je.basename(process.cwd()),o=$a(),i={kill:()=>(o(),!0)};yr.set("originalConfigWatcher",i),await jn(e),await In(e),await Nn(e),Wr("raclette_shared"),await To(e,t.workingDir,t.dockerComposePath,!1,"development",!0),await Fn(e,r),await Qr(e,r);let s=await Xr(e,r,t.forceRebuild??!1);s.length>0&&await zr(e,r,s,{noCache:t.noCache});let a=Pk(e),c=$k(a);c.length>0&&f.info(`Found existing services: ${c.join(", ")}`);let u=Dk(e,n,t.dockerComposePath);["SIGINT","SIGTERM"].forEach(l=>{process.removeAllListeners(l),process.on(l,()=>u(l))}),t.quiet?(await Gp(e,n,t.dockerComposePath,a,c),console.log(h.green(`
647
- \u2705 Development environment is ready!`)),a.frontend.enabled&&console.log(h.blue(`\u{1F30D} Frontend running at: http://localhost:${a.frontend.port}`)),a.backend.enabled&&console.log(h.blue(`\u{1F680} Server running at: http://localhost:${a.backend.port}`)),console.log(h.yellow(`
648
- \u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await Nk(e,n,t.dockerComposePath,a,c,t.logFilter,t.verbose)},Pk=e=>{let t=e.name??Je.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}}},$k=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&ir(n.containerName)&&t.push(r)}),t},Dk=(e,t,r)=>n=>{console.log(`
633
+ }`)};import rt from"fs-extra";import Ot from"path";var af=async(e,t)=>{try{await rt.ensureDir(Ot.dirname(e)),await rt.pathExists(e)&&(await rt.stat(e)).isDirectory()&&(console.warn(h.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await rt.remove(e)),await rt.writeFile(e,t)}catch(r){throw f.error(` Error writing file ${e}: ${r.message}`),r}},cf=async(e,t)=>{f.debug("Generating service configuration files...");let r=Ot.join(t,"backend"),n=Ot.join(t,"frontend");await rt.ensureDir(r),await rt.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=`
634
+ // Generated racletteJS Backend Configuration
635
+ // This file is auto-generated, do not edit directly
636
+
637
+ export const racletteConfig = ${JSON.stringify(i,null,2)};
638
+
639
+ export default racletteConfig;
640
+ `;await af(Ot.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
641
+ // Generated racletteJS Frontend Configuration
642
+ // This file is auto-generated, do not edit directly
643
+
644
+ export const racletteConfig = ${JSON.stringify(a,null,2)};
645
+
646
+ export default racletteConfig;
647
+ `;await af(Ot.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var Xn=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},zn=async(e,t=process.cwd())=>{let r=Ot.join(t,".raclette"),n=Ot.join(r,"raclette.config.workbench.js");await rt.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
648
+
649
+ export default defineRacletteConfig(${JSON.stringify(e,null,2)})
650
+ `;return await rt.writeFile(n,o,"utf8"),n};var Tr=new Map,lf=async(e,t,r,n)=>{f.raclette("Starting development environment...");let o=nt.dirname(n.dockerComposePath),i=r.name??nt.basename(e),s=Jc(e,t),a={kill:()=>(s(),!0)};Tr.set("originalConfigWatcher",a),await Yn(r),await qn(r),await Gn(r),Zr("raclette_shared"),await Ko(r,n.workingDir,n.dockerComposePath,!1,"development",!0),await Kn(r,o),await an(r,o);let c=await on(r,o,n.forceRebuild??!1);c.length>0&&await sn(r,o,c,{noCache:n.noCache});let u=Ek(r),l=xk(u);l.length>0&&f.info(`Found existing services: ${l.join(", ")}`);let p=kk(r,i,n.dockerComposePath);["SIGINT","SIGTERM"].forEach(d=>{process.removeAllListeners(d),process.on(d,()=>p(d))}),n.quiet?(await uf(r,i,n.dockerComposePath,u,l),console.log(h.green(`
651
+ \u2705 Development environment is ready!`)),u.frontend.enabled&&console.log(h.blue(`\u{1F30D} Frontend running at: http://localhost:${u.frontend.port}`)),u.backend.enabled&&console.log(h.blue(`\u{1F680} Server running at: http://localhost:${u.backend.port}`)),console.log(h.yellow(`
652
+ \u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await wk(r,i,n.dockerComposePath,u,l,n.logFilter,n.verbose)},Ek=e=>{let t=e.name??nt.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}}},xk=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&br(n.containerName)&&t.push(r)}),t},kk=(e,t,r)=>n=>{console.log(`
649
653
  `+"=".repeat(80)),console.log(h.bold.yellow(` CLEANUP: Shutting down services after ${n}...`)),console.log("=".repeat(80)+`
650
- `);for(let[o,i]of yr.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(h.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{Wp(e),ye(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
651
- `+"=".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)},Gp=async(e,t,r,n,o,i)=>{if(console.log(h.blue("\u{1F433} Starting Docker services...")),!await Fs.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{ye(["-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 Lk(e,i)}catch(a){f.error(`Error starting Workbench: ${a.message}`)}},Nk=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await Gp(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=Je.resolve(r),u=["-p",t,"-f",c,"logs","--follow",...a];try{f.debug("Running Docker Compose logs...");let l=Ms("docker",["compose",...u],{stdio:"inherit",shell:!0,cwd:Je.dirname(c)});return yr.set("dockerLogs",l),new Promise(d=>{l.on("close",p=>{l.killed||console.log(h.yellow(`
652
- Log process ended with code ${p??0}`)),d()}),l.on("error",p=>{f.error(` Error with log process: ${p.message}`),d()})})}catch(l){throw f.error(`Error setting up log following: ${l.message}`),l}},Mn=async e=>{if(!e.services?.workbench?.enabled)return;let t=Je.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await Fs.pathExists(t))throw f.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=Je.join(t,"package.json");if(!await Fs.pathExists(r))throw f.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},Lk=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await Mn(e);if(!r)return;let n=Je.join(process.cwd(),"workbenchPlugins");await Tk(n)||(n=void 0);let o;if(e.workbench)try{Pr(e.workbench),o=await $r(e.workbench)}catch(a){throw console.error(h.red("Workbench configuration error:"),a.message),a}let i=Object.fromEntries(Object.entries(e.env.development||{}).filter(([a])=>a.startsWith("RACLETTE_")).flatMap(([a,c])=>{let u=[[a,c]];if(a.startsWith("RACLETTE_WORKBENCH_")){let l=a.replace("RACLETTE_WORKBENCH_","RACLETTE_");u.push([l,c])}return u}));e.services?.workbench?.debugPort&&(i.ENABLE_DEBUG=!0,i.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let s={...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),...i};return new Promise((a,c)=>{let u=`${e.name}-workbench`;f.progress("Starting workbench as "+u);let l=["dev",t?"-v":"","-p",u,...o?["-f",o]:[]].filter(m=>m!==""),d=e.services?.workbench?.withLogs||t,p=Ms("yarn",l,{cwd:r,env:s,stdio:d?"pipe":"ignore"});yr.set("workbench",p),d&&(p.stdout?.on("data",m=>{m.toString().trim().split(`
653
- `).forEach(k=>{console.log(h.magenta(`[Workbench] ${k}`))})}),p.stderr?.on("data",m=>{m.toString().trim().split(`
654
- `).forEach(k=>{console.error(h.red(`[Workbench] ${k}`))})}),p.stdout?.on("data",m=>{m.toString().includes("VITE v")&&(clearTimeout(g),a())}));let g=setTimeout(()=>{a()},d?1e3*60*5:5e3);p.on("close",m=>{clearTimeout(g),m!==0&&m!==null?(console.error(h.red(`Workbench process exited with code ${m}`)),c(new Error(`Workbench process exited with code ${m}`))):a()}),p.on("error",m=>{clearTimeout(g),console.error(h.red("Workbench process error:"),m),c(m)}),d||setTimeout(a,1e3)})},Wp=async e=>{if(e.services?.workbench?.enabled)try{let t=await Mn(e);if(!t)return;Ms("yarn",["down","-p",`${e.name}-workbench`],{cwd:t,stdio:"pipe"})}catch{f.debug("Workbench down command failed, forcing process termination");let r=yr.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{Lc(n)}catch(o){f.warn(`Could not stop workbench containers: ${o.message}`)}}}},Bs=(e,t)=>{let r=t?.name??Je.basename(process.cwd());f.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),f.raclette("Stopping all Docker services...");try{Wp(t),ye(["-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 qp from"fs-extra";import Yp from"path";var Ik=e=>Tt(e),br=async(e,t,r)=>{let o=`${t?.name??Yp.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await qp.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},Up=async(e,t,r)=>{let n=await br(e,t,r);if(!Ik(n))return!1;try{console.log(h.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),Ro(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=Ro(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}},Hs=async(e,t,r)=>{console.log(h.blue("\u{1F9C0} Updating package dependencies..."));let n=Yp.join(r,"docker-compose.yml");if(!await qp.pathExists(n))return console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running with Raclette.")),!1;let o=!1,i=!0;if(e==="frontend"||e==="both"){let s=await Up("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await Up("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 zp}from"child_process";import Kp from"path";var Qp=async(e,t,r,n)=>{if(e.includes("workbench")){await Mk(r,t);return}let o=[];if(e.length===0)o=Xp(r),console.log(h.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=Xp(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 jk(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 Fk(r,n,o,t)};function Xp(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 jk(e,t,r){let n=[];for(let o of e)try{let i=await br(o,t,r);Tt(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 Fk(e,t,r,n){let o=e?.name??Kp.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=zp("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:Kp.dirname(t)});s.on("close",a=>{s.killed||console.log(h.yellow(`
654
+ `);for(let[o,i]of Tr.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(h.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{pf(e),_e(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
655
+ `+"=".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)},uf=async(e,t,r,n,o,i)=>{if(console.log(h.blue("\u{1F433} Starting Docker services...")),!await ea.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{_e(["-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 Ck(e,i)}catch(a){f.error(`Error starting Workbench: ${a.message}`)}},wk=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await uf(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=nt.resolve(r),u=["-p",t,"-f",c,"logs","--follow",...a];try{f.debug("Running Docker Compose logs...");let l=ta("docker",["compose",...u],{stdio:"inherit",shell:!0,cwd:nt.dirname(c)});return Tr.set("dockerLogs",l),new Promise(p=>{l.on("close",d=>{l.killed||console.log(h.yellow(`
656
+ 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}},Jn=async e=>{if(!e.services?.workbench?.enabled)return;let t=nt.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await ea.pathExists(t))throw f.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=nt.join(t,"package.json");if(!await ea.pathExists(r))throw f.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},Ck=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await Jn(e);if(!r)return;let n=nt.join(process.cwd(),"workbenchPlugins");await _k(n)||(n=void 0);let o;if(e.workbench)try{Xn(e.workbench),o=await zn(e.workbench)}catch(a){throw console.error(h.red("Workbench configuration error:"),a.message),a}let i=Object.fromEntries(Object.entries(e.env.development||{}).filter(([a])=>a.startsWith("RACLETTE_")).flatMap(([a,c])=>{let u=[[a,c]];if(a.startsWith("RACLETTE_WORKBENCH_")){let l=a.replace("RACLETTE_WORKBENCH_","RACLETTE_");u.push([l,c])}return u}));e.services?.workbench?.debugPort&&(i.ENABLE_DEBUG=!0,i.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let s={...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),...i};return new Promise((a,c)=>{let u=`${e.name}-workbench`;f.progress("Starting workbench as "+u);let l=["dev",t?"-v":"","-p",u,...o?["-f",o]:[]].filter(m=>m!==""),p=e.services?.workbench?.withLogs||t,d=ta("yarn",l,{cwd:r,env:s,stdio:p?"pipe":"ignore"});Tr.set("workbench",d),p&&(d.stdout?.on("data",m=>{m.toString().trim().split(`
657
+ `).forEach(E=>{console.log(h.magenta(`[Workbench] ${E}`))})}),d.stderr?.on("data",m=>{m.toString().trim().split(`
658
+ `).forEach(E=>{console.error(h.red(`[Workbench] ${E}`))})}),d.stdout?.on("data",m=>{m.toString().includes("VITE v")&&(clearTimeout(y),a())}));let y=setTimeout(()=>{a()},p?1e3*60*5:5e3);d.on("close",m=>{clearTimeout(y),m!==0&&m!==null?(console.error(h.red(`Workbench process exited with code ${m}`)),c(new Error(`Workbench process exited with code ${m}`))):a()}),d.on("error",m=>{clearTimeout(y),console.error(h.red("Workbench process error:"),m),c(m)}),p||setTimeout(a,1e3)})},pf=async e=>{if(e.services?.workbench?.enabled)try{let t=await Jn(e);if(!t)return;ta("yarn",["down","-p",`${e.name}-workbench`],{cwd:t,stdio:"pipe"})}catch{f.debug("Workbench down command failed, forcing process termination");let r=Tr.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{Qc(n)}catch(o){f.warn(`Could not stop workbench containers: ${o.message}`)}}}},ra=(e,t)=>{let r=t?.name??nt.basename(process.cwd());f.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),f.raclette("Stopping all Docker services...");try{pf(t),_e(["-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 ff from"fs-extra";import hf from"path";var Ak=e=>Ht(e),Pr=async(e,t,r)=>{let o=`${t?.name??hf.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await ff.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},df=async(e,t,r)=>{let n=await Pr(e,t,r);if(!Ak(n))return!1;try{console.log(h.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),qo(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=qo(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=hf.join(r,"docker-compose.yml");if(!await ff.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 df("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await df("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 yf}from"child_process";import mf from"path";var vf=async(e,t,r,n)=>{if(e.includes("workbench")){await Ok(r,t);return}let o=[];if(e.length===0)o=gf(r),console.log(h.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=gf(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 Sk(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 Rk(r,n,o,t)};function gf(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 Sk(e,t,r){let n=[];for(let o of e)try{let i=await Pr(o,t,r);Ht(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 Rk(e,t,r,n){let o=e?.name??mf.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=yf("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:mf.dirname(t)});s.on("close",a=>{s.killed||console.log(h.yellow(`
655
659
  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(`
656
- \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 Mk(e,t){console.log(h.blue("\u{1F527} Handling workbench logs..."));let r=Mn(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=zp("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(h.yellow(`
660
+ \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 Ok(e,t){console.log(h.blue("\u{1F527} Handling workbench logs..."));let r=Jn(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=yf("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(h.yellow(`
657
661
  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(`
658
- \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 Qk}from"child_process";import V from"fs-extra";import H from"path";import{execSync as Bk}from"child_process";import B from"fs-extra";import W from"path";var Vs=async(e,t,r)=>{console.log(h.blue("\u{1F4E6} Creating production artifacts...")),await Gk(t,e,r);let n=W.join(t,"docker-compose.yml");return await Wk(e,t,n,r),await Uk(e,t,r),await qk(t,r,e),console.log(h.green("\u2705 Production artifacts created")),n},Jp=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=W.join(t,a),u=W.basename(a),l=W.join(r,u);if(await B.ensureDir(W.dirname(l)),await B.pathExists(c))await B.copy(c,l),o&&await B.chmod(l,493),console.log(h.gray(`${s} \u2705 Copied ${a}`));else{let d=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${d}`);console.log(h.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},Hk=async(e,t,r)=>Jp(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),Vk=async(e,t,r,n)=>Jp(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),Gk=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
662
+ \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 Hk}from"child_process";import G from"fs-extra";import V from"path";import{execSync as Tk}from"child_process";import H from"fs-extra";import W from"path";var oa=async(e,t,r)=>{console.log(h.blue("\u{1F4E6} Creating production artifacts...")),await Dk(t,e,r);let n=W.join(t,"docker-compose.yml");return await Nk(e,t,n,r),await Lk(e,t,r),await Ik(t,r,e),console.log(h.green("\u2705 Production artifacts created")),n},bf=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=W.join(t,a),u=W.basename(a),l=W.join(r,u);if(await H.ensureDir(W.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)`))}}},Pk=async(e,t,r)=>bf(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),$k=async(e,t,r,n)=>bf(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),Dk=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
659
663
  FROM nginx:alpine
660
664
  COPY service/frontend /usr/share/nginx/html
661
665
  COPY nginx.conf /etc/nginx/conf.d/default.conf
@@ -764,7 +768,7 @@ server {
764
768
  proxy_set_header Host $host;
765
769
  }
766
770
  }
767
- `;if(await B.writeFile(W.join(e,"Dockerfile.frontend"),i),await B.writeFile(W.join(e,"Dockerfile.backend"),s),await B.writeFile(W.join(e,"nginx.conf"),a),await Hk(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let u=`
771
+ `;if(await H.writeFile(W.join(e,"Dockerfile.frontend"),i),await H.writeFile(W.join(e,"Dockerfile.backend"),s),await H.writeFile(W.join(e,"nginx.conf"),a),await Pk(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let u=`
768
772
  FROM nginx:alpine
769
773
  COPY workbench/frontend /usr/share/nginx/html
770
774
  COPY nginx.workbench.conf /etc/nginx/conf.d/default.conf
@@ -812,7 +816,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \\
812
816
 
813
817
  ENTRYPOINT ["/sbin/tini", "--"]
814
818
  CMD ["yarn", "start"]
815
- `,d=`
819
+ `,p=`
816
820
  server {
817
821
  listen ${o};
818
822
  root /usr/share/nginx/html;
@@ -842,7 +846,7 @@ server {
842
846
  proxy_set_header Authorization $http_authorization;
843
847
  }
844
848
  }
845
- `;await B.writeFile(W.join(e,"Dockerfile.workbench-frontend"),u),await B.writeFile(W.join(e,"Dockerfile.workbench-backend"),l),await B.writeFile(W.join(e,"nginx.workbench.conf"),d)}},Wk=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}`)]},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}`)]},database:{image:"mongo:5.0.6",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:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},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:-http://localhost:${i}/api}`,"RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(u).map(([l,d])=>`${l}=${d}`)]},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,d])=>`${l}=${d}`)]}}await B.writeFile(r,it.dump(a))},Uk=async(e,t,r)=>{let n=Gs(e,r);await B.writeFile(W.join(t,".env.example"),n)},Gs=(e,t)=>{let r=e.services.frontend?.port||8081,n=e.services.workbench?.frontendPort||8083;return`# Production Environment Variables
849
+ `;await H.writeFile(W.join(e,"Dockerfile.workbench-frontend"),u),await H.writeFile(W.join(e,"Dockerfile.workbench-backend"),l),await H.writeFile(W.join(e,"nginx.workbench.conf"),p)}},Nk=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}`)]},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}`)]},database:{image:"mongo:5.0.6",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:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},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:-http://localhost:${i}/api}`,"RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(u).map(([l,p])=>`${l}=${p}`)]},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}`)]}}await H.writeFile(r,Ce.dump(a))},Lk=async(e,t,r)=>{let n=ia(e,r);await H.writeFile(W.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
846
850
  # Copy this file to .env and fill in your values
847
851
 
848
852
  # Required - Generate a secure random string for this
@@ -880,12 +884,12 @@ ${Object.keys(e.env.production||{}).map(i=>`# ${i}=`).join(`
880
884
 
881
885
  # Cache specific overrides (uncomment if using external Valkey/Redis)
882
886
  # RACLETTE_CACHE_URL=valkey://your-external-cache:6379
883
- `},qk=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
884
- # Raclette Production Deployment Script
887
+ `},Ik=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
888
+ # racletteJS Production Deployment Script
885
889
 
886
890
  set -e
887
891
 
888
- echo "\u{1F680} Deploying Raclette application..."
892
+ echo "\u{1F680} Deploying racletteJS application..."
889
893
 
890
894
  # Check if .env file exists
891
895
  if [ ! -f .env ]; then
@@ -933,12 +937,12 @@ echo " - Built with TypeScript and compiled to dist/src/server.js"
933
937
  echo " - Runs on Node.js 24 Alpine with production dependencies only"
934
938
  echo " - Should listen on 0.0.0.0:3000 for proper container networking"
935
939
  echo " - Accessible via /api proxy on port ${n}"
936
- `,s=W.join(e,"deploy.sh");await B.writeFile(s,i),await B.chmod(s,493)},Zp=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:5.0.6",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",`${$t("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=st(i,t);n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=Yr(i.volumes,t))}),await B.writeFile(r,it.dump(n))},ef=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",`${$t("frontend",e)}:/app/yarn.lock`,`${W.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=st(a,t);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",`${$t("backend",e)}:/app/yarn.lock`,"./.raclette/virtual/backend/types:/app/types",`${W.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=st(a,t);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=Yr(s.volumes,t))}),await B.writeFile(r,it.dump(o))},Yk=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
937
- # Raclette Production Deployment Script with Image Loading
940
+ `,s=W.join(e,"deploy.sh");await H.writeFile(s,i),await H.chmod(s,493)},_f=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:5.0.6",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",`${Gt("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=dt(i,t);n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=rn(i.volumes,t))}),await H.writeFile(r,Ce.dump(n))},Ef=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",`${Gt("frontend",e)}:/app/yarn.lock`,`${W.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=dt(a,t);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",`${Gt("backend",e)}:/app/yarn.lock`,"./.raclette/virtual/backend/types:/app/types",`${W.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=dt(a,t);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=rn(s.volumes,t))}),await H.writeFile(r,Ce.dump(o))},jk=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
941
+ # racletteJS Production Deployment Script with Image Loading
938
942
 
939
943
  set -e
940
944
 
941
- echo "\u{1F680} Deploying Raclette application from packaged images..."
945
+ echo "\u{1F680} Deploying racletteJS application from packaged images..."
942
946
 
943
947
  # Check if running from package directory
944
948
  if [ ! -d "images" ]; then
@@ -988,7 +992,7 @@ echo " View logs: docker compose logs -f"
988
992
  echo " Stop: docker compose down"
989
993
  echo " Restart: docker compose restart"
990
994
  echo " Update images: ./load-images.sh && docker compose up -d"
991
- `;await B.writeFile(W.join(e,"deploy.sh"),s),await B.chmod(W.join(e,"deploy.sh"),493)},Kk=async(e,t)=>{let r=`#!/bin/bash
995
+ `;await H.writeFile(W.join(e,"deploy.sh"),s),await H.chmod(W.join(e,"deploy.sh"),493)},Fk=async(e,t)=>{let r=`#!/bin/bash
992
996
  # Load Docker Images Script
993
997
 
994
998
  set -e
@@ -1020,9 +1024,9 @@ echo "\u2705 All images loaded successfully!"
1020
1024
  echo ""
1021
1025
  echo "\u{1F433} Available images:"
1022
1026
  docker images | grep -E "${t.map(n=>n.split(":")[0]).join("|")}" || echo "No images found (this might be expected if tags changed)"
1023
- `;await B.writeFile(W.join(e,"load-images.sh"),r),await B.chmod(W.join(e,"load-images.sh"),493)},Xk=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
1027
+ `;await H.writeFile(W.join(e,"load-images.sh"),r),await H.chmod(W.join(e,"load-images.sh"),493)},Mk=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
1024
1028
 
1025
- This package contains everything needed to deploy your Raclette application.
1029
+ This package contains everything needed to deploy your racletteJS application.
1026
1030
 
1027
1031
  ## Contents
1028
1032
 
@@ -1107,7 +1111,7 @@ ${n?`- Workbench: http://localhost:${i}`:""}
1107
1111
  - Ports ${o}${n?`, ${i}`:""} available
1108
1112
 
1109
1113
  Generated on: ${new Date().toISOString()}
1110
- `;await B.writeFile(W.join(e,"README.md"),s)},tf=async(e,t,r,n,o)=>{console.log(h.blue("\u{1F4E6} Packaging images for distribution..."));let i=W.join(t,"..","package"),s=`${e.name}-deployment-${n}`,a=W.join(i,`${s}.tar.gz`);await B.ensureDir(i),await B.emptyDir(i);let c=W.join(i,s);await B.ensureDir(c);try{console.log(h.gray(" \u{1F4BE} Exporting Docker images..."));let u=W.join(c,"images");await B.ensureDir(u);for(let d of r){let p=`${d.replace(/[:/]/g,"_")}.tar`,g=W.join(u,p);console.log(h.gray(` \u{1F4E6} Exporting ${d}...`)),ce(["save","-o",g,d],{stdio:"pipe"});let m=await B.stat(g);if(m.size===0)throw new Error(`Failed to export image ${d}`);console.log(h.gray(` \u2705 Exported ${d} (${(m.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 Vk(l,t,c,{required:!1,logPrefix:" "}),await Yk(c,r,o,e),await Kk(c,r),await Xk(c,e,r,o),console.log(h.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await zk(c,a),await B.remove(c),console.log(h.green(` \u2705 Deployment package created: ${s}.tar.gz`)),{packagePath:a,imageNames:r}}catch(u){throw await B.remove(c).catch(()=>{}),u}},zk=async(e,t)=>{let r=W.dirname(e),n=W.basename(e);Bk(`tar -czf "${t}" -C "${r}" "${n}"`,{stdio:"pipe"});let o=await B.stat(t);console.log(h.gray(` \u{1F4E6} Package size: ${(o.size/1024/1024).toFixed(1)}MB`))};var rf=async(e,t,r={})=>{let n=Date.now(),o=Jk(r);console.log(h.blue(`\u{1F9C0} Starting Raclette ${o} build...`)),Gr();let i=H.join(process.cwd(),".raclette"),s=H.resolve(r.outputDir||H.join(i,".build"));await V.ensureDir(s),await V.emptyDir(s);try{await sx(e,t,i),await ax(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await Zk(e,i,s,r);break;case"images":a=await nf(e,i,s,r);break;case"package":a=await ex(e,i,s,r);break}let c=(Date.now()-n)/1e3;return f.success(` ${o} build completed in ${c}s`),ix(a,e),a}catch(a){throw f.error(`${o} build failed: ${a.message}`),a}},Jk=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),Zk=async(e,t,r,n)=>{if(n.buildOnly){console.log(h.blue("\u{1F4C1} Building application files only...")),await Ws(e,t,r,n);let i=await Us(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=H.join(r,"service");await Ws(e,t,i,n);let s=await Us(e,r,n),a=await Vs(e,r,s),c=await ox(e,r,s);return console.log(h.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:H.join(r,"deploy.sh"),readmeFile:c,envExampleFile:H.join(r,".env.example")}}}},nf=async(e,t,r,n)=>{console.log(h.blue("\u{1F433} Building Docker images for CI/CD..."));let o=H.join(r,"service");await Ws(e,t,o,n);let i=await Us(e,r,n);await Vs(e,r,i);let s=await tx(e,r,i,n);return console.log(h.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},ex=async(e,t,r,n)=>{console.log(h.blue("\u{1F4E6} Building offline deployment package..."));let o=await nf(e,t,r,n),i=of(),s=await tf(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}},tx=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||of(),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 rx(),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 d of l){let p=`${o}/${d}`,g=H.join(t,`Dockerfile.${d}`);if(!await V.pathExists(g))throw new Error(`Dockerfile not found: ${g}`);let m=u.map(y=>`${p}:${y}`);c.push(...m),await nx({context:t,dockerfile:g,tags:m,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(h.gray(` \u2705 Built ${d} for ${s}`)),m.forEach(y=>{console.log(h.gray(` ${y}`))})}}else{console.log(h.gray(" \u{1F528} Building single-architecture images..."));let d=["-f",H.join(t,"docker-compose.yml"),"build"];n.noCache&&d.push("--no-cache"),ye(d,{stdio:n.verbose?"inherit":"pipe",cwd:t});let p=["frontend","backend"];r&&p.push("workbench-frontend","workbench-backend");for(let g of p){let m=`${H.basename(t)}-${g}`.replace(/\./,""),y=`${o}/${g}`;u.forEach(k=>{let R=`${y}:${k}`;ce(["tag",m,R],{stdio:"pipe"}),c.push(R)}),console.log(h.gray(` \u2705 Tagged ${g}`))}}return console.log(h.green(" \u2705 Docker images built and tagged")),{names:c,tags:u}},rx=async()=>{try{ce(["buildx","version"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),ce(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Creating buildx builder...")),ce(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),ce(["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")}},nx=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{ce(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},ox=async(e,t,r)=>{let n=H.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
1114
+ `;await H.writeFile(W.join(e,"README.md"),s)},xf=async(e,t,r,n,o)=>{console.log(h.blue("\u{1F4E6} Packaging images for distribution..."));let i=W.join(t,"..","package"),s=`${e.name}-deployment-${n}`,a=W.join(i,`${s}.tar.gz`);await H.ensureDir(i),await H.emptyDir(i);let c=W.join(i,s);await H.ensureDir(c);try{console.log(h.gray(" \u{1F4BE} Exporting Docker images..."));let u=W.join(c,"images");await H.ensureDir(u);for(let p of r){let d=`${p.replace(/[:/]/g,"_")}.tar`,y=W.join(u,d);console.log(h.gray(` \u{1F4E6} Exporting ${p}...`)),le(["save","-o",y,p],{stdio:"pipe"});let m=await H.stat(y);if(m.size===0)throw new Error(`Failed to export image ${p}`);console.log(h.gray(` \u2705 Exported ${p} (${(m.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 $k(l,t,c,{required:!1,logPrefix:" "}),await jk(c,r,o,e),await Fk(c,r),await Mk(c,e,r,o),console.log(h.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await Bk(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}},Bk=async(e,t)=>{let r=W.dirname(e),n=W.basename(e);Tk(`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 kf=async(e,t,r={})=>{let n=Date.now(),o=Vk(r);console.log(h.blue(`\u{1F9C0} Starting racletteJS ${o} build...`)),Qr();let i=V.join(process.cwd(),".raclette"),s=V.resolve(r.outputDir||V.join(i,".build"));await G.ensureDir(s),await G.emptyDir(s);try{await zk(e,t,i),await Jk(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await Gk(e,i,s,r);break;case"images":a=await wf(e,i,s,r);break;case"package":a=await Uk(e,i,s,r);break}let c=(Date.now()-n)/1e3;return f.success(` ${o} build completed in ${c}s`),Xk(a,e),a}catch(a){throw f.error(`${o} build failed: ${a.message}`),a}},Vk=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),Gk=async(e,t,r,n)=>{if(n.buildOnly){console.log(h.blue("\u{1F4C1} Building application files only...")),await sa(e,t,r,n);let i=await aa(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=V.join(r,"service");await sa(e,t,i,n);let s=await aa(e,r,n),a=await oa(e,r,s),c=await Kk(e,r,s);return console.log(h.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:V.join(r,"deploy.sh"),readmeFile:c,envExampleFile:V.join(r,".env.example")}}}},wf=async(e,t,r,n)=>{console.log(h.blue("\u{1F433} Building Docker images for CI/CD..."));let o=V.join(r,"service");await sa(e,t,o,n);let i=await aa(e,r,n);await oa(e,r,i);let s=await Wk(e,r,i,n);return console.log(h.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},Uk=async(e,t,r,n)=>{console.log(h.blue("\u{1F4E6} Building offline deployment package..."));let o=await wf(e,t,r,n),i=Cf(),s=await xf(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}},Wk=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||Cf(),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 qk(),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=V.join(t,`Dockerfile.${p}`);if(!await G.pathExists(y))throw new Error(`Dockerfile not found: ${y}`);let m=u.map(g=>`${d}:${g}`);c.push(...m),await Yk({context:t,dockerfile:y,tags:m,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(h.gray(` \u2705 Built ${p} for ${s}`)),m.forEach(g=>{console.log(h.gray(` ${g}`))})}}else{console.log(h.gray(" \u{1F528} Building single-architecture images..."));let p=["-f",V.join(t,"docker-compose.yml"),"build"];n.noCache&&p.push("--no-cache"),_e(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 m=`${V.basename(t)}-${y}`.replace(/\./,""),g=`${o}/${y}`;u.forEach(E=>{let A=`${g}:${E}`;le(["tag",m,A],{stdio:"pipe"}),c.push(A)}),console.log(h.gray(` \u2705 Tagged ${y}`))}}return console.log(h.green(" \u2705 Docker images built and tagged")),{names:c,tags:u}},qk=async()=>{try{le(["buildx","version"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),le(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Creating buildx builder...")),le(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),le(["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")}},Yk=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{le(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},Kk=async(e,t,r)=>{let n=V.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
1111
1115
 
1112
1116
  This build contains everything needed to deploy ${e.name} locally using Docker.
1113
1117
 
@@ -1172,7 +1176,7 @@ Edit \`docker-compose.yml\` to:
1172
1176
 
1173
1177
  Built on: ${new Date().toISOString()}
1174
1178
  Build type: Local deployment artifacts
1175
- `;return await V.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},ix=(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. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 2. 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}},of=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),sx=async(e,t,r)=>{console.log(h.blue("\u{1F4C1} Setting up build environment...")),await jn(e),await In(e),await Nn(e),await Fn(e,r),await Qr(e,r),await Tr(e,r),console.log(h.green("\u2705 Build environment ready"))},ax=async(e,t,r)=>{console.log(h.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=H.join(r,"docker-compose.generate.yml");await Kr(e,r,"build"),await Zp(e,t,o),Wr("raclette_shared");try{console.log(h.gray(" \u{1F433} Starting generation services...")),ye(["-p",n,"-f",o,"up","-d"],{stdio:"pipe"}),console.log(h.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=60;for(;i<s;)try{if(!(await ye(["-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");console.log(h.green(" \u2705 File generation completed"))}finally{try{ye(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup generation services"))}}},Ws=async(e,t,r,n)=>{console.log(h.blue("\u{1F3A8} Building main application...")),await V.ensureDir(r),await Kr(e,t,"build"),await cx(e,t,r,n)},cx=async(e,t,r,n)=>{console.log(h.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=H.join(t,"docker-compose.app-build.yml"),s=H.join(t,".temp-build");await V.ensureDir(s),await V.ensureDir(H.join(s,"frontend")),await V.ensureDir(H.join(s,"backend"));try{await ef(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...")),ye(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=H.join(r,"frontend");await V.ensureDir(c);let u=H.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=H.join(r,"backend");await V.ensureDir(c);let u=H.join(s,"backend");if(!await V.pathExists(u))throw new Error("Backend build did not produce expected output directory");await lx(e,t,c,s),console.log(h.green(" \u2705 Backend build complete"))}console.log(h.green(" \u2705 Application build completed"))}finally{try{ye(["-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)}},lx=async(e,t,r,n)=>{console.log(h.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=H.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=H.join(r,"dist");if(!await V.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=H.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=H.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=H.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 ux(r)},ux=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=H.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=H.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"))},Us=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await dx(e,t,r),!0),dx=async(e,t,r)=>{console.log(h.blue("\u{1F527} Building workbench..."));let n=H.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await V.pathExists(n)){f.warn("Workbench package not found, skipping workbench build");return}let o=H.join(t,"workbench"),i;if(e.workbench)try{Pr(e.workbench),i=await $r(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(p=>p!==""),d=Qk("yarn",l,{cwd:n,stdio:r.verbose?"inherit":"ignore",env:s});d.on("close",p=>{f.raw(h.gray(` \u{1F3C1} Workbench build process exited with code ${p}`)),p===0?c():u(new Error(`Workbench build failed with exit code ${p}`))}),d.on("error",p=>{f.raw(h.red(` \u274C Workbench build process error: ${p.message}`)),u(p)})}),f.raw(h.green(" \u2705 Workbench build complete"))}catch(s){throw f.error("Workbench build failed: "+s.message),s}};import et from"fs-extra";import Ze from"path";var qs=()=>[{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 sf=async(e,t={})=>{console.log(h.blue("\u{1F4CB} Generating deployment guide..."));let r=Ze.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=lf(e,n,o,i);return t.generateFiles?await hx(e,s,r,i):await mx(e,s,r,i)},af=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=lf(e,r,n,o);return await px(e,i,n,o)},px=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await df(e,t,r,n),a=await pf(),c=fx(e.name,r);return`# Deploy ${e.name} with Docker
1179
+ `;return await G.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},Xk=(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. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 2. 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}},Cf=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),zk=async(e,t,r)=>{console.log(h.blue("\u{1F4C1} Setting up build environment...")),await Yn(e),await qn(e),await Gn(e),await Kn(e,r),await an(e,r),await cf(e,r),console.log(h.green("\u2705 Build environment ready"))},Jk=async(e,t,r)=>{console.log(h.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=V.join(r,"docker-compose.generate.yml");await nn(e,r,"build"),await _f(e,t,o),Zr("raclette_shared");try{console.log(h.gray(" \u{1F433} Starting generation services...")),_e(["-p",n,"-f",o,"up","-d"],{stdio:"pipe"}),console.log(h.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=60;for(;i<s;)try{if(!(await _e(["-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");console.log(h.green(" \u2705 File generation completed"))}finally{try{_e(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup generation services"))}}},sa=async(e,t,r,n)=>{console.log(h.blue("\u{1F3A8} Building main application...")),await G.ensureDir(r),await nn(e,t,"build"),await Qk(e,t,r,n)},Qk=async(e,t,r,n)=>{console.log(h.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=V.join(t,"docker-compose.app-build.yml"),s=V.join(t,".temp-build");await G.ensureDir(s),await G.ensureDir(V.join(s,"frontend")),await G.ensureDir(V.join(s,"backend"));try{await Ef(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...")),_e(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=V.join(r,"frontend");await G.ensureDir(c);let u=V.join(s,"frontend");if(await G.pathExists(u)){if((await G.readdir(u)).length===0)throw new Error("Frontend build produced no output files");await G.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=V.join(r,"backend");await G.ensureDir(c);let u=V.join(s,"backend");if(!await G.pathExists(u))throw new Error("Backend build did not produce expected output directory");await Zk(e,t,c,s),console.log(h.green(" \u2705 Backend build complete"))}console.log(h.green(" \u2705 Application build completed"))}finally{try{_e(["-p",o,"-f",i,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup build services"))}await G.remove(s),await G.remove(i)}},Zk=async(e,t,r,n)=>{console.log(h.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=V.join(n,"backend");await G.ensureDir(r),await G.pathExists(o)&&(await G.copy(o,r),console.log(h.gray(" \u2705 Copied backend build artifacts")));let i=V.join(r,"dist");if(!await G.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=V.join(i,"src","server.js");if(!await G.pathExists(s))throw new Error("Backend build did not produce expected dist/src/server.js entry point");let a=V.join(r,"package.json");if(await G.pathExists(a)){let u=await G.readJson(a),l={...u,scripts:{start:"node dist/src/server.js",...u.scripts},devDependencies:void 0};await G.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=V.join(r,"yarn.lock");await G.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 ew(r)},ew=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=V.join(e,i);await G.pathExists(s)||r.push(i)}if(r.length>0)throw new Error(`Backend application is missing required files: ${r.join(", ")}`);let n=V.join(e,"package.json"),o=await G.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"))},aa=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await tw(e,t,r),!0),tw=async(e,t,r)=>{console.log(h.blue("\u{1F527} Building workbench..."));let n=V.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await G.pathExists(n)){f.warn("Workbench package not found, skipping workbench build");return}let o=V.join(t,"workbench"),i;if(e.workbench)try{Xn(e.workbench),i=await zn(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=Hk("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 it from"fs-extra";import ot from"path";var ca=()=>[{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 Af=async(e,t={})=>{console.log(h.blue("\u{1F4CB} Generating deployment guide..."));let r=ot.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=Of(e,n,o,i);return t.generateFiles?await ow(e,s,r,i):await iw(e,s,r,i)},Sf=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=Of(e,r,n,o);return await rw(e,i,n,o)},rw=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await Pf(e,t,r,n),a=await $f(),c=nw(e.name,r);return`# Deploy ${e.name} with Docker
1176
1180
 
1177
1181
  Deploy ${e.name} using pre-built Docker images.
1178
1182
 
@@ -1240,8 +1244,8 @@ docker compose down -v
1240
1244
  - **502 errors:** Check backend logs with \`docker compose logs backend\`
1241
1245
  - **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
1242
1246
  - **Image pull errors:** Check registry access and IMAGE_TAG value
1243
- `},fx=(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(`
1244
- `),cf=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await df(e,t,"latest",r),s=await pf();return`# Deploy ${e.name} with Docker
1247
+ `},nw=(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(`
1248
+ `),Rf=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await Pf(e,t,"latest",r),s=await $f();return`# Deploy ${e.name} with Docker
1245
1249
 
1246
1250
  Deploy ${e.name} using pre-built Docker images.
1247
1251
 
@@ -1349,7 +1353,7 @@ docker compose down -v
1349
1353
  - **502 errors:** Check backend logs with \`docker compose logs backend\`
1350
1354
  - **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
1351
1355
  - **Image pull errors:** Check registry access and IMAGE_TAG value
1352
- `},lf=(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}},hx=async(e,t,r,n)=>{console.log(h.blue("\u{1F4C1} Generating deployment files..."));let o=Ze.join(r,"deploy-guide");await et.ensureDir(o);let i=Ze.join(o,"docker-compose.yml");await uf(e,t,i,"latest",n);let s=Ze.join(o,"docker-compose.override.yml.example");await gx(e,s);let a=Ze.join(o,".env.example");await yx(e,a,t.hasWorkbench);let c=Ze.join(o,"README.md");await bx(e,t,c,n);let u=Ze.join(o,"DEPLOY.md");return await vx(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]}},mx=async(e,t,r,n)=>{console.log(h.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=Ze.join(r,"DEPLOY.md");return await _x(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}},uf=async(e,t,r,n,o)=>{let i=e.services.frontend?.port||8081,s=e.services.workbench?.frontendPort||8083,a=u=>{let p=u.split(":")[0].replace(o,"");return o?`${o}${p}:\${IMAGE_TAG:-${n}}`:`\${DOCKER_REGISTRY:-}${p}:\${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:{test:["CMD","curl","-f",`http://0.0.0.0:${i}/`],interval:"10s",timeout:"30s",retries:10}},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:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},database:{image:"mongo:5.0.6",restart:"unless-stopped",volumes:["mongodb_data:/data/db"],networks:["app-network"],environment:[`MONGO_INITDB_DATABASE=\${MONGO_DATABASE:-${e.name}}`],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},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:{test:["CMD","curl","-f",`http://0.0.0.0:${s}/`],interval:"10s",timeout:"30s",retries:10}},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:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}}),await et.writeFile(r,it.dump(c))},gx=async(e,t)=>{let r=qs(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
1356
+ `},Of=(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}},ow=async(e,t,r,n)=>{console.log(h.blue("\u{1F4C1} Generating deployment files..."));let o=ot.join(r,"deploy-guide");await it.ensureDir(o);let i=ot.join(o,"docker-compose.yml");await Tf(e,t,i,"latest",n);let s=ot.join(o,"docker-compose.override.yml.example");await sw(e,s);let a=ot.join(o,".env.example");await aw(e,a,t.hasWorkbench);let c=ot.join(o,"README.md");await cw(e,t,c,n);let u=ot.join(o,"DEPLOY.md");return await lw(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]}},iw=async(e,t,r,n)=>{console.log(h.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=ot.join(r,"DEPLOY.md");return await uw(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}},Tf=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:{test:["CMD","curl","-f",`http://0.0.0.0:${i}/`],interval:"10s",timeout:"30s",retries:10}},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:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},database:{image:"mongo:5.0.6",restart:"unless-stopped",volumes:["mongodb_data:/data/db"],networks:["app-network"],environment:[`MONGO_INITDB_DATABASE=\${MONGO_DATABASE:-${e.name}}`],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},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:{test:["CMD","curl","-f",`http://0.0.0.0:${s}/`],interval:"10s",timeout:"30s",retries:10}},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:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}}),await it.writeFile(r,Ce.dump(c))},sw=async(e,t)=>{let r=ca(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
1353
1357
  # Copy this file to docker-compose.override.yml and customize as needed
1354
1358
  # This file allows you to extend the main docker-compose.yml without modifying it
1355
1359
 
@@ -1387,7 +1391,7 @@ ${o.map(s=>` # ${s.description}
1387
1391
  # Add custom networks if needed
1388
1392
  # networks:
1389
1393
  # custom-network:
1390
- `;await et.writeFile(t,i)},yx=async(e,t,r)=>{let n=Gs(e,r);await et.writeFile(t,n)},bx=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
1394
+ `;await it.writeFile(t,i)},aw=async(e,t,r)=>{let n=ia(e,r);await it.writeFile(t,n)},cw=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
1391
1395
 
1392
1396
  This folder contains deployment files for testing registry-based deployment locally.
1393
1397
 
@@ -1476,7 +1480,7 @@ you can adjust these registry examples based on where your images will be hosted
1476
1480
  \`\`\`
1477
1481
 
1478
1482
  Generated on: ${new Date().toISOString()}
1479
- `;await et.writeFile(r,s)},vx=async(e,t,r,n)=>{let o=await cf(e,t,n);await et.writeFile(r,o)},_x=async(e,t,r,n)=>{let o=await cf(e,t,n),i=`# ${e.name} - Registry Deployment Guide
1483
+ `;await it.writeFile(r,s)},lw=async(e,t,r,n)=>{let o=await Rf(e,t,n);await it.writeFile(r,o)},uw=async(e,t,r,n)=>{let o=await Rf(e,t,n),i=`# ${e.name} - Registry Deployment Guide
1480
1484
 
1481
1485
  ## For Developers
1482
1486
 
@@ -1500,7 +1504,7 @@ ${t.names.map(s=>`- \`${s}\``).join(`
1500
1504
  *Copy everything below this line to your project README or documentation*
1501
1505
 
1502
1506
  ${o}
1503
- `;await et.writeFile(r,i)},df=async(e,t,r,n)=>{let o=Ze.join(process.cwd(),"temp-compose.yml");await uf(e,t,o,r,n);let i=await et.readFile(o,"utf8");return await et.remove(o),i},pf=async()=>{let e=qs(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
1507
+ `;await it.writeFile(r,i)},Pf=async(e,t,r,n)=>{let o=ot.join(process.cwd(),"temp-compose.yml");await Tf(e,t,o,r,n);let i=await it.readFile(o,"utf8");return await it.remove(o),i},$f=async()=>{let e=ca(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
1504
1508
  frontend:
1505
1509
  volumes:
1506
1510
  ${t.map(n=>` # ${n.description}
@@ -1515,10 +1519,10 @@ ${r.map(n=>` # ${n.description}
1515
1519
  # - ${n.source}:${n.target}`).join(`
1516
1520
  `)}
1517
1521
  environment:
1518
- # - CUSTOM_API_KEY=your-key`};var Ne=new ba;Ne.version("0.1.0");Ne.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("--no-cache","Force rebuild Docker images without using cache").action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment..."),Gr();let t=await Oe(),r=process.cwd(),n;try{n=await Pe(e.configFile)}catch(i){f.error("Could not read raclette.config.js file. Please check your file for syntax errors! Canceling startup process."),f.error(`The following error occured on reading the file: "${i.message}"`),process.exit(1)}n||(f.error("No configuration loaded"),process.exit(1));let o=qt.join(t,"docker-compose.yml");e.projectName&&(f.raclette("Setting project name to "+e.projectName),n.name=e.projectName),await Vp(n,{dockerComposePath:o,workingDir:r,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):["frontend","backend"],forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});Ne.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").action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs...");let r=await Oe(),n=await Pe(),o=qt.join(r,"docker-compose.yml");await vr.pathExists(o)||(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 Qp(e,t,n,o)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});Ne.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").action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=await Oe(),r=await Pe(),n=process.cwd();e.projectName&&(f.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let o=qt.join(t,"docker-compose.yml"),i=qt.join(t,"docker-compose.full.yml");if(!await vr.pathExists(o)){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 Bs(o,r)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Ic(r,n,i,"development"),await Bs(i,r),await vr.remove(i)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});Ne.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").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=await Oe(),n=await Pe(),o=n?.name??qt.basename(process.cwd()),i=qt.join(r,"docker-compose.yml");if(!await vr.pathExists(i)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let s of e)try{let a=await br(s,n,i);if(!Tt(a)){f.warn(`Service '${s}' (container: ${a}) 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 vr.pathExists(i)?(f.progress(`Restarting service: ${s}...`),ye(["-p",o,"-f",i,"restart",s],{stdio:"inherit"})):(f.progress(` Restarting container: ${a}...`),ce(["restart",a],{stdio:"inherit"})),f.success(`Service '${s}' restarted successfully`)}catch(a){f.error(`Error restarting service '${s}': ${a.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});Ne.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").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));let r=await Oe(),n=await Pe();await js(e,n),await Hs(e,n,r)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});Ne.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").action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=process.cwd();await Oe();let r=await Pe(e.configFile);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 rf(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)}});var Ys=()=>["frontend","backend","workbench.frontend","workbench.backend"],Ex=e=>Ys().includes(e),ff=e=>e.join(", ");Ne.command("add-package <target> <package...>").description(`Add a package to the project (target: ${ff(Ys())})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").action(async(e,t,r)=>{try{if(f.setVerbose(r.verbose),!Ex(e)){let i=Ys();f.error(`Target must be one of: ${ff(i)}`),process.exit(1)}f.raclette(`Adding package(s) to ${e}...`);for(let i of t)await Mp(e,i,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder...");let n=await Oe(),o=await Pe();await js(e,o),await Hs(e,o,n)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});Ne.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").action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images...");let r=await Oe(),n=await Pe();if(e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let i=await Xr(n,r);if(i.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=i}let o=e.filter(i=>i==="frontend"||i==="backend"||i==="workbench");o.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await zr(n,r,o,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${o.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});Ne.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").action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),await Oe();let t=await Pe();if(e.returnOnly){let o={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},i=await af(t,o);console.log(i),process.exit(0)}let r={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},n=await sf(t,r);f.success("Deployment guide generated!"),n.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${n.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: ${n.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch{f.error("Error generating deployment guide: "+error.message),process.exit(1)}});Ne.parse(process.argv);
1522
+ # - CUSTOM_API_KEY=your-key`};var Tt=process.cwd();process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=Tt);var nr=await zc(),Df=Object.keys(nr).length&&h.blue(`\u{1F4C4} Loaded ${Object.keys(nr).length} environment variables from ${Tt}/.env`);nr.RACLETTE_APP_PATH=process.env.RACLETTE_APP_PATH;var ue=Go(await wt(),await wt("raclette.config.*",nr)),Nf=nr.RACLETTE_ROOT||ue.root||".raclette",$e=or.join(Tt,Nf),st=or.join($e,"docker-compose.yml");ue.root=Nf;var De=new Da,Ke=(e,t)=>{Df&&f.raclette(Df),_t.ensureDirSync($e)};De.version("0.1.0");De.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",Ke).action(async e=>{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment...");try{Qr();let t=Go(ue,e.configFile?await wt(e.configFile):{});_t.writeFileSync(or.join($e,"raclette.config.yaml"),Ce.dump(t)),e.projectName&&(f.raclette("Setting project name to "+e.projectName),t.name=e.projectName),Uo(t,$e),await lf($e,nr,t,{workingDir:Tt,dockerComposePath:st,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):Be,forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});De.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",Ke).action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs..."),await _t.pathExists(st)||(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 vf(e,t,ue,st)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});De.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",Ke).action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=Tt;e.projectName&&(f.raclette("Setting project name to "+e.projectName),ue.name=e.projectName);let r=or.join($e,"docker-compose.full.yml");if(!await _t.pathExists(st)){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 ra(st,ue)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Zc(ue,t,r,"development"),await ra(r,ue),await _t.remove(r)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});De.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").hook("preAction",Ke).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=ue?.name??or.basename(Tt);if(!await _t.pathExists(st)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let n of e)try{let o=await Pr(n,ue,st);if(!Ht(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 _t.pathExists(st)?(f.progress(`Restarting service: ${n}...`),_e(["-p",r,"-f",st,"restart",n],{stdio:"inherit"})):(f.progress(` Restarting container: ${o}...`),le(["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)}});De.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").hook("preAction",Ke).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 Zs(e,ue),await na(e,ue,$e)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});De.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",Ke).action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=Tt,r=lt(ue,e.configFile?await wt(e.configFile):{});_t.writeFileSync(or.join($e,"raclette.config.yaml"),Ce.dump(r)),Uo(r,$e),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 kf(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)}});De.command("add-package <target> <package...>").description(`Add a package to the project (target: ${Ir.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",Ke).action(async(e,t,r)=>{f.setVerbose(r.verbose);try{Ir.includes(e)||(f.error(`Target must be one of: ${Ir.join(", ")}}`),process.exit(1)),f.raclette(`Adding package(s) to ${e}...`);for(let n of t)await nf(e,n,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder..."),await Zs(e,ue),await na(e,ue,$e)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});De.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",Ke).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 on(ue,$e);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 sn(ue,$e,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)}});De.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",Ke).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 Sf(ue,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 Af(ue,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)}});De.command("config").description("(Re)Configure Raclette Application").option("-c, --config <config>","configuration file","raclette.config.yaml").hook("preAction",Ke).action(async e=>{console.log(h.bold.green("YO!")+h.bold.red(":"))});De.parse(process.argv);
1519
1523
  /*! Bundled license information:
1520
1524
 
1521
- is-extglob/index.js:
1525
+ .store/is-extglob-npm-2.1.1-0870ea68b5/package/index.js:
1522
1526
  (*!
1523
1527
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
1524
1528
  *
@@ -1526,7 +1530,7 @@ is-extglob/index.js:
1526
1530
  * Licensed under the MIT License.
1527
1531
  *)
1528
1532
 
1529
- is-glob/index.js:
1533
+ .store/is-glob-npm-4.0.3-cb87bf1bdb/package/index.js:
1530
1534
  (*!
1531
1535
  * is-glob <https://github.com/jonschlinkert/is-glob>
1532
1536
  *
@@ -1534,7 +1538,7 @@ is-glob/index.js:
1534
1538
  * Released under the MIT License.
1535
1539
  *)
1536
1540
 
1537
- is-number/index.js:
1541
+ .store/is-number-npm-7.0.0-060086935c/package/index.js:
1538
1542
  (*!
1539
1543
  * is-number <https://github.com/jonschlinkert/is-number>
1540
1544
  *
@@ -1542,7 +1546,7 @@ is-number/index.js:
1542
1546
  * Released under the MIT License.
1543
1547
  *)
1544
1548
 
1545
- to-regex-range/index.js:
1549
+ .store/to-regex-range-npm-5.0.1-f1e8263b00/package/index.js:
1546
1550
  (*!
1547
1551
  * to-regex-range <https://github.com/micromatch/to-regex-range>
1548
1552
  *
@@ -1550,7 +1554,7 @@ to-regex-range/index.js:
1550
1554
  * Released under the MIT License.
1551
1555
  *)
1552
1556
 
1553
- fill-range/index.js:
1557
+ .store/fill-range-npm-7.1.1-bf491486db/package/index.js:
1554
1558
  (*!
1555
1559
  * fill-range <https://github.com/jonschlinkert/fill-range>
1556
1560
  *
@@ -1558,12 +1562,19 @@ fill-range/index.js:
1558
1562
  * Licensed under the MIT License.
1559
1563
  *)
1560
1564
 
1561
- queue-microtask/index.js:
1565
+ .store/queue-microtask-npm-1.2.3-fcc98e4e2d/package/index.js:
1562
1566
  (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
1563
1567
 
1564
- run-parallel/index.js:
1568
+ .store/run-parallel-npm-1.2.0-3f47ff2034/package/index.js:
1565
1569
  (*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
1566
1570
 
1567
- js-yaml/dist/js-yaml.mjs:
1571
+ .store/js-yaml-npm-4.1.0-3606f32312/package/dist/js-yaml.mjs:
1568
1572
  (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
1573
+
1574
+ .store/mustache-npm-4.2.0-1fe3d6d77a/package/mustache.mjs:
1575
+ (*!
1576
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
1577
+ * http://github.com/janl/mustache.js
1578
+ *)
1569
1579
  */
1580
+ //# sourceMappingURL=cli.js.map