@catladder/cli 3.34.1 → 3.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var __webpack_modules__={6057:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(1);const r=a(5110);const i=a(5472);const s=a(5614);const o=a(8832);const p=a(241);t["default"]=async(e,t)=>{var a;const l=await(0,n.getProjectConfig)();if(!l){return}const d=(0,p.createCatenvContext)(l);if(t===null||t===void 0?void 0:t.verbose){(0,i.printVerboseBanner)()}await Promise.all([(0,p.generatePipelineFiles)(d,(a=l.pipelineType)!==null&&a!==void 0?a:"gitlab"),(0,s.writeDotEnvFiles)(d,e),(0,o.writeDTsFiles)(d,e),(0,r.printVariables)(d,e)])}},5110:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.printVariables=void 0;const n=a(1);const r=a(1909);const getAllVariablesToPrint=async(e,t)=>{var a;const{env:i,currentComponent:s}=await(0,r.getCurrentComponentAndEnvFromChoice)(e,t);if(s){if((a=e.components[s].dotEnv)!==null&&a!==void 0?a:true){return{}}return await(0,n.getEnvVarsResolved)(null,i,s)}else{return await Object.keys(e.components).reduce((async(t,a)=>{var s;if((s=e.components[a].dotEnv)!==null&&s!==void 0?s:true){return await t}const o=await(0,n.getEnvVarsResolved)(null,i,a);delete o["_ALL_ENV_VAR_KEYS"];return{...await t,...o,...Object.fromEntries(Object.entries(o).map((([e,t])=>[`${(0,r.sanitizeEnvVarName)(a.toUpperCase())}_${e}`,t])))}}),Promise.resolve({}))}};const printVariables=async(e,t)=>{const a=await getAllVariablesToPrint(e.config,t);console.log(makeExportKeyValuestring(a))};t.printVariables=printVariables;const makeExportKeyValuestring=e=>(0,r.makeKeyValueString)(e,{keyPrefix:"export ",escapeOptions:{quoteMode:"always"}})},1909:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.sanitizeEnvVarName=t.makeKeyValueString=t.getCurrentComponentAndEnvFromChoice=t.getComponentFullPath=void 0;const n=a(6928);const r=a(7414);const i=a(241);const getComponentFullPath=(e,t,a)=>(0,n.join)(e,t.components[a].dir);t.getComponentFullPath=getComponentFullPath;const getCurrentComponentName=async e=>{const a=await(0,r.getGitRoot)();const n=process.cwd();return Object.keys(e.components).find((r=>n.startsWith((0,t.getComponentFullPath)(a,e,r))))};const getCurrentComponentAndEnvFromChoice=async(e,t)=>{var a,n;const r=(a=t===null||t===void 0?void 0:t.env)!==null&&a!==void 0?a:"local";const i=(n=t===null||t===void 0?void 0:t.componentName)!==null&&n!==void 0?n:await getCurrentComponentName(e);return{currentComponent:i,env:r}};t.getCurrentComponentAndEnvFromChoice=getCurrentComponentAndEnvFromChoice;const makeKeyValueString=(e,{keyPrefix:t,escapeOptions:a}={keyPrefix:""})=>Object.entries(e).map((([e,n])=>`${t}${e}=${(0,i.escapeForDotEnv)(n,a)}`)).join("\n");t.makeKeyValueString=makeKeyValueString;const sanitizeEnvVarName=e=>e.replace(/[\s\-.]+/g,"_");t.sanitizeEnvVarName=sanitizeEnvVarName},5472:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.printVerboseBanner=void 0;const n=a(1);const printVerboseBanner=async()=>{const e=await(0,n.getProjectConfig)();if(!e){return}const t=await Promise.all(Object.keys(e.components).map((async e=>{const t=await(0,n.getEnvironment)("local",e);const a=t.envVars.PORT;if(!a){return null}return`${e}: http://localhost:${a}`}))).then((e=>e.filter(Boolean)));const a=["catenv","-------","running on:","",...t];for(const e of a){console.log(e)}};t.printVerboseBanner=printVerboseBanner},5614:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeDotEnvFiles=void 0;const n=a(6928);const r=a(1);const i=a(7414);const s=a(1909);const writeDotEnvFiles=async(e,t)=>{const{env:a,currentComponent:o}=await(0,s.getCurrentComponentAndEnvFromChoice)(e.config,t);const p=Object.entries(e.config.components).filter((([,e])=>{var t;return(t=e===null||e===void 0?void 0:e.dotEnv)!==null&&t!==void 0?t:true})).map((([e])=>e));const l=o?p.includes(o)?[o]:[]:p;const d=await(0,i.getGitRoot)();for(const t of l){const i=await(0,r.getEnvVarsResolved)(null,a,t);delete i["_ALL_ENV_VAR_KEYS"];const o=(0,s.getComponentFullPath)(d,e.config,t);const p=(0,n.join)(o,".env");await e.fileWriter.writeGeneratedFile(p,(0,s.makeKeyValueString)(i),{commentChar:"#"})}};t.writeDotEnvFiles=writeDotEnvFiles},8832:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeDTsFiles=void 0;const n=a(6928);const r=a(1);const i=a(7414);const s=a(1909);const writeDTsFiles=async(e,t)=>{const{env:a,currentComponent:r}=await(0,s.getCurrentComponentAndEnvFromChoice)(e.config,t);const o=Object.entries(e.config.components).filter((([,e])=>{var t;return(t=e===null||e===void 0?void 0:e.envDTs)!==null&&t!==void 0?t:true})).map((([e])=>e));const p=r?o.includes(r)?[r]:[]:o;const l=await(0,i.getGitRoot)();for(const t of p){const r=await getEnvsForDTs(a,t);const i=createEnvDTsContent(r);const o=(0,s.getComponentFullPath)(l,e.config,t);const p=(0,n.join)(o,"env.d.ts");await e.fileWriter.writeGeneratedFile(p,i,{commentChar:"//"})}};t.writeDTsFiles=writeDTsFiles;async function getEnvsForDTs(e,t){const a=await(0,r.getEnvironment)(e,t);const n=Object.keys(a.envVars);const i=new Set(a.secretEnvVarKeys.filter((e=>e.hidden)).map((e=>e.key)).concat(["_ALL_ENV_VAR_KEYS"]));const s=n.filter((e=>!i.has(e)));return s}function createEnvDTsContent(e){return`/* tslint:disable prettier/prettier */\n/* eslint-disable prettier/prettier */\n/* prettier-ignore */\n\nexport {}\n\ndeclare global {\n namespace NodeJS {\n interface ProcessEnv {\n${e.map((e=>` ${e}: string`)).join("\n")}\n }\n }\n}\n`}},2994:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=n(a(6057));const i=a(4272);const s=process.argv.slice(2);const o=["--help","-h","help"];if(s.some((e=>o.includes(e)))){const e="https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";console.log(`\nUsage: catenv [env|env:component] [-v|--verbose]\n\nEnv variable and catenv documentation:\n${e}`);process.exit(0)}const p=s.some((e=>e==="-v"||e==="--verbose"));const l=s.find((e=>e!=="-v"&&e!=="--verbose"));(0,r.default)(l?(0,i.parseChoice)(l):null,{verbose:p}).then((()=>{process.exit()}))},1:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getJobOnlyEnvVarsResolved=t.getEnvVarsResolved=t.getGitlabVar=t.getEnvironment=t.getAllPipelineContexts=t.getAllComponentsWithAllEnvsHierarchical=t.getAllComponentsWithAllEnvsFlat=t.getPipelineContextByChoice=t.getProjectComponents=t.getProjectConfig=t.parseChoice=void 0;const n=a(241);const r=a(4508);const i=a(7414);const s=a(9896);var o=a(4272);Object.defineProperty(t,"parseChoice",{enumerable:true,get:function(){return o.parseChoice}});let p=null;const reloadConfigAndObserve=async()=>{const e=await(0,i.getGitRoot)();if(!e){return}const t=await(0,n.readConfig)(e);if(!t){return}const{config:a,path:r}=t;const o=(0,s.watch)(r,(()=>{o.close();reloadConfigAndObserve()}));p=a};const getProjectConfig=async()=>{if(!p){await reloadConfigAndObserve()}return p};t.getProjectConfig=getProjectConfig;const getProjectComponents=async()=>{const e=await(0,t.getProjectConfig)();if(!e)return[];return Object.keys(e.components)};t.getProjectComponents=getProjectComponents;const getPipelineContextByChoice=async(e,a)=>{const r=await(0,t.getProjectConfig)();return await(0,n.createComponentContext)({config:r,componentName:a,env:e})};t.getPipelineContextByChoice=getPipelineContextByChoice;const getAllComponentsWithAllEnvsFlat=async()=>{const e=await(0,t.getProjectConfig)();if(!e){return[]}return getAllComponentsWithAllEnvsFlatFromConfig(e)};t.getAllComponentsWithAllEnvsFlat=getAllComponentsWithAllEnvsFlat;const getAllComponentsWithAllEnvsHierarchical=async()=>{const e=await(0,t.getProjectConfig)();if(!e){return{}}return Object.fromEntries(Object.keys(e.components).map((t=>[t,(0,n.getAllEnvs)(e,t)])))};t.getAllComponentsWithAllEnvsHierarchical=getAllComponentsWithAllEnvsHierarchical;const getAllPipelineContexts=async e=>{const a=e?Array.isArray(e)?e:[e]:null;return Promise.all((await(0,t.getAllComponentsWithAllEnvsFlat)()).filter((e=>e.env!=="local")).filter((e=>!a||a.includes(e.componentName))).map((({env:e,componentName:a})=>(0,t.getPipelineContextByChoice)(e,a))))};t.getAllPipelineContexts=getAllPipelineContexts;const getEnvironment=async(e,a)=>{const r=await(0,t.getProjectConfig)();return(0,n.getEnvironment)({config:r,componentName:a,env:e})};t.getEnvironment=getEnvironment;const getGitlabVar=async(e,t,a,i)=>{const s=(0,n.getSecretVarName)(t,a,i);return await(0,r.getVariableValueByRawName)(e,s)};t.getGitlabVar=getGitlabVar;const resolveSecrets=async(e,t)=>{const a=await(0,r.getAllVariables)(e);return Object.fromEntries(t.flatMap((({envVars:e,secretEnvVarKeys:t})=>Object.entries(e).filter((([e,a])=>{var n;return a!==undefined&&a!==null&&!((n=t.find((t=>t.key===e)))===null||n===void 0?void 0:n.hidden)})).map((([e,t])=>[e,a.reduce(((e,t)=>e.replace(new RegExp("\\$"+t.key,"g"),t.value)),`${t}`)])))))};const getEnvVarsResolved=async(e,a,n)=>{if(!n){return{}}const r=await(0,t.getEnvironment)(a,n);return resolveSecrets(e,[{envVars:r.envVars,secretEnvVarKeys:r.secretEnvVarKeys}])};t.getEnvVarsResolved=getEnvVarsResolved;const getJobOnlyEnvVarsResolved=async(e,a,n)=>{const r=await(0,t.getEnvironment)(a,n);return resolveSecrets(e,[r.jobOnlyVars.build,r.jobOnlyVars.deploy])};t.getJobOnlyEnvVarsResolved=getJobOnlyEnvVarsResolved;function getAllComponentsWithAllEnvsFlatFromConfig(e){return Object.keys(e.components).flatMap((t=>(0,n.getAllEnvs)(e,t).map((e=>({env:e,componentName:t})))))}},4272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseChoice=void 0;const parseChoice=e=>{const[t,a]=e.split(":").map((e=>e||null));return{env:t,componentName:a}};t.parseChoice=parseChoice},6636:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gitConfigSet=t.gitConfigGet=void 0;const n=a(1748);const argsJoin=e=>e.filter(Boolean).join(" ");async function gitConfigGet(e,{location:t}={}){const{stdout:a}=await(0,n.exec)(`git config --get ${argsJoin([t?`--${t}`:undefined])} ${e}`);return a.trim()}t.gitConfigGet=gitConfigGet;const gitConfigSet=(e,t,{location:a,comment:r}={})=>(0,n.exec)(`git config --set ${argsJoin([a?`--${a}`:undefined,r?`--comment=${r}`:undefined])} ${e} ${t}`);t.gitConfigSet=gitConfigSet},1111:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gitProjectInformation=t.getGitRemoteHostAndPath=t.getProjectRootPath=void 0;const n=a(6636);const r=a(1748);const getProjectRootPath=async()=>{const{stdout:e}=await(0,r.exec)(`git rev-parse --show-toplevel`);return e.trim()};t.getProjectRootPath=getProjectRootPath;const getGitRemoteHostAndPath=async()=>{var e;const t=await(0,n.gitConfigGet)("remote.origin.url");const a=/(https:\/\/|git@)([^:/]+)[:/]([^.]*)(\.git)?/;const r=(e=t.match(a))!==null&&e!==void 0?e:[];const[,,i,s]=r;if(!(i===null||i===void 0?void 0:i.length)||!(s===null||s===void 0?void 0:s.length)){throw new Error(`Failed to parse git remote hostname and path from git configs remote.origin.url! ${t}`)}return{gitRemoteHost:i,gitRemotePath:s}};t.getGitRemoteHostAndPath=getGitRemoteHostAndPath;const gitProjectInformation=async()=>{const[{gitRemoteHost:e,gitRemotePath:a},n]=await Promise.all([(0,t.getGitRemoteHostAndPath)(),(0,t.getProjectRootPath)()]);return{gitRemoteHost:e,gitRemotePath:a,projectRootPath:n}};t.gitProjectInformation=gitProjectInformation},6172:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.readFileOrError=void 0;const n=a(6954);const readFile=e=>(0,n.readFile)(e,{encoding:"utf-8"});const readFileOrError=async e=>{try{const t=await readFile(e);return[null,t]}catch(e){return[e]}};t.readFileOrError=readFileOrError},4508:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.upsertAllVariables=t.clearBackups=t.getVariableValueByRawName=t.getAllVariables=t.getProjectInfo=t.doGitlabRequest=t.getGitlabToken=t.setupGitlabToken=t.hasGitlabToken=void 0;const r=a(241);const i=a(9250);const s=n(a(7009));const o=n(a(1479));const p=n(a(5186));const l=a(6261);const d=a(1111);const c="gitlab-personal-access-token";const hasGitlabToken=async()=>await(0,l.hasPreference)(c);t.hasGitlabToken=hasGitlabToken;const setupGitlabToken=async e=>{e.log("");e.log("☝ in order to access the api, we need a personal access token");e.log("Its best to create one specifically for catladder");e.log("Scopes needed: api");e.log("");e.log("☝ we open up the settings page for you!");e.log("");const[{shouldContinue:t},{gitRemoteHost:a}]=await Promise.all([e.prompt({default:true,message:"Ok",name:"shouldContinue",type:"prompt"}),(0,d.getGitRemoteHostAndPath)()]);(0,p.default)(`https://${a}/-/user_settings/personal_access_tokens`);e.log("Please type in gitlab's personal access token");const{personalToken:n}=await e.prompt({type:"string",name:"personalToken",default:"",message:"Your personal access token "});if(n){await(0,l.setPreference)(c,n)}};t.setupGitlabToken=setupGitlabToken;const getGitlabToken=async e=>{if(!await(0,t.hasGitlabToken)()){if(!e){console.error("⚠️ gitlab token missing, please run catladder to set it up");process.exit(1)}await(0,t.setupGitlabToken)(e)}return(0,l.getPreference)(c)};t.getGitlabToken=getGitlabToken;const doGitlabRequest=async(e,a,n=undefined,r="GET")=>{const[i,{gitRemoteHost:s}]=await Promise.all([(0,t.getGitlabToken)(e),(0,d.getGitRemoteHostAndPath)()]);const p=await(0,o.default)(`https://${s}/api/v4/${a}`,{method:r,headers:{"Content-Type":"application/json","Private-Token":i},body:n?JSON.stringify(n):undefined});if(p.status>=200&&p.status<400){if(p.headers.get("content-type")==="application/json"){return p.json()}return null}if(p.status===404){throw new Error("not found")}throw new Error(`Could not send request to gitlab api ${a}: ${p.status} "${p.statusText}".\nResponse: ${JSON.stringify(await p.json(),null,2)}`)};t.doGitlabRequest=doGitlabRequest;const getProjectInfo=async e=>{const{gitRemotePath:a}=await(0,d.getGitRemoteHostAndPath)();const n=await(0,t.doGitlabRequest)(e,`projects/${encodeURIComponent(a)}`);return n};t.getProjectInfo=getProjectInfo;t.getAllVariables=(0,s.default)((async(e,a=5)=>{const{id:n}=await(0,t.getProjectInfo)(e);let r=[];let i=[];let s=1;do{const o=Array.from({length:a},((a,r)=>(0,t.doGitlabRequest)(e,`projects/${n}/variables?per_page=100&page=${s+r}`)));i=await Promise.all(o);s+=a;r=[...r,...i.flat()]}while(i.length>0&&i[i.length-1].length>0);return r}),{promise:true});const getVariableValueByRawName=async(e,a)=>{var n;const r=await(0,t.getAllVariables)(e);return(n=r.find((e=>e.key===a)))===null||n===void 0?void 0:n.value};t.getVariableValueByRawName=getVariableValueByRawName;const u=new RegExp("^[a-zA-Z0-9_+=/@:.~-]{8,}$");const isMaskable=e=>u.test(e);const createVariable=async(e,a,n,r,i=true,s="*")=>await(0,t.doGitlabRequest)(e,`projects/${a}/variables`,{key:n,value:r,masked:i&&isMaskable(r),environment_scope:s},"POST");const updateVariable=async(e,a,n,r,i=true)=>await(0,t.doGitlabRequest)(e,`projects/${a}/variables/${n}`,{value:r,masked:i&&isMaskable(r)},"PUT");const deleteVariable=async(e,a,n)=>await(0,t.doGitlabRequest)(e,`projects/${a}/variables/${n}`,undefined,"DELETE");const getAllCatladderEnvVarsInGitlab=async e=>{const a=await(0,t.getAllVariables)(e).then((e=>e.reduce(((e,t)=>{var a,n,r,i;const{key:s}=t;if(s.startsWith("CL_")){const o=s.match(/(CL_.*)_backup_([0-9]+)/);if(o){const t=o[1];const i=Number(o[2]);const s=[...(n=(a=e[t])===null||a===void 0?void 0:a.backups)!==null&&n!==void 0?n:[],i];return{...e,[t]:{...(r=e[t])!==null&&r!==void 0?r:{},backups:s}}}return{...e,[s]:{backups:[],...(i=e[s])!==null&&i!==void 0?i:{},value:t.value}}}return e}),{})));return a};const getBackupKey=(e,t)=>`${e}_backup_${t}`;const clearBackups=async(e,a)=>{const n=await getAllCatladderEnvVarsInGitlab(e);const{id:r}=await(0,t.getProjectInfo)(e);for(const[t,{backups:i}]of Object.entries(n)){const n=i.sort(((e,t)=>t-e));const s=n.slice(a);for(const a of s){await deleteVariable(e,r,getBackupKey(t,a))}}};t.clearBackups=clearBackups;const upsertAllVariables=async(e,a,n,s,o=true,p=true)=>{var l;const{id:d}=await(0,t.getProjectInfo)(e);const c=await getAllCatladderEnvVarsInGitlab(e);for(const[t,u]of Object.entries(a!==null&&a!==void 0?a:{})){const a=(0,r.getSecretVarName)(n,s,t);const f=(0,i.isObject)(u)?JSON.stringify(u):`${u}`;const m=(0,i.has)(c,a);const h=(l=c[a])===null||l===void 0?void 0:l.value;const v=h!==f;if(v){if(m){e.log(`changed: ${t}`);await updateVariable(e,d,a,f,p);if(o){await createVariable(e,d,getBackupKey(a,(new Date).getTime()),h,p,"_backup")}}else{e.log(`new : ${t}`);await createVariable(e,d,a,f,p)}}else{e.log(`skip : ${t}`)}}t.getAllVariables.clear()};t.upsertAllVariables=upsertAllVariables},6261:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.setPreference=t.getPreference=t.hasPreference=t.getPreferences=void 0;const n=a(1943);const r=a(9896);const i=a(6928);const s=a(857);const o=a(6637);const p=(0,i.join)((0,s.homedir)(),".catladder/preferences.yml");const l=(0,i.join)((0,s.homedir)(),".config/catladder/preferences.yml");const ensurePreferencesFile=async()=>{if((0,r.existsSync)(l)){return}await(0,n.mkdir)((0,i.dirname)(l),{recursive:true,mode:448});if(!(0,r.existsSync)(p)){return(0,n.writeFile)(l,"---\n{}",{encoding:"utf-8",mode:384})}await(0,n.cp)(p,l);await(0,n.chmod)(l,384);await(0,n.cp)(l,(0,i.join)((0,i.dirname)(l),"old_preferences_backup.yml"))};const loadPreferences=async()=>{await ensurePreferencesFile();return(0,n.readFile)(l,{encoding:"utf-8"})};const getPreferences=async()=>{var e;const t=await loadPreferences();return(e=(0,o.parse)(t))!==null&&e!==void 0?e:{}};t.getPreferences=getPreferences;const hasPreference=async e=>{const a=await(0,t.getPreferences)();return e in a};t.hasPreference=hasPreference;const getPreference=async e=>{const a=await(0,t.getPreferences)();return a[e]};t.getPreference=getPreference;const setPreference=async(e,a)=>{const r=await(0,t.getPreferences)();const i={...r,[e]:a};await(0,n.writeFile)(l,(0,o.stringify)(i),{encoding:"utf-8",mode:384})};t.setPreference=setPreference},7414:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getProjectNamespace=t.hasGitlabCiFile=t.readRootGitlabCiFile=t.getRootGitlabCiFile=t.getGitRoot=void 0;const n=a(6928);const r=a(1);const i=a(6172);const s=a(1748);const getGitRoot=async()=>{try{return(await(0,s.exec)(`git rev-parse --show-toplevel`)).stdout.trim()}catch(e){return null}};t.getGitRoot=getGitRoot;const getRootGitlabCiFile=async()=>{const e=await(0,t.getGitRoot)();return(0,n.join)(e,".gitlab-ci.yml")};t.getRootGitlabCiFile=getRootGitlabCiFile;const readRootGitlabCiFile=async()=>(0,i.readFileOrError)(await(0,t.getRootGitlabCiFile)());t.readRootGitlabCiFile=readRootGitlabCiFile;const hasGitlabCiFile=async()=>{const[e,a]=await(0,t.readRootGitlabCiFile)();if(e){return false}return true};t.hasGitlabCiFile=hasGitlabCiFile;const getProjectNamespace=async e=>{const{env:t}=(0,r.parseChoice)(e);const a=await(0,r.getProjectConfig)();return`${a.customerName}-${a.appName}-${t}`};t.getProjectNamespace=getProjectNamespace},5354:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.joinBashExpressions=t.getBashVariable=t.BashExpression=void 0;class BashExpression{constructor(e){this.value=e}toJSON(){return this.toString()}toString(){return this.value.toString()}replace(e,t){return new BashExpression(this.value.toString().replace(e,t))}toLowerCase(){return this.transformWithCommand("awk '{print tolower($0)}'")}concat(...e){return new BashExpression(this.toString().concat(...e.map((e=>e.toString()))))}transformWithCommand(e){return new BashExpression(`$(printf %s "${this.toString()}" | ${e})`)}}t.BashExpression=BashExpression;const getBashVariable=e=>new BashExpression(`$${e}`);t.getBashVariable=getBashVariable;const joinBashExpressions=(e,t="")=>{const a=e.some((e=>e instanceof BashExpression));if(a){return new BashExpression(e.map((e=>e instanceof BashExpression?e.toString():e)).join(t))}else{return e.join(t)}};t.joinBashExpressions=joinBashExpressions},8127:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.escapeForDotEnv=t.escapeNewlines=t.escapeBackTicks=t.escapeSingleQuotes=t.escapeDoubleQuotes=t.escapeBashExpression=t.escapeString=t.bashEscape=void 0;const n=a(3891);const r=a(4396);const i=a(5354);const bashEscape=(e,a={quotes:"double"})=>{if(e instanceof i.BashExpression){return(0,t.escapeBashExpression)(e,a)}if(e instanceof r.VariableValueContainingReferences){return e.toString(a)}return(0,t.escapeString)(e,a)};t.bashEscape=bashEscape;const escapeString=(e,{quotes:a}={quotes:"double"})=>{const n=a?a==="single"?(0,t.escapeSingleQuotes)(e):(0,t.escapeDoubleQuotes)(e):e;return n};t.escapeString=escapeString;const escapeBashExpression=(e,t)=>e;t.escapeBashExpression=escapeBashExpression;const escapeDoubleQuotes=e=>e===null||e===void 0?void 0:e.toString().replace(/"/g,'\\"');t.escapeDoubleQuotes=escapeDoubleQuotes;const escapeSingleQuotes=e=>e===null||e===void 0?void 0:e.toString().replace(/'/g,"\\'");t.escapeSingleQuotes=escapeSingleQuotes;const escapeBackTicks=e=>e===null||e===void 0?void 0:e.toString().replace(/`/g,"\\`");t.escapeBackTicks=escapeBackTicks;const escapeNewlines=e=>e===null||e===void 0?void 0:e.toString().replace(/\n/g,"\\n");t.escapeNewlines=escapeNewlines;const escapeForDotEnv=(e,a={quoteMode:"auto"})=>{if(e===undefined||e===null){return""}if(typeof e==="string"){if(a.quoteMode==="always"||e.includes("\n")){const t=e.replace(/\n/g,"\\n");const a=e.includes(`"`)?e.includes(`'`)?e.includes("`")?'"':"`":"'":'"';return`${a}${t}${a}`}else{return e}}else if(e instanceof i.BashExpression){return escapeBashExpressionForDotEnv(e)}else if(e instanceof r.VariableValueContainingReferences){const a=e.parts.some((e=>e instanceof i.BashExpression));if(!a){return(0,t.escapeForDotEnv)(e.toString({quotes:"double"}))}else{const t=escapeBashExpressionForDotEnv(new i.BashExpression(e.toString({quotes:"double"})));return t}}else{return e}};t.escapeForDotEnv=escapeForDotEnv;const s=(0,n.registerGlobalScriptFunction)("escapeForDotEnv",`\n input="\${1:-$(cat)}"\n input="\${input//$'\\n'/\\\\n}"\n if [[ "$input" == *\\\\n* ]]; then\n if [[ "$input" == *\\"* && "$input" == *\\'* && "$input" == *\\\`* ]]; then\n printf "\\"%s\\"\\n" "$input" ${""}\n elif [[ "$input" == *\\"* && "$input" == *\\'* ]]; then\n printf "\`%s\`\\n" "$input"\n elif [[ "$input" == *\\"* ]]; then\n printf "'%s'\\n" "$input"\n else\n printf "\\"%s\\"\\n" "$input"\n fi\n else\n printf "%s\\n" "$input"\n fi\n `);const escapeBashExpressionForDotEnv=e=>e.transformWithCommand(s.name).toString()},1945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBashExpressionPerPipelineType=void 0;const getBashExpressionPerPipelineType=(e,t)=>{if(!t)return e.default;return e[t]||e.default};t.getBashExpressionPerPipelineType=getBashExpressionPerPipelineType},5103:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBashYamlToFileScript=t.yamlBashString=void 0;const n=a(6637);const r=a(5354);const i=a(4396);const s={tag:"",resolve:e=>new r.BashExpression(e),stringify(e,t){return"|-\n"+t.indent+indentNewlinesInBashExpression(e.value,t.indent)},identify:e=>e instanceof r.BashExpression};const indentNewlinesInBashExpression=(e,t)=>e.transformWithCommand(`sed '1!s/^/${t}/'`);const o={tag:"",resolve:e=>new i.VariableValueContainingReferences(e),stringify(e,t){const a=e.value;const n=a.parts.map((e=>e instanceof r.BashExpression?indentNewlinesInBashExpression(e,t.indent):e.toString().replace(/\n/g,`\n${t.indent}`))).join("");return"|-\n"+t.indent+n},identify:e=>e instanceof i.VariableValueContainingReferences};const yamlBashString=e=>(0,n.stringify)(e,{defaultStringType:"BLOCK_LITERAL",defaultKeyType:"PLAIN",customTags:[s,o],aliasDuplicateObjects:false,lineWidth:0});t.yamlBashString=yamlBashString;const writeBashYamlToFileScript=(e,a)=>[`cat > ${a} <<EOF\n${(0,t.yamlBashString)(e)}\nEOF\n`];t.writeBashYamlToFileScript=writeBashYamlToFileScript},436:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getInjectVarsScript=void 0;const n=a(9250);const r=a(8127);const getInjectVarsScript=e=>{if(!e)return[];return Object.entries(e).filter((([,e])=>!(0,n.isNil)(e))).map((([e,t])=>`export ${e}="${t?(0,r.bashEscape)(t,{quotes:"double"}):""}"`))};t.getInjectVarsScript=getInjectVarsScript},8016:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(8127),t);r(a(5354),t)},7677:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createBuildJobArtifacts=void 0;const n=a(6928);const r=a(5063);const i=a(9250);const s=a(7652);const uniqueAndAlphabeticalSort=e=>(0,i.uniq)(e).sort(((e,t)=>e.localeCompare(t)));const createBuildJobArtifacts=e=>{var t,a;const i=e.type==="workspace"?e.components.flatMap((e=>getArtifactsPathForComponent(e))):getArtifactsPathForComponent(e,["__build_info.json"]);const s=e.type==="workspace"?e.components.flatMap((e=>getAllArtifactExcludePathsForComponent(e))):getAllArtifactExcludePathsForComponent(e);return{paths:uniqueAndAlphabeticalSort(i),...s.length>0?{exclude:uniqueAndAlphabeticalSort(s)}:{},expire_in:"1 day",when:"always",reports:e.type==="component"&&(0,r.componentContextIsStandaloneBuild)(e)?{junit:(a=(t=e.build.config.artifactsReports)===null||t===void 0?void 0:t.junit)===null||a===void 0?void 0:a.map((t=>(0,n.join)(e.build.dir,t)))}:{}}};t.createBuildJobArtifacts=createBuildJobArtifacts;const _getArtifactPathsForComponent=(e,t,a)=>{var r,i;return(i=[...e.build.type!=="disabled"?(r=e.build.config[t])!==null&&r!==void 0?r:[]:[],...a!==null&&a!==void 0?a:[]])===null||i===void 0?void 0:i.flatMap((t=>e.build.getComponentDirs("all").flatMap((e=>(0,n.join)(e,t)))))};const getArtifactsPathForComponent=(e,t)=>_getArtifactPathsForComponent(e,"artifactsPaths",t);const getAllArtifactExcludePathsForComponent=e=>[...getDotEnvPathsForComponent(e),...getArtifactExcludePathsForComponent(e)];const getArtifactExcludePathsForComponent=(e,t)=>_getArtifactPathsForComponent(e,"artifactsExcludePaths",t);const getDotEnvPathsForComponent=e=>{if((0,s.componentContextNeedsBuildTimeDotEnv)(e)){return[(0,n.join)(e.build.dir,".env")]}return[]}},2727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RUNNER_BUILD_RESOURCE_VARIABLES=t.APP_BUILD_JOB_NAME=void 0;t.APP_BUILD_JOB_NAME="🔨 app";t.RUNNER_BUILD_RESOURCE_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},1950:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAppBuildJob=void 0;const n=a(9250);const r=a(241);const i=a(595);const s=a(7677);const o=a(5644);const p=a(8897);const l=a(2727);const d=a(2877);const c=a(7652);const createAppBuildJob=(e,{script:t,variables:a,runnerVariables:u,cache:f,...m})=>{var h;return(0,n.merge)({name:l.APP_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build",image:(0,r.getRunnerImage)("jobs-default"),needs:[],cache:f?(0,o.createJobCacheFromCacheConfigs)(e,f):undefined,variables:{...a!==null&&a!==void 0?a:{},...e.type==="component"?{...e.environment.envVars,...e.environment.jobOnlyVars.build.envVars}:{}},runnerVariables:{...l.RUNNER_BUILD_RESOURCE_VARIABLES,...u!==null&&u!==void 0?u:{},...(h=e.build.config.runnerVariables)!==null&&h!==void 0?h:{}},script:[...e.type==="component"?(0,c.componentContextNeedsBuildTimeDotEnv)(e)?(0,c.writeDotEnv)(e):[]:e.type==="workspace"?e.components.filter((e=>(0,c.componentContextNeedsBuildTimeDotEnv)(e))).flatMap((e=>(0,c.writeDotEnv)(e))):[],...e.type==="component"?(0,d.writeBuildInfo)(e):[],...(0,p.ensureNodeVersion)(e),`cd ${e.build.dir}`,...(0,i.ensureArray)(t)],artifacts:(0,s.createBuildJobArtifacts)(e)},m)};t.createAppBuildJob=createAppBuildJob},3983:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createArtifactsConfig=void 0;const n=a(6928);const createArtifactsConfig=(e,t,a)=>{var r,i,s,o;return t||a?{artifacts:{paths:[],...a,reports:{...a===null||a===void 0?void 0:a.reports,junit:[t===null||t===void 0?void 0:t.junit,Array.isArray((r=a===null||a===void 0?void 0:a.reports)===null||r===void 0?void 0:r.junit)&&((i=a===null||a===void 0?void 0:a.reports)===null||i===void 0?void 0:i.junit),typeof((s=a===null||a===void 0?void 0:a.reports)===null||s===void 0?void 0:s.junit)==="string"&&[(o=a===null||a===void 0?void 0:a.reports)===null||o===void 0?void 0:o.junit]].filter(Array.isArray).reduce(((t,a)=>[...t,...a.map((t=>(0,n.join)(e,t)))]),[])}}}:undefined};t.createArtifactsConfig=createArtifactsConfig},6254:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createBuildJobDefinition=void 0;const n=a(2348);const r=a(595);const i=a(1255);const s=a(5497);const createBuildJobDefinition=(e,t,a={})=>{var o,p,l,d;if(t.buildCommand===null)return undefined;const c=(0,n.getRunnerImage)("jobs-default");return{image:(o=t.jobImage)!==null&&o!==void 0?o:c,runnerVariables:s.NODE_RUNNER_BUILD_VARIABLES,cache:[...(p=a.cache)!==null&&p!==void 0?p:[],...(0,i.getAllCacheConfigsFromConfig)(e,t)],services:"jobServices"in t?t.jobServices:undefined,script:[...(l=a.prescript)!==null&&l!==void 0?l:[],...(0,r.ensureArray)(t.buildCommand),...(d=a.postscript)!==null&&d!==void 0?d:[]],jobTags:t.jobTags}};t.createBuildJobDefinition=createBuildJobDefinition},8121:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceBuildJobs=t.createComponentBuildJobs=void 0;const n=a(9256);const r=a(3660);const i=a(2764);const s=a(4713);const o=a(2727);const p=a(1950);const createComponentBuildJobs=(e,t)=>{var a;return[...t.appBuild&&(0,r.componentContextIsStandaloneBuild)(e)?[(0,p.createAppBuildJob)(e,t.appBuild)]:[],...(0,i.requiresDockerBuild)(e)?[(0,i.createDockerBuildJobBase)(e,{...t.dockerBuild,needs:[...(a=t.dockerBuild.needs)!==null&&a!==void 0?a:[],...t.appBuild&&(0,r.componentContextIsStandaloneBuild)(e)?[o.APP_BUILD_JOB_NAME]:(0,r.componentContextHasWorkspaceBuild)(e)?[{job:o.APP_BUILD_JOB_NAME,artifacts:true,workspaceName:e.build.workspaceName}]:[]]})]:[],...(0,n.sbomDeactivated)(e)?[]:[(0,s.createSbomBuildJob)(e)]]};t.createComponentBuildJobs=createComponentBuildJobs;const createWorkspaceBuildJobs=(e,t)=>t.appBuild?[(0,p.createAppBuildJob)(e,t.appBuild)]:[];t.createWorkspaceBuildJobs=createWorkspaceBuildJobs},2877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBuildInfo=void 0;const writeBuildInfo=e=>[`echo '{"id":"${e.environment.envVars.BUILD_INFO_BUILD_ID}","time":"${e.environment.envVars.BUILD_INFO_BUILD_TIME}"}' > ${e.build.dir}/__build_info.json`];t.writeBuildInfo=writeBuildInfo},7652:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.componentContextNeedsBuildTimeDotEnv=t.writeDotEnv=void 0;const n=a(9250);const r=a(8127);const i=a(52);const s=a(3468);const writeDotEnv=e=>{const t=e.environment.envVars;const a=Object.entries(t).filter((([,e])=>!(0,n.isNil)(e))).filter((([e])=>!i.ALL_BUILD_VARIABLES.includes(e))).map((([e,t])=>`${e}=${(0,r.escapeForDotEnv)(t)}`)).join("\n");return(0,s.collapseableSection)("write-dotenv-"+e.name,"write dot env for "+e.name)([`cat <<EOF > ${e.build.dir}/.env\n${a}\nEOF`])};t.writeDotEnv=writeDotEnv;const componentContextNeedsBuildTimeDotEnv=e=>{var t;return((t=e.componentConfig.dotEnv)!==null&&t!==void 0?t:true)===true};t.componentContextNeedsBuildTimeDotEnv=componentContextNeedsBuildTimeDotEnv},5644:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.createJobCacheFromConfig=t.createJobCacheFromCacheConfigs=void 0;const r=a(6928);const i=a(1255);const s=n(a(4206));const createJobCacheFromCacheConfigs=(e,t)=>{if(t.length===0)return undefined;const a=t.filter((e=>!("key"in e)));const n=t.filter((e=>"key"in e));const i=a.length>0?[{key:e.name+"-default",policy:"pull-push",paths:a.flatMap((t=>t.paths.map((a=>{var n;const i=t.pathMode==="absolute"?"":(n=t.baseDir)!==null&&n!==void 0?n:e.build.dir;return(0,r.join)(i,a)}))))}]:[];const o=n.map((({key:t,paths:a,policy:n,scope:i,pathMode:o,buildDir:p,...l})=>{var d;const c=o==="absolute"?"":p!==null&&p!==void 0?p:e.build.dir;const u=i==="global"?t:typeof t==="string"?(i==="buildDir"?(0,s.default)(c):e.name)+"-"+t:{...t,files:(d=t.files)===null||d===void 0?void 0:d.map((e=>o==="absolute"?e:(0,r.join)(c,e)))};return{key:u,policy:n!==null&&n!==void 0?n:"pull-push",paths:o==="absolute"?a:a===null||a===void 0?void 0:a.map((e=>(0,r.join)(c,e))),...l}}));return[...o,...i]};t.createJobCacheFromCacheConfigs=createJobCacheFromCacheConfigs;const createJobCacheFromConfig=(e,a)=>(0,t.createJobCacheFromCacheConfigs)(e,(0,i.getAllCacheConfigsFromConfig)(e,a));t.createJobCacheFromConfig=createJobCacheFromConfig},1255:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getAllCacheConfigsFromConfig=void 0;const n=a(595);const r=a(3507);const getAllCacheConfigsFromConfig=(e,t)=>[..."jobCache"in t?(0,r.transformLegacyJobCache)(t.jobCache):[],...(0,n.ensureArray)(t.cache),...e.type==="workspace"?e.components.flatMap((e=>{var t;return e.build.type!=="disabled"?(t=(0,n.ensureArray)(e.build.config.cache).map((t=>({...t,baseDir:e.build.dir}))))!==null&&t!==void 0?t:[]:[]})):[]];t.getAllCacheConfigsFromConfig=getAllCacheConfigsFromConfig},3507:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transformLegacyJobCache=void 0;const n=a(595);function transformLegacyJobCache(e){return(0,n.ensureArray)(e).map((e=>{var t,a;return{pathMode:"absolute",...e,key:(t=e.key)!==null&&t!==void 0?t:"default",paths:(a=e.paths)!==null&&a!==void 0?a:[]}}))}t.transformLegacyJobCache=transformLegacyJobCache},985:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomBuildJobs=void 0;const n=a(2764);const r=a(9851);const i=a(8121);const s=a(6254);const createCustomBuildJobs=e=>{const t=e.build.config;if(!(0,r.isOfBuildType)(t,"custom")){throw new Error("deploy config is not custom")}return(0,i.createComponentBuildJobs)(e,{appBuild:t.buildCommand!==null?(0,s.createBuildJobDefinition)(e,t):undefined,dockerBuild:{script:(0,n.getDockerBuildScriptWithBuiltInDockerFile)(e),variables:{}}})};t.createCustomBuildJobs=createCustomBuildJobs},2924:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomJobs=void 0;const n=a(985);const r=a(7039);const createCustomJobs=e=>[...(0,r.createCustomTestJobs)(e),...(0,n.createCustomBuildJobs)(e)];t.createCustomJobs=createCustomJobs},7039:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomTestJobs=void 0;const n=a(595);const r=a(3983);const i=a(5644);const s=a(9851);const o={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"};const createCustomTestJobs=e=>{var t,a,p,l,d,c,u,f,m,h,v,g,y,b,w,_,S,N,C,A,O;if(e.trigger==="taggedRelease"){return[]}const I=e.build.config;if(!(0,s.isOfBuildType)(I,"custom")){throw new Error("deploy config is not custom")}const D={variables:{APP_PATH:e.build.dir,...e.environment.jobOnlyVars.build.envVars},services:I.jobServices,cache:(0,i.createJobCacheFromConfig)(e,I),stage:"test",needs:[]};const k=I.audit?{name:"🛡 audit",...D,runnerVariables:{...o,...(a=(t=I.audit)===null||t===void 0?void 0:t.runnerVariables)!==null&&a!==void 0?a:{}},image:(l=(p=I.audit)===null||p===void 0?void 0:p.jobImage)!==null&&l!==void 0?l:I.jobImage,cache:undefined,script:[...(0,n.ensureArray)((d=I.audit)===null||d===void 0?void 0:d.command)],allow_failure:true,...(0,r.createArtifactsConfig)(e.build.dir,(c=I.audit)===null||c===void 0?void 0:c.artifactsReports,(u=I.audit)===null||u===void 0?void 0:u.artifacts)}:null;const T=I.lint?{name:"👮 lint",...D,runnerVariables:{...o,...(m=(f=I.lint)===null||f===void 0?void 0:f.runnerVariables)!==null&&m!==void 0?m:{}},image:(v=(h=I.lint)===null||h===void 0?void 0:h.jobImage)!==null&&v!==void 0?v:I.jobImage,script:[...(0,n.ensureArray)((g=I.lint)===null||g===void 0?void 0:g.command)],...(0,r.createArtifactsConfig)(e.build.dir,(y=I.lint)===null||y===void 0?void 0:y.artifactsReports,(b=I.lint)===null||b===void 0?void 0:b.artifacts)}:null;const P=I.test?{name:"🧪 test",...D,runnerVariables:{...o,...(_=(w=I.test)===null||w===void 0?void 0:w.runnerVariables)!==null&&_!==void 0?_:{}},image:(N=(S=I.test)===null||S===void 0?void 0:S.jobImage)!==null&&N!==void 0?N:I.jobImage,script:[...(0,n.ensureArray)((C=I.test)===null||C===void 0?void 0:C.command)],...(0,r.createArtifactsConfig)(e.build.dir,(A=I.test)===null||A===void 0?void 0:A.artifactsReports,(O=I.test)===null||O===void 0?void 0:O.artifacts)}:null;return[k,T,P].filter(n.notNil)};t.createCustomTestJobs=createCustomTestJobs},2764:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.hasDockerfile=t.getDockerBuildDefaultScript=t.getDockerBuildScriptWithBuiltInDockerFile=t.gitlabDockerLogin=t.createDockerBuildJobBase=t.getDockerJobBaseProps=t.DOCKER_BUILD_JOB_NAME=t.getDockerBuildVariables=t.requiresDockerBuild=t.getDockerImageVariables=void 0;const r=a(9896);const i=a(9250);const s=n(a(6928));const o=a(8025);const p=a(4316);const l=a(1201);const d=a(2348);const c=a(3468);const u=a(5644);const f={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"2Gi"};const getDockerImageVariables=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;return{...(0,o.isOfDeployType)(a,"google-cloudrun")?{DOCKER_REGISTRY:(0,p.getArtifactsRegistryHost)(e),DOCKER_IMAGE:(0,p.getArtifactsRegistryImageName)(e),DOCKER_CACHE_IMAGE:(0,p.getArtifactsRegistryBuildCacheImage)(e)}:{DOCKER_REGISTRY:"$CI_REGISTRY",DOCKER_CACHE_IMAGE:"$CI_REGISTRY_IMAGE/caches/"+e.name,DOCKER_IMAGE_NAME:e.env+"/"+e.name,DOCKER_IMAGE:"$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME"},DOCKER_IMAGE_TAG:"$CI_COMMIT_SHA"}};t.getDockerImageVariables=getDockerImageVariables;const requiresDockerBuild=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;return(0,o.isOfDeployType)(a,"kubernetes","google-cloudrun","dockerTag")||(0,o.isOfDeployType)(a,"custom")&&a.requiresDocker};t.requiresDockerBuild=requiresDockerBuild;const getDockerBuildRunnerVariables=()=>({DOCKER_HOST:"tcp://docker:2375",DOCKER_TLS_CERTDIR:"",DOCKER_DRIVER:"overlay2",DOCKER_BUILDKIT:"1"});const getDockerAdditions=e=>{var t,a;if(!("docker"in e))return{};if(!e.docker)return{};return{DOCKERFILE_ADDITIONS:"additionsBegin"in e.docker?(t=e.docker.additionsBegin)===null||t===void 0?void 0:t.join("\n"):undefined,DOCKERFILE_ADDITIONS_END:"additionsEnd"in e.docker?(a=e.docker.additionsEnd)===null||a===void 0?void 0:a.join("\n"):undefined}};const getDockerBuildVariables=e=>{var a;return{...getDockerAdditions(e.build.config),APP_DIR:e.build.dir,DOCKER_BUILD_CONTEXT:"docker"in e.build.config&&e.build.config.docker&&"buildContextLocation"in e.build.config.docker&&((a=e.build.config.docker)===null||a===void 0?void 0:a.buildContextLocation)==="component"?e.build.dir:".",...(0,t.getDockerImageVariables)(e)}};t.getDockerBuildVariables=getDockerBuildVariables;t.DOCKER_BUILD_JOB_NAME="🔨 docker";const getDockerJobBaseProps=()=>({image:(0,d.getRunnerImage)("docker-build"),services:[{name:"docker:24.0.6-dind",command:["--tls=false","--registry-mirror=https://mirror.gcr.io"]}],variables:{},runnerVariables:getDockerBuildRunnerVariables()});t.getDockerJobBaseProps=getDockerJobBaseProps;const createDockerBuildJobBase=(e,{script:a,cache:n,...r})=>(0,i.merge)({name:t.DOCKER_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build",cache:n?(0,u.createJobCacheFromCacheConfigs)(e,n):undefined,...(0,t.getDockerJobBaseProps)(),script:a||[]},{variables:(0,t.getDockerBuildVariables)(e),runnerVariables:{...f,...getDockerBuildRunnerVariables()}},r);t.createDockerBuildJobBase=createDockerBuildJobBase;const gitlabDockerLogin=e=>e.deploy&&(0,o.isOfDeployType)(e.deploy.config,"google-cloudrun")?[...(0,l.gcloudServiceAccountLoginCommands)(e),`gcloud auth configure-docker ${(0,p.getArtifactsRegistryHost)(e)}`]:["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY"];t.gitlabDockerLogin=gitlabDockerLogin;const m={meteor:"ensureMeteorDockerfile",node:"ensureNodeDockerfile",nginx:"ensureNginxDockerfile",custom:null};const getEnsureDockerFileScript=(e,t)=>{var a,n,r,i,s,o;if("docker"in e.build.config&&e.build.config.docker&&"type"in e.build.config.docker){if(((a=e.build.config.docker)===null||a===void 0?void 0:a.type)==="custom"){if((n=e.build.config.docker)===null||n===void 0?void 0:n.dockerfileContent){return`\necho "Creating Dockerfile"\ncat >$APP_DIR/Dockerfile <<EOF\n${(i=(r=e.build.config.docker)===null||r===void 0?void 0:r.dockerfileContent)===null||i===void 0?void 0:i.join("\n")}\nEOF`}}const p=(o=(s=e.build.config.docker)===null||s===void 0?void 0:s.type)!==null&&o!==void 0?o:t;return p?m[p]:null}return t?m[t]:null};const getDockerBuildScriptWithBuiltInDockerFile=(e,a)=>(0,t.getDockerBuildDefaultScript)(e,getEnsureDockerFileScript(e,a));t.getDockerBuildScriptWithBuiltInDockerFile=getDockerBuildScriptWithBuiltInDockerFile;const getDockerBuildDefaultScript=(e,a)=>[a!==null&&a!==void 0?a:undefined,...(0,c.collapseableSection)("docker-login","Docker Login")((0,t.gitlabDockerLogin)(e)),...(0,c.collapseableSection)("docker-build","Docker build")(["docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile $DOCKER_BUILD_CONTEXT --build-arg BUILDKIT_INLINE_CACHE=1"]),...(0,c.collapseableSection)("docker-push","Docker push and tag")(["docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG","docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE","docker push $DOCKER_CACHE_IMAGE"])].filter(Boolean);t.getDockerBuildDefaultScript=getDockerBuildDefaultScript;const hasDockerfile=e=>(0,r.existsSync)(s.default.join(e.build.dir,"Dockerfile"));t.hasDockerfile=hasDockerfile},1398:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});t.WORKSPACE_BUILD_TYPES=t.BUILD_TYPES=void 0;const i=a(2924);const s=a(7667);const o=a(3260);r(a(7667),t);r(a(9851),t);t.BUILD_TYPES={node:{jobs:s.createNodeJobs,defaults:()=>({buildCommand:"yarn build",startCommand:"yarn start",artifactsPaths:["dist",".next"],artifactsExcludePaths:[".next/cache/**/*"]})},"node-static":{jobs:s.createNodeJobs,defaults:()=>({buildCommand:"yarn build",artifactsPaths:["dist"]})},storybook:{jobs:s.createStorybookJobs,defaults:()=>({buildCommand:["yarn build-storybook --quiet -o ./dist"],artifactsPaths:["dist"]})},meteor:{jobs:s.createMeteorJobs,defaults:()=>({startCommand:"node main.js",artifactsPaths:["dist"]})},custom:{jobs:i.createCustomJobs,defaults:()=>({artifactsPaths:["dist"]})},rails:{jobs:o.createRailsJobs,defaults:()=>({cnbBuilder:{image:"heroku/builder:24",packVersion:"0.36.4"}})}};t.WORKSPACE_BUILD_TYPES={node:{jobs:s.createNodeJobs,defaults:()=>({buildCommand:"yarn build",lint:{command:"yarn lint"},test:{command:"yarn test"}})}}},5464:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createNodeDockerJobDefinition=t.createNodeBuildJobDefinition=t.createNodeBuildJobs=void 0;const n=a(3660);const r=a(8121);const i=a(6254);const s=a(2764);const o=a(4189);const p=a(8897);const createNodeBuildJobs=e=>{if(e.type==="workspace"){return(0,r.createWorkspaceBuildJobs)(e,{appBuild:(0,t.createNodeBuildJobDefinition)(e)})}return(0,r.createComponentBuildJobs)(e,{appBuild:(0,n.componentContextIsStandaloneBuild)(e)?(0,t.createNodeBuildJobDefinition)(e):undefined,dockerBuild:(0,t.createNodeDockerJobDefinition)(e)})};t.createNodeBuildJobs=createNodeBuildJobs;const createNodeBuildJobDefinition=e=>{const t=e.build.config;const a=(0,p.getYarnInstall)(e);return(0,i.createBuildJobDefinition)(e,t,{prescript:a,cache:(0,o.getNodeCache)(e)})};t.createNodeBuildJobDefinition=createNodeBuildJobDefinition;const createNodeDockerJobDefinition=e=>{var t,a;const n=e.build.buildType==="node-static"||e.build.buildType==="storybook"?"nginx":"node";return{script:(0,s.getDockerBuildScriptWithBuiltInDockerFile)(e,n),cache:[...(0,o.getYarnCache)(e,"pull")],variables:{DOCKER_COPY_AND_INSTALL_APP:(0,p.getDockerAppCopyAndBuildScript)(e),DOCKER_COPY_WORKSPACE_FILES:(a=(t=e.packageManagerInfo)===null||t===void 0?void 0:t.pathsToCopyInDocker.map((e=>`COPY --chown=node:node ${e} /app/${e}`)))===null||a===void 0?void 0:a.join("\n")}}};t.createNodeDockerJobDefinition=createNodeDockerJobDefinition},4189:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getNodeCache=t.getNodeModulesCache=t.getYarnCache=void 0;const r=a(9250);const i=a(6928);const s=n(a(4206));const getYarnCache=(e,t="pull-push")=>{const a=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[{scope:a?"global":"buildDir",pathMode:a?"absolute":"relative",key:"yarn",policy:t,paths:[".yarn"]}]};t.getYarnCache=getYarnCache;const getNodeModulesCache=(e,t="pull-push")=>{var a;const n=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[{scope:"global",pathMode:"absolute",key:n?"node-modules-workspace":(0,s.default)(e.build.dir)+"-node-modules",policy:t,paths:[...n?(0,r.uniq)(["node_modules",...(a=e.packageManagerInfo.workspaces.map((e=>(0,i.join)(e.location,"node_modules"))))!==null&&a!==void 0?a:[]]):[(0,i.join)(e.build.dir,"node_modules")]]}]};t.getNodeModulesCache=getNodeModulesCache;const getNodeCache=(e,a="pull-push")=>[...(0,t.getYarnCache)(e,a),...(0,t.getNodeModulesCache)(e,a)];t.getNodeCache=getNodeCache},5497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NODE_RUNNER_BUILD_VARIABLES=void 0;t.NODE_RUNNER_BUILD_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},7667:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMeteorJobs=t.createStorybookJobs=t.createNodeJobs=void 0;const n=a(5464);const r=a(6055);const i=a(9884);const createNodeJobs=e=>[...(0,i.createNodeTestJobs)(e),...(0,n.createNodeBuildJobs)(e)];t.createNodeJobs=createNodeJobs;const createStorybookJobs=e=>[...(0,n.createNodeBuildJobs)(e)];t.createStorybookJobs=createStorybookJobs;const createMeteorJobs=e=>[...(0,i.createNodeTestJobs)(e),...(0,r.createMeteorBuildJobs)(e)];t.createMeteorJobs=createMeteorJobs},6055:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMeteorBuildJobs=void 0;const n=a(2348);const r=a(8121);const i=a(2764);const s=a(9851);const o=a(4189);const p=a(8897);const getMeteorCache=e=>[{key:"meteor-build-cache",policy:"pull-push",paths:[".meteor/local/resolver-result-cache.json",".meteor/local/plugin-cache",".meteor/local/isopacks",".meteor/local/bundler-cache/scanner"]}];const createMeteorBuildJobs=e=>{const t=e.build.config;if(!(0,s.isOfBuildType)(t,"meteor")){throw new Error("deploy config is not meteor")}const a=(0,p.getYarnInstall)(e);return(0,r.createComponentBuildJobs)(e,{appBuild:t.buildCommand!==null?{cache:[...(0,o.getNodeCache)(e),...getMeteorCache(e)],image:(0,n.getRunnerImage)("jobs-meteor"),variables:{METEOR_DISABLE_OPTIMISTIC_CACHING:"1"},script:[...a,'echo "add healthcheck package"',"meteor add panter:healthroute --allow-superuser","meteor add qualia:prod-shell --allow-superuser",'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory',"cp ./__build_info.json ./dist/bundle/programs/server"]}:undefined,dockerBuild:{script:(0,i.getDockerBuildScriptWithBuiltInDockerFile)(e,"meteor"),variables:{METEOR_INSTALL_SCRIPTS:t.installScripts?"true":""}}})};t.createMeteorBuildJobs=createMeteorBuildJobs},9884:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createNodeTestJobs=void 0;const n=a(2348);const r=a(3660);const i=a(595);const s=a(3983);const o=a(4189);const p=a(5497);const l=a(8897);const d=a(5644);const createNodeTestJobs=e=>{var t,a,c,u,f,m,h,v,g,y,b,w,_,S,N,C,A,O,I,D,k,T,P,R;if(e.trigger==="taggedRelease"){return[]}if(e.type==="component"&&!(0,r.componentContextIsStandaloneBuild)(e)){return[]}const L=(0,n.getRunnerImage)("jobs-default");const x={variables:{APP_PATH:e.build.dir,...e.type==="component"?{...e.environment.jobOnlyVars.build.envVars}:{}},stage:"test",needs:[]};const j=e.build.config;const B=(0,l.getYarnInstall)(e);const M=j.audit!==false?{name:"🛡 audit",...x,runnerVariables:{...p.NODE_RUNNER_BUILD_VARIABLES,...(a=(t=j.audit)===null||t===void 0?void 0:t.runnerVariables)!==null&&a!==void 0?a:{}},image:(u=(c=j.audit)===null||c===void 0?void 0:c.jobImage)!==null&&u!==void 0?u:L,cache:undefined,script:[`cd ${e.build.dir}`,...(m=(0,i.ensureArrayOrNull)((f=j.audit)===null||f===void 0?void 0:f.command))!==null&&m!==void 0?m:[e.packageManagerInfo.isClassic?"yarn audit":"yarn npm audit --environment production"]],allow_failure:true,...(0,s.createArtifactsConfig)(e.build.dir,(h=j.audit)===null||h===void 0?void 0:h.artifactsReports,(v=j.audit)===null||v===void 0?void 0:v.artifacts)}:null;const V=j.lint!==false?{name:"👮 lint",...x,runnerVariables:{...p.NODE_RUNNER_BUILD_VARIABLES,...(y=(g=j.lint)===null||g===void 0?void 0:g.runnerVariables)!==null&&y!==void 0?y:{}},image:(w=(b=j.lint)===null||b===void 0?void 0:b.jobImage)!==null&&w!==void 0?w:L,cache:(0,d.createJobCacheFromCacheConfigs)(e,(0,o.getNodeCache)(e)),script:[...(0,l.ensureNodeVersion)(e),`cd ${e.build.dir}`,...B,...(S=(0,i.ensureArrayOrNull)((_=j.lint)===null||_===void 0?void 0:_.command))!==null&&S!==void 0?S:["yarn lint"]],...(0,s.createArtifactsConfig)(e.build.dir,(N=j.lint)===null||N===void 0?void 0:N.artifactsReports,(C=j.lint)===null||C===void 0?void 0:C.artifacts)}:null;const U=j.test!==false?{name:"🧪 test",...x,runnerVariables:{...p.NODE_RUNNER_BUILD_VARIABLES,...(O=(A=j.test)===null||A===void 0?void 0:A.runnerVariables)!==null&&O!==void 0?O:{}},image:(D=(I=j.test)===null||I===void 0?void 0:I.jobImage)!==null&&D!==void 0?D:(0,n.getRunnerImage)("jobs-testing-chrome"),cache:(0,d.createJobCacheFromCacheConfigs)(e,(0,o.getNodeCache)(e)),script:[...(0,l.ensureNodeVersion)(e),`cd ${e.build.dir}`,...B,...(T=(0,i.ensureArrayOrNull)((k=j.test)===null||k===void 0?void 0:k.command))!==null&&T!==void 0?T:["yarn test"]],...(0,s.createArtifactsConfig)(e.build.dir,(P=j.test)===null||P===void 0?void 0:P.artifactsReports,(R=j.test)===null||R===void 0?void 0:R.artifacts)}:null;return[M,V,U].filter(i.notNil)};t.createNodeTestJobs=createNodeTestJobs},8897:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDockerAppCopyAndBuildScript=t.getYarnInstall=t.ensureNodeVersion=void 0;const n=a(5354);const r=a(595);const i=a(3468);const s=`yarn install --frozen-lockfile`;const o=`yarn workspaces focus --production`;const p=`yarn rebuild`;const getYarnInstallCommand=e=>{if(e.packageManagerInfo.isClassic){return s}return`yarn install --immutable --inline-builds`};const ensureNodeVersion=e=>(0,i.collapseableSection)("nodeinstall","Ensure node version")(["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi","if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi"]);t.ensureNodeVersion=ensureNodeVersion;const getYarnInstall=(e,a)=>{const n=e.type!=="workspace"&&e.build.type!=="disabled"&&"postInstall"in e.build.config?e.build.config.postInstall:null;return[...(0,t.ensureNodeVersion)(e),...(0,i.collapseableSection)("yarninstall","Yarn install")([getYarnInstallCommand(e)]),...n&&!(a===null||a===void 0?void 0:a.noCustomPostInstall)?(0,i.collapseableSection)("postinstall","Custom post install")((0,r.ensureArray)(n)):[]]};t.getYarnInstall=getYarnInstall;const l=`COPY --chown=node:node $APP_DIR .`;const getDockerAppCopyAndBuildScript=e=>{var t,a,r;if(e.packageManagerInfo.isClassic){return new n.BashExpression(`\nRUN ${s} --production --ignore-scripts\n${l}\nRUN ${s} --production \n `.trim())}const i=e.build.type==="fromWorkspace"?(a=(t=e.build.workspaceBuildConfig.dockerDefaults)===null||t===void 0?void 0:t.yarnRebuildEnabled)!==null&&a!==void 0?a:true:true;const d="docker"in e.build.config&&e.build.config.docker&&"yarnRebuildEnabled"in e.build.config.docker?(r=e.build.config.docker.yarnRebuildEnabled)!==null&&r!==void 0?r:i:i;const c=["2","3"].some((t=>e.packageManagerInfo.version.startsWith(t)));const u=c?"RUN yarn plugin import workspace-tools":"";return new n.BashExpression(`\n ENV YARN_ENABLE_INLINE_BUILDS=1\n${l}\n${u}\nRUN ${o}\n${d?`RUN ${p}`:""}\n\n `.trim())};t.getDockerAppCopyAndBuildScript=getDockerAppCopyAndBuildScript},3188:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRailsBuildJobs=void 0;const n=a(241);const r=a(8121);const i=a(2764);const s=a(9851);const createRailsBuildJobs=e=>{var t,a,o;const p=e.build.config;if(!(0,s.isOfBuildType)(p,"rails")){throw new Error("build type is not rails")}if(!(0,n.componentContextIsStandaloneBuild)(e)){throw new Error("workspace builds are not supported for rails apps")}if((0,i.hasDockerfile)(e)){return(0,r.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{script:(0,i.getDockerBuildDefaultScript)(e),variables:{}}})}const l=p.cnbBuilder;const d=Object.entries((t=l===null||l===void 0?void 0:l.buildVars)!==null&&t!==void 0?t:{}).map((([e,t])=>`--env '${e}${t?`=${t}`:""}'`)).join(" ");return(0,r.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{variables:{...e.environment.jobOnlyVars.build.envVars},script:[...(0,i.gitlabDockerLogin)(e),`cd ${e.build.dir}`,`wget --output-document=- https://github.com/buildpacks/pack/releases/download/v${l===null||l===void 0?void 0:l.packVersion}/pack-v${l===null||l===void 0?void 0:l.packVersion}-linux.tgz | tar -zx --directory /usr/local/bin pack`,`chmod +x /usr/local/bin/pack`,`sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock`,`pack build "$DOCKER_IMAGE:$DOCKER_IMAGE_TAG" --builder '${l===null||l===void 0?void 0:l.image}' --publish --cache-image "$DOCKER_CACHE_IMAGE" ${d} ${(o=(a=l===null||l===void 0?void 0:l.packExtraArgs)===null||a===void 0?void 0:a.join(" "))!==null&&o!==void 0?o:""}`]}})};t.createRailsBuildJobs=createRailsBuildJobs},3260:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRailsJobs=void 0;const n=a(3188);const r=a(7983);const createRailsJobs=e=>[...(0,r.createRailsTestJobs)(e),...(0,n.createRailsBuildJobs)(e)];t.createRailsJobs=createRailsJobs},7983:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRailsTestJobs=void 0;const n=a(241);const r=a(595);const createRailsTestJobs=e=>{var t,a,i,s,o,p,l,d,c,u,f,m,h,v,g,y,b;if(e.trigger==="taggedRelease"){return[]}if(!(0,n.componentContextIsStandaloneBuild)(e)){return[]}const w=e.build.config;const _={variables:{...e.environment.jobOnlyVars.build.envVars},stage:"test",needs:[]};const S="docker.io/ruby";const N="tmp/cache";const C=[`bundle config set path '${N}'`,"bundle install -j $(nproc)"];const A={key:{files:["Gemfile.lock"],prefix:"$CI_JOB_IMAGE"},paths:[N]};const O=w.audit!==false?{name:"🛡 audit",..._,cache:undefined,image:(i=(a=(t=w.audit)===null||t===void 0?void 0:t.jobImage)!==null&&a!==void 0?a:w.jobImage)!==null&&i!==void 0?i:S,script:[`cd ${e.build.dir}`,...(o=(0,r.ensureArrayOrNull)((s=w.audit)===null||s===void 0?void 0:s.command))!==null&&o!==void 0?o:["gem install bundler-audit","bundle audit check"]],allow_failure:true}:null;const I=w.lint!==false?{name:"👮 lint",..._,cache:A,image:(d=(l=(p=w.lint)===null||p===void 0?void 0:p.jobImage)!==null&&l!==void 0?l:w.jobImage)!==null&&d!==void 0?d:S,script:[`cd ${e.build.dir}`,...C,...(u=(0,r.ensureArrayOrNull)((c=w.lint)===null||c===void 0?void 0:c.command))!==null&&u!==void 0?u:["bundle exec rubocop"]]}:null;const D=w.test!==false?{name:"🧪 test",..._,cache:A,image:(h=(m=(f=w.test)===null||f===void 0?void 0:f.jobImage)!==null&&m!==void 0?m:w.jobImage)!==null&&h!==void 0?h:S,script:[`cd ${e.build.dir}`,...C,...(g=(0,r.ensureArrayOrNull)((v=w.test)===null||v===void 0?void 0:v.command))!==null&&g!==void 0?g:["bundle exec rake db:test:prepare","bundle exec rake assets:precompile assets:clean","bundle exec rspec"]],runnerVariables:{RAILS_ENV:"test",DATABASE_URL:"postgresql://postgres@database"},services:[{name:w.test&&"databaseImage"in w.test?(b=(y=w===null||w===void 0?void 0:w.test)===null||y===void 0?void 0:y.databaseImage)!==null&&b!==void 0?b:"docker.io/postgres:latest":"docker.io/postgres:latest",alias:"database",variables:{POSTGRES_HOST_AUTH_METHOD:"trust"}}]}:null;return[O,I,D].filter(r.notNil)};t.createRailsTestJobs=createRailsTestJobs},4713:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSbomBuildJob=t.SBOM_FILE=t.SBOM_BUILD_JOB_NAME=void 0;const n=a(1398);const r=a(595);t.SBOM_BUILD_JOB_NAME="🧾 sbom";t.SBOM_FILE="__sbom.json";const createSbomBuildJob=e=>{var a,i,s,o;const p=e.build.config;const l={name:"aquasec/trivy:0.58.2",entrypoint:[""]};const d=[`trivy fs --quiet --format cyclonedx --output "${t.SBOM_FILE}" ${e.packageManagerInfo.componentIsInWorkspace?".":e.build.dir}`];const c=(0,n.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(i=(a=p.sbom)===null||a===void 0?void 0:a.jobImage)!==null&&i!==void 0?i:l:l;const u=(0,n.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(o=(0,r.ensureArrayOrNull)((s=p.sbom)===null||s===void 0?void 0:s.command))!==null&&o!==void 0?o:d:d;return{name:t.SBOM_BUILD_JOB_NAME,stage:"build",envMode:"jobPerEnv",variables:{},cache:undefined,image:c,script:u,allow_failure:true,artifacts:{paths:[t.SBOM_FILE]}}};t.createSbomBuildJob=createSbomBuildJob},9851:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isOfBuildType=t.isStandaloneBuildConfig=void 0;const isStandaloneBuildConfig=e=>{if(!e)return false;return!("from"in e)};t.isStandaloneBuildConfig=isStandaloneBuildConfig;const isOfBuildType=(e,...a)=>{if(!(0,t.isStandaloneBuildConfig)(e))return false;return a.includes(e.type)};t.isOfBuildType=isOfBuildType},5233:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCatenvContext=void 0;const n=a(5585);const createCatenvContext=e=>({config:e,fileWriter:n.FileWriter.create(e)});t.createCatenvContext=createCatenvContext},6740:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getAllEnvsByTrigger=t.getAllEnvsInAllComponents=t.getAllEnvs=void 0;const n=a(5063);const getConfiguredAndDefaultEnvs=(e,t,a)=>{var n,r;const i=(n=e.components[t].env)!==null&&n!==void 0?n:{};const s=a.filter((e=>i[e]!==false));const o=Object.entries((r=e.components[t].env)!==null&&r!==void 0?r:{}).filter((([,e])=>e&&"type"in e&&e.type&&a.includes(e.type))).map((([e])=>e));return[...new Set([...s,...o])]};const getAllEnvs=(e,t)=>getConfiguredAndDefaultEnvs(e,t,n.DEFAULT_ENV_TYPES);t.getAllEnvs=getAllEnvs;const getAllEnvsInAllComponents=e=>[...new Set(Object.keys(e.components).flatMap((a=>(0,t.getAllEnvs)(e,a))))];t.getAllEnvsInAllComponents=getAllEnvsInAllComponents;const getAllEnvsByTrigger=(e,t,a)=>{const r=(0,n.getEnvTypesByTrigger)(a);return getConfiguredAndDefaultEnvs(e,t,r)};t.getAllEnvsByTrigger=getAllEnvsByTrigger},940:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(6740),t);r(a(3376),t)},3376:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.readConfig=void 0;const n=a(9896);const r=a(2896);const i=a(6637);const fullPath=(e,t)=>e+"/catladder."+t;const readConfigInternal=async(e=process.cwd())=>{const t=["ts","js","yml","yaml"].find((t=>(0,n.existsSync)(fullPath(e,t))));if(t){const a=fullPath(e,t);if(t==="ts"||t==="js"){const n=await r.require(a,e);const i=n.default.default||n.default;return{path:a,ext:t,config:i}}else{return{path:a,ext:t,config:(0,i.parse)((0,n.readFileSync)(a,{encoding:"utf-8"}))}}}return null};const readConfig=async(e=process.cwd())=>{try{return await readConfigInternal(e)}catch(t){console.error(`Error reading config in ${e}:`,t);console.error(`\nThis may happen due to various reasons:\n - Syntax errors in your catladder.ts file\n - tsx (the TypeScript loader used by catladder) needs to understand the syntax in your project.\n If your project uses newer TypeScript/JavaScript syntax, you may need to update catladder\n to get a newer version of tsx that supports it.\n - Missing or incorrect dependencies in your project\n - TypeScript configuration issues in your tsconfig.json\n`);return null}};t.readConfig=readConfig},3480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_REGISTRY=t.PIPELINE_IMAGE_TAG=void 0;t.PIPELINE_IMAGE_TAG=process.env.INLINE_PIPELINE_IMAGE_TAG||"latest";t.DOCKER_REGISTRY=process.env.INLINE_DOCKER_REGISTRY||"git.panter.ch:5001/catladder/catladder"},8347:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAllComponentsContext=void 0;const n=a(6740);const r=a(4847);const createAllComponentsContext=async({config:e,trigger:t,pipelineType:a})=>await Promise.all(Object.keys(e.components).flatMap((i=>{const s=(0,n.getAllEnvsByTrigger)(e,i,t);return s.map((async n=>await(0,r.createComponentContext)({config:e,componentName:i,env:n,trigger:t,pipelineType:a})))})));t.createAllComponentsContext=createAllComponentsContext},4847:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createComponentContext=void 0;const n=a(9250);const r=a(1398);const i=a(8025);const s=a(4041);const o=a(595);const p=a(4956);const l=a(5841);const createComponentContext=async e=>{var t;if(!/^[a-z0-9-]+$/.test(e.componentName)){throw new Error("componentName may only contain lower case letters, numbers and -")}const a=await(0,s.getPackageManagerInfoForComponent)(e.config,e.componentName);const d=(0,l.getEnvironmentContext)(e);const c=d.envConfigRaw;const u=c.build===false?false:(0,r.isStandaloneBuildConfig)(c.build)?c.build.type:(t=e.config.builds)===null||t===void 0?void 0:t[c.build.from].type;if(u===undefined){throw new Error("build type not found, is the build config correct?")}const f=c.deploy?{build:u&&r.BUILD_TYPES[u].defaults(d),deploy:i.DEPLOY_TYPES[c.deploy.type].defaults(d)}:{build:u&&r.BUILD_TYPES[u].defaults(d),deploy:{}};const m=(0,o.mergeWithMergingArrays)(f,c);const h=await(0,p.getEnvironment)(e);const{deploy:v,build:g,customJobs:y,dir:b}=m;const getComponentDirs=e=>{var t;return[b,...e==="all"?(t=a.currentWorkspaceDependencies)!==null&&t!==void 0?t:[]:[]]};const _getBuildContext=()=>{var t;if(g===false){return{type:"disabled",getComponentDirs:getComponentDirs,dir:b}}if((0,r.isStandaloneBuildConfig)(g)){return{dir:b,getComponentDirs:getComponentDirs,config:g,buildType:g.type,type:"standalone"}}const a=(t=e.config.builds)===null||t===void 0?void 0:t[g.from];if(!a){throw new Error("build.from not found in config")}return{dir:b,getComponentDirs:getComponentDirs,config:g,workspaceBuildConfig:a,workspaceName:g.from,buildType:a.type,type:"fromWorkspace"}};const w=_getBuildContext();const _={type:"component",name:e.componentName,env:e.env,fullConfig:e.config,componentConfig:m,build:w,deploy:v?{config:v}:null,environment:h,packageManagerInfo:a,pipelineType:e.pipelineType,trigger:e.trigger};const S=(0,n.isFunction)(y)?y(_):y;return{..._,customJobs:S}};t.createComponentContext=createComponentContext},2981:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceContext=void 0;const n=a(241);const r=a(4041);const i=a(595);const s=a(9250);async function createWorkspaceContext({env:e,components:t,workspaceName:a,config:o,pipelineType:p,trigger:l}){var d,c;const u=(d=o.builds)===null||d===void 0?void 0:d[a];if(!u){throw new Error(`Workspace ${a} not found in config`)}const f=n.WORKSPACE_BUILD_TYPES[u.type].defaults();const m=(0,i.mergeWithMergingArrays)(f,u);return{name:a,pipelineType:p,trigger:l,type:"workspace",workspaceConfig:m,env:e,components:t,fullConfig:o,packageManagerInfo:await(0,r.getPackageManagerInfoBase)(),build:{type:"workspace",dir:(c=m.dir)!==null&&c!==void 0?c:".",getComponentDirs:e=>(0,s.uniq)(t.flatMap((t=>t.build.getComponentDirs(e)))),buildType:m.type,config:m}}}t.createWorkspaceContext=createWorkspaceContext},52:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBuildInfoVariables=t.ALL_BUILD_VARIABLES=void 0;const n=a(5354);const r=a(1945);const i={BUILD_INFO_BUILD_ID:{default:new n.BashExpression(`$(git describe --tags 2>/dev/null || git rev-parse HEAD)`)},BUILD_INFO_BUILD_TIME:{default:"unknown-build-time",gitlab:new n.BashExpression(`$CI_JOB_STARTED_AT`)},BUILD_INFO_CURRENT_VERSION:{default:new n.BashExpression(`$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")`)}};t.ALL_BUILD_VARIABLES=Object.keys(i);const getBuildInfoVariables=e=>{const{pipelineType:t}=e;return Object.fromEntries(Object.entries(i).map((([e,a])=>[e,(0,r.getBashExpressionPerPipelineType)(a,t)])))};t.getBuildInfoVariables=getBuildInfoVariables},7044:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvConfig=void 0;const n=a(9250);const getEnvConfig=(e,t,a)=>{var r,i;const s=e.components[t];if(!s){throw new Error("unknown component "+t)}const o=(i=(r=s.env)===null||r===void 0?void 0:r[a])!==null&&i!==void 0?i:{};if(o===false){return s}return(0,n.mergeWith)((0,n.cloneDeep)(s),o,((e,t,a,n,r)=>{if(typeof t==="function"&&typeof e!=="function"){return t(e)}return undefined}))};t.getEnvConfig=getEnvConfig},8254:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvType=void 0;const n=a(5063);const getEnvType=(e,t)=>{if(t.type)return t.type;if((0,n.isKnowEnvType)(e)){return e}throw new Error("unknown env type: "+e)};t.getEnvType=getEnvType},4956:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvironment=void 0;const n=a(5841);const r=a(5855);const getEnvironment=async e=>{const{env:t}=e;const a=await(0,r.getEnvironmentVariables)(e);const i=(0,n.getEnvironmentContext)(e);const s=i.envType;return{envType:s,fullName:i.fullName,slugPrefix:i.environmentSlugPrefix,reviewSlug:i.reviewSlug,slug:i.environmentSlug,...a}};t.getEnvironment=getEnvironment},5841:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvironmentContext=void 0;const n=a(5354);const r=a(7044);const i=a(8254);const s=a(7342);const getEnvironmentSlugPrefix=(e,t)=>{if(t){return(0,n.joinBashExpressions)([e,t],"-")}return e};const getEnvironmentContext=({env:e,componentName:t,config:a,pipelineType:o})=>{const p=(0,r.getEnvConfig)(a,t,e);const l=(0,i.getEnvType)(e,p);const d=(0,s.getReviewSlug)(p,e,o);const c=getEnvironmentSlugPrefix(e,d);const u=c.concat(`-${t}`);const f=(0,n.joinBashExpressions)([a.customerName,a.appName,u],"-");return{envConfigRaw:p,deployConfigRaw:p.deploy,buildConfigRaw:p.build,environmentSlugPrefix:c,environmentSlug:u,reviewSlug:d,pipelineType:o,fullName:f,envType:l,componentName:t,env:e,fullConfig:a}};t.getEnvironmentContext=getEnvironmentContext},5855:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getSecretVarNameForContext=t.getSecretVarName=t.getEnvironmentVariables=void 0;const n=a(8025);const r=a(5354);const i=a(9851);const s=a(4396);const o=a(5598);const p=a(52);const l=a(5841);const d=a(98);const c=a(4946);const getBasePredefinedVariables=e=>({ENV_SHORT:e.env,APP_DIR:e.envConfigRaw.dir,ENV_TYPE:e.envType,...e.envType!=="local"?(0,p.getBuildInfoVariables)(e):{}});const getEnvironmentVariables=async(e,a={})=>{var p,u,f,m,h,v,g,y;const b=(0,l.getEnvironmentContext)(e);const{config:w,env:_,componentName:S}=e;const{envConfigRaw:N,deployConfigRaw:C,buildConfigRaw:A,envType:O}=b;const I=getBasePredefinedVariables(b);let D;let k;let T;if(O==="local"){const e=N;const t=e.port!==false?(p=e.port)!==null&&p!==void 0?p:3e3:null;k=t?"localhost:"+t.toString():null;T=k?"http://"+k:null;D={...I,ENV_SHORT:"local",...T?{ROOT_URL:T}:{},...k?{HOSTNAME:k}:{},...k?{HOSTNAME_INTERNAL:k}:{},...k?{ROOT_URL_INTERNAL:"http://"+k}:{},...t?{PORT:t.toString()}:{}}}else{const e=C?n.DEPLOY_TYPES[C.type].getAdditionalEnvVars(b):{};const t=(u=e.HOSTNAME_INTERNAL)!==null&&u!==void 0?u:"unknown-host.example.com";k=(f=N===null||N===void 0?void 0:N.host)!==null&&f!==void 0?f:t;T=(0,r.joinBashExpressions)(["https://",k]);D={...I,HOSTNAME:k,ROOT_URL:T,HOSTNAME_INTERNAL:t,ROOT_URL_INTERNAL:(0,r.joinBashExpressions)(["https://",t]),...e}}const P=(h=(m=N.vars)===null||m===void 0?void 0:m.public)!==null&&h!==void 0?h:{};const R=C?n.DEPLOY_TYPES[C.type].additionalSecretKeys(b):[];const L=[...(0,c.stringListToSecreteEnvVarList)((g=(v=N.vars)===null||v===void 0?void 0:v.secret)!==null&&g!==void 0?g:[]),...R];const x=(0,c.makeSecretEnvVarMapping)(_,S,L);const j=(0,c.stringifyValues)(P);const B=Object.fromEntries(Object.entries(j).map((([t,a])=>[t,(0,s.createVariableValueContainingReferencesFromString)(a,{componentName:e.componentName})])));const M=((y=a.shouldResolveReferences)!==null&&y!==void 0?y:true)?await(0,o.resolveAllReferences)(B,(async a=>{const{envVars:n}=await(0,t.getEnvironmentVariables)({...e,componentName:a},{shouldResolveReferences:false});return n})):B;const V=addIndexVar({...D,...x,...M});return{envVars:V,secretEnvVarKeys:L,jobOnlyVars:{build:await(0,d.transformJobOnlyVars)(_,S,A&&(0,i.isStandaloneBuildConfig)(A)&&A.jobVars||null),deploy:await(0,d.transformJobOnlyVars)(_,S,C&&C.jobVars||null)}}};t.getEnvironmentVariables=getEnvironmentVariables;const sanitizeForEnVar=e=>e.replace(/-/g,"_");const getSecretVarName=(e,t,a)=>`CL_${sanitizeForEnVar(e)}_${sanitizeForEnVar(t)}_${a}`;t.getSecretVarName=getSecretVarName;const addIndexVar=e=>({...e,_ALL_ENV_VAR_KEYS:JSON.stringify(Object.keys(e))});const getSecretVarNameForContext=(e,a)=>(0,t.getSecretVarName)(e.env,e.name,a);t.getSecretVarNameForContext=getSecretVarNameForContext},482:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getLabels=void 0;const r=n(a(4206));const sanitize=e=>{if(!e)return e;return(0,r.default)(e).toLowerCase()};const getLabels=e=>{var t,a;const n={"customer-name":sanitize(e.fullConfig.customerName),"component-name":sanitize(e.name),"app-name":sanitize(e.fullConfig.appName),"env-type":sanitize(e.environment.envType),"env-name":sanitize(e.env),"build-type":e.build.type==="disabled"?"disabled":sanitize(e.build.buildType),...(a=(t=e.fullConfig.meta)===null||t===void 0?void 0:t.labels)!==null&&a!==void 0?a:{}};return n};t.getLabels=getLabels},7342:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getReviewSlug=void 0;const n=a(5354);const r=a(1945);const i=a(8254);const s={default:"unknown-review-slug",gitlab:new n.BashExpression(`$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })`)};const getReviewSlug=(e,t,a)=>{const n=(0,i.getEnvType)(t,e);if(n==="review"){return(0,r.getBashExpressionPerPipelineType)(s,a)}return null};t.getReviewSlug=getReviewSlug},8045:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(4847),t);r(a(4956),t);r(a(5855),t)},98:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transformJobOnlyVars=void 0;const n=a(4946);const transformJobOnlyVars=async(e,t,a)=>{var r,i;if(!a){return{envVars:{},secretEnvVarKeys:[]}}const s=(0,n.stringifyValues)((r=a===null||a===void 0?void 0:a.public)!==null&&r!==void 0?r:{});const o=(0,n.stringListToSecreteEnvVarList)((i=a===null||a===void 0?void 0:a.secret)!==null&&i!==void 0?i:[]);const p=(a===null||a===void 0?void 0:a.secret)?(0,n.makeSecretEnvVarMapping)(e,t,o):{};const l={...p,...s};return{envVars:l,secretEnvVarKeys:o}};t.transformJobOnlyVars=transformJobOnlyVars},4946:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeSecretEnvVarMapping=t.stringListToSecreteEnvVarList=t.stringifyValues=void 0;const n=a(9250);const r=a(5855);const i=a(5354);const stringifyValues=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,n.isObject)(t)?JSON.stringify(t):`${t}`])));t.stringifyValues=stringifyValues;const stringListToSecreteEnvVarList=e=>e.map((e=>({key:e})));t.stringListToSecreteEnvVarList=stringListToSecreteEnvVarList;const makeSecretEnvVarMapping=(e,t,a)=>Object.fromEntries(a.map((({key:a})=>[a,(0,i.getBashVariable)((0,r.getSecretVarName)(e,t,a))])));t.makeSecretEnvVarMapping=makeSecretEnvVarMapping},4628:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_RETRY=void 0;t.BASE_RETRY={max:2}},4328:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createDeployJob=t.DEPLOY_JOB_NAME=void 0;const n=a(5644);const r=a(2764);const i=a(4713);const s=a(3660);const o=a(9256);const p=a(5044);const l=a(9415);const d=a(9666);t.DEPLOY_JOB_NAME="🚀 Deploy";const createDeployJob=(e,a)=>{var c,u,f,m,h,v;const g=(0,r.requiresDockerBuild)(e);const y=(0,p.contextIsStoppable)(e);const b=e.environment.envType==="review"?"1 week":e.environment.envType==="dev"?"4 weeks":undefined;const w=(c=e.deploy)===null||c===void 0?void 0:c.config;const _=w&&w.when?w.when:undefined;const S=e.environment.envType!=="prod"?"auto":((u=e.componentConfig.env)===null||u===void 0?void 0:u.stage)===false?"auto":"manual";const N=_?_:S;return{name:t.DEPLOY_JOB_NAME,script:a.script,image:a.image,cache:a.cache?(0,n.createJobCacheFromCacheConfigs)(e,a.cache):undefined,artifacts:a.artifacts,services:a.services,envMode:"stagePerEnv",needs:[...(0,o.sbomDeactivated)(e)?[]:[{job:i.SBOM_BUILD_JOB_NAME,artifacts:true}],...w?(m=(f=w.waitFor)===null||f===void 0?void 0:f.map((e=>({componentName:e,job:t.DEPLOY_JOB_NAME,artifacts:false}))))!==null&&m!==void 0?m:[]:[]],needsStages:[...(0,s.componentContextHasWorkspaceBuild)(e)?g?[{stage:"build",artifacts:false}]:[{stage:"build",artifacts:true,workspaceName:e.build.workspaceName}]:[{stage:"build",artifacts:g?false:true}],{stage:"test",artifacts:false,workspaceName:(0,s.componentContextHasWorkspaceBuild)(e)?e.build.workspaceName:undefined}],when:N==="auto"?"on_success":"manual",allow_failure:N==="manual"?true:false,stage:"deploy",variables:{...e.environment.envVars,...g?(0,r.getDockerImageVariables)(e):{},...e.environment.jobOnlyVars.deploy.envVars,...a.variables},runnerVariables:{...d.DEPLOY_RUNNER_VARIABLES,...(h=a.runnerVariables)!==null&&h!==void 0?h:{},...w?(v=w.runnerVariables)!==null&&v!==void 0?v:{}:{}},environment:y?{on_stop:l.STOP_JOB_NAME,auto_stop_in:b}:{},jobTags:w?w.jobTags:undefined}};t.createDeployJob=createDeployJob},8563:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createDeployementJobs=void 0;const n=a(4328);const r=a(2099);const i=a(9415);const createDeployementJobs=(e,t)=>[(0,n.createDeployJob)(e,t.deploy),...t.stop?[(0,i.createStopJob)(e,t.stop)]:[],...t.rollback?[(0,r.createRollbackJob)(e,t.rollback)]:[]];t.createDeployementJobs=createDeployementJobs},2099:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRollbackJob=t.ROLLBACK_JOB_NAME=void 0;const n=a(9666);t.ROLLBACK_JOB_NAME="↩️ Rollback ⚠️";const createRollbackJob=(e,a)=>{var r;return{name:t.ROLLBACK_JOB_NAME,image:a.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",variables:{...e.environment.jobOnlyVars.deploy.envVars,...a.variables},runnerVariables:{...n.DEPLOY_RUNNER_VARIABLES,GIT_STRATEGY:"none",...(r=a.runnerVariables)!==null&&r!==void 0?r:{}},stage:"rollback",environment:{action:"access"},script:a.script}};t.createRollbackJob=createRollbackJob},9415:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createStopJob=t.STOP_JOB_NAME=void 0;const n=a(9666);t.STOP_JOB_NAME="🛑 Stop ⚠️";const createStopJob=(e,a)=>({name:t.STOP_JOB_NAME,image:a.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",rules:[{if:"$CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/",when:"on_success"}],variables:{...e.environment.jobOnlyVars.deploy.envVars,...a.variables},runnerVariables:{...n.DEPLOY_RUNNER_VARIABLES,GIT_STRATEGY:"none",...a.runnerVariables},stage:"stop",environment:{action:"stop"},script:a.script});t.createStopJob=createStopJob},9666:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_RUNNER_VARIABLES=void 0;t.DEPLOY_RUNNER_VARIABLES={KUBERNETES_CPU_REQUEST:"0.22",KUBERNETES_MEMORY_REQUEST:"200Mi",KUBERNETES_MEMORY_LIMIT:"400Mi"}},4316:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedImagesCommands=t.getArtifactsRegistryImage=t.getArtifactsRegistryBuildCacheImage=t.getArtifactsRegistryImageName=t.getArtifactsRegistryDockerUrl=t.getArtifactsRegistryHost=void 0;const n=a(5354);const r=a(3468);const i=a(2383);const s=a(9497);const getArtifactsRegistryHost=e=>{var t;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"google-cloudrun")){throw new Error("deploy config is wrong")}return`${e.deploy.config.region}-docker.pkg.dev`};t.getArtifactsRegistryHost=getArtifactsRegistryHost;const getArtifactsRegistryDockerUrl=e=>{var a;const n=(a=e.deploy)===null||a===void 0?void 0:a.config;if(!(0,i.isOfDeployType)(n,"google-cloudrun")){throw new Error("deploy config is wrong")}const r=`${e.fullConfig.customerName}-${e.fullConfig.appName}`;return`${(0,t.getArtifactsRegistryHost)(e)}/${n.projectId}/catladder-deploy/${r}`};t.getArtifactsRegistryDockerUrl=getArtifactsRegistryDockerUrl;const getArtifactsRegistryImageName=(e,a=false)=>{if(a&&e.environment.envType!=="review"){throw new Error("lecacyReviewImageName is only allowed for review app")}const r=(0,t.getArtifactsRegistryDockerUrl)(e);const i=[r,e.env,e.name,...e.environment.reviewSlug&&!a?[e.environment.reviewSlug]:[]];return(0,n.joinBashExpressions)(i,"/")};t.getArtifactsRegistryImageName=getArtifactsRegistryImageName;const getArtifactsRegistryBuildCacheImage=e=>{const a=(0,t.getArtifactsRegistryDockerUrl)(e);const n=[a,"caches",e.name];return n.join("/")};t.getArtifactsRegistryBuildCacheImage=getArtifactsRegistryBuildCacheImage;const getArtifactsRegistryImage=e=>`${(0,t.getArtifactsRegistryImageName)(e)}:$DOCKER_IMAGE_TAG`;t.getArtifactsRegistryImage=getArtifactsRegistryImage;const getDeleteImageCommands=(e,t=0)=>{if(t===0){return[`gcloud artifacts docker images delete ${e} --quiet --delete-tags`]}const a=`gcloud artifacts docker images list ${e} --sort-by=~CREATE_TIME --format="value(version)"`;const n=(0,s.removeFirstLinesFromCommandOutput)(a,t);const r=`gcloud artifacts docker images delete ${e}@$version --quiet --delete-tags`;const i=`${n} | while read -r version; do ${r}; done`;return[i]};const getDeleteUnusedImagesCommands=(e,a=0)=>{var n;const s=(n=e.deploy)===null||n===void 0?void 0:n.config;if(!(0,i.isOfDeployType)(s,"google-cloudrun")){throw new Error("deploy config is wrong")}const o=(0,t.getArtifactsRegistryImageName)(e);const p=(0,t.getArtifactsRegistryBuildCacheImage)(e);return[...getDeleteImageCommands(o,a),...getDeleteImageCommands(p,1),...e.environment.envType==="review"?(0,r.allowFailureInScripts)(getDeleteImageCommands((0,t.getArtifactsRegistryImageName)(e,true),0)):[]]};t.getDeleteUnusedImagesCommands=getDeleteUnusedImagesCommands},7744:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRemoveOldRevisionsAndImagesCommand=void 0;const n=a(3468);const r=a(4316);const i=a(4212);const getRemoveOldRevisionsAndImagesCommand=(e,t)=>{if(t==="onStop"){return(0,r.getDeleteUnusedImagesCommands)(e)}const a=e.environment.envType==="prod"?5:0;const s=a+1;const o=(0,i.getDeleteUnusedRevisionsCommands)(e,a);const p=(0,r.getDeleteUnusedImagesCommands)(e,s);return(0,n.allowFailureInScripts)([...o,...p])};t.getRemoveOldRevisionsAndImagesCommand=getRemoveOldRevisionsAndImagesCommand},4212:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedRevisionsCommands=void 0;const n=a(2383);const r=a(5516);const i=a(6428);const s=a(9497);const getListRevisionsCommand=(e,t)=>{var a;const s=(0,i.getServiceName)(e);const o=(a=e.deploy)===null||a===void 0?void 0:a.config;if(!o||!(0,n.isOfDeployType)(o,"google-cloudrun")){throw new Error("deploy config is wrong")}const p={project:o.projectId,region:o.region,service:s,limit:"unlimited","sort-by":"metadata.creationTimestamp",...t};return`gcloud run revisions list ${(0,r.createArgsString)(p)}`};const getDeleteUnusedRevisionsCommands=(e,t)=>{var a;const i=(a=e.deploy)===null||a===void 0?void 0:a.config;if(!(0,n.isOfDeployType)(i,"google-cloudrun")){throw new Error("deploy config is wrong")}const o=getListRevisionsCommand(e,{format:`"value(name)"`,filter:`'(status.conditions.status=False OR status.conditions.status=Unknown)'`});const p=(0,s.removeFirstLinesFromCommandOutput)(o,t);const l=`gcloud run revisions delete ${(0,r.createArgsString)({project:i.projectId,region:i.region,quiet:true})} $revisionname `;const d=`${p} | while read -r revisionname; do ${l}; done`;return[d]};t.getDeleteUnusedRevisionsCommands=getDeleteUnusedRevisionsCommands},2579:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunJobsWithNames=t.getJobCreateScripts=t.getDeleteJobsScripts=void 0;const n=a(482);const r=a(595);const i=a(5516);const s=a(6962);const o=a(4884);const p=a(7180);const l=a(7770);const d=a(2790);const getDeleteJobsScripts=e=>{const a=(0,o.getCommonCloudRunArgs)(e);const n=(0,i.createArgsString)(a);const r=(0,t.getCloudRunJobsWithNames)(e);return r.flatMap((({fullJobName:e})=>[`${(0,o.gcloudRunCmd)()} jobs executions list ${n} --job ${e} --format="value(name)" | xargs -I {} ${(0,o.gcloudRunCmd)()} jobs executions delete {} --quiet ${n}`,`${(0,o.gcloudRunCmd)()} jobs delete ${e} ${n}`]))};t.getDeleteJobsScripts=getDeleteJobsScripts;const getJobCreateScripts=e=>(0,t.getCloudRunJobsWithNames)(e).map((({job:t,fullJobName:a},s)=>{var c,u,f,m,h;const v=Array.isArray(t.command)?t.command:t.command.split(" ");const{image:g,project:y,region:b,...w}=(0,o.getCommonDeployArgs)(e);const _=(0,i.createArgsString)({command:`"${v.join(",")}"`,args:(0,d.getCloudRunServiceOrJobArgsArg)(t.args),labels:`"${(0,o.makeLabelString)((0,n.getLabels)(e))},cloud-run-job-name=$current_job_name"`,image:`"${(c=t.image)!==null&&c!==void 0?c:g}"`,project:y,region:b,cpu:t.cpu,memory:(u=t.memory)!==null&&u!==void 0?u:"512Mi",parallelism:(f=t.parallelism)!==null&&f!==void 0?f:1,"task-timeout":(m=t.timeout)!==null&&m!==void 0?m:"10m","env-vars-file":p.ENV_VARS_FILENAME,"max-retries":(h=t.maxRetries)!==null&&h!==void 0?h:0,...w,"vpc-connector":t===null||t===void 0?void 0:t.vpcConnector,"vpc-egress":t===null||t===void 0?void 0:t.vpcEgress,network:t===null||t===void 0?void 0:t.network,subnet:t===null||t===void 0?void 0:t.subnet},...(0,l.createVolumeConfig)(t.volumes,"job"));return[s===0?`exist_job_names="$(\n ${(0,o.gcloudRunCmd)()} jobs list --filter='metadata.name ~ ${e.env}.*${e.name}' --format='value(name)' --limit=999 --project='${y}' --region='${b}'\n)"`:null,`current_job_name="${a}"`,'if echo "$exist_job_names" | grep -Fx "$current_job_name" >/dev/null; then',` ${(0,o.gcloudRunCmd)()} jobs update "$current_job_name" ${_}`,"else",` ${(0,o.gcloudRunCmd)()} jobs create "$current_job_name" ${_}`,"fi"].filter(r.notNil).join("\n")}));t.getJobCreateScripts=getJobCreateScripts;const getCloudRunJobsWithNames=e=>{var t;const a=(0,o.getCloudRunDeployConfig)(e);const n=Object.entries((t=a.jobs)!==null&&t!==void 0?t:{}).filter((e=>Boolean(e[1]))).map((([t,a])=>({fullJobName:(0,s.getFullJobName)(e,t),job:a,jobName:t})));return n};t.getCloudRunJobsWithNames=getCloudRunJobsWithNames},675:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getServiceDeleteScript=t.getServiceDeployScript=void 0;const n=a(482);const r=a(5516);const i=a(2790);const s=a(6428);const o=a(4884);const p=a(7180);const l=a(6451);const d=a(7770);const getServiceDeployScript=(e,t,a)=>{var c,u,f,m,h,v;const g=(0,o.getCommonDeployArgs)(e);const y=(0,s.getServiceName)(e);const b=t!==true?t:undefined;const w=t!==true?(c=t===null||t===void 0?void 0:t.command)!==null&&c!==void 0?c:e.build.type!=="disabled"?e.build.config.startCommand:undefined:undefined;const _=w?Array.isArray(w)?w:w.split(" "):undefined;const S=y.concat(a!==null&&a!==void 0?a:"");const N=(0,r.createArgsString)({command:_?'"'+_.join(",")+'"':'""',args:(0,i.getCloudRunServiceOrJobArgsArg)(b===null||b===void 0?void 0:b.args),...g,image:(u=b===null||b===void 0?void 0:b.image)!==null&&u!==void 0?u:g.image,labels:(0,o.makeLabelString)({...(0,n.getLabels)(e),"cloud-run-service-name":S}),"env-vars-file":p.ENV_VARS_FILENAME,"min-instances":(f=b===null||b===void 0?void 0:b.minInstances)!==null&&f!==void 0?f:0,"max-instances":(m=b===null||b===void 0?void 0:b.maxInstances)!==null&&m!==void 0?m:100,"cpu-throttling":(b===null||b===void 0?void 0:b.noCpuThrottling)!==true,cpu:b===null||b===void 0?void 0:b.cpu,memory:b===null||b===void 0?void 0:b.memory,timeout:b===null||b===void 0?void 0:b.timeout,"vpc-connector":b===null||b===void 0?void 0:b.vpcConnector,"vpc-egress":b===null||b===void 0?void 0:b.vpcEgress,network:b===null||b===void 0?void 0:b.network,subnet:b===null||b===void 0?void 0:b.subnet,"use-http2":b===null||b===void 0?void 0:b.http2,"allow-unauthenticated":(h=b===null||b===void 0?void 0:b.allowUnauthenticated)!==null&&h!==void 0?h:true,ingress:(v=b===null||b===void 0?void 0:b.ingress)!==null&&v!==void 0?v:"all","cpu-boost":true,"execution-environment":b===null||b===void 0?void 0:b.executionEnvironment,gpu:b===null||b===void 0?void 0:b.gpu,"gpu-type":b===null||b===void 0?void 0:b.gpuType,...(0,l.healthCheckCliArgs)(b===null||b===void 0?void 0:b.healthCheck)},...(0,d.createVolumeConfig)(b===null||b===void 0?void 0:b.volumes,"service"));const C=requiresBeta(b)?"beta":undefined;return`${(0,o.gcloudRunCmd)(C)} deploy ${S} ${N}`};t.getServiceDeployScript=getServiceDeployScript;const getServiceDeleteScript=(e,t)=>{const a=(0,o.getCommonCloudRunArgs)(e);const n=(0,r.createArgsString)(a);const i=(0,s.getServiceName)(e);const p=t?`${i}-${t}`:i;return[`${(0,o.gcloudRunCmd)()} services delete ${p} ${n}`]};t.getServiceDeleteScript=getServiceDeleteScript;const requiresBeta=e=>{if(!e){return false}if(e.gpuType){return true}if(e.gpu&&e.gpu>0){return true}if(e.healthCheck!==undefined){return true}return false}},4884:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCommonDeployArgs=t.getCommonCloudRunArgs=t.getCloudRunDeployConfig=t.makeLabelString=t.setGoogleProjectNumberScript=t.gcloudSchedulerCmd=t.gcloudRunCmd=t.gcloudCmd=void 0;const n=a(2383);const r=a(4316);const gcloudCmd=e=>e?`gcloud ${e}`:"gcloud";t.gcloudCmd=gcloudCmd;const gcloudRunCmd=e=>`${(0,t.gcloudCmd)(e)} run`;t.gcloudRunCmd=gcloudRunCmd;const gcloudSchedulerCmd=e=>`${(0,t.gcloudCmd)(e)} scheduler`;t.gcloudSchedulerCmd=gcloudSchedulerCmd;const setGoogleProjectNumberScript=e=>[`export GCLOUD_PROJECT_NUMBER=$(${(0,t.gcloudCmd)()} projects describe ${e.projectId} --format="value(projectNumber)")`,'echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"'];t.setGoogleProjectNumberScript=setGoogleProjectNumberScript;const makeLabelString=e=>Object.entries(e).map((([e,t])=>`${e}=${t}`)).join(",");t.makeLabelString=makeLabelString;const getCloudRunDeployConfig=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,n.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}return a};t.getCloudRunDeployConfig=getCloudRunDeployConfig;function getCommonCloudRunArgs(e){const a=(0,t.getCloudRunDeployConfig)(e);return{project:a.projectId,region:a.region}}t.getCommonCloudRunArgs=getCommonCloudRunArgs;function getCommonDeployArgs(e){const a=getCommonCloudRunArgs(e);const n=(0,t.getCloudRunDeployConfig)(e);return{image:(0,r.getArtifactsRegistryImage)(e),...a,"set-cloudsql-instances":n.cloudSql?n.cloudSql.instanceConnectionName:undefined}}t.getCommonDeployArgs=getCommonDeployArgs},7180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ENV_VARS_FILENAME=void 0;t.ENV_VARS_FILENAME="____envvars.yaml"},9099:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getOnDeployExecuteScript=void 0;const n=a(595);const r=a(5516);const i=a(2790);const s=a(6962);const o=a(2579);const p=a(4884);const getOnDeployExecuteScript=(e,t)=>{const a=getExecutes(e);return a.filter((({config:e})=>e.when===t)).flatMap((t=>getJobRunScriptForExecute(e,t)))};t.getOnDeployExecuteScript=getOnDeployExecuteScript;const getExecutes=e=>{var t;const a=(0,p.getCloudRunDeployConfig)(e);return[...getLegacyExecutes(e),...Object.entries((t=a.execute)!==null&&t!==void 0?t:{}).flatMap((([e,t])=>{if(!t){return[]}return[{jobName:e,config:t}]}))]};const getLegacyExecutes=e=>{const t=(0,o.getCloudRunJobsWithNames)(e);return t.flatMap((({jobName:e,job:t})=>{if(!t.when||!["preDeploy","postDeploy","preStop","postStop"].includes(t.when)){return[]}return[{jobName:e,config:{job:e,type:"job",when:t.when,...t.when==="preDeploy"||t.when==="postDeploy"?{waitForCompletion:t.waitForCompletion}:{}}}]}))};const getJobRunScriptForExecute=(e,{jobName:t,config:a})=>{var o;const l=a.type;if(l==="script"){return(0,n.ensureArray)(a.script)}else if(l==="job"){const n=(0,p.getCommonCloudRunArgs)(e);const l=["preStop","postStop"].includes(a.when)?true:"waitForCompletion"in a?(o=a.waitForCompletion)!==null&&o!==void 0?o:false:false;const d=(0,r.createArgsString)({...n,wait:l===true?true:undefined,args:(0,i.getCloudRunServiceOrJobArgsArg)(a.args)});const c=(0,s.getFullJobName)(e,t);return[`${(0,p.gcloudRunCmd)()} jobs execute ${c.toString()} ${d}`]}throw new Error(`unsupported execute type: ${l}`)}},1503:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCreateScheduleScript=t.getDeleteSchedulesScript=void 0;const n=a(8016);const r=a(595);const i=a(5857);const s=a(5516);const o=a(6962);const p=a(2579);const l=a(4884);const getDeleteSchedulesScript=e=>{const t=(0,l.getCloudRunDeployConfig)(e);const a=getSchedules(e);const n=(0,s.createArgsString)({project:t.projectId,location:t.region});return a.map((({fullName:e})=>[`${(0,l.gcloudSchedulerCmd)()} jobs delete ${e} ${n}`])).flat()};t.getDeleteSchedulesScript=getDeleteSchedulesScript;const getCreateScheduleScript=e=>{const t=getSchedules(e);const{region:a,projectId:n}=(0,l.getCloudRunDeployConfig)(e);return t.map((({fullName:t,config:i},o)=>{var p;const{uri:d,...c}=getSchedulerArgs(i,e);const u=(0,s.createArgsString)({project:n,location:a,uri:`"$current_job_uri"`,...c,schedule:`"${i.schedule}"`,"max-retry-attempts":(p=i.maxRetryAttempts)!==null&&p!==void 0?p:0});return[o===0?`exist_scheduler_names="$(\n ${(0,l.gcloudSchedulerCmd)()} jobs list --filter='httpTarget.uri ~ ${e.env}.*${e.name}' --format='value(name)' --limit=999 --location='${a}' --project='${n}'\n)"`:null,`current_job_uri="${d}"`,`current_scheduler_name="${t}"`,`if echo "$exist_scheduler_names" | grep -Fx "$current_scheduler_name" >/dev/null; then`,` ${(0,l.gcloudSchedulerCmd)()} jobs update http "$current_scheduler_name" ${u}`,`else`,` ${(0,l.gcloudSchedulerCmd)()} jobs create http "$current_scheduler_name" ${u}`,`fi`].filter(r.notNil).join("\n")}))};t.getCreateScheduleScript=getCreateScheduleScript;const getSchedulerArgs=(e,t)=>{var a;if(e.type==="job"){const{projectId:r,region:s}=(0,l.getCloudRunDeployConfig)(t);const o=e.args!==undefined?{overrides:{containerOverrides:[((a=e.args)===null||a===void 0?void 0:a.length)>0?{args:e.args}:{args:[],clearArgs:true}]}}:null;return{uri:(0,i.getCloudRunJobExecuteUrl)(e.job,{appFullName:t.environment.fullName,projectId:r,region:s}),"message-body":o?'"'+(0,n.bashEscape)(JSON.stringify(o))+'"':undefined,"http-method":"POST","oauth-service-account-email":`"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"`}}if(e.type==="http"){return{uri:e.url,"message-body":e.body,"http-method":e.method,"oidc-service-account-email":`"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"`}}throw new Error(`Unknown scheduler type: ${e.type}`)};const getSchedules=e=>{const t=getLegacyJobSchedules(e);const a=getScheduledExecutes(e);return Object.entries({...t,...a}).map((([t,a])=>({name:t,fullName:(0,o.getFullSchedulerName)(e,t),config:a})))};const getLegacyJobSchedules=e=>{const t=(0,p.getCloudRunJobsWithNames)(e);return Object.fromEntries(t.filter((e=>e.job.when==="schedule")).map((({job:{maxRetryAttempts:e,schedule:t},jobName:a})=>{const n=a.concat("-scheduler");return[n,{type:"job",job:a,maxRetryAttempts:e,schedule:t,when:"schedule"}]})))};const getScheduledExecutes=e=>{var t;const a=(0,l.getCloudRunDeployConfig)(e);return Object.fromEntries(Object.entries((t=a.execute)!==null&&t!==void 0?t:{}).flatMap((([e,t])=>{if(!t||t.when!=="schedule"){return[]}return[[e,t]]})))}},9726:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunDeployScripts=void 0;const n=a(9250);const r=a(3468);const i=a(9256);const s=a(7728);const o=a(5103);const p=a(7744);const l=a(41);const d=a(1201);const c=a(2579);const u=a(9099);const f=a(675);const m=a(4884);const h=a(7180);const v=a(1503);function getCloudRunDeployScripts(e){var t;const a=(0,m.getCloudRunDeployConfig)(e);const g=(0,n.omit)(e.environment.envVars,s.GCLOUD_DEPLOY_CREDENTIALS_KEY);return[...(0,r.collapseableSection)("prepare","Prepare...")([...(0,d.gcloudServiceAccountLoginCommands)(e),...(0,m.setGoogleProjectNumberScript)(a)]),...(0,r.collapseableSection)("writeenvvars","Write env vars to file")((0,o.writeBashYamlToFileScript)(g,h.ENV_VARS_FILENAME)),...(0,r.collapseableSection)("deploy","Deploy to cloud run")([...a.cloudSql?(0,l.getDatabaseCreateScript)(e,a):[],...(0,v.getCreateScheduleScript)(e),...(0,c.getJobCreateScripts)(e),...(0,u.getOnDeployExecuteScript)(e,"preDeploy"),...a.service!==false?[(0,f.getServiceDeployScript)(e,a.service)]:[],...Object.entries((t=a.additionalServices)!==null&&t!==void 0?t:{}).filter((([e,t])=>t!==false&&t!==null)).map((([t,a])=>(0,f.getServiceDeployScript)(e,a,"-"+t))),...(0,u.getOnDeployExecuteScript)(e,"postDeploy")]),...(0,r.collapseableSection)("cleanup","Cleanup")((0,p.getRemoveOldRevisionsAndImagesCommand)(e,"postDeploy")),...(0,i.getDependencyTrackUploadScript)(e)]}t.getCloudRunDeployScripts=getCloudRunDeployScripts},9551:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunStopScripts=void 0;const n=a(9256);const r=a(7744);const i=a(41);const s=a(1201);const o=a(2579);const p=a(9099);const l=a(1503);const d=a(675);const c=a(4884);function getCloudRunStopScripts(e){var t;const a=(0,c.getCloudRunDeployConfig)(e);return[...(0,s.gcloudServiceAccountLoginCommands)(e),...(0,p.getOnDeployExecuteScript)(e,"preStop"),...a.service!==false?(0,d.getServiceDeleteScript)(e):[],...Object.entries((t=a.additionalServices)!==null&&t!==void 0?t:{}).filter((([e,t])=>t!==false&&t!==null)).flatMap((([t])=>(0,d.getServiceDeleteScript)(e,t))),...(0,p.getOnDeployExecuteScript)(e,"postStop"),...(0,l.getDeleteSchedulesScript)(e),...(0,o.getDeleteJobsScripts)(e),...a.cloudSql&&a.cloudSql.deleteDatabaseOnStop?(0,i.getDatabaseDeleteScript)(e,a):[],...(0,r.getRemoveOldRevisionsAndImagesCommand)(e,"onStop"),...(0,n.getDependencyTrackDeleteScript)(e)]}t.getCloudRunStopScripts=getCloudRunStopScripts},6451:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.healthCheckCliArgs=void 0;const n=a(2383);const r=8080;function healthCheckCliArgs(e){const t=e===undefined;if(t){return undefined}const a=e===true;if(a){return{"startup-probe":toArgValue(probeToKeyValuePairs(n.defaultStartupProbe)),"liveness-probe":toArgValue(probeToKeyValuePairs(n.defaultLivenessProbe))}}return{"startup-probe":toArgValue(probeToKeyValuePairs(e.startupProbe)),"liveness-probe":e.livenessProbe?toArgValue(probeToKeyValuePairs(e.livenessProbe)):""}}t.healthCheckCliArgs=healthCheckCliArgs;function probeToKeyValuePairs(e){const t=Object.entries({initialDelaySeconds:e.initialDelaySeconds,timeoutSeconds:e.timeoutSeconds,periodSeconds:e.periodSeconds,failureThreshold:e.failureThreshold});switch(e.type){case"tcp":return[...t,["tcpSocket.port",r]];case"http1":return[...t,["httpGet.port",r],["httpGet.path",e.path]];default:e;return[]}}function toArgValue(e){return e.map((([e,t])=>`${e}=${t}`)).join(",")}},933:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createGoogleCloudRunDeployJobs=void 0;const n=a(2348);const r=a(3468);const i=a(8563);const s=a(2383);const o=a(7180);const p=a(9726);const l=a(9551);const createGoogleCloudRunDeployJobs=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,s.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}const d=(0,p.getCloudRunDeployScripts)(e);const c=(0,l.getCloudRunStopScripts)(e);return(0,i.createDeployementJobs)(e,{deploy:{variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"},...a.debug?{artifacts:{paths:[o.ENV_VARS_FILENAME],when:"always"}}:{},image:(0,n.getRunnerImage)("gcloud"),script:d},stop:{image:(0,n.getRunnerImage)("gcloud"),variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"},script:(0,r.allowFailureInScripts)(c)}})};t.createGoogleCloudRunDeployJobs=createGoogleCloudRunDeployJobs},7770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createVolumeConfig=void 0;const createVolumeConfig=(e,t)=>{if(!e){return[]}return[...Object.entries(e).map((([e,{type:t,bucket:a,mountPath:n,readonly:r}])=>({"add-volume":`name=${e},type=${t},bucket=${a}${r?",readonly=true":""}`,"add-volume-mount":`volume=${e},mount-path=${n}`}))),t==="service"?{"execution-environment":"gen2"}:{}]};t.createVolumeConfig=createVolumeConfig},7728:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GCLOUD_RUN_DEPLOY_TYPE=t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX=t.GCLOUD_DEPLOY_CREDENTIALS_KEY=void 0;const n=a(5354);const r=a(8045);const i=a(3468);const s=a(7844);const o=a(933);const p=a(5857);const l=a(41);t.GCLOUD_DEPLOY_CREDENTIALS_KEY="GCLOUD_DEPLOY_credentialsKey";t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX="GCLOUD_RUN_canonicalHostSuffix";const getCloudSqlVariables=({deployConfigRaw:e,environmentSlugPrefix:t,env:a,componentName:n,fullConfig:i})=>{var o,p,d;if(e&&e.cloudSql){const c=(0,s.getFullDbName)(e.cloudSql,i,t,n);const u=Object.entries((o=e.cloudSql.dbAdditionalQueryParams)!==null&&o!==void 0?o:{}).map((([e,t])=>`&${e}=${t}`)).join("");const f={CLOUD_SQL_INSTANCE_CONNECTION_NAME:e.cloudSql.instanceConnectionName,DB_NAME:c,DB_USER:(p=e.cloudSql.dbUser)!==null&&p!==void 0?p:"postgres",DB_PASSWORD:"$"+(0,r.getSecretVarName)(a,n,"DB_PASSWORD")};return{...f,DATABASE_URL:(0,l.getDatabaseConnectionString)(e.cloudSql,f).concat(u),DATABASE_JDBC_URL:(0,l.getDatabaseJdbcUrl)(f,(d=e.cloudSql.dbConnectionStringVariablesMode)!==null&&d!==void 0?d:l.DEFAULT_DB_VARIABLES_MODE)}}return{}};t.GCLOUD_RUN_DEPLOY_TYPE={jobs:o.createGoogleCloudRunDeployJobs,defaults:({deployConfigRaw:e,envType:t})=>{if(e&&e.cloudSql){return{cloudSql:{deleteDatabaseOnStop:t==="review"}}}return{}},additionalSecretKeys:e=>[{key:t.GCLOUD_DEPLOY_CREDENTIALS_KEY,hidden:true},{key:t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX,hidden:true},...e.deployConfigRaw&&e.deployConfigRaw.cloudSql?[{key:"DB_PASSWORD"}]:[]],getAdditionalEnvVars:e=>{const{fullName:a,env:s,componentName:o,deployConfigRaw:l}=e;const d=(0,n.joinBashExpressions)([a,(0,n.getBashVariable)((0,r.getSecretVarName)(s,o,t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX))],"-").toLowerCase();const c=l&&l.jobs?Object.fromEntries(Object.entries(l.jobs).filter((([e,t])=>Boolean(t))).map((([e,t])=>["CLOUD_RUN_JOB_TRIGGER_URL_"+(0,i.sanitizeForBashVariable)(e),(0,p.getCloudRunJobExecuteUrl)(e,{appFullName:a,projectId:l.projectId,region:l.region})]))):{};return{HOSTNAME_INTERNAL:d,...getCloudSqlVariables(e),...c,DEPLOY_CLOUD_RUN_PROJECT_ID:l?l.projectId:undefined,DEPLOY_CLOUD_RUN_REGION:l?l.region:undefined}}}},5857:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunJobExecuteUrl=void 0;const n=a(6962);function getCloudRunJobExecuteUrl(e,{region:t,projectId:a,appFullName:r}){const i=`https://${t}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${a}/jobs`;const s=(0,n.getCloudRunJobName)(r,e);return`${i}/${s}:run`}t.getCloudRunJobExecuteUrl=getCloudRunJobExecuteUrl},5516:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createArgsString=void 0;const n=a(9250);const createArgsString=(...e)=>e.map((e=>Object.entries(e).filter((([,e])=>!(0,n.isNil)(e))).map((([e,t])=>{if(t===true){return`--${e}`}else if(t===false){return`--no-${e}`}return`--${e}=${t}`})))).flat().join(" ");t.createArgsString=createArgsString},41:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDatabaseConnectionString=t.getPrismaDatabaseConnectionString=t.getRailsDatabaseConnectionString=t.getDatabaseJdbcUrl=t.DEFAULT_DB_VARIABLES_MODE=t.getDatabaseCreateScript=t.getDatabaseDeleteScript=void 0;const n=a(8016);const r=a(3468);const getDatabaseDeleteScript=(e,t)=>{if(!t.cloudSql||!t.cloudSql.deleteDatabaseOnStop){throw new Error("not possible")}const a=e.environment.envVars["DB_NAME"];if(!a){throw new Error("error: env vars did not specify DB_NAME")}const[n,i,s]=t.cloudSql.instanceConnectionName.split(":");return[`echo "deleting database ${a}..."`,`echo "👆 this can take multiple attemps (3-5min), because google cloud run may still have a connection to the database after the cloud run service is shut down"`,(0,r.repeatOnFailure)(`gcloud sql databases delete ${a} --instance=${s} --project ${n}`,{pauseInSeconds:10})]};t.getDatabaseDeleteScript=getDatabaseDeleteScript;const getDatabaseCreateScript=(e,t)=>{if(!t.cloudSql){throw new Error("not possible")}const a=e.environment.envVars["DB_NAME"];if(!a){throw new Error("error: env vars did not specify DB_NAME")}const[n,i,s]=t.cloudSql.instanceConnectionName.split(":");return(0,r.allowFailureInScripts)([`echo "ensuring Database..."`,`gcloud sql databases create ${a} --instance=${s} --project ${n}`])};t.getDatabaseCreateScript=getDatabaseCreateScript;t.DEFAULT_DB_VARIABLES_MODE="legacy";const getVariableOrValue=(e,t,a)=>a==="legacy"?`$${e}`:t[e];const getDatabaseJdbcUrl=(e,t)=>{const a=["jdbc:postgresql:///",getVariableOrValue("DB_NAME",e,t),"?cloudSqlInstance=",getVariableOrValue("CLOUD_SQL_INSTANCE_CONNECTION_NAME",e,t),"&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=",getVariableOrValue("DB_USER",e,t),"&password=",getVariableOrValue("DB_PASSWORD",e,t)];return(0,n.joinBashExpressions)(a)};t.getDatabaseJdbcUrl=getDatabaseJdbcUrl;const getRailsDatabaseConnectionString=(e,t)=>{const a=["postgresql://",getVariableOrValue("DB_USER",e,t),":",getVariableOrValue("DB_PASSWORD",e,t),"@",encodeURIComponent(`/cloudsql/${e.CLOUD_SQL_INSTANCE_CONNECTION_NAME}`),"/",getVariableOrValue("DB_NAME",e,t),"?"];return(0,n.joinBashExpressions)(a)};t.getRailsDatabaseConnectionString=getRailsDatabaseConnectionString;const getPrismaDatabaseConnectionString=(e,t)=>{const a=["postgresql://",getVariableOrValue("DB_USER",e,t),":",getVariableOrValue("DB_PASSWORD",e,t),"@localhost/",getVariableOrValue("DB_NAME",e,t),"?host=/cloudsql/",getVariableOrValue("CLOUD_SQL_INSTANCE_CONNECTION_NAME",e,t)];return(0,n.joinBashExpressions)(a)};t.getPrismaDatabaseConnectionString=getPrismaDatabaseConnectionString;const getDatabaseConnectionString=(e,a)=>{var n;const r=(n=e.dbConnectionStringVariablesMode)!==null&&n!==void 0?n:t.DEFAULT_DB_VARIABLES_MODE;switch(e.dbConnectionStringFormat){case"jdbc":return(0,t.getDatabaseJdbcUrl)(a,r);case"rails":return(0,t.getRailsDatabaseConnectionString)(a,r);default:return(0,t.getPrismaDatabaseConnectionString)(a,r)}};t.getDatabaseConnectionString=getDatabaseConnectionString},1201:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gcloudServiceAccountLoginCommands=void 0;const n=a(7728);const r=a(8045);const gcloudServiceAccountLoginCommands=e=>[`gcloud auth activate-service-account --key-file=<(echo "$${(0,r.getSecretVarNameForContext)(e,n.GCLOUD_DEPLOY_CREDENTIALS_KEY)}")`];t.gcloudServiceAccountLoginCommands=gcloudServiceAccountLoginCommands},2790:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunServiceOrJobArgsArg=void 0;const getCloudRunServiceOrJobArgsArg=e=>e!==undefined?e.length>0?e===null||e===void 0?void 0:e.map((e=>`"${e}"`)).join(","):"":undefined;t.getCloudRunServiceOrJobArgsArg=getCloudRunServiceOrJobArgsArg},6428:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getServiceName=void 0;const getServiceName=e=>e.environment.fullName.toLowerCase();t.getServiceName=getServiceName},6962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullSchedulerName=t.getCloudRunSchedulerName=t.getFullJobName=t.getCloudRunJobName=void 0;const getCloudRunJobName=(e,t)=>e.toLowerCase().concat("-"+t.toLowerCase());t.getCloudRunJobName=getCloudRunJobName;const getFullJobName=(e,a)=>(0,t.getCloudRunJobName)(e.environment.fullName,a);t.getFullJobName=getFullJobName;const getCloudRunSchedulerName=(e,t)=>e.toLowerCase().concat("-"+t.toLowerCase());t.getCloudRunSchedulerName=getCloudRunSchedulerName;const getFullSchedulerName=(e,a)=>(0,t.getCloudRunSchedulerName)(e.environment.fullName,a);t.getFullSchedulerName=getFullSchedulerName},9497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeFirstLinesFromCommandOutput=void 0;const removeFirstLinesFromCommandOutput=(e,t)=>t===0?e:`${e} | tail -n +${t+1}`;t.removeFirstLinesFromCommandOutput=removeFirstLinesFromCommandOutput},7844:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullDbName=void 0;const n=a(5354);const getFullDbName=(e,t,a,r)=>{var i,s;return(0,n.joinBashExpressions)([(i=e.dbNamePrefix)!==null&&i!==void 0?i:`${t.customerName}-${t.appName}`,a,(s=e.dbBaseName)!==null&&s!==void 0?s:r].flatMap((e=>e?[e]:[])),"-")};t.getFullDbName=getFullDbName},5935:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomDeployJobs=void 0;const n=a(1255);const r=a(8897);const i=a(2348);const s=a(8563);const o=a(9256);const p=a(2383);const createCustomDeployJobs=e=>{var t,a,l;const d=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,p.isOfDeployType)(d,"custom")){throw new Error("deploy config is not custom")}const c=(0,r.getYarnInstall)(e,{noCustomPostInstall:true});const u=(0,s.createDeployementJobs)(e,{deploy:{image:(a=d.jobImage)!==null&&a!==void 0?a:(0,i.getRunnerImage)("jobs-default"),cache:(0,n.getAllCacheConfigsFromConfig)(e,d),script:[`cd ${e.build.dir}`,...d.requiresYarnInstall?c:[],...d.script,...(0,o.getDependencyTrackUploadScript)(e)],variables:{}},stop:d.stopScript?{image:(l=d.jobImage)!==null&&l!==void 0?l:(0,i.getRunnerImage)("jobs-default"),script:[...d.stopScript,...(0,o.getDependencyTrackDeleteScript)(e)],variables:{}}:undefined});return u};t.createCustomDeployJobs=createCustomDeployJobs},4697:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CUSTOM_DEPLOY_TYPE=void 0;const n=a(5935);t.CUSTOM_DEPLOY_TYPE={jobs:n.createCustomDeployJobs,defaults:()=>({}),additionalSecretKeys:()=>[],getAdditionalEnvVars:()=>({})}},5200:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createDockerTagDeployJobs=void 0;const n=a(2764);const r=a(8563);const i=a(2383);const createDockerTagDeployJobs=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(a,"dockerTag")){throw new Error("deploy config is not dockerTag")}const s=a.tag;return(0,r.createDeployementJobs)(e,{deploy:{...(0,n.getDockerJobBaseProps)(),script:[...(0,n.gitlabDockerLogin)(e),`docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG`,`docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_IMAGE:${s}`,`docker push $DOCKER_IMAGE:${s}`,`echo "pushed as $DOCKER_IMAGE:${s}"`]}})};t.createDockerTagDeployJobs=createDockerTagDeployJobs},8098:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_TAG_DEPLOY_TYPE=void 0;const n=a(5200);t.DOCKER_TAG_DEPLOY_TYPE={jobs:n.createDockerTagDeployJobs,defaults:()=>({}),additionalSecretKeys:()=>[],getAdditionalEnvVars:()=>({})}},8025:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_TYPES=void 0;const i=a(7728);const s=a(4697);const o=a(8098);const p=a(6198);r(a(7728),t);r(a(6198),t);r(a(2383),t);r(a(5044),t);t.DEPLOY_TYPES={kubernetes:p.KUBERNETES_DEPLOY_TYPE,custom:s.CUSTOM_DEPLOY_TYPE,dockerTag:o.DOCKER_TAG_DEPLOY_TYPE,"google-cloudrun":i.GCLOUD_RUN_DEPLOY_TYPE}},6877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.additionalKubernetesSecretKeys=void 0;const additionalKubernetesSecretKeys=({deployConfigRaw:e})=>{var t,a,n,r;if(!e){return[]}const i=[];if((a=(t=e.values)===null||t===void 0?void 0:t.mongodb)===null||a===void 0?void 0:a.enabled){i.push("MONGODB_ROOT_PASSWORD");if(e.values.mongodb.architecture==="replicaset"){i.push("MONGODB_REPLICASET_KEY")}}if((r=(n=e.values)===null||n===void 0?void 0:n.cloudsql)===null||r===void 0?void 0:r.enabled){i.push("POSTGRESQL_PASSWORD");i.push("cloudsqlProxyCredentials")}return i.map((e=>({key:e})))};t.additionalKubernetesSecretKeys=additionalKubernetesSecretKeys},5032:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesCloudsqlBaseValues=t.hasKubernetesCloudSQL=void 0;const n=a(8045);const r=a(7844);const i=a(2383);const hasKubernetesCloudSQL=e=>{var t,a,n;const r=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,i.isOfDeployType)(r,"kubernetes")){return(n=(a=r.values)===null||a===void 0?void 0:a.cloudsql)===null||n===void 0?void 0:n.enabled}return false};t.hasKubernetesCloudSQL=hasKubernetesCloudSQL;const createKubernetesCloudsqlBaseValues=e=>{var t,a,s;const o=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(o,"kubernetes")){throw new Error("cannot get cloud sql config")}const p=(a=o.values)===null||a===void 0?void 0:a.cloudsql;if(!p){throw new Error("cannot get cloud sql config")}const l=`$${(0,n.getSecretVarNameForContext)(e,"cloudsqlProxyCredentials")}`;if(p.type==="unmanaged"){return{cloudsql:{enabled:p.enabled,dbUser:(s=p.dbUser)!==null&&s!==void 0?s:"postgres",instanceConnectionName:p.instanceConnectionName,proxyCredentials:l,fullDbName:(0,r.getFullDbName)(p,e.fullConfig,e.environment.slugPrefix,e.name)}}}else{throw new Error("unknonw type")}};t.createKubernetesCloudsqlBaseValues=createKubernetesCloudsqlBaseValues},7444:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesDeployJobs=void 0;const n=a(5855);const r=a(2348);const i=a(8563);const s=a(9256);const o=a(2383);const p=a(6143);const l=a(5103);const d=a(3468);const c="__all_values.yml";const createKubernetesDeployJobs=e=>{var t,a,u;const f=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,o.isOfDeployType)(f,"kubernetes")){throw new Error("deploy config is not kubernetes")}const m={image:(0,r.getRunnerImage)("kubernetes"),...f.debug?{artifacts:{paths:[c],when:"always"}}:{},variables:{...e.environment.envVars,RELEASE_NAME:e.environment.fullName,HELM_EXPERIMENTAL_OCI:"1",KUBE_DOCKER_IMAGE_PULL_SECRET:`gitlab-registry-${e.name}`,HELM_GITLAB_CHART_NAME:(a=f.chartName)!==null&&a!==void 0?a:"/helm-charts/the-panter-chart",HELM_ARGS:[...f.debug?["--debug"]:[],...(u=f.additionalHelmArgs)!==null&&u!==void 0?u:[]].join(" "),COMPONENT_NAME:e.name}};const h=`kube-${e.environment.fullName}`;const v=[`kubectl config set-cluster "${h}" --server="$${(0,n.getSecretVarNameForContext)(e,"KUBE_URL")}" --certificate-authority <(echo $${(0,n.getSecretVarNameForContext)(e,"KUBE_CA_PEM")} | base64 -d) --embed-certs=true`,`kubectl config set-credentials "${h}" --token="$${(0,n.getSecretVarNameForContext)(e,"KUBE_TOKEN")}"`,`kubectl config set-context "${h}" --cluster="${h}" --user="${h}" --namespace="${e.environment.envVars.KUBE_NAMESPACE}"`,`kubectl config use-context "${h}"`];return(0,i.createDeployementJobs)(e,{deploy:{...m,script:[...v,...(0,d.collapseableSection)("writeallvalues","Write "+c+" for helm deployment")((0,l.writeBashYamlToFileScript)((0,p.createKubeValues)(e),c)),"kubernetesCreateSecret","kubernetesDeploy",...(0,s.getDependencyTrackUploadScript)(e),"echo deployment successful 😻"]},stop:{...m,script:[...v,"kubernetesDelete",...(0,s.getDependencyTrackDeleteScript)(e)]},rollback:{...m,script:[...v,"kubernetesRollback"]}})};t.createKubernetesDeployJobs=createKubernetesDeployJobs},6198:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.KUBERNETES_DEPLOY_TYPE=void 0;const s=i(a(4206));const o=a(8025);const p=a(5354);const l=a(6877);const d=a(7444);r(a(5032),t);t.KUBERNETES_DEPLOY_TYPE={jobs:d.createKubernetesDeployJobs,defaults:()=>({}),additionalSecretKeys:l.additionalKubernetesSecretKeys,getAdditionalEnvVars:({componentName:e,fullConfig:t,deployConfigRaw:a,env:n,reviewSlug:r,envType:i})=>{var l;const d=i==="review"&&r?r.concat("-"):"";const c=d.concat(e);const u=(0,o.getKubernetesNamespace)(t,n);const f=(0,s.default)(e);const m=a&&((l=a.cluster)===null||l===void 0?void 0:l.domainCanonical)||t.domainCanonical||"panter.cloud";const h=(0,p.joinBashExpressions)([f,...i==="review"&&r?[r]:[],n,t.appName,t.customerName,m],".");return{KUBE_NAMESPACE:u,KUBE_APP_NAME:c,KUBE_APP_NAME_PREFIX:d,HOSTNAME_INTERNAL:h}}}},4894:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubeEnv=void 0;const n=a(2383);const shouldGoIntoSecrets=(e,t)=>{var a;if(!t)return false;if((a=String(t))===null||a===void 0?void 0:a.includes("$CL_")){return true}return false};const createKubeEnv=e=>{var t;if(!(0,n.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("deploy config is not kubernetes")}const a=e.environment.envVars;const r=Object.entries(a).reduce(((e,[t,a])=>{if(shouldGoIntoSecrets(t,a===null||a===void 0?void 0:a.toString())){e.secret={...e.secret,[t]:a!==null&&a!==void 0?a:""};return e}e.public={...e.public,[t]:a!==null&&a!==void 0?a:""};return e}),{secret:{},public:{}});return r};t.createKubeEnv=createKubeEnv},6143:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubeValues=void 0;const n=a(9250);const r=a(595);const i=a(2383);const s=a(5032);const o=a(4894);const p=a(8400);const createAppConfig=(e,t)=>{if(t===false){return{enabled:false}}const{healthRoute:a,command:n,...i}=t!==null&&t!==void 0?t:{};return(0,r.mergeWithMergingArrays)({host:e.environment.envVars.HOSTNAME,command:n!==null&&n!==void 0?n:e.build.type!=="disabled"?e.build.config.startCommand:undefined,livenessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},readinessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},startupProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}}},i)};const removeFalsy=e=>{if(!e)return undefined;return Object.fromEntries(Object.entries(e).filter((([,e])=>e!==false)))};const createKubeValues=e=>{var t,a,l;const d=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!d){return[]}if(!(0,i.isOfDeployType)(d,"kubernetes")){throw new Error("deploy config is not kubernetes")}const{values:c}=d;const{application:u,jobs:f,cronjobs:m,...h}=c!==null&&c!==void 0?c:{};const v=(0,o.createKubeEnv)(e);const g=(0,n.merge)({env:v,application:createAppConfig(e,u)},(0,s.hasKubernetesCloudSQL)(e)?(0,s.createKubernetesCloudsqlBaseValues)(e):{},((l=(a=d.values)===null||a===void 0?void 0:a.mongodb)===null||l===void 0?void 0:l.enabled)?(0,p.createMongodbBaseConfig)(e):{});const y=(0,r.mergeWithMergingArrays)(g,{jobs:removeFalsy(f),cronjobs:removeFalsy(m),...h});return y};t.createKubeValues=createKubeValues},8400:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMongodbBaseConfig=void 0;const n=a(9250);const r=a(5855);const i=a(2383);const getCredentialString=e=>`root:$${(0,r.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD")}@`;const getMongodbHost=(e,t)=>{const a=e.environment.envVars.KUBE_NAMESPACE;return`${t}.${a}.svc.cluster.local:27017`};const getMongodbStandaloneHost=e=>{const t=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,`${t}-mongodb`)};const getMongodbReplicasetHost=(e,t)=>{const a=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,`${a}-mongodb-${t}.${a}-mongodb-headless`)};const createMongodbUrl=(e,t)=>{var a,r,s,o;if(!(0,i.isOfDeployType)((a=e.deploy)===null||a===void 0?void 0:a.config,"kubernetes")){throw new Error("can only createMongodbUrl on supported deploys")}const p=(s=(r=e.deploy)===null||r===void 0?void 0:r.config.values)===null||s===void 0?void 0:s.mongodb;let l=undefined;let d="";if((p===null||p===void 0?void 0:p.architecture)==="replicaset"){d=(0,n.range)(0,(o=p===null||p===void 0?void 0:p.replicaCount)!==null&&o!==void 0?o:2).map((t=>getMongodbReplicasetHost(e,t))).join(",");l="replicaSet=rs0&authSource=admin"}else{d=getMongodbStandaloneHost(e);l="authSource=admin"}return`mongodb://${getCredentialString(e)}${d}/${t}${l?`?${l}`:""}`};const createMongoBackupDefaultConfig=e=>{var t,a,n;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}const r=(n=(a=e.deploy)===null||a===void 0?void 0:a.config.values)===null||n===void 0?void 0:n.mongodb;const s=e.environment.envVars.KUBE_APP_NAME;const o=["prod","stage"].includes(e.environment.envType);let p;let l;if((r===null||r===void 0?void 0:r.architecture)==="replicaset"){const t=(r===null||r===void 0?void 0:r.architecture)==="replicaset"&&r.replicaCount&&r.replicaCount>1?1:0;p=getMongodbReplicasetHost(e,t);l=`datadir-${s}-mongodb-${t}`}else{p=getMongodbStandaloneHost(e);l=`${s}-mongodb`}return{enabled:o,hostToBackup:p,pvcToBackup:l,image:"mrelite/kubectlmongoshell:v1.0",schedule:"0 4 * * *",volumeSnapshotClass:"snapshotclass"}};const createMongodbBaseConfig=e=>{var t,a,n,s;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}const o=(n=(a=e.deploy)===null||a===void 0?void 0:a.config.values)===null||n===void 0?void 0:n.mongodb;return{mongodb:{enabled:true,auth:{enabled:true,rootPassword:"$"+(0,r.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD"),replicaSetKey:"$"+(0,r.getSecretVarNameForContext)(e,"MONGODB_REPLICASET_KEY")},persistence:{storageClass:"standard-rwo"},image:{registry:"bitnamilegacy",repository:"mongodb"},backup:createMongoBackupDefaultConfig(e)},env:{secret:{MONGO_URL:createMongodbUrl(e,(s=o===null||o===void 0?void 0:o.dbName)!==null&&s!==void 0?s:"app"),...(o===null||o===void 0?void 0:o.architecture)==="replicaset"?{MONGO_OPLOG_URL:createMongodbUrl(e,"local")}:{}}}}};t.createMongodbBaseConfig=createMongodbBaseConfig},9256:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDependencyTrackDeleteScript=t.getDependencyTrackUploadScript=t.sbomDeactivated=void 0;const n=a(5354);const r=a(4713);const i=a(3660);const sbomDeactivated=e=>e.build.type==="disabled"||(0,i.componentContextIsStandaloneBuild)(e)&&e.build.config.type==="custom"&&e.build.config.sbom===false;t.sbomDeactivated=sbomDeactivated;const getDependencyTrackUploadScript=e=>(0,t.sbomDeactivated)(e)?[]:["echo 'Uploading SBOM to Dependency Track'",`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "${e.fullConfig.customerName}-${e.fullConfig.appName}/${e.name}" "${(0,n.getBashVariable)("ROOT_URL")}" "${r.SBOM_FILE}" vex.json || true`];t.getDependencyTrackUploadScript=getDependencyTrackUploadScript;const getDependencyTrackDeleteScript=e=>(0,t.sbomDeactivated)(e)?[]:["echo 'Disabling component in Dependency Track'",`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "${e.fullConfig.customerName}-${e.fullConfig.appName}/${e.name}" "${(0,n.getBashVariable)("CI_ENVIRONMENT_URL")}" || true`];t.getDependencyTrackDeleteScript=getDependencyTrackDeleteScript},8252:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1086:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultLivenessProbe=t.defaultStartupProbe=void 0;t.defaultStartupProbe={type:"http1",path:"/__health",initialDelaySeconds:5,timeoutSeconds:1,periodSeconds:30,failureThreshold:3};t.defaultLivenessProbe={...t.defaultStartupProbe,initialDelaySeconds:0,timeoutSeconds:10,periodSeconds:30,failureThreshold:3}},2383:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});t.getDeployConfigType=t.isOfDeployType=void 0;r(a(8252),t);r(a(1086),t);r(a(5383),t);r(a(508),t);const isOfDeployType=(e,...t)=>e&&t.includes(e.type)?true:false;t.isOfDeployType=isOfDeployType;const getDeployConfigType=e=>{if(!e)return undefined;return e.type};t.getDeployConfigType=getDeployConfigType},5383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5044:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contextIsStoppable=t.getKubernetesNamespace=t.getFullKubernetesClusterName=void 0;const n=a(2383);const getFullKubernetesClusterName=e=>{if(e.type==="gcloud"){return`gke_${e.projectId}_${e.region}_${e.name}`}};t.getFullKubernetesClusterName=getFullKubernetesClusterName;const getKubernetesNamespace=(e,t)=>`${e.customerName}-${e.appName}-${t}`;t.getKubernetesNamespace=getKubernetesNamespace;const contextIsStoppable=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,n.isOfDeployType)(a,"kubernetes")){return true}if((0,n.isOfDeployType)(a,"google-cloudrun")){return true}if((0,n.isOfDeployType)(a,"custom")&&a.stopScript){return true}return false};t.contextIsStoppable=contextIsStoppable},3891:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.registerGlobalScriptFunction=t.globalScriptFunctions=void 0;class GlobalScriptFunction{constructor(e,t){this.name=e;this.script=t}toBashFunction(){return`function ${this.name} () {\n${this.script.trim()}\n}`.trim()}invoke(...e){return`${this.name} ${e.join(" ")}`}}t.globalScriptFunctions=new Map;const registerGlobalScriptFunction=(e,a)=>{if(t.globalScriptFunctions.has(e)){throw new Error(`Global script function ${e} already exists`)}const n=new GlobalScriptFunction(e,a);t.globalScriptFunctions.set(e,n);return n};t.registerGlobalScriptFunction=registerGlobalScriptFunction},241:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(6940),t);r(a(5063),t);r(a(4565),t);r(a(2348),t);r(a(940),t);r(a(8045),t);r(a(1398),t);r(a(8025),t);r(a(5585),t);r(a(250),t);r(a(8016),t);r(a(5233),t)},9212:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAgentContext=t.AgentContext=void 0;class AgentContext{constructor(e,t){this.agentName=e;this.config=t;this.type="agent"}get name(){return this.agentName}get agentConfig(){var e;const t=(e=this.config.agents)===null||e===void 0?void 0:e[this.agentName];if(!t){throw new Error(`Agent ${this.agentName} not found in config`)}return t}get agentUser(){var e,t,a,n;return{username:(t=(e=this.agentConfig.agentUser)===null||e===void 0?void 0:e.username)!==null&&t!==void 0?t:"agent.claude",userId:(n=(a=this.agentConfig.agentUser)===null||a===void 0?void 0:a.userId)!==null&&n!==void 0?n:"$DEFAULT_AGENT_USER_ID"}}get reviews(){var e,t;return{byUser:(t=(e=this.agentConfig.reviews)===null||e===void 0?void 0:e.byUser)!==null&&t!==void 0?t:{[this.agentUser.username]:{automatic:true}}}}get fullConfig(){return this.config}}t.AgentContext=AgentContext;const createAgentContext=async e=>new AgentContext(e.agentName,e.config);t.createAgentContext=createAgentContext},8756:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAgentEventJob=void 0;const n=a(7781);const r=a(5729);const i=a(5687);const createAgentEventJob=e=>{const t=(0,r.createBaseAgentJob)(e);const a=(0,i.getAgentUserId)(e);const s=(0,i.getAgentUserName)(e);return{interruptible:false,...t,variables:{...t.variables},name:e.name+"-agent-event",rules:[{if:`$CI_PIPELINE_SOURCE == "trigger" && ($ASSIGNEE_USER_ID == ${a} || $OBJECT_DESCRIPTION =~ /@${s}/)`,when:"always"},{when:"never"}],script:[...r.baseSetupScript,...(0,r.callClaude)({prompt:(0,n.getEventPrompt)({agentUserName:s})})]}};t.createAgentEventJob=createAgentEventJob},2651:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAgentReviewJob=void 0;const n=a(4565);const r=a(7781);const i=a(5729);const s=a(5687);const createAgentReviewJob=e=>{const t=(0,i.createBaseAgentJob)(e);const a=(0,s.getAgentUserName)(e);const o=e.reviews.byUser==="all-automatic"?[{...n.RULE_IS_MERGE_REQUEST,when:"always"}]:Object.entries(e.reviews.byUser).filter((([e,{automatic:t}])=>t)).map((([e])=>({if:`${n.RULE_IS_MERGE_REQUEST.if} && $GITLAB_USER_LOGIN == "${e}"`,when:"always"})));return{...t,envMode:"jobPerEnv",name:e.name+"-agent-review",allow_failure:true,rules:[...o,{...n.RULE_IS_MERGE_REQUEST,when:"manual"},{when:"never"}],script:[...i.baseSetupScript,...(0,i.callClaude)({prompt:(0,r.getMergeRequestPrompt)({agentUserName:a})})]}};t.createAgentReviewJob=createAgentReviewJob},9161:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForAgentContext=void 0;const n=a(8756);const r=a(2651);const createJobsForAgentContext=e=>[(0,n.createAgentEventJob)(e),(0,r.createAgentReviewJob)(e)];t.createJobsForAgentContext=createJobsForAgentContext},7781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getMergeRequestPrompt=t.getEventPrompt=void 0;const header=()=>`\nProject ID: $CI_PROJECT_ID\nGitLab Host: $CI_SERVER_URL\nDefault Branch: $CI_DEFAULT_BRANCH\n`;const identity=({agentUserName:e})=>`\n## Identity\n- Your GitLab username is "${e}".\n`;const goldenRules=({agentUserName:e})=>`\n## Golden Rules\n- Use the \`gitlab-mcp\` tool for ALL GitLab actions. Do not call any other APIs.\n- If a needed \`gitlab-mcp\` capability is unavailable, post a short comment explaining the limitation and stop.\n- NEVER mention yourself ("@${e}") anywhere (comments, descriptions, titles, commit messages).\n- NEVER push to $CI_DEFAULT_BRANCH or any protected branch. Always create a new branch and open a Merge Request (MR).\n- Always assign yourself as the assignee of any MR you create.\n- Do not create an MR for a **closed** issue.\n- Keep actions minimal and idempotent. Avoid duplicate comments or duplicate MRs.\n- Use ONE stable \`source_branch\` per run; do not regenerate its name later.\n`;const conversationsIntake=({agentUserName:e})=>`\n## Conversations Intake & Threading (MANDATORY before acting)\nAlways load and reason about the current conversation to avoid duplicates and to respond in the right place.\n\n- **MRs**: Use \`mr_discussions({ projectId: $CI_PROJECT_ID, mergeRequestIid })\`.\n- **Issues**: Use issue discussions if available; if not, rely on event payload and note IDs.\n\nRules:\n1) Detect latest human note (exclude "${e}"). If it replies to you or is in a discussion you started, reply **in the same thread**.\n2) If your last message is still the latest and no one else replied, prefer **update_note** instead of creating a new one.\n3) For MR code discussions: reply inline in the same discussion.\n4) Always sanitize (see Self-mention Guard) before writing.\n`;const selfMentionGuard=({agentUserName:e})=>`\n## Self-mention Guard\nBefore ANY write (comment/MR/issue/commit message):\n- Remove all occurrences of "@${e}" (case-insensitive).\n- If the text becomes empty, skip the write.\n- If the last actor is you, skip acknowledgement comments.\n- To assign yourself, use assignee fields, not mentions.\n`;const commentGuidelines=()=>`\n## Comment Guidelines\n- Professional, friendly, concise.\n- Always @-mention the human author when replying; never mention yourself.\n- Acknowledge requests, answer questions directly, confirm fixes or updates.\n- Avoid repeating boilerplate.\n`;const mcpOnly=()=>`\n## gitlab-mcp Operations\n\n- **Comments / Notes**\n - create_issue_note({ projectId, issueIid, body })\n - update_issue_note({ projectId, issueIid, noteId, body })\n - create_merge_request_note({ projectId, mergeRequestIid, body })\n - update_merge_request_note({ projectId, mergeRequestIid, noteId, body })\n - mr_discussions({ projectId, mergeRequestIid })\n\n- **Issues**\n - create_issue({ projectId, title, description, assigneeUsernames?: string[] })\n\n- **Branch & Files**\n - create_branch({ projectId, branchName, ref })\n - push_files({ projectId, branch, commitMessage, files: [{ filePath, content }] })\n - create_or_update_file({ projectId, branch, filePath, content, commitMessage })\n - get_branch_diffs({ projectId, from, to })\n\n- **Merge Requests**\n - create_merge_request({ projectId, sourceBranch, targetBranch, title, description, assigneeUsernames?: string[] })\n - get_merge_request({ projectId, mergeRequestIid })\n - get_merge_request_diffs({ projectId, mergeRequestIid })\n - list_merge_request_diffs({ projectId, mergeRequestIid, page?, perPage? })\n - update_merge_request({ projectId, mergeRequestIid, title?, description?, draft?, assigneeUsernames? })\n\n- **Pipelines / Jobs**\n - list_pipelines({ projectId, ref?, sha?, status?, orderBy?, sort? })\n - list_pipeline_jobs({ projectId, pipelineId })\n - get_pipeline_job_output({ projectId, pipelineId, jobId })\n - play_pipeline_job({ projectId, jobId })\n - cancel_pipeline_job({ projectId, jobId })\n`;const outputDiscipline=({agentUserName:e})=>`\n## Output Discipline\n- Output only \`gitlab-mcp\` tool calls and plain-text summaries where requested.\n- Keep comments concise and professional.\n- Never include "@${e}" in any body.\n`;const eventSelfParse=()=>`\n## Self-Parse Raw Payload\nFrom \`event_json\`, extract:\n- kind: "issue" | "merge_request" | "note"\n- iid from URL (/issues/<n>, /merge_requests/<n>)\n- note_id if present (#note_<id>)\n- description/body, state, author, timestamps\n- project id/path\n- discussion id if available for inline replies\n`;const resolveMrPipeline=()=>`\n## Resolve MR Pipeline\n1) get_merge_request({ projectId, mergeRequestIid }) → sourceBranch, sha\n2) Prefer: list_pipelines({ projectId, sha })\n3) Else: list_pipelines({ projectId, ref: sourceBranch, orderBy: "updated_at", sort: "desc" })\n4) Pick newest → mr_pipeline_id\n`;const singleRunnerGuard=()=>`\n## Single-Runner Guard\n- If mr_pipeline_id available:\n - list_pipeline_jobs({ projectId, pipelineId: mr_pipeline_id })\n - cancel_pipeline_job on any running/pending job ending with "agent-review"\n- If not available, note limitation and proceed\n`;const reviewOnDemandFromEvents=()=>`\n## Review-on-Demand\nIf the text asks for a review ("review", "please review", "PTAL", "needs review", "can you look at", "LGTM?"):\n1) Resolve MR IID (from target or text).\n2) Resolve MR pipeline (do NOT use the event pipeline).\n3) If a manual "agent-review" job exists, play it → confirm in-thread → STOP.\n4) Else run Single-Runner Guard, then enter MR Review Mode.\n`;const eventWorkflow=({agentUserName:e})=>`\n## Event Workflow\n0) Conversations Intake first\n1) Acknowledge with note (unless last actor is you)\n2) Default branch: use \`$CI_DEFAULT_BRANCH\`\n3) Create branch from \`$CI_DEFAULT_BRANCH\`:\n create_branch({ projectId: $CI_PROJECT_ID, branchName: "<source_branch>", ref: $CI_DEFAULT_BRANCH })\n4) Write changes → commit → push:\n push_files({ projectId: $CI_PROJECT_ID, branch: "<source_branch>", commitMessage, files })\n - Ensure files list is not empty before calling push_files; if empty, skip pushing.\n5) Verify:\n get_branch_diffs({ projectId: $CI_PROJECT_ID, from: $CI_DEFAULT_BRANCH, to: "<source_branch>" })\n - Require non-empty diffs\n6) Create MR (if diffs exist):\n create_merge_request({\n projectId: $CI_PROJECT_ID,\n sourceBranch: "<source_branch>",\n targetBranch: $CI_DEFAULT_BRANCH,\n title,\n description, // include "Closes #<issue_iid>" when applicable\n assigneeUsernames: ["${e}"]\n })\n7) Follow-up note (in correct thread) with branch, short SHA if available, files-changed count, and MR link (unless last actor is you)\n8) If verification fails: comment error and STOP\n\n## Stdout Summary (Event)\nPrint a plain-text summary with:\n- action: "event"\n- source_branch\n- target_branch: $CI_DEFAULT_BRANCH\n- diff_count (from get_branch_diffs)\n- mr_iid and/or mr_url if created\n- any note ids created/updated\n- any limitations encountered (e.g., missing discussions tool)\n`;const mrScope=({agentUserName:e})=>`\n## MR Scope\n- You are reviewing a single MR\n- Never merge the MR yourself\n- Work only on the MR's source branch\n`;const mrWorkflow=()=>`\n## MR Workflow\n1) get_merge_request + get_merge_request_diffs + mr_discussions\n2) Conversations Intake\n3) Post review comments first via create_merge_request_note (sanitize)\n4) If will_push_changes = true:\n - push_files to source branch\n - verify with get_branch_diffs({ from: targetBranch || $CI_DEFAULT_BRANCH, to: sourceBranch })\n - follow-up note summarizing changes in the right thread (sanitize)\n\n## Stdout Summary (MR)\nPrint a plain-text summary with:\n- action: "mr"\n- mr_iid\n- source_branch and target_branch (fallback to $CI_DEFAULT_BRANCH)\n- will_push_changes: true|false\n- diff_count (post-push, if applicable)\n- discussions: number of notes added/updated\n- ci: whether mr_pipeline_id was resolved\n- blocking_failed_jobs (names+stages) if inspected\n`;const ciInspection=()=>`\n## CI Inspection (diagnose only)\n- Use mr_pipeline_id if available\n- list_pipeline_jobs → for each failed + allow_failure=false:\n - get_pipeline_job_output\n - classify: code vs infra\n - Do not retry; only report diagnosis in a note\n- If no mr_pipeline_id, note limitation\n`;const outputDisciplineMR=({agentUserName:e})=>`\n## Output Discipline (MR)\n- Only gitlab-mcp calls + final summary\n- Never merge MR\n- Never mention "@${e}"\n`;const mrReviewBundle=e=>`\n## MR Review Mode\n${mrScope(e)}\n${mrWorkflow()}\n${ciInspection()}\n`;const getEventPrompt=e=>`\nYou are a GitLab assistant bot. You receive ONE raw GitLab webhook JSON payload.\n\n${header()}\n---\nevent_json:\n$(cat $TRIGGER_PAYLOAD)\n---\n\n${identity(e)}\n${goldenRules(e)}\n${selfMentionGuard(e)}\n${conversationsIntake(e)}\n${eventSelfParse()}\n${resolveMrPipeline()}\n${singleRunnerGuard()}\n${reviewOnDemandFromEvents()}\n${mrReviewBundle(e)}\n${eventWorkflow(e)}\n${commentGuidelines()}\n${mcpOnly()}\n${outputDiscipline(e)}\n`;t.getEventPrompt=getEventPrompt;const getMergeRequestPrompt=e=>`\nYou are a GitLab assistant bot reviewing and updating a single Merge Request (MR).\n\n${header()}\n---\nmerge_request_iid: $CI_MERGE_REQUEST_IID\ntitle: $CI_MERGE_REQUEST_TITLE\ndescription: $CI_MERGE_REQUEST_DESCRIPTION\n---\n\n${mrScope(e)}\n${goldenRules(e)}\n${selfMentionGuard(e)}\n${conversationsIntake(e)}\n${mrWorkflow()}\n${ciInspection()}\n${commentGuidelines()}\n${mcpOnly()}\n${outputDisciplineMR(e)}\n`;t.getMergeRequestPrompt=getMergeRequestPrompt},5729:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.callClaude=t.baseSetupScript=t.createBaseAgentJob=void 0;const n=a(8127);const r=a(2348);const createBaseAgentJob=e=>({stage:"agents",image:(0,r.getRunnerImage)("agent-claude"),variables:{MAX_MCP_OUTPUT_TOKENS:"75000",GITLAB_PERSONAL_ACCESS_TOKEN:"$AGENT_GITLAB_PERSONAL_ACCESS_TOKEN",GITLAB_API_URL:"$CI_API_V4_URL"}});t.createBaseAgentJob=createBaseAgentJob;t.baseSetupScript=["claude mcp add gitlab --env GITLAB_PERSONAL_ACCESS_TOKEN=$GITLAB_PERSONAL_ACCESS_TOKEN --env GITLAB_API_URL=$GITLAB_API_URL --env USE_PIPELINE='true' -- npx -y @zereight/mcp-gitlab"];const callClaude=({prompt:e})=>[`export PROMPT="${(0,n.escapeNewlines)((0,n.escapeDoubleQuotes)((0,n.escapeBackTicks)(e)))}"`,`claude -p "$PROMPT" --permission-mode acceptEdits --allowedTools "Bash Read(*) Edit(*) Write(*) mcp__gitlab" --verbose --debug`];t.callClaude=callClaude},5687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getAgentUserId=t.getAgentUserName=void 0;const getAgentUserName=e=>{var t,a;return(a=(t=e.agentConfig.agentUser)===null||t===void 0?void 0:t.username)!==null&&a!==void 0?a:"agent.claude"};t.getAgentUserName=getAgentUserName;const getAgentUserId=e=>{var t,a;return(a=(t=e.agentConfig.agentUser)===null||t===void 0?void 0:t.userId)!==null&&a!==void 0?a:"$DEFAULT_AGENT_USER_ID"};t.getAgentUserId=getAgentUserId},3671:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAllJobs=void 0;const n=a(8347);const r=a(2981);const i=a(5063);const s=a(2424);const o=a(426);const p=a(9161);const l=a(9212);const createAllJobs=async({config:e,trigger:t,pipelineType:a})=>{var d,c;const u=await(0,n.createAllComponentsContext)({config:e,trigger:t,pipelineType:a});return{workspaces:await Promise.all(Object.keys((d=e.builds)!==null&&d!==void 0?d:{}).map((async n=>{const s=u.filter((e=>(0,i.componentContextHasWorkspaceBuild)(e)&&e.build.workspaceName===n));const p=[...new Set(s.map((({env:e})=>e)))];return await Promise.all(p.map((async i=>{const p=await(0,r.createWorkspaceContext)({components:s.filter((({env:e})=>e===i)),workspaceName:n,config:e,trigger:t,pipelineType:a,env:i});return{context:p,jobs:(0,o.createJobsForWorkspace)(p)}})))}))).then((e=>e.flat())),components:u.map((e=>({context:e,jobs:(0,s.createJobsForComponentContext)(e)}))),agents:await Promise.all(Object.keys((c=e.agents)!==null&&c!==void 0?c:{}).map((async t=>{const a=await(0,l.createAgentContext)({agentName:t,config:e});return{context:a,jobs:(0,p.createJobsForAgentContext)(a)}}))).then((e=>e.flat()))}};t.createAllJobs=createAllJobs},2424:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForComponentContext=void 0;const n=a(1398);const r=a(8025);const injectDefaultVarsInCustomJobs=(e,t)=>t.map((({variables:t,...a})=>{var n;return{variables:{...(n=e.environment.envVars)!==null&&n!==void 0?n:{},...t!==null&&t!==void 0?t:{}},...a}}));const getCustomJobs=e=>{if(!e.customJobs){return[]}const t=e.customJobs;return injectDefaultVarsInCustomJobs(e,t)};const createJobsForComponentContext=e=>{const t=e.build.type!=="disabled"?n.BUILD_TYPES[e.build.buildType].jobs(e):[];const a=e.componentConfig.deploy!==false?r.DEPLOY_TYPES[e.componentConfig.deploy.type].jobs(e):[];const i=getCustomJobs(e);return[...t,...a,...i]};t.createJobsForComponentContext=createJobsForComponentContext},426:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForWorkspace=void 0;const n=a(1398);const createJobsForWorkspace=e=>{const t=n.WORKSPACE_BUILD_TYPES[e.build.buildType].jobs(e);return t};t.createJobsForWorkspace=createJobsForWorkspace},402:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMainPipeline=void 0;const n=a(4565);const r=a(6925);const i=a(3671);const s=a(2453);const o=a(4519);const p=a(6441);const l=a(8705);const createMainPipeline=async(e,t)=>{const a=(0,s.getPipelineStages)(t);if(e==="gitlab"){const n=await Promise.all(r.ALL_PIPELINE_TRIGGERS.map((async a=>await(0,o.createGitlabJobs)(await(0,i.createAllJobs)({config:t,trigger:a,pipelineType:e}),getGitlabRulesForTrigger(a))))).then((e=>e.flat()));const s=n.filter((e=>{var t;return((t=e.context)===null||t===void 0?void 0:t.type)==="workspace"})).sort(((e,a)=>{var n;const r=Object.keys((n=t.builds)!==null&&n!==void 0?n:{});const i=r.findIndex((t=>t===e.context.name));const s=r.findIndex((e=>e===a.context.name));return i-s}));const d=n.filter((e=>{var t;return((t=e.context)===null||t===void 0?void 0:t.type)==="component"})).sort(((e,a)=>{const n=Object.keys(t.components);const r=n.findIndex((t=>t===e.context.name));const i=n.findIndex((e=>e===a.context.name));return r-i}));const c=n.filter((e=>{var t;return((t=e.context)===null||t===void 0?void 0:t.type)==="agent"}));const u=[...s,...d,...c].reduce(((e,{gitlabJob:t,name:a,context:n})=>{var r,i;if(e[a]){e[a].gitlabJob.rules=[...(r=e[a].gitlabJob.rules)!==null&&r!==void 0?r:[],...(i=t.rules)!==null&&i!==void 0?i:[]]}else{e[a]={context:n,gitlabJob:t}}return e}),{});return(0,p.createGitlabPipelineWithDefaults)({stages:[...a,"release"],jobs:{...u,...Object.fromEntries(Object.entries((0,l.getGitlabReleaseJobs)(t)).map((([e,t])=>[e,{gitlabJob:t,context:null}])))},variables:t.runnerVariables})}throw new Error(`${e} is not supported`)};t.createMainPipeline=createMainPipeline;function getGitlabRulesForTrigger(e){switch(e){case"mainBranch":return[n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT];case"mr":return[n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_IS_MERGE_REQUEST];case"taggedRelease":return[n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_IS_TAGGED_RELEASE]}throw new Error(`${e} is not supported`)}},8860:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGitlabCompletePipeline=t.generatePipelineFiles=void 0;const n=a(1943);const r=a(6928);const i=a(402);const s=a(8215);const o=".catladder-generated";const p=o+"/gitlab";async function generatePipelineFiles(e,t){if(t!=="gitlab"){throw new Error("Pipeline type not supported")}const a=await getGitlabPipelineIncludes(e.config);const i={path:".gitlab-ci.yml",content:{include:a.map((e=>e.path))}};const s=[i,...a];await(0,n.rm)(p,{force:true,recursive:true});await Promise.all(s.map((async({path:t,content:a})=>{await(0,n.mkdir)((0,r.dirname)(t),{recursive:true});await e.fileWriter.writeYamlfile(t,a)})))}t.generatePipelineFiles=generatePipelineFiles;async function getGitlabPipelineIncludes(e){const{jobs:t,image:a,stages:n,variables:r,workflow:o,...l}=await(0,i.createMainPipeline)("gitlab",e);const d=Object.entries(t).reduce(((e,[t,{gitlabJob:a,context:n}])=>{const r=!n?"global-jobs":(n===null||n===void 0?void 0:n.type)+"/"+n.name;if(!e[r]){e[r]={}}e[r][t]=(0,s.sortGitLabJobDefProps)(a);return e}),{});const c=Object.entries(d).map((([e,t])=>({path:p+"/"+e+".yaml",content:t})));const u={path:p+"/main.yaml",content:{image:a,stages:n,variables:r,workflow:o,...l}};const f=[u,...c];return f}async function getGitlabCompletePipeline(e){const t=await getGitlabPipelineIncludes(e);return t.reduce(((e,{content:t})=>({...e,...t})),{})}t.getGitlabCompletePipeline=getGitlabCompletePipeline},2453:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPipelineStages=void 0;const n=a(940);const r=a(1507);function getPipelineStages(e){const t=(0,n.getAllEnvsInAllComponents)(e).filter((e=>e!=="local"));const a=r.BASE_STAGES.reduce(((e,a)=>[...e,a,...t.map((e=>`${a} ${e}`))]),[]);return a}t.getPipelineStages=getPipelineStages},8932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.addCacheFallback=t.getCacheKeyWithFallbackForMR=void 0;const getCacheKeyWithFallbackForMR=(e,t)=>{if(t.trigger==="mr"){return{key:e+"-mr$CI_MERGE_REQUEST_IID",fallback_keys:[e]}}return{key:e}};t.getCacheKeyWithFallbackForMR=getCacheKeyWithFallbackForMR;const addCacheFallback=(e,t)=>{if(t.type!=="agent"&&t.trigger==="mr"){if(Array.isArray(e)){return e.map((e=>addCacheFallbackToSingleCacheForMR(e,t)))}return addCacheFallbackToSingleCacheForMR(e,t)}return e};t.addCacheFallback=addCacheFallback;const addCacheFallbackToSingleCacheForMR=(e,a)=>{if(typeof e.key==="string"){return{...e,...(0,t.getCacheKeyWithFallbackForMR)(e.key,a)}}return e}},4519:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createGitlabJobs=t.makeGitlabJob=t.GITLAB_ENVIRONMENT_URL_VARIABLE=void 0;const n=a(9250);const r=a(436);const i=a(4628);const s=a(595);const o=a(3468);const p=a(4195);const l=a(5354);const d=a(8932);t.GITLAB_ENVIRONMENT_URL_VARIABLE="CL_GITLAB_ENVIRONMENT_URL";const getFullJobName=({type:e,name:t,baseName:a,allJobs:n,env:r})=>{const i=n.workspaces.length>0;const s=e==="component"?"🔹":e==="agent"?"🤖":"🔸";const o=i?s+" ":"";if(r){return`${o}${a} ${t} | ${r} `}return`${o}${a} ${t}`};const getFullReferencedJobNameFromComponent=(e,t,a,n)=>{var r,i;const s=(i=(r=n.components.find((e=>e.context.name===t&&e.context.env===a)))===null||r===void 0?void 0:r.jobs)===null||i===void 0?void 0:i.find((t=>t.name===e));if(!s){throw new Error(`unknown job referenced: '${e}' from '${a}:${t}'`)}return getFullJobName({type:"component",name:e,baseName:t,env:a,allJobs:n})};const getFullReferencedJobNameFromWorkspace=(e,t,a,n)=>{var r,i;const s=(i=(r=n.workspaces.find((e=>e.context.name===t)))===null||r===void 0?void 0:r.jobs)===null||i===void 0?void 0:i.find((t=>t.name===e));if(!s){throw new Error(`unknown job referenced: '${e}' from workspace ${a}:${t}'`)}return getFullJobName({type:"workspace",name:e,baseName:t,env:a,allJobs:n})};const getJobName=e=>(0,n.isObject)(e)?e.job:e;const makeGitlabJob=(e,t,a,n)=>{var l,c;const{environment:u,envMode:f,needsStages:m,name:h,needs:v,jobTags:g,script:y,variables:b,runnerVariables:w,when:_,cache:S,...N}=t;const C=f==="stagePerEnv"&&e.type!=="agent"?`${t.stage} ${e.env}`:t.stage;const A=getGitlabNeeds(e,t,a);const O=getFullJobName({type:e.type,name:h,baseName:e.name,env:e.type!=="agent"?e.env:undefined,allJobs:a});const I=["KUBERNETES_CPU_REQUEST","KUBERNETES_MEMORY_REQUEST","KUBERNETES_CPU_LIMIT","KUBERNETES_MEMORY_LIMIT"];const D=(0,o.collapseableSection)("injectvars","Injecting variables")([...(0,r.getInjectVarsScript)(Object.fromEntries(Object.entries(b!==null&&b!==void 0?b:{}).filter((([e])=>!I.includes(e)))))]);const k=Object.fromEntries(Object.entries(b!==null&&b!==void 0?b:{}).filter((([e])=>I.includes(e))));if(Object.keys(k).length>0){console.warn(`Legacy variables detected in ${O}: ${Object.keys(k).join(", ")}. Please move them to the runnerVariables key.`)}const T=[...(l=t.rules)!==null&&l!==void 0?l:[],...n?n.map((e=>({when:_,...e}))):_?[{when:_}]:[]];const P={retry:i.BASE_RETRY,interruptible:true,...N,cache:S?(0,d.addCacheFallback)(S,e):undefined,rules:T.length>0?T:undefined,variables:{...k,...w},script:[...D,...(c=y===null||y===void 0?void 0:y.filter(s.notNil))!==null&&c!==void 0?c:[]],tags:g,stage:C,needs:A};const R=addGitlabEnvironment(e,u,P,a);return[O,(0,p.removeUndefined)(R)]};t.makeGitlabJob=makeGitlabJob;const addGitlabEnvironment=(e,a,r,i)=>{var s,o;if(!a){return r}if(e.type!=="component"){return r}const{env:p,name:d,environment:c}=e;const{envVars:u,envType:f}=c;const{on_stop:m,...h}=a;const v="gitlab_environment.env";const g=!a.action||a.action==="start";const y=(0,n.merge)((s=r.artifacts)!==null&&s!==void 0?s:{},g?{reports:{dotenv:v}}:{});const b=[`echo "${t.GITLAB_ENVIRONMENT_URL_VARIABLE}=${(0,l.getBashVariable)("ROOT_URL")}" >> ${v}`];const w=f==="review"?`${p}/$CI_COMMIT_REF_NAME/${d}`:`${p}/${d}`;return{...r,environment:{name:w,...g?{url:`$${t.GITLAB_ENVIRONMENT_URL_VARIABLE}`}:{},...m?{on_stop:getFullReferencedJobNameFromComponent(m,d,p,i)}:{},...h},...!(0,n.isEmpty)(y)?{artifacts:y}:{},script:[...(o=r.script)!==null&&o!==void 0?o:[],...g?b:[]]}};const createGitlabJobs=async(e,a)=>[...e.workspaces,...e.components,...e.agents].flatMap((({context:n,jobs:r})=>r.map((r=>{const[i,s]=(0,t.makeGitlabJob)(n,r,e,a);return{name:i,gitlabJob:s,context:n}}))));t.createGitlabJobs=createGitlabJobs;function getGitlabNeeds(e,t,a){var n;const r=e.type==="workspace"?getGitlabNeedsForWorkspaceJob(e,t,a):e.type==="agent"?(n=t.needs)!==null&&n!==void 0?n:null:getGitlabNeedsForComponentJob(e,t,a);return r?deduplicateNeeds(r):undefined}function deduplicateNeeds(e){return e?[...new Map(e.map((e=>[(0,n.isObject)(e)?e.job:e,e]))).values()]:undefined}function getGitlabNeedsForComponentJob(e,{needsStages:t,needs:a},r){const i=t===null||t===void 0?void 0:t.flatMap((t=>{var a,n,i,s,o,p,l,d;const c=e.name;if(!t.workspaceName){const s=(i=(n=(a=r.components.filter((t=>t.context.name===c&&t.context.env===e.env)).flatMap((e=>e.jobs)))===null||a===void 0?void 0:a.filter((e=>e.stage===t.stage)))===null||n===void 0?void 0:n.map((e=>e.name)))!==null&&i!==void 0?i:[];return s.map((e=>{var a;return{job:e,artifacts:(a=t.artifacts)!==null&&a!==void 0?a:false,componentName:c}}))}else{const a=(d=(l=(p=(o=(s=r.workspaces.find((a=>a.context.name===t.workspaceName&&a.context.env===e.env)))===null||s===void 0?void 0:s.jobs)===null||o===void 0?void 0:o.flatMap((e=>e)))===null||p===void 0?void 0:p.filter((e=>e.stage===t.stage)))===null||l===void 0?void 0:l.map((e=>e.name)))!==null&&d!==void 0?d:[];return a.map((e=>{var a;return{job:e,artifacts:(a=t.artifacts)!==null&&a!==void 0?a:false,workspaceName:t.workspaceName}}))}}));const s=[...i!==null&&i!==void 0?i:[],...a!==null&&a!==void 0?a:[]];return s===null||s===void 0?void 0:s.map((t=>{var a;return(0,n.isObject)(t)?"workspaceName"in t?{job:getFullReferencedJobNameFromWorkspace(t.job,t.workspaceName,e.env,r),artifacts:t.artifacts}:{job:getFullReferencedJobNameFromComponent(t.job,(a=t.componentName)!==null&&a!==void 0?a:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromComponent(t,e.name,e.env,r)})).sort(((e,t)=>getJobName(e).localeCompare(getJobName(t))))}function getGitlabNeedsForWorkspaceJob(e,{needsStages:t,needs:a},r){const i=t===null||t===void 0?void 0:t.flatMap((t=>{var a,n,i,s;const o=(a=t.workspaceName)!==null&&a!==void 0?a:e.name;const p=(s=(i=(n=r.workspaces.filter((t=>t.context.name===o&&t.context.env===e.env)).flatMap((e=>e.jobs)))===null||n===void 0?void 0:n.filter((e=>e.stage===t.stage)))===null||i===void 0?void 0:i.map((e=>e.name)))!==null&&s!==void 0?s:[];return p.map((e=>{var a;return{job:e,artifacts:(a=t.artifacts)!==null&&a!==void 0?a:false,workspaceName:o}}))}));const s=[...i!==null&&i!==void 0?i:[],...a!==null&&a!==void 0?a:[]];return s===null||s===void 0?void 0:s.map((t=>(0,n.isObject)(t)?{job:getFullReferencedJobNameFromWorkspace(t.job,"workspaceName"in t&&t.workspaceName?t.workspaceName:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromWorkspace(t,e.name,e.env,r))).sort(((e,t)=>getJobName(e).localeCompare(getJobName(t))))}},6441:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createGitlabPipelineWithDefaults=void 0;const n=a(2348);const r=a(3891);const i=a(4565);const createGitlabPipelineWithDefaults=({image:e,variables:t,before_script:a,...s})=>({image:e!==null&&e!==void 0?e:(0,n.getRunnerImage)("jobs-default"),variables:{FF_USE_FASTZIP:"true",ARTIFACT_COMPRESSION_LEVEL:"fast",CACHE_COMPRESSION_LEVEL:"fast",TRANSFER_METER_FREQUENCY:"5s",GIT_DEPTH:"1",...t!==null&&t!==void 0?t:{}},before_script:[...[...r.globalScriptFunctions.values()].map((e=>e.toBashFunction())),...a!==null&&a!==void 0?a:[]],workflow:{name:"$PIPELINE_ICON $PIPELINE_NAME",rules:[{if:'$CI_PIPELINE_SOURCE == "trigger"',variables:{PIPELINE_ICON:"🤖",PIPELINE_NAME:"Thinking..."}},{if:i.RULE_IS_MERGE_REQUEST.if,variables:{PIPELINE_ICON:"🐱🔨",PIPELINE_NAME:"mr$CI_MERGE_REQUEST_IID - $CI_MERGE_REQUEST_TITLE"}},{if:i.RULE_IS_TAGGED_RELEASE.if,variables:{PIPELINE_ICON:"🐱📦",PIPELINE_NAME:"Release $CI_COMMIT_TAG"}},{if:i.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT.if,variables:{PIPELINE_ICON:"🐱🔨",PIPELINE_NAME:"Main - $CI_COMMIT_TITLE"}},{when:"always",variables:{PIPELINE_ICON:"🐱❓",PIPELINE_NAME:"Default"}}]},...s});t.createGitlabPipelineWithDefaults=createGitlabPipelineWithDefaults},8705:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGitlabReleaseJobs=void 0;const n=a(4565);const r=a(2348);const i="echo '👉 If this job failed with access denied, the project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";const s=[n.RULE_NEVER_ON_RELEASE_COMMIT,n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_NEVER_ON_SCHEDULE];const getGitlabReleaseJobs=e=>{var t;return{["create release"]:{stage:"release",image:(0,r.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],rules:[...s,{if:n.RULE_CONDITION_MAIN_BRANCH,when:((t=e.releases)===null||t===void 0?void 0:t.when)==="auto"?"on_success":"manual"},{if:n.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}]},["⚠️ force create release"]:{stage:"release",image:(0,r.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],needs:[],rules:[...s,{if:n.RULE_CONDITION_MAIN_BRANCH,when:"manual"},{if:n.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}]}}};t.getGitlabReleaseJobs=getGitlabReleaseJobs},8215:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.sortGitLabJobDefProps=void 0;const a=["stage","tags","image","services","variables","before_script","script","after_script","cache","coverage","environment","release","artifacts","rules","only","except","needs","dependencies","trigger","retry","interruptible","allow_failure","parallel","hooks","resource_group"];const sortGitLabJobDefKeys=e=>Object.keys(e).sort(((e,t)=>a.indexOf(e)===-1&&a.indexOf(t)===-1?0:a.indexOf(e)===-1?1:a.indexOf(t)===-1?-1:a.indexOf(e)-a.indexOf(t)));const sortGitLabJobDefProps=e=>sortGitLabJobDefKeys(e).reduce(((t,a)=>e[a]!==undefined?Object.assign(t,{[a]:e[a]}):t),{});t.sortGitLabJobDefProps=sortGitLabJobDefProps},6940:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(2424),t);r(a(8860),t);r(a(8705),t)},4041:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getPackageManagerInfoBase=t.getPackageManagerInfoForComponent=void 0;const r=a(9896);const i=a(6928);const s=a(3728);const o=a(9688);const p=n(a(7009));const getPackageManagerInfoForComponent=async(e,a)=>{const n=await(0,t.getPackageManagerInfoBase)();const{workspaces:p}=n;const l=e.components[a];const d=p.find((e=>(0,s.pathEqual)(l.dir,e.location)));const c=Boolean(d);const u=".";const f=(0,i.join)(l.dir,"package.json");const m=c?(0,i.join)(u,"package.json"):null;const h=c?(0,i.join)(u,"yarn.lock"):(0,i.join)(l.dir,"yarn.lock");const v=[".yarnrc",".yarnrc.yml",".npmrc",".yarn"];const g=[...v,...v.map((e=>(0,i.join)(l.dir,e)))].filter((e=>(0,r.existsSync)(e)));const y=d?(0,o.getWorkspaceDependencies)(d,p):[];const b=[...new Set([f,...m?[m]:[],h,...g,...y])];return{...n,currentWorkspace:d,currentWorkspaceDependencies:y,componentIsInWorkspace:c,pathsToCopyInDocker:b}};t.getPackageManagerInfoForComponent=getPackageManagerInfoForComponent;const _getPackageManagerInfoBase=async()=>{const e=await(0,o.getYarnVersion)();if(!e)throw new Error("could not get yarn version");const t=e.startsWith("1");const a=await(0,o.getWorkspaces)(t);return{type:"yarn",workspaces:a,version:e,isClassic:t}};t.getPackageManagerInfoBase=(0,p.default)(_getPackageManagerInfoBase,{promise:true})},9688:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getWorkspaceDependencies=t.getWorkspaces=t.getYarnVersion=void 0;const r=a(1748);const i=n(a(7009));const s=a(502);const execOrFail=async(e,t)=>{try{return await(0,r.exec)(e).then((e=>e.stdout))}catch(e){return t!==null&&t!==void 0?t:null}};t.getYarnVersion=(0,i.default)((async()=>await execOrFail("yarn --version","")),{promise:true});t.getWorkspaces=(0,i.default)((async e=>{var t,a;return e?Object.values((0,s.jsonParseOrThrow)((a=(t=(0,s.jsonParseOrThrow)(await execOrFail("yarn workspaces --json info","{}")))===null||t===void 0?void 0:t.data)!==null&&a!==void 0?a:"{}")):(0,s.jsonParseOrThrow)(`[${(await execOrFail("yarn workspaces list --json --verbose","")).trim().split("\n").join(",")}]`)}),{promise:true});const getWorkspaceDependencies=(e,a)=>e?[...e.workspaceDependencies,...e.mismatchedWorkspaceDependencies].flatMap((e=>{const n=a.find((t=>t.location===e));if(n){return[...(0,t.getWorkspaceDependencies)(n,a),n.location]}return[]})).filter(Boolean):[];t.getWorkspaceDependencies=getWorkspaceDependencies},4565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RULE_CONDITION_HOTFIX_BRANCH=t.RULE_IS_TAGGED_RELEASE=t.RULE_IS_MERGE_REQUEST=t.RULE_NEVER_ON_SCHEDULE=t.RULE_NEVER_ON_AGENT_TRIGGER=t.RULE_NEVER_ON_RELEASE_COMMIT=t.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT=t.RULE_IS_MAIN_BRANCH=t.RULE_CONDITION_NOT_RELEASE_COMMIT=t.RULE_CONDITION_RELEASE_COMMIT=t.RULE_CONDITION_MAIN_BRANCH=void 0;t.RULE_CONDITION_MAIN_BRANCH="$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";t.RULE_CONDITION_RELEASE_COMMIT="$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/";t.RULE_CONDITION_NOT_RELEASE_COMMIT="$CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/";t.RULE_IS_MAIN_BRANCH={if:t.RULE_CONDITION_MAIN_BRANCH};t.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT={if:t.RULE_CONDITION_MAIN_BRANCH+" && "+t.RULE_CONDITION_NOT_RELEASE_COMMIT};t.RULE_NEVER_ON_RELEASE_COMMIT={if:t.RULE_CONDITION_RELEASE_COMMIT,when:"never"};t.RULE_NEVER_ON_AGENT_TRIGGER={if:'$CI_PIPELINE_SOURCE == "trigger"',when:"never"};t.RULE_NEVER_ON_SCHEDULE={if:'$CI_PIPELINE_SOURCE == "schedule"',when:"never"};t.RULE_IS_MERGE_REQUEST={if:"$CI_MERGE_REQUEST_ID"};t.RULE_IS_TAGGED_RELEASE={if:"$CI_COMMIT_TAG"};t.RULE_CONDITION_HOTFIX_BRANCH="$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/"},2348:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRunnerImage=void 0;const n=a(3480);const getRunnerImage=e=>n.DOCKER_REGISTRY+"/"+e+":"+n.PIPELINE_IMAGE_TAG;t.getRunnerImage=getRunnerImage},2766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKnowEnvType=t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS=t.getEnvTypesByTrigger=t.ENV_TYPES=t.ALL_PIPELINE_TRIGGERS=void 0;t.ALL_PIPELINE_TRIGGERS=["mainBranch","mr","taggedRelease"];t.ENV_TYPES={dev:{triggers:["mainBranch"]},review:{triggers:["mr"]},stage:{triggers:["taggedRelease"]},prod:{triggers:["taggedRelease"]},local:{triggers:[]}};const getEnvTypesByTrigger=e=>Object.entries(t.ENV_TYPES).filter((([,t])=>t.triggers.includes(e))).map((([e])=>e));t.getEnvTypesByTrigger=getEnvTypesByTrigger;t.DEFAULT_ENVS=Object.keys(t.ENV_TYPES);t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS;const isKnowEnvType=e=>e in t.ENV_TYPES;t.isKnowEnvType=isKnowEnvType},3660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.componentContextHasWorkspaceBuild=t.componentContextIsStandaloneBuild=void 0;const componentContextIsStandaloneBuild=e=>e.build.type==="standalone";t.componentContextIsStandaloneBuild=componentContextIsStandaloneBuild;const componentContextHasWorkspaceBuild=e=>e.build.type==="fromWorkspace";t.componentContextHasWorkspaceBuild=componentContextHasWorkspaceBuild},3928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5063:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(6925),t);r(a(3928),t);r(a(3660),t);r(a(2349),t);r(a(7197),t);r(a(1507),t);r(a(2766),t)},2349:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1507:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_STAGES=void 0;t.BASE_STAGES=["setup","test","build","deploy","verify","agents","rollback","stop"]},7197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},3468:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.collapseableSection=t.repeatOnFailure=t.sanitizeForBashVariable=t.allowFailureInScripts=void 0;const n=a(3891);const allowFailureInScripts=e=>["set +e",...e,"set -e"];t.allowFailureInScripts=allowFailureInScripts;const sanitizeForBashVariable=e=>e.replace(/-/g,"_");t.sanitizeForBashVariable=sanitizeForBashVariable;const repeatOnFailure=(e,t)=>`\n until ${e}\n do\n echo "Trying again."\n sleep ${t.pauseInSeconds}\n done\n `;t.repeatOnFailure=repeatOnFailure;const r=(0,n.registerGlobalScriptFunction)("collapseable_section_start",`local section_title="\${1}"\n local section_description="\${2:-$section_title}"\n echo -e "section_start:\`date +%s\`:\${section_title}[collapsed=true]\\r\\e[0K\${section_description}"\n`);const i=(0,n.registerGlobalScriptFunction)("collapseable_section_end",`local section_title="\${1}"\n echo -e "section_end:\`date +%s\`:\${section_title}\\r\\e[0K"\n`);const collapseableSection=(e,t)=>a=>[r.invoke(`"${e}"`,`"${t}"`),...a,i.invoke(`"${e}"`)];t.collapseableSection=collapseableSection},595:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.mergeWithMergingArrays=t.ensureArray=t.ensureArrayOrNull=t.notNil=void 0;const n=a(9250);function notNil(e){return e!==null&&e!==undefined}t.notNil=notNil;const ensureArrayOrNull=e=>(0,n.isNil)(e)?null:Array.isArray(e)?e:[e];t.ensureArrayOrNull=ensureArrayOrNull;const ensureArray=e=>{var a;return(a=(0,t.ensureArrayOrNull)(e))!==null&&a!==void 0?a:[]};t.ensureArray=ensureArray;const mergeWithMergingArrays=(e,t)=>(0,n.mergeWith)({},e,t,((e,t)=>Array.isArray(e)&&Array.isArray(t)?[...e,...t]:undefined));t.mergeWithMergingArrays=mergeWithMergingArrays},502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.jsonParseOrThrow=void 0;const jsonParseOrThrow=e=>{try{return JSON.parse(e)}catch(t){throw new Error(`could not parse json: ${e}`)}};t.jsonParseOrThrow=jsonParseOrThrow},4195:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeUndefined=void 0;const removeUndefined=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>e!==undefined)));t.removeUndefined=removeUndefined},5585:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.FileWriter=t.yamlStringifyOptions=void 0;const n=a(1943);const r=a(6637);t.yamlStringifyOptions={lineWidth:0,doubleQuotedAsJSON:true,singleQuote:true};class FileWriter{static create(e){return new FileWriter(e)}constructor(e){this.config=e;this.config=e}async writeTheFile(e,t){var a,r;const i=await((r=(a=this.config.hooks)===null||a===void 0?void 0:a.transformFileBeforeWrite)===null||r===void 0?void 0:r.call(a,{...await this.getBaseHookContext(e),content:t}));await(0,n.writeFile)(e,i!==null&&i!==void 0?i:t,{encoding:"utf-8"})}async getBaseHookContext(e){var t,a;const n=(t=e.split("/").pop())!==null&&t!==void 0?t:"";return{filename:n,path:e,extension:(a=e.split(".").pop())!==null&&a!==void 0?a:""}}async writeGeneratedFile(e,t,a){await this.writeTheFile(e,[this.getAutoGeneratedHeader(a.commentChar),t].join("\n"))}async writeYamlfile(e,a){var n,i;const s=await((i=(n=this.config.hooks)===null||n===void 0?void 0:n.transformYamlBeforeWrite)===null||i===void 0?void 0:i.call(n,{...await this.getBaseHookContext(e),data:a}));return this.writeGeneratedFile(e,(0,r.stringify)(s!==null&&s!==void 0?s:a,t.yamlStringifyOptions),{commentChar:"#"})}getAutoGeneratedHeader(e){return["-------------------------------------------------",`🐱 🔨 This file is generated by catladder`,`🚨 Do not edit this file manually 🚨`,"-------------------------------------------------"].map((t=>`${e} ${t}`)).join("\n").concat("\n")}}t.FileWriter=FileWriter},250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},4396:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createVariableValueContainingReferencesFromString=t.VariableValueContainingReferences=t.VariableReference=t.UnresolvableReference=void 0;const n=a(5354);const r=a(8127);class UnresolvableReference{constructor(e){this.reference=e}toString(){return`Unresolvable reference: ${this.reference.toString()}`}}t.UnresolvableReference=UnresolvableReference;class VariableReference{constructor(e,t){this.componentName=e;this.variableName=t}toString(){return`\${${this.componentName}:${this.variableName}}`}}t.VariableReference=VariableReference;class VariableValueContainingReferences{constructor(e){this.parts=(Array.isArray(e)?e:[e]).flatMap((e=>e instanceof VariableValueContainingReferences?e.parts:e===""?[]:[e]))}toString(e={quotes:false}){return this.parts.map((t=>{if(typeof t==="string"){return(0,r.escapeString)(t,e)}else if(t instanceof n.BashExpression){return(0,r.escapeBashExpression)(t,e)}else{return t.toString()}})).join("")}}t.VariableValueContainingReferences=VariableValueContainingReferences;const i=/\$\{(([^:}]+):)?([^}]+)}/gm;const createVariableValueContainingReferencesFromString=(e,t)=>{const a=[];let n;let r=0;while((n=i.exec(e))!==null){const[s,o,p,l]=n;a.push(e.slice(r,n.index));a.push(new VariableReference(p||t.componentName,l));r=i.lastIndex}a.push(e.slice(r));return new VariableValueContainingReferences(a)};t.createVariableValueContainingReferencesFromString=createVariableValueContainingReferencesFromString},5598:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveAllReferences=void 0;const n=a(4396);const r=a(8843);const resolveAllReferences=async(e,t)=>{let a=e;let i=0;while(Object.values(a).some((e=>e.parts.some((e=>e instanceof n.VariableReference))))){const e=await(0,r.resolveAllReferencesOnce)(a,t);a=e;i++;if(i>1e3){const e=Object.entries(a).filter((([e,t])=>t.parts.some((e=>e instanceof n.VariableReference))));throw new Error("Infinite loop detected in these variables: "+e.map((([e,t])=>`${e} (last reference: ${t.parts.find((e=>e instanceof n.VariableReference))})`)).join(", "))}}return a};t.resolveAllReferences=resolveAllReferences},8843:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveAllReferencesOnce=void 0;const n=a(4396);const r=a(6080);const resolveAllReferencesOnce=async(e,t)=>{const a=Object.values(e).flatMap((e=>e===null||e===void 0?void 0:e.parts.filter((e=>e instanceof n.VariableReference))));const i=Array.from(new Set(a.map((e=>e.componentName))));const s=Object.fromEntries(await Promise.all(i.map((async e=>[e,await t(e)]))));return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,t!==null&&t!==undefined?(0,r.resolveReferencesOnce)(t,(({componentName:e,variableName:t})=>s[e][t])):t])))};t.resolveAllReferencesOnce=resolveAllReferencesOnce},6080:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveReferencesOnce=void 0;const n=a(4396);const resolveReferencesOnce=(e,t)=>{const a=e.parts.map((e=>{if(e instanceof n.VariableReference){const a=t({componentName:e.componentName,variableName:e.variableName});return a!==null&&a!==void 0?a:new n.UnresolvableReference(e)}else{return e}}));return new n.VariableValueContainingReferences(a)};t.resolveReferencesOnce=resolveReferencesOnce},1748:(e,t,a)=>{"use strict";if(a(7819).major>=4){e.exports=a(5232)}else{e.exports=a(930)}},9177:e=>{"use strict";function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var t=function(e){_inherits(ChildProcessError,e);function ChildProcessError(e,t,a,n,r){_classCallCheck(this,ChildProcessError);var i=_possibleConstructorReturn(this,(ChildProcessError.__proto__||Object.getPrototypeOf(ChildProcessError)).call(this,e));Error.captureStackTrace(i,i.constructor);i.name=i.constructor.name;i.code=t;i.childProcess=a;i.stdout=n;i.stderr=r;return i}return ChildProcessError}(Error);e.exports=t},1458:(e,t,a)=>{"use strict";var n=function(){function defineProperties(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}return function(e,t,a){if(t)defineProperties(e.prototype,t);if(a)defineProperties(e,a);return e}}();var r=function get(e,t,a){if(e===null)e=Function.prototype;var n=Object.getOwnPropertyDescriptor(e,t);if(n===undefined){var r=Object.getPrototypeOf(e);if(r===null){return undefined}else{return get(r,t,a)}}else if("value"in n){return n.value}else{var i=n.get;if(i===undefined){return undefined}return i.call(a)}};function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var i;if(a(7819).major>=4){i=global.Promise}else{i=a(3352)}var s=function(e){_inherits(ChildProcessPromise,e);function ChildProcessPromise(e){_classCallCheck(this,ChildProcessPromise);var t;var a;var n=_possibleConstructorReturn(this,(ChildProcessPromise.__proto__||Object.getPrototypeOf(ChildProcessPromise)).call(this,(function(n,r){t=n;a=r;if(e){e(t,a)}})));n._cpResolve=t;n._cpReject=a;n.childProcess=undefined;return n}n(ChildProcessPromise,[{key:"progress",value:function progress(e){var t=this;process.nextTick((function(){e(t.childProcess)}));return this}},{key:"then",value:function then(e,t){var a=r(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"then",this).call(this,e,t);a.childProcess=this.childProcess;return a}},{key:"catch",value:function _catch(e){var t=r(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"catch",this).call(this,e);t.childProcess=this.childProcess;return t}},{key:"done",value:function done(){this.catch((function(e){process.nextTick((function(){throw e}))}))}}]);return ChildProcessPromise}(i);s.prototype.fail=s.prototype.catch;e.exports=s},930:(e,t,a)=>{"use strict";var n=a(5317);var r=a(4782);var i=a(1458);var s=a(9177);var o=Array.prototype.slice;function doExec(e,t){var a;var r=new i;var p=r._cpReject;var l=r._cpResolve;var d=o.call(t,0);d.push(callback);a=n[e].apply(n,d);function callback(e,r,i){if(e){var o=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+o+"` (exited with error code "+e.code+")";e.stdout=r;e.stderr=i;var d=new s(e.message,e.code,n,r,i);p(d)}else{l({childProcess:a,stdout:r,stderr:i})}}r.childProcess=a;return r}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,a,n){var r={};var o;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=n&&n.successfulExitCodes||[0];o=e(t,a,n);var u=false;var f=false;var m=n&&n.capture;if(m){for(var h=0,v=m.length;h<v;h++){var g=m[h];if(g==="stdout"){u=true}else if(g==="stderr"){f=true}}}r.childProcess=o;if(u){r.stdout="";o.stdout.on("data",(function(e){r.stdout+=e}))}if(f){r.stderr="";o.stderr.on("data",(function(e){r.stderr+=e}))}o.on("error",l);o.on("close",(function(e){if(c.indexOf(e)===-1){var n=t+(a.length?" "+a.join(" "):"");var i="`"+n+"` failed with code "+e;var p=new s(i,e,o);if(f){p.stderr=r.stderr.toString()}if(u){p.stdout=r.stdout.toString()}l(p)}else{r.code=e;d(r)}}));p.childProcess=o;return p}function spawn(e,t,a){return doSpawn(r,e,t,a)}function fork(e,t,a){return doSpawn(n.fork,e,t,a)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},4019:e=>{"use strict";class ChildProcessError extends Error{constructor(e,t,a,n,r){super(e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=t;this.childProcess=a;this.stdout=n;this.stderr=r}}e.exports=ChildProcessError},6008:(e,t,a)=>{"use strict";var n;if(a(7819).major>=4){n=global.Promise}else{n=a(3352)}class ChildProcessPromise extends n{constructor(e){var t;var a;super(((n,r)=>{t=n;a=r;if(e){e(t,a)}}));this._cpResolve=t;this._cpReject=a;this.childProcess=undefined}progress(e){process.nextTick((()=>{e(this.childProcess)}));return this}then(e,t){var a=super.then(e,t);a.childProcess=this.childProcess;return a}catch(e){var t=super.catch(e);t.childProcess=this.childProcess;return t}done(){this.catch((e=>{process.nextTick((()=>{throw e}))}))}}ChildProcessPromise.prototype.fail=ChildProcessPromise.prototype.catch;e.exports=ChildProcessPromise},5232:(e,t,a)=>{"use strict";var n=a(5317);var r=a(4782);var i=a(6008);var s=a(4019);var o=Array.prototype.slice;function doExec(e,t){var a;var r=new i;var p=r._cpReject;var l=r._cpResolve;var d=o.call(t,0);d.push(callback);a=n[e].apply(n,d);function callback(e,r,i){if(e){var o=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+o+"` (exited with error code "+e.code+")";e.stdout=r;e.stderr=i;var d=new s(e.message,e.code,n,r,i);p(d)}else{l({childProcess:a,stdout:r,stderr:i})}}r.childProcess=a;return r}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,a,n){var r={};var o;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=n&&n.successfulExitCodes||[0];o=e(t,a,n);var u=false;var f=false;var m=n&&n.capture;if(m){for(var h=0,v=m.length;h<v;h++){var g=m[h];if(g==="stdout"){u=true}else if(g==="stderr"){f=true}}}r.childProcess=o;if(u){r.stdout="";o.stdout.on("data",(function(e){r.stdout+=e}))}if(f){r.stderr="";o.stderr.on("data",(function(e){r.stderr+=e}))}o.on("error",l);o.on("close",(function(e){if(c.indexOf(e)===-1){var n=t+(a.length?" "+a.join(" "):"");var i="`"+n+"` failed with code "+e;var p=new s(i,e,o);if(f){p.stderr=r.stderr.toString()}if(u){p.stdout=r.stdout.toString()}l(p)}else{r.code=e;d(r)}}));p.childProcess=o;return p}function spawn(e,t,a){return doSpawn(r,e,t,a)}function fork(e,t,a){return doSpawn(n.fork,e,t,a)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},4782:(e,t,a)=>{"use strict";var n=a(5317);var r=a(5057);var i=a(2097);var s=n.spawnSync;function spawn(e,t,a){var s;var o;s=r(e,t,a);o=n.spawn(s.command,s.args,s.options);i.hookChildProcess(o,s);return o}function spawnSync(e,t,n){var o;var p;if(!s){try{s=a(4584)}catch(e){throw new Error("In order to use spawnSync on node 0.10 or older, you must "+"install spawn-sync:\n\n"+" npm install spawn-sync --save")}}o=r(e,t,n);p=s(o.command,o.args,o.options);p.error=p.error||i.verifyENOENTSync(p.status,o);return p}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=r;e.exports._enoent=i},2097:(e,t,a)=>{"use strict";var n=process.platform==="win32";var r=a(173);var i=process.version.indexOf("v0.10.")===0;function notFoundError(e,t){var a;a=new Error(t+" "+e+" ENOENT");a.code=a.errno="ENOENT";a.syscall=t+" "+e;return a}function hookChildProcess(e,t){var a;if(!n){return}a=e.emit;e.emit=function(n,r){var i;if(n==="exit"){i=verifyENOENT(r,t,"spawn");if(i){return a.call(e,"error",i)}}return a.apply(e,arguments)}}function verifyENOENT(e,t){if(n&&e===1&&!t.file){return notFoundError(t.original,"spawn")}return null}function verifyENOENTSync(e,t){if(n&&e===1&&!t.file){return notFoundError(t.original,"spawnSync")}if(i&&e===-1){t.file=n?t.file:r(t.original);if(!t.file){return notFoundError(t.original,"spawnSync")}}return null}e.exports.hookChildProcess=hookChildProcess;e.exports.verifyENOENT=verifyENOENT;e.exports.verifyENOENTSync=verifyENOENTSync;e.exports.notFoundError=notFoundError},176:e=>{"use strict";e.exports=function(){if(process.platform!=="win32"){return false}var e=process.version.substr(1).split(".").map((function(e){return parseInt(e,10)}));return e[0]===0&&e[1]<12}()},5057:(e,t,a)=>{"use strict";var n=a(9896);var r=a(166);var i=a(173);var s=a(176);var o=process.platform==="win32";var p=new r({max:50,maxAge:30*1e3});function readShebang(e){var t;var a;var r;var i;if(p.has(e)){return p.get(e)}t=new Buffer(150);try{a=n.openSync(e,"r");n.readSync(a,t,0,150,0);n.closeSync(a)}catch(e){}r=t.toString().trim().match(/#!(.+)/i);if(r){i=r[1].replace(/\/usr\/bin\/env\s+/i,"")}p.set(e,i);return i}function escapeArg(e,t){e=""+e;if(!t){e=e.replace(/([\(\)%!\^<>&|;,"'\s])/g,"^$1")}else{e=e.replace(/(\\*)"/g,'$1$1\\"');e=e.replace(/(\\*)$/,"$1$1");e='"'+e+'"'}return e}function escapeCommand(e){return/^[a-z0-9_-]+$/i.test(e)?e:escapeArg(e,true)}function requiresShell(e){return!/\.(?:com|exe)$/i.test(e)}function parse(e,t,a){var n;var r;var p;var l;var d;if(t&&!Array.isArray(t)){a=t;t=null}t=t?t.slice(0):[];a=a||{};l=e;if(o){p=i(e);p=p||i(e,true);n=p&&readShebang(p);d=a.shell||s;if(n){t.unshift(p);e=n;d=d||requiresShell(i(n)||i(n,true))}else{d=d||requiresShell(p)}if(d){r=e!=="echo";e=escapeCommand(e);t=t.map((function(e){return escapeArg(e,r)}));t=["/s","/c",'"'+e+(t.length?" "+t.join(" "):"")+'"'];e=process.env.comspec||"cmd.exe";a.windowsVerbatimArguments=true}}return{command:e,args:t,options:a,file:p,original:l}}e.exports=parse},173:(e,t,a)=>{"use strict";var n=a(6928);var r=a(2788);var i=a(166);var s=new i({max:50,maxAge:30*1e3});function resolveCommand(e,t){var a;t=!!t;a=s.get(e+"!"+t);if(s.has(e)){return s.get(e)}try{a=!t?r.sync(e):r.sync(e,{pathExt:n.delimiter+(process.env.PATHEXT||"")})}catch(e){}s.set(e+"!"+t,a);return a}e.exports=resolveCommand},166:(e,t,a)=>{"use strict";e.exports=LRUCache;var n=a(9100);var r=a(9023);var i=a(7516);var s=typeof Symbol==="function"&&process.env._nodeLRUCacheForceNoSymbol!=="1";var o;if(s){o=function(e){return Symbol(e)}}else{o=function(e){return"_"+e}}var p=o("max");var l=o("length");var d=o("lengthCalculator");var c=o("allowStale");var u=o("maxAge");var f=o("dispose");var m=o("noDisposeOnSet");var h=o("lruList");var v=o("cache");function naiveLength(){return 1}function LRUCache(e){if(!(this instanceof LRUCache)){return new LRUCache(e)}if(typeof e==="number"){e={max:e}}if(!e){e={}}var t=this[p]=e.max;if(!t||!(typeof t==="number")||t<=0){this[p]=Infinity}var a=e.length||naiveLength;if(typeof a!=="function"){a=naiveLength}this[d]=a;this[c]=e.stale||false;this[u]=e.maxAge||0;this[f]=e.dispose;this[m]=e.noDisposeOnSet||false;this.reset()}Object.defineProperty(LRUCache.prototype,"max",{set:function(e){if(!e||!(typeof e==="number")||e<=0){e=Infinity}this[p]=e;trim(this)},get:function(){return this[p]},enumerable:true});Object.defineProperty(LRUCache.prototype,"allowStale",{set:function(e){this[c]=!!e},get:function(){return this[c]},enumerable:true});Object.defineProperty(LRUCache.prototype,"maxAge",{set:function(e){if(!e||!(typeof e==="number")||e<0){e=0}this[u]=e;trim(this)},get:function(){return this[u]},enumerable:true});Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(e){if(typeof e!=="function"){e=naiveLength}if(e!==this[d]){this[d]=e;this[l]=0;this[h].forEach((function(e){e.length=this[d](e.value,e.key);this[l]+=e.length}),this)}trim(this)},get:function(){return this[d]},enumerable:true});Object.defineProperty(LRUCache.prototype,"length",{get:function(){return this[l]},enumerable:true});Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return this[h].length},enumerable:true});LRUCache.prototype.rforEach=function(e,t){t=t||this;for(var a=this[h].tail;a!==null;){var n=a.prev;forEachStep(this,e,a,t);a=n}};function forEachStep(e,t,a,n){var r=a.value;if(isStale(e,r)){del(e,a);if(!e[c]){r=undefined}}if(r){t.call(n,r.value,r.key,e)}}LRUCache.prototype.forEach=function(e,t){t=t||this;for(var a=this[h].head;a!==null;){var n=a.next;forEachStep(this,e,a,t);a=n}};LRUCache.prototype.keys=function(){return this[h].toArray().map((function(e){return e.key}),this)};LRUCache.prototype.values=function(){return this[h].toArray().map((function(e){return e.value}),this)};LRUCache.prototype.reset=function(){if(this[f]&&this[h]&&this[h].length){this[h].forEach((function(e){this[f](e.key,e.value)}),this)}this[v]=new n;this[h]=new i;this[l]=0};LRUCache.prototype.dump=function(){return this[h].map((function(e){if(!isStale(this,e)){return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}}}),this).toArray().filter((function(e){return e}))};LRUCache.prototype.dumpLru=function(){return this[h]};LRUCache.prototype.inspect=function(e,t){var a="LRUCache {";var n=false;var i=this[c];if(i){a+="\n allowStale: true";n=true}var s=this[p];if(s&&s!==Infinity){if(n){a+=","}a+="\n max: "+r.inspect(s,t);n=true}var o=this[u];if(o){if(n){a+=","}a+="\n maxAge: "+r.inspect(o,t);n=true}var f=this[d];if(f&&f!==naiveLength){if(n){a+=","}a+="\n length: "+r.inspect(this[l],t);n=true}var m=false;this[h].forEach((function(e){if(m){a+=",\n "}else{if(n){a+=",\n"}m=true;a+="\n "}var i=r.inspect(e.key).split("\n").join("\n ");var s={value:e.value};if(e.maxAge!==o){s.maxAge=e.maxAge}if(f!==naiveLength){s.length=e.length}if(isStale(this,e)){s.stale=true}s=r.inspect(s,t).split("\n").join("\n ");a+=i+" => "+s}));if(m||n){a+="\n"}a+="}";return a};LRUCache.prototype.set=function(e,t,a){a=a||this[u];var n=a?Date.now():0;var r=this[d](t,e);if(this[v].has(e)){if(r>this[p]){del(this,this[v].get(e));return false}var i=this[v].get(e);var s=i.value;if(this[f]){if(!this[m]){this[f](e,s.value)}}s.now=n;s.maxAge=a;s.value=t;this[l]+=r-s.length;s.length=r;this.get(e);trim(this);return true}var o=new Entry(e,t,r,n,a);if(o.length>this[p]){if(this[f]){this[f](e,t)}return false}this[l]+=o.length;this[h].unshift(o);this[v].set(e,this[h].head);trim(this);return true};LRUCache.prototype.has=function(e){if(!this[v].has(e))return false;var t=this[v].get(e).value;if(isStale(this,t)){return false}return true};LRUCache.prototype.get=function(e){return get(this,e,true)};LRUCache.prototype.peek=function(e){return get(this,e,false)};LRUCache.prototype.pop=function(){var e=this[h].tail;if(!e)return null;del(this,e);return e.value};LRUCache.prototype.del=function(e){del(this,this[v].get(e))};LRUCache.prototype.load=function(e){this.reset();var t=Date.now();for(var a=e.length-1;a>=0;a--){var n=e[a];var r=n.e||0;if(r===0){this.set(n.k,n.v)}else{var i=r-t;if(i>0){this.set(n.k,n.v,i)}}}};LRUCache.prototype.prune=function(){var e=this;this[v].forEach((function(t,a){get(e,a,false)}))};function get(e,t,a){var n=e[v].get(t);if(n){var r=n.value;if(isStale(e,r)){del(e,n);if(!e[c])r=undefined}else{if(a){e[h].unshiftNode(n)}}if(r)r=r.value}return r}function isStale(e,t){if(!t||!t.maxAge&&!e[u]){return false}var a=false;var n=Date.now()-t.now;if(t.maxAge){a=n>t.maxAge}else{a=e[u]&&n>e[u]}return a}function trim(e){if(e[l]>e[p]){for(var t=e[h].tail;e[l]>e[p]&&t!==null;){var a=t.prev;del(e,t);t=a}}}function del(e,t){if(t){var a=t.value;if(e[f]){e[f](a.key,a.value)}e[l]-=a.length;e[v].delete(a.key);e[h].removeNode(t)}}function Entry(e,t,a,n,r){this.key=e;this.value=t;this.length=a;this.now=n;this.maxAge=r||0}},2788:(e,t,a)=>{e.exports=which;which.sync=whichSync;var n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";var r=a(6928);var i=n?";":":";var s=a(8026);function getNotFoundError(e){var t=new Error("not found: "+e);t.code="ENOENT";return t}function getPathInfo(e,t){var a=t.colon||i;var r=t.path||process.env.PATH||"";var s=[""];r=r.split(a);var o="";if(n){r.unshift(process.cwd());o=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM";s=o.split(a);if(e.indexOf(".")!==-1&&s[0]!=="")s.unshift("")}if(e.match(/\//)||n&&e.match(/\\/))r=[""];return{env:r,ext:s,extExe:o}}function which(e,t,a){if(typeof t==="function"){a=t;t={}}var n=getPathInfo(e,t);var i=n.env;var o=n.ext;var p=n.extExe;var l=[];(function F(n,d){if(n===d){if(t.all&&l.length)return a(null,l);else return a(getNotFoundError(e))}var c=i[n];if(c.charAt(0)==='"'&&c.slice(-1)==='"')c=c.slice(1,-1);var u=r.join(c,e);if(!c&&/^\.[\\\/]/.test(e)){u=e.slice(0,2)+u}(function E(e,r){if(e===r)return F(n+1,d);var i=o[e];s(u+i,{pathExt:p},(function(n,s){if(!n&&s){if(t.all)l.push(u+i);else return a(null,u+i)}return E(e+1,r)}))})(0,o.length)})(0,i.length)}function whichSync(e,t){t=t||{};var a=getPathInfo(e,t);var n=a.env;var i=a.ext;var o=a.extExe;var p=[];for(var l=0,d=n.length;l<d;l++){var c=n[l];if(c.charAt(0)==='"'&&c.slice(-1)==='"')c=c.slice(1,-1);var u=r.join(c,e);if(!c&&/^\.[\\\/]/.test(e)){u=e.slice(0,2)+u}for(var f=0,m=i.length;f<m;f++){var h=u+i[f];var v;try{v=s.sync(h,{pathExt:o});if(v){if(t.all)p.push(h);else return h}}catch(e){}}}if(t.all&&p.length)return p;if(t.nothrow)return null;throw getNotFoundError(e)}},7516:e=>{e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var a=0,n=arguments.length;a<n;a++){t.push(arguments[a])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var a=e.prev;if(t){t.prev=a}if(a){a.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=a}e.list.length--;e.next=null;e.prev=null;e.list=null};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var a=this.head,n=0;a!==null;n++){e.call(t,a.value,n,this);a=a.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var a=this.tail,n=this.length-1;a!==null;n--){e.call(t,a.value,n,this);a=a.prev}};Yallist.prototype.get=function(e){for(var t=0,a=this.head;a!==null&&t<e;t++){a=a.next}if(t===e&&a!==null){return a.value}};Yallist.prototype.getReverse=function(e){for(var t=0,a=this.tail;a!==null&&t<e;t++){a=a.prev}if(t===e&&a!==null){return a.value}};Yallist.prototype.map=function(e,t){t=t||this;var a=new Yallist;for(var n=this.head;n!==null;){a.push(e.call(t,n.value,this));n=n.next}return a};Yallist.prototype.mapReverse=function(e,t){t=t||this;var a=new Yallist;for(var n=this.tail;n!==null;){a.push(e.call(t,n.value,this));n=n.prev}return a};Yallist.prototype.reduce=function(e,t){var a;var n=this.head;if(arguments.length>1){a=t}else if(this.head){n=this.head.next;a=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=0;n!==null;r++){a=e(a,n.value,r);n=n.next}return a};Yallist.prototype.reduceReverse=function(e,t){var a;var n=this.tail;if(arguments.length>1){a=t}else if(this.tail){n=this.tail.prev;a=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=this.length-1;n!==null;r--){a=e(a,n.value,r);n=n.prev}return a};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,a=this.head;a!==null;t++){e[t]=a.value;a=a.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,a=this.tail;a!==null;t++){e[t]=a.value;a=a.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var a=new Yallist;if(t<e||t<0){return a}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=0,r=this.head;r!==null&&n<e;n++){r=r.next}for(;r!==null&&n<t;n++,r=r.next){a.push(r.value)}return a};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var a=new Yallist;if(t<e||t<0){return a}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=this.length,r=this.tail;r!==null&&n>t;n--){r=r.prev}for(;r!==null&&n>e;n--,r=r.prev){a.push(r.value)}return a};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var a=e;a!==null;a=a.prev){var n=a.prev;a.prev=a.next;a.next=n}this.head=t;this.tail=e;return this};function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,a,n){if(!(this instanceof Node)){return new Node(e,t,a,n)}this.list=n;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(a){a.prev=this;this.next=a}else{this.next=null}}},90:(e,t,a)=>{"use strict";var n=a(9358),r=a(9214),i=a(6377),s=a(9707),o=a(6905);var p=e.exports=function(e,t){var a,r,p,l,d;if(arguments.length<2||typeof e!=="string"){l=t;t=e;e=null}else{l=arguments[2]}if(n(e)){a=o.call(e,"c");r=o.call(e,"e");p=o.call(e,"w")}else{a=p=true;r=false}d={value:t,configurable:a,enumerable:r,writable:p};return!l?d:i(s(l),d)};p.gs=function(e,t,a){var p,l,d,c;if(typeof e!=="string"){d=a;a=t;t=e;e=null}else{d=arguments[3]}if(!n(t)){t=undefined}else if(!r(t)){d=t;t=a=undefined}else if(!n(a)){a=undefined}else if(!r(a)){d=a;a=undefined}if(n(e)){p=o.call(e,"c");l=o.call(e,"e")}else{p=true;l=false}c={get:t,set:a,configurable:p,enumerable:l};return!d?c:i(s(d),c)}},2116:e=>{"use strict";e.exports=(e,t,a)=>{const define=a=>Object.defineProperty(e,t,{value:a,enumerable:true,writable:true});Object.defineProperty(e,t,{configurable:true,enumerable:true,get(){const e=a();define(e);return e},set(e){define(e)}});return e}},9926:(e,t,a)=>{"use strict";var n=a(8538);e.exports.C=convert;function convert(e,t,a){a=checkEncoding(a||"UTF-8");t=checkEncoding(t||"UTF-8");e=e||"";var n;if(a!=="UTF-8"&&typeof e==="string"){e=Buffer.from(e,"binary")}if(a===t){if(typeof e==="string"){n=Buffer.from(e)}else{n=e}}else{try{n=convertIconvLite(e,t,a)}catch(t){console.error(t);n=e}}if(typeof n==="string"){n=Buffer.from(n,"utf-8")}return n}function convertIconvLite(e,t,a){if(t==="UTF-8"){return n.decode(e,a)}else if(a==="UTF-8"){return n.encode(e,t)}else{return n.encode(n.decode(e,a),t)}}function checkEncoding(e){return(e||"").toString().trim().replace(/^latin[\-_]?(\d+)$/i,"ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i,"WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i,"UTF-$1").replace(/^ks_c_5601\-1987$/i,"CP949").replace(/^us[\-_]?ascii$/i,"ASCII").toUpperCase()}},2907:(e,t,a)=>{"use strict";var n=a(6546),r=a(6648),i=a(6349),s=Array.prototype.indexOf,o=Object.prototype.hasOwnProperty,p=Math.abs,l=Math.floor;e.exports=function(e){var t,a,d,c;if(!n(e))return s.apply(this,arguments);a=r(i(this).length);d=arguments[1];if(isNaN(d))d=0;else if(d>=0)d=l(d);else d=r(this.length)-l(p(d));for(t=d;t<a;++t){if(o.call(this,t)){c=this[t];if(n(c))return t}}return-1}},7998:(e,t,a)=>{"use strict";e.exports=a(8853)()?Array.from:a(8857)},8853:e=>{"use strict";e.exports=function(){var e=Array.from,t,a;if(typeof e!=="function")return false;t=["raz","dwa"];a=e(t);return Boolean(a&&a!==t&&a[1]==="dwa")}},8857:(e,t,a)=>{"use strict";var n=a(6219).iterator,r=a(9131),i=a(7743),s=a(6648),o=a(5370),p=a(6349),l=a(6163),d=a(2707),c=Array.isArray,u=Function.prototype.call,f={configurable:true,enumerable:true,writable:true,value:null},m=Object.defineProperty;e.exports=function(e){var t=arguments[1],a=arguments[2],h,v,g,y,b,w,_,S,N,C;e=Object(p(e));if(l(t))o(t);if(!this||this===Array||!i(this)){if(!t){if(r(e)){b=e.length;if(b!==1)return Array.apply(null,e);y=new Array(1);y[0]=e[0];return y}if(c(e)){y=new Array(b=e.length);for(v=0;v<b;++v)y[v]=e[v];return y}}y=[]}else{h=this}if(!c(e)){if((N=e[n])!==undefined){_=o(N).call(e);if(h)y=new h;S=_.next();v=0;while(!S.done){C=t?u.call(t,a,S.value,v):S.value;if(h){f.value=C;m(y,v,f)}else{y[v]=C}S=_.next();++v}b=v}else if(d(e)){b=e.length;if(h)y=new h;for(v=0,g=0;v<b;++v){C=e[v];if(v+1<b){w=C.charCodeAt(0);if(w>=55296&&w<=56319)C+=e[++v]}C=t?u.call(t,a,C,g):C;if(h){f.value=C;m(y,g,f)}else{y[g]=C}++g}b=g}}if(b===undefined){b=s(e.length);if(h)y=new h(b);for(v=0;v<b;++v){C=t?u.call(t,a,e[v],v):e[v];if(h){f.value=C;m(y,v,f)}else{y[v]=C}}}if(h){f.value=null;y.length=b}return y}},2984:(e,t,a)=>{"use strict";var n=a(7998),r=Array.isArray;e.exports=function(e){return r(e)?e:n(e)}},7775:(e,t,a)=>{"use strict";var n=a(6377),r=a(3115),i=a(6163),s=Error.captureStackTrace;e.exports=function(t){var a=new Error(t),o=arguments[1],p=arguments[2];if(!i(p)){if(r(o)){p=o;o=null}}if(i(p))n(a,p);if(i(o))a.code=o;if(s)s(a,e.exports);return a}},7447:(e,t,a)=>{"use strict";var n=a(6648);var test=function(e,t){return t};var r,i,s,o;try{Object.defineProperty(test,"length",{configurable:true,writable:false,enumerable:false,value:1})}catch(e){}if(test.length===1){r={configurable:true,writable:false,enumerable:false};i=Object.defineProperty;e.exports=function(e,t){t=n(t);if(e.length===t)return e;r.value=t;return i(e,"length",r)}}else{o=a(6554);s=function(){var e=[];return function(t){var a,n=0;if(e[t])return e[t];a=[];while(t--)a.push("a"+(++n).toString(36));return new Function("fn","return function ("+a.join(", ")+") { return fn.apply(this, arguments); };")}}();e.exports=function(e,t){var a;t=n(t);if(e.length===t)return e;a=s(t)(e);try{o(a,e)}catch(e){}return a}}},9131:e=>{"use strict";var t=Object.prototype.toString,a=t.call(function(){return arguments}());e.exports=function(e){return t.call(e)===a}},7743:e=>{"use strict";var t=Object.prototype.toString,a=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return typeof e==="function"&&a(t.call(e))}},9334:e=>{"use strict";e.exports=function(){}},9618:(e,t,a)=>{"use strict";e.exports=a(1769)()?Math.sign:a(8021)},1769:e=>{"use strict";e.exports=function(){var e=Math.sign;if(typeof e!=="function")return false;return e(10)===1&&e(-20)===-1}},8021:e=>{"use strict";e.exports=function(e){e=Number(e);if(isNaN(e)||e===0)return e;return e>0?1:-1}},6546:(e,t,a)=>{"use strict";e.exports=a(1273)()?Number.isNaN:a(4373)},1273:e=>{"use strict";e.exports=function(){var e=Number.isNaN;if(typeof e!=="function")return false;return!e({})&&e(NaN)&&!e(34)}},4373:e=>{"use strict";e.exports=function(e){return e!==e}},3247:(e,t,a)=>{"use strict";var n=a(9618),r=Math.abs,i=Math.floor;e.exports=function(e){if(isNaN(e))return 0;e=Number(e);if(e===0||!isFinite(e))return e;return n(e)*i(r(e))}},6648:(e,t,a)=>{"use strict";var n=a(3247),r=Math.max;e.exports=function(e){return r(0,n(e))}},8486:(e,t,a)=>{"use strict";var n=a(5370),r=a(6349),i=Function.prototype.bind,s=Function.prototype.call,o=Object.keys,p=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(a,l){var d,c=arguments[2],u=arguments[3];a=Object(r(a));n(l);d=o(a);if(u){d.sort(typeof u==="function"?i.call(u,a):undefined)}if(typeof e!=="function")e=d[e];return s.call(e,d,(function(e,n){if(!p.call(a,e))return t;return s.call(l,c,a[e],e,a,n)}))}}},6377:(e,t,a)=>{"use strict";e.exports=a(2144)()?Object.assign:a(5404)},2144:e=>{"use strict";e.exports=function(){var e=Object.assign,t;if(typeof e!=="function")return false;t={foo:"raz"};e(t,{bar:"dwa"},{trzy:"trzy"});return t.foo+t.bar+t.trzy==="razdwatrzy"}},5404:(e,t,a)=>{"use strict";var n=a(6300),r=a(6349),i=Math.max;e.exports=function(e,t){var a,s,o=i(arguments.length,2),p;e=Object(r(e));p=function(n){try{e[n]=t[n]}catch(e){if(!a)a=e}};for(s=1;s<o;++s){t=arguments[s];n(t).forEach(p)}if(a!==undefined)throw a;return e}},7904:(e,t,a)=>{"use strict";e.exports=a(8486)("forEach")},3152:e=>{"use strict";e.exports=function(e){return typeof e==="function"}},3115:(e,t,a)=>{"use strict";var n=a(6163);var r={function:true,object:true};e.exports=function(e){return n(e)&&r[typeof e]||false}},6163:(e,t,a)=>{"use strict";var n=a(9334)();e.exports=function(e){return e!==n&&e!==null}},6300:(e,t,a)=>{"use strict";e.exports=a(1235)()?Object.keys:a(8659)},1235:e=>{"use strict";e.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},8659:(e,t,a)=>{"use strict";var n=a(6163);var r=Object.keys;e.exports=function(e){return r(n(e)?Object(e):e)}},2929:(e,t,a)=>{"use strict";var n=a(5370),r=a(7904),i=Function.prototype.call;e.exports=function(e,t){var a={},s=arguments[2];n(t);r(e,(function(e,n,r,o){a[n]=i.call(t,s,e,n,r,o)}));return a}},6554:(e,t,a)=>{"use strict";var n=a(6349),r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols;e.exports=function(e,t){var a,p=Object(n(t));e=Object(n(e));s(p).forEach((function(n){try{r(e,n,i(t,n))}catch(e){a=e}}));if(typeof o==="function"){o(p).forEach((function(n){try{r(e,n,i(t,n))}catch(e){a=e}}))}if(a!==undefined)throw a;return e}},9707:(e,t,a)=>{"use strict";var n=a(6163);var r=Array.prototype.forEach,i=Object.create;var process=function(e,t){var a;for(a in e)t[a]=e[a]};e.exports=function(e){var t=i(null);r.call(arguments,(function(e){if(!n(e))return;process(Object(e),t)}));return t}},4579:e=>{"use strict";var t=Array.prototype.forEach,a=Object.create;e.exports=function(e){var n=a(null);t.call(arguments,(function(e){n[e]=true}));return n}},5370:e=>{"use strict";e.exports=function(e){if(typeof e!=="function")throw new TypeError(e+" is not a function");return e}},6349:(e,t,a)=>{"use strict";var n=a(6163);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},9861:(e,t,a)=>{"use strict";var n=a(6349),r=a(8013);e.exports=function(e){return r(n(e))}},8013:(e,t,a)=>{"use strict";var n=a(3152);e.exports=function(e){try{if(e&&n(e.toString))return e.toString();return String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},9110:(e,t,a)=>{"use strict";var n=a(3152);e.exports=function(e){try{if(e&&n(e.toString))return e.toString();return String(e)}catch(e){return"<Non-coercible to string value>"}}},6905:(e,t,a)=>{"use strict";e.exports=a(528)()?String.prototype.contains:a(588)},528:e=>{"use strict";var t="razdwatrzy";e.exports=function(){if(typeof t.contains!=="function")return false;return t.contains("dwa")===true&&t.contains("foo")===false}},588:e=>{"use strict";var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},2707:e=>{"use strict";var t=Object.prototype.toString,a=t.call("");e.exports=function(e){return typeof e==="string"||e&&typeof e==="object"&&(e instanceof String||t.call(e)===a)||false}},4625:(e,t,a)=>{"use strict";var n=a(9110);var r=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=n(e);if(t.length>100)t=t.slice(0,99)+"…";t=t.replace(r,(function(e){return JSON.stringify(e).slice(1,-1)}));return t}},6219:(e,t,a)=>{"use strict";e.exports=a(9506)()?a(1328).Symbol:a(8696)},9506:(e,t,a)=>{"use strict";var n=a(1328),r={object:true,symbol:true};e.exports=function(){var e=n.Symbol;var t;if(typeof e!=="function")return false;t=e("test symbol");try{String(t)}catch(e){return false}if(!r[typeof e.iterator])return false;if(!r[typeof e.toPrimitive])return false;if(!r[typeof e.toStringTag])return false;return true}},5764:e=>{"use strict";e.exports=function(e){if(!e)return false;if(typeof e==="symbol")return true;if(!e.constructor)return false;if(e.constructor.name!=="Symbol")return false;return e[e.constructor.toStringTag]==="Symbol"}},7138:(e,t,a)=>{"use strict";var n=a(90);var r=Object.create,i=Object.defineProperty,s=Object.prototype;var o=r(null);e.exports=function(e){var t=0,a,r;while(o[e+(t||"")])++t;e+=t||"";o[e]=true;a="@@"+e;i(s,a,n.gs(null,(function(e){if(r)return;r=true;i(this,a,n(e));r=false})));return a}},9320:(e,t,a)=>{"use strict";var n=a(90),r=a(1328).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:n("",r&&r.hasInstance||e("hasInstance")),isConcatSpreadable:n("",r&&r.isConcatSpreadable||e("isConcatSpreadable")),iterator:n("",r&&r.iterator||e("iterator")),match:n("",r&&r.match||e("match")),replace:n("",r&&r.replace||e("replace")),search:n("",r&&r.search||e("search")),species:n("",r&&r.species||e("species")),split:n("",r&&r.split||e("split")),toPrimitive:n("",r&&r.toPrimitive||e("toPrimitive")),toStringTag:n("",r&&r.toStringTag||e("toStringTag")),unscopables:n("",r&&r.unscopables||e("unscopables"))})}},2777:(e,t,a)=>{"use strict";var n=a(90),r=a(5358);var i=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:n((function(t){if(i[t])return i[t];return i[t]=e(String(t))})),keyFor:n((function(e){var t;r(e);for(t in i){if(i[t]===e)return t}return undefined}))})}},8696:(e,t,a)=>{"use strict";var n=a(90),r=a(5358),i=a(1328).Symbol,s=a(7138),o=a(9320),p=a(2777);var l=Object.create,d=Object.defineProperties,c=Object.defineProperty;var u,f,m;if(typeof i==="function"){try{String(i());m=true}catch(e){}}else{i=null}f=function Symbol(e){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return u(e)};e.exports=u=function Symbol(e){var t;if(this instanceof Symbol)throw new TypeError("Symbol is not a constructor");if(m)return i(e);t=l(f.prototype);e=e===undefined?"":String(e);return d(t,{__description__:n("",e),__name__:n("",s(e))})};o(u);p(u);d(f.prototype,{constructor:n(u),toString:n("",(function(){return this.__name__}))});d(u.prototype,{toString:n((function(){return"Symbol ("+r(this).__description__+")"})),valueOf:n((function(){return r(this)}))});c(u.prototype,u.toPrimitive,n("",(function(){var e=r(this);if(typeof e==="symbol")return e;return e.toString()})));c(u.prototype,u.toStringTag,n("c","Symbol"));c(f.prototype,u.toStringTag,n("c",u.prototype[u.toStringTag]));c(f.prototype,u.toPrimitive,n("c",u.prototype[u.toPrimitive]))},5358:(e,t,a)=>{"use strict";var n=a(5764);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}},7045:(e,t,a)=>{"use strict";var n=a(90),r=a(5370),i=Function.prototype.apply,s=Function.prototype.call,o=Object.create,p=Object.defineProperty,l=Object.defineProperties,d=Object.prototype.hasOwnProperty,c={configurable:true,enumerable:false,writable:true},u,f,m,h,v,g,y;u=function(e,t){var a;r(t);if(!d.call(this,"__ee__")){a=c.value=o(null);p(this,"__ee__",c);c.value=null}else{a=this.__ee__}if(!a[e])a[e]=t;else if(typeof a[e]==="object")a[e].push(t);else a[e]=[a[e],t];return this};f=function(e,t){var a,n;r(t);n=this;u.call(this,e,a=function(){m.call(n,e,a);i.call(t,this,arguments)});a.__eeOnceListener__=t;return this};m=function(e,t){var a,n,i,s;r(t);if(!d.call(this,"__ee__"))return this;a=this.__ee__;if(!a[e])return this;n=a[e];if(typeof n==="object"){for(s=0;i=n[s];++s){if(i===t||i.__eeOnceListener__===t){if(n.length===2)a[e]=n[s?0:1];else n.splice(s,1)}}}else{if(n===t||n.__eeOnceListener__===t){delete a[e]}}return this};h=function(e){var t,a,n,r,o;if(!d.call(this,"__ee__"))return;r=this.__ee__[e];if(!r)return;if(typeof r==="object"){a=arguments.length;o=new Array(a-1);for(t=1;t<a;++t)o[t-1]=arguments[t];r=r.slice();for(t=0;n=r[t];++t){i.call(n,this,o)}}else{switch(arguments.length){case 1:s.call(r,this);break;case 2:s.call(r,this,arguments[1]);break;case 3:s.call(r,this,arguments[1],arguments[2]);break;default:a=arguments.length;o=new Array(a-1);for(t=1;t<a;++t){o[t-1]=arguments[t]}i.call(r,this,o)}}};v={on:u,once:f,off:m,emit:h};g={on:n(u),once:n(f),off:n(m),emit:n(h)};y=l({},g);e.exports=t=function(e){return e==null?o(y):l(Object(e),g)};t.methods=v},5588:e=>{var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}()},1328:(e,t,a)=>{"use strict";e.exports=a(4359)()?globalThis:a(5588)},4359:e=>{"use strict";e.exports=function(){if(typeof globalThis!=="object")return false;if(!globalThis)return false;return globalThis.Array===Array}},2457:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(1063).mkdirsSync;const s=a(4668).utimesMillisSync;const o=Symbol("notExist");function copySync(e,t,a){if(typeof a==="function"){a={filter:a}}a=a||{};a.clobber="clobber"in a?!!a.clobber:true;a.overwrite="overwrite"in a?!!a.overwrite:a.clobber;if(a.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}const s=checkPaths(e,t);if(a.filter&&!a.filter(e,t))return;const o=r.dirname(t);if(!n.existsSync(o))i(o);return startCopy(s,e,t,a)}function startCopy(e,t,a,n){if(n.filter&&!n.filter(t,a))return;return getStats(e,t,a,n)}function getStats(e,t,a,r){const i=r.dereference?n.statSync:n.lstatSync;const s=i(t);if(s.isDirectory())return onDir(s,e,t,a,r);else if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return onFile(s,e,t,a,r);else if(s.isSymbolicLink())return onLink(e,t,a,r)}function onFile(e,t,a,n,r){if(t===o)return copyFile(e,a,n,r);return mayCopyFile(e,a,n,r)}function mayCopyFile(e,t,a,r){if(r.overwrite){n.unlinkSync(a);return copyFile(e,t,a,r)}else if(r.errorOnExist){throw new Error(`'${a}' already exists`)}}function copyFile(e,t,a,r){if(typeof n.copyFileSync==="function"){n.copyFileSync(t,a);n.chmodSync(a,e.mode);if(r.preserveTimestamps){return s(a,e.atime,e.mtime)}return}return copyFileFallback(e,t,a,r)}function copyFileFallback(e,t,r,i){const s=64*1024;const o=a(1925)(s);const p=n.openSync(t,"r");const l=n.openSync(r,"w",e.mode);let d=0;while(d<e.size){const e=n.readSync(p,o,0,s,d);n.writeSync(l,o,0,e);d+=e}if(i.preserveTimestamps)n.futimesSync(l,e.atime,e.mtime);n.closeSync(p);n.closeSync(l)}function onDir(e,t,a,n,r){if(t===o)return mkDirAndCopy(e,a,n,r);if(t&&!t.isDirectory()){throw new Error(`Cannot overwrite non-directory '${n}' with directory '${a}'.`)}return copyDir(a,n,r)}function mkDirAndCopy(e,t,a,r){n.mkdirSync(a);copyDir(t,a,r);return n.chmodSync(a,e.mode)}function copyDir(e,t,a){n.readdirSync(e).forEach((n=>copyDirItem(n,e,t,a)))}function copyDirItem(e,t,a,n){const i=r.join(t,e);const s=r.join(a,e);const o=checkPaths(i,s);return startCopy(o,i,s,n)}function onLink(e,t,a,i){let s=n.readlinkSync(t);if(i.dereference){s=r.resolve(process.cwd(),s)}if(e===o){return n.symlinkSync(s,a)}else{let e;try{e=n.readlinkSync(a)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return n.symlinkSync(s,a);throw e}if(i.dereference){e=r.resolve(process.cwd(),e)}if(isSrcSubdir(s,e)){throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${e}'.`)}if(n.statSync(a).isDirectory()&&isSrcSubdir(e,s)){throw new Error(`Cannot overwrite '${e}' with '${s}'.`)}return copyLink(s,a)}}function copyLink(e,t){n.unlinkSync(t);return n.symlinkSync(e,t)}function isSrcSubdir(e,t){const a=r.resolve(e).split(r.sep);const n=r.resolve(t).split(r.sep);return a.reduce(((e,t,a)=>e&&n[a]===t),true)}function checkStats(e,t){const a=n.statSync(e);let r;try{r=n.statSync(t)}catch(e){if(e.code==="ENOENT")return{srcStat:a,destStat:o};throw e}return{srcStat:a,destStat:r}}function checkPaths(e,t){const{srcStat:a,destStat:n}=checkStats(e,t);if(n.ino&&n.ino===a.ino){throw new Error("Source and destination must not be the same.")}if(a.isDirectory()&&isSrcSubdir(e,t)){throw new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`)}return n}e.exports=copySync},6942:(e,t,a)=>{"use strict";e.exports={copySync:a(2457)}},9761:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(1063).mkdirs;const s=a(2535).pathExists;const o=a(4668).utimesMillis;const p=Symbol("notExist");function copy(e,t,a,n){if(typeof a==="function"&&!n){n=a;a={}}else if(typeof a==="function"){a={filter:a}}n=n||function(){};a=a||{};a.clobber="clobber"in a?!!a.clobber:true;a.overwrite="overwrite"in a?!!a.overwrite:a.clobber;if(a.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}checkPaths(e,t,((r,i)=>{if(r)return n(r);if(a.filter)return handleFilter(checkParentDir,i,e,t,a,n);return checkParentDir(i,e,t,a,n)}))}function checkParentDir(e,t,a,n,o){const p=r.dirname(a);s(p,((r,s)=>{if(r)return o(r);if(s)return startCopy(e,t,a,n,o);i(p,(r=>{if(r)return o(r);return startCopy(e,t,a,n,o)}))}))}function handleFilter(e,t,a,n,r,i){Promise.resolve(r.filter(a,n)).then((s=>{if(s){if(t)return e(t,a,n,r,i);return e(a,n,r,i)}return i()}),(e=>i(e)))}function startCopy(e,t,a,n,r){if(n.filter)return handleFilter(getStats,e,t,a,n,r);return getStats(e,t,a,n,r)}function getStats(e,t,a,r,i){const s=r.dereference?n.stat:n.lstat;s(t,((n,s)=>{if(n)return i(n);if(s.isDirectory())return onDir(s,e,t,a,r,i);else if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return onFile(s,e,t,a,r,i);else if(s.isSymbolicLink())return onLink(e,t,a,r,i)}))}function onFile(e,t,a,n,r,i){if(t===p)return copyFile(e,a,n,r,i);return mayCopyFile(e,a,n,r,i)}function mayCopyFile(e,t,a,r,i){if(r.overwrite){n.unlink(a,(n=>{if(n)return i(n);return copyFile(e,t,a,r,i)}))}else if(r.errorOnExist){return i(new Error(`'${a}' already exists`))}else return i()}function copyFile(e,t,a,r,i){if(typeof n.copyFile==="function"){return n.copyFile(t,a,(t=>{if(t)return i(t);return setDestModeAndTimestamps(e,a,r,i)}))}return copyFileFallback(e,t,a,r,i)}function copyFileFallback(e,t,a,r,i){const s=n.createReadStream(t);s.on("error",(e=>i(e))).once("open",(()=>{const t=n.createWriteStream(a,{mode:e.mode});t.on("error",(e=>i(e))).on("open",(()=>s.pipe(t))).once("close",(()=>setDestModeAndTimestamps(e,a,r,i)))}))}function setDestModeAndTimestamps(e,t,a,r){n.chmod(t,e.mode,(n=>{if(n)return r(n);if(a.preserveTimestamps){return o(t,e.atime,e.mtime,r)}return r()}))}function onDir(e,t,a,n,r,i){if(t===p)return mkDirAndCopy(e,a,n,r,i);if(t&&!t.isDirectory()){return i(new Error(`Cannot overwrite non-directory '${n}' with directory '${a}'.`))}return copyDir(a,n,r,i)}function mkDirAndCopy(e,t,a,r,i){n.mkdir(a,(s=>{if(s)return i(s);copyDir(t,a,r,(t=>{if(t)return i(t);return n.chmod(a,e.mode,i)}))}))}function copyDir(e,t,a,r){n.readdir(e,((n,i)=>{if(n)return r(n);return copyDirItems(i,e,t,a,r)}))}function copyDirItems(e,t,a,n,r){const i=e.pop();if(!i)return r();return copyDirItem(e,i,t,a,n,r)}function copyDirItem(e,t,a,n,i,s){const o=r.join(a,t);const p=r.join(n,t);checkPaths(o,p,((t,r)=>{if(t)return s(t);startCopy(r,o,p,i,(t=>{if(t)return s(t);return copyDirItems(e,a,n,i,s)}))}))}function onLink(e,t,a,i,s){n.readlink(t,((t,o)=>{if(t)return s(t);if(i.dereference){o=r.resolve(process.cwd(),o)}if(e===p){return n.symlink(o,a,s)}else{n.readlink(a,((t,p)=>{if(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return n.symlink(o,a,s);return s(t)}if(i.dereference){p=r.resolve(process.cwd(),p)}if(isSrcSubdir(o,p)){return s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${p}'.`))}if(e.isDirectory()&&isSrcSubdir(p,o)){return s(new Error(`Cannot overwrite '${p}' with '${o}'.`))}return copyLink(o,a,s)}))}}))}function copyLink(e,t,a){n.unlink(t,(r=>{if(r)return a(r);return n.symlink(e,t,a)}))}function isSrcSubdir(e,t){const a=r.resolve(e).split(r.sep);const n=r.resolve(t).split(r.sep);return a.reduce(((e,t,a)=>e&&n[a]===t),true)}function checkStats(e,t,a){n.stat(e,((e,r)=>{if(e)return a(e);n.stat(t,((e,t)=>{if(e){if(e.code==="ENOENT")return a(null,{srcStat:r,destStat:p});return a(e)}return a(null,{srcStat:r,destStat:t})}))}))}function checkPaths(e,t,a){checkStats(e,t,((n,r)=>{if(n)return a(n);const{srcStat:i,destStat:s}=r;if(s.ino&&s.ino===i.ino){return a(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&isSrcSubdir(e,t)){return a(new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`))}return a(null,s)}))}e.exports=copy},5494:(e,t,a)=>{"use strict";const n=a(2171).S;e.exports={copy:n(a(9761))}},4832:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(9896);const i=a(6928);const s=a(1063);const o=a(4099);const p=n((function emptyDir(e,t){t=t||function(){};r.readdir(e,((a,n)=>{if(a)return s.mkdirs(e,t);n=n.map((t=>i.join(e,t)));deleteItem();function deleteItem(){const e=n.pop();if(!e)return t();o.remove(e,(e=>{if(e)return t(e);deleteItem()}))}}))}));function emptyDirSync(e){let t;try{t=r.readdirSync(e)}catch(t){return s.mkdirsSync(e)}t.forEach((t=>{t=i.join(e,t);o.removeSync(t)}))}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:p,emptydir:p}},4363:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(6928);const i=a(5158);const s=a(1063);const o=a(2535).pathExists;function createFile(e,t){function makeFile(){i.writeFile(e,"",(e=>{if(e)return t(e);t()}))}i.stat(e,((a,n)=>{if(!a&&n.isFile())return t();const i=r.dirname(e);o(i,((e,a)=>{if(e)return t(e);if(a)return makeFile();s.mkdirs(i,(e=>{if(e)return t(e);makeFile()}))}))}))}function createFileSync(e){let t;try{t=i.statSync(e)}catch(e){}if(t&&t.isFile())return;const a=r.dirname(e);if(!i.existsSync(a)){s.mkdirsSync(a)}i.writeFileSync(e,"")}e.exports={createFile:n(createFile),createFileSync:createFileSync}},8937:(e,t,a)=>{"use strict";const n=a(4363);const r=a(2469);const i=a(1638);e.exports={createFile:n.createFile,createFileSync:n.createFileSync,ensureFile:n.createFile,ensureFileSync:n.createFileSync,createLink:r.createLink,createLinkSync:r.createLinkSync,ensureLink:r.createLink,ensureLinkSync:r.createLinkSync,createSymlink:i.createSymlink,createSymlinkSync:i.createSymlinkSync,ensureSymlink:i.createSymlink,ensureSymlinkSync:i.createSymlinkSync}},2469:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(6928);const i=a(5158);const s=a(1063);const o=a(2535).pathExists;function createLink(e,t,a){function makeLink(e,t){i.link(e,t,(e=>{if(e)return a(e);a(null)}))}o(t,((n,p)=>{if(n)return a(n);if(p)return a(null);i.lstat(e,(n=>{if(n){n.message=n.message.replace("lstat","ensureLink");return a(n)}const i=r.dirname(t);o(i,((n,r)=>{if(n)return a(n);if(r)return makeLink(e,t);s.mkdirs(i,(n=>{if(n)return a(n);makeLink(e,t)}))}))}))}))}function createLinkSync(e,t){const a=i.existsSync(t);if(a)return undefined;try{i.lstatSync(e)}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const n=r.dirname(t);const o=i.existsSync(n);if(o)return i.linkSync(e,t);s.mkdirsSync(n);return i.linkSync(e,t)}e.exports={createLink:n(createLink),createLinkSync:createLinkSync}},7355:(e,t,a)=>{"use strict";const n=a(6928);const r=a(5158);const i=a(2535).pathExists;function symlinkPaths(e,t,a){if(n.isAbsolute(e)){return r.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return a(t)}return a(null,{toCwd:e,toDst:e})}))}else{const s=n.dirname(t);const o=n.join(s,e);return i(o,((t,i)=>{if(t)return a(t);if(i){return a(null,{toCwd:o,toDst:e})}else{return r.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return a(t)}return a(null,{toCwd:e,toDst:n.relative(s,e)})}))}}))}}function symlinkPathsSync(e,t){let a;if(n.isAbsolute(e)){a=r.existsSync(e);if(!a)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const i=n.dirname(t);const s=n.join(i,e);a=r.existsSync(s);if(a){return{toCwd:s,toDst:e}}else{a=r.existsSync(e);if(!a)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:n.relative(i,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},3135:(e,t,a)=>{"use strict";const n=a(5158);function symlinkType(e,t,a){a=typeof t==="function"?t:a;t=typeof t==="function"?false:t;if(t)return a(null,t);n.lstat(e,((e,n)=>{if(e)return a(null,"file");t=n&&n.isDirectory()?"dir":"file";a(null,t)}))}function symlinkTypeSync(e,t){let a;if(t)return t;try{a=n.lstatSync(e)}catch(e){return"file"}return a&&a.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},1638:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(6928);const i=a(5158);const s=a(1063);const o=s.mkdirs;const p=s.mkdirsSync;const l=a(7355);const d=l.symlinkPaths;const c=l.symlinkPathsSync;const u=a(3135);const f=u.symlinkType;const m=u.symlinkTypeSync;const h=a(2535).pathExists;function createSymlink(e,t,a,n){n=typeof a==="function"?a:n;a=typeof a==="function"?false:a;h(t,((s,p)=>{if(s)return n(s);if(p)return n(null);d(e,t,((s,p)=>{if(s)return n(s);e=p.toDst;f(p.toCwd,a,((a,s)=>{if(a)return n(a);const p=r.dirname(t);h(p,((a,r)=>{if(a)return n(a);if(r)return i.symlink(e,t,s,n);o(p,(a=>{if(a)return n(a);i.symlink(e,t,s,n)}))}))}))}))}))}function createSymlinkSync(e,t,a){const n=i.existsSync(t);if(n)return undefined;const s=c(e,t);e=s.toDst;a=m(s.toCwd,a);const o=r.dirname(t);const l=i.existsSync(o);if(l)return i.symlinkSync(e,t,a);p(o);return i.symlinkSync(e,t,a)}e.exports={createSymlink:n(createSymlink),createSymlinkSync:createSymlinkSync}},612:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(5158);const i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>typeof r[e]==="function"));Object.keys(r).forEach((e=>{if(e==="promises"){return}t[e]=r[e]}));i.forEach((e=>{t[e]=n(r[e])}));t.exists=function(e,t){if(typeof t==="function"){return r.exists(e,t)}return new Promise((t=>r.exists(e,t)))};t.read=function(e,t,a,n,i,s){if(typeof s==="function"){return r.read(e,t,a,n,i,s)}return new Promise(((s,o)=>{r.read(e,t,a,n,i,((e,t,a)=>{if(e)return o(e);s({bytesRead:t,buffer:a})}))}))};t.write=function(e,t,...a){if(typeof a[a.length-1]==="function"){return r.write(e,t,...a)}return new Promise(((n,i)=>{r.write(e,t,...a,((e,t,a)=>{if(e)return i(e);n({bytesWritten:t,buffer:a})}))}))}},6954:(e,t,a)=>{"use strict";e.exports=Object.assign({},a(612),a(6942),a(5494),a(4832),a(8937),a(5553),a(1063),a(3526),a(782),a(4338),a(2535),a(4099));const n=a(9896);if(Object.getOwnPropertyDescriptor(n,"promises")){Object.defineProperty(e.exports,"promises",{get(){return n.promises}})}},5553:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(4741);r.outputJson=n(a(2851));r.outputJsonSync=a(3251);r.outputJSON=r.outputJson;r.outputJSONSync=r.outputJsonSync;r.writeJSON=r.writeJson;r.writeJSONSync=r.writeJsonSync;r.readJSON=r.readJson;r.readJSONSync=r.readJsonSync;e.exports=r},4741:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(433);e.exports={readJson:n(r.readFile),readJsonSync:r.readFileSync,writeJson:n(r.writeFile),writeJsonSync:r.writeFileSync}},3251:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(1063);const s=a(4741);function outputJsonSync(e,t,a){const o=r.dirname(e);if(!n.existsSync(o)){i.mkdirsSync(o)}s.writeJsonSync(e,t,a)}e.exports=outputJsonSync},2851:(e,t,a)=>{"use strict";const n=a(6928);const r=a(1063);const i=a(2535).pathExists;const s=a(4741);function outputJson(e,t,a,o){if(typeof a==="function"){o=a;a={}}const p=n.dirname(e);i(p,((n,i)=>{if(n)return o(n);if(i)return s.writeJson(e,t,a,o);r.mkdirs(p,(n=>{if(n)return o(n);s.writeJson(e,t,a,o)}))}))}e.exports=outputJson},1063:(e,t,a)=>{"use strict";const n=a(2171).S;const r=n(a(9563));const i=a(603);e.exports={mkdirs:r,mkdirsSync:i,mkdirp:r,mkdirpSync:i,ensureDir:r,ensureDirSync:i}},603:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(2832).invalidWin32Path;const s=parseInt("0777",8);function mkdirsSync(e,t,a){if(!t||typeof t!=="object"){t={mode:t}}let o=t.mode;const p=t.fs||n;if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";throw t}if(o===undefined){o=s&~process.umask()}if(!a)a=null;e=r.resolve(e);try{p.mkdirSync(e,o);a=a||e}catch(n){if(n.code==="ENOENT"){if(r.dirname(e)===e)throw n;a=mkdirsSync(r.dirname(e),t,a);mkdirsSync(e,t,a)}else{let t;try{t=p.statSync(e)}catch(e){throw n}if(!t.isDirectory())throw n}}return a}e.exports=mkdirsSync},9563:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(2832).invalidWin32Path;const s=parseInt("0777",8);function mkdirs(e,t,a,o){if(typeof t==="function"){a=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";return a(t)}let p=t.mode;const l=t.fs||n;if(p===undefined){p=s&~process.umask()}if(!o)o=null;a=a||function(){};e=r.resolve(e);l.mkdir(e,p,(n=>{if(!n){o=o||e;return a(null,o)}switch(n.code){case"ENOENT":if(r.dirname(e)===e)return a(n);mkdirs(r.dirname(e),t,((n,r)=>{if(n)a(n,r);else mkdirs(e,t,a,r)}));break;default:l.stat(e,((e,t)=>{if(e||!t.isDirectory())a(n,o);else a(null,o)}));break}}))}e.exports=mkdirs},2832:(e,t,a)=>{"use strict";const n=a(6928);function getRootPath(e){e=n.normalize(n.resolve(e)).split(n.sep);if(e.length>0)return e[0];return null}const r=/[<>:"|?*]/;function invalidWin32Path(e){const t=getRootPath(e);e=e.replace(t,"");return r.test(e)}e.exports={getRootPath:getRootPath,invalidWin32Path:invalidWin32Path}},3526:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(6942).copySync;const s=a(4099).removeSync;const o=a(1063).mkdirsSync;const p=a(1925);function moveSync(e,t,a){a=a||{};const i=a.overwrite||a.clobber||false;e=r.resolve(e);t=r.resolve(t);if(e===t)return n.accessSync(e);if(isSrcSubdir(e,t))throw new Error(`Cannot move '${e}' into itself '${t}'.`);o(r.dirname(t));tryRenameSync();function tryRenameSync(){if(i){try{return n.renameSync(e,t)}catch(n){if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"){s(t);a.overwrite=false;return moveSync(e,t,a)}if(n.code!=="EXDEV")throw n;return moveSyncAcrossDevice(e,t,i)}}else{try{n.linkSync(e,t);return n.unlinkSync(e)}catch(a){if(a.code==="EXDEV"||a.code==="EISDIR"||a.code==="EPERM"||a.code==="ENOTSUP"){return moveSyncAcrossDevice(e,t,i)}throw a}}}}function moveSyncAcrossDevice(e,t,a){const r=n.statSync(e);if(r.isDirectory()){return moveDirSyncAcrossDevice(e,t,a)}else{return moveFileSyncAcrossDevice(e,t,a)}}function moveFileSyncAcrossDevice(e,t,a){const r=64*1024;const i=p(r);const s=a?"w":"wx";const o=n.openSync(e,"r");const l=n.fstatSync(o);const d=n.openSync(t,s,l.mode);let c=0;while(c<l.size){const e=n.readSync(o,i,0,r,c);n.writeSync(d,i,0,e);c+=e}n.closeSync(o);n.closeSync(d);return n.unlinkSync(e)}function moveDirSyncAcrossDevice(e,t,a){const n={overwrite:false};if(a){s(t);tryCopySync()}else{tryCopySync()}function tryCopySync(){i(e,t,n);return s(e)}}function isSrcSubdir(e,t){try{return n.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(r.dirname(e)+r.sep)[1].split(r.sep)[0]===r.basename(e)}catch(e){return false}}e.exports={moveSync:moveSync}},782:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(5158);const i=a(6928);const s=a(5494).copy;const o=a(4099).remove;const p=a(1063).mkdirp;const l=a(2535).pathExists;function move(e,t,a,n){if(typeof a==="function"){n=a;a={}}const s=a.overwrite||a.clobber||false;e=i.resolve(e);t=i.resolve(t);if(e===t)return r.access(e,n);r.stat(e,((a,r)=>{if(a)return n(a);if(r.isDirectory()&&isSrcSubdir(e,t)){return n(new Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`))}p(i.dirname(t),(a=>{if(a)return n(a);return doRename(e,t,s,n)}))}))}function doRename(e,t,a,n){if(a){return o(t,(r=>{if(r)return n(r);return rename(e,t,a,n)}))}l(t,((r,i)=>{if(r)return n(r);if(i)return n(new Error("dest already exists."));return rename(e,t,a,n)}))}function rename(e,t,a,n){r.rename(e,t,(r=>{if(!r)return n();if(r.code!=="EXDEV")return n(r);return moveAcrossDevice(e,t,a,n)}))}function moveAcrossDevice(e,t,a,n){const r={overwrite:a,errorOnExist:true};s(e,t,r,(t=>{if(t)return n(t);return o(e,n)}))}function isSrcSubdir(e,t){const a=e.split(i.sep);const n=t.split(i.sep);return a.reduce(((e,t,a)=>e&&n[a]===t),true)}e.exports={move:n(move)}},4338:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(5158);const i=a(6928);const s=a(1063);const o=a(2535).pathExists;function outputFile(e,t,a,n){if(typeof a==="function"){n=a;a="utf8"}const p=i.dirname(e);o(p,((i,o)=>{if(i)return n(i);if(o)return r.writeFile(e,t,a,n);s.mkdirs(p,(i=>{if(i)return n(i);r.writeFile(e,t,a,n)}))}))}function outputFileSync(e,...t){const a=i.dirname(e);if(r.existsSync(a)){return r.writeFileSync(e,...t)}s.mkdirsSync(a);r.writeFileSync(e,...t)}e.exports={outputFile:n(outputFile),outputFileSync:outputFileSync}},2535:(e,t,a)=>{"use strict";const n=a(2171).z;const r=a(612);function pathExists(e){return r.access(e).then((()=>true)).catch((()=>false))}e.exports={pathExists:n(pathExists),pathExistsSync:r.existsSync}},4099:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(1250);e.exports={remove:n(r),removeSync:r.sync}},1250:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(2613);const s=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||n[t];t=t+"Sync";e[t]=e[t]||n[t]}));e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,a){let n=0;if(typeof t==="function"){a=t;t={}}i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i.strictEqual(typeof a,"function","rimraf: callback function required");i(t,"rimraf: invalid options argument provided");i.strictEqual(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,(function CB(r){if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&n<t.maxBusyTries){n++;const a=n*100;return setTimeout((()=>rimraf_(e,t,CB)),a)}if(r.code==="ENOENT")r=null}a(r)}))}function rimraf_(e,t,a){i(e);i(t);i(typeof a==="function");t.lstat(e,((n,r)=>{if(n&&n.code==="ENOENT"){return a(null)}if(n&&n.code==="EPERM"&&s){return fixWinEPERM(e,t,n,a)}if(r&&r.isDirectory()){return rmdir(e,t,n,a)}t.unlink(e,(n=>{if(n){if(n.code==="ENOENT"){return a(null)}if(n.code==="EPERM"){return s?fixWinEPERM(e,t,n,a):rmdir(e,t,n,a)}if(n.code==="EISDIR"){return rmdir(e,t,n,a)}}return a(n)}))}))}function fixWinEPERM(e,t,a,n){i(e);i(t);i(typeof n==="function");if(a){i(a instanceof Error)}t.chmod(e,438,(r=>{if(r){n(r.code==="ENOENT"?null:a)}else{t.stat(e,((r,i)=>{if(r){n(r.code==="ENOENT"?null:a)}else if(i.isDirectory()){rmdir(e,t,a,n)}else{t.unlink(e,n)}}))}}))}function fixWinEPERMSync(e,t,a){let n;i(e);i(t);if(a){i(a instanceof Error)}try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw a}}try{n=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw a}}if(n.isDirectory()){rmdirSync(e,t,a)}else{t.unlinkSync(e)}}function rmdir(e,t,a,n){i(e);i(t);if(a){i(a instanceof Error)}i(typeof n==="function");t.rmdir(e,(r=>{if(r&&(r.code==="ENOTEMPTY"||r.code==="EEXIST"||r.code==="EPERM")){rmkids(e,t,n)}else if(r&&r.code==="ENOTDIR"){n(a)}else{n(r)}}))}function rmkids(e,t,a){i(e);i(t);i(typeof a==="function");t.readdir(e,((n,i)=>{if(n)return a(n);let s=i.length;let o;if(s===0)return t.rmdir(e,a);i.forEach((n=>{rimraf(r.join(e,n),t,(n=>{if(o){return}if(n)return a(o=n);if(--s===0){t.rmdir(e,a)}}))}))}))}function rimrafSync(e,t){let a;t=t||{};defaults(t);i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i(t,"rimraf: missing options");i.strictEqual(typeof t,"object","rimraf: options should be object");try{a=t.lstatSync(e)}catch(a){if(a.code==="ENOENT"){return}if(a.code==="EPERM"&&s){fixWinEPERMSync(e,t,a)}}try{if(a&&a.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(a){if(a.code==="ENOENT"){return}else if(a.code==="EPERM"){return s?fixWinEPERMSync(e,t,a):rmdirSync(e,t,a)}else if(a.code!=="EISDIR"){throw a}rmdirSync(e,t,a)}}function rmdirSync(e,t,a){i(e);i(t);if(a){i(a instanceof Error)}try{t.rmdirSync(e)}catch(n){if(n.code==="ENOTDIR"){throw a}else if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"){rmkidsSync(e,t)}else if(n.code!=="ENOENT"){throw n}}}function rmkidsSync(e,t){i(e);i(t);t.readdirSync(e).forEach((a=>rimrafSync(r.join(e,a),t)));if(s){const a=Date.now();do{try{const a=t.rmdirSync(e,t);return a}catch(e){}}while(Date.now()-a<500)}else{const a=t.rmdirSync(e,t);return a}}e.exports=rimraf;rimraf.sync=rimrafSync},1925:e=>{"use strict";e.exports=function(e){if(typeof Buffer.allocUnsafe==="function"){try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}}return new Buffer(e)}},4668:(e,t,a)=>{"use strict";const n=a(5158);const r=a(857);const i=a(6928);function hasMillisResSync(){let e=i.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=i.join(r.tmpdir(),e);const t=new Date(1435410243862);n.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");const a=n.openSync(e,"r+");n.futimesSync(a,t,t);n.closeSync(a);return n.statSync(e).mtime>1435410243e3}function hasMillisRes(e){let t=i.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));t=i.join(r.tmpdir(),t);const a=new Date(1435410243862);n.writeFile(t,"https://github.com/jprichardson/node-fs-extra/pull/141",(r=>{if(r)return e(r);n.open(t,"r+",((r,i)=>{if(r)return e(r);n.futimes(i,a,a,(a=>{if(a)return e(a);n.close(i,(a=>{if(a)return e(a);n.stat(t,((t,a)=>{if(t)return e(t);e(null,a.mtime>1435410243e3)}))}))}))}))}))}function timeRemoveMillis(e){if(typeof e==="number"){return Math.floor(e/1e3)*1e3}else if(e instanceof Date){return new Date(Math.floor(e.getTime()/1e3)*1e3)}else{throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}}function utimesMillis(e,t,a,r){n.open(e,"r+",((e,i)=>{if(e)return r(e);n.futimes(i,t,a,(e=>{n.close(i,(t=>{if(r)r(e||t)}))}))}))}function utimesMillisSync(e,t,a){const r=n.openSync(e,"r+");n.futimesSync(r,t,a);return n.closeSync(r)}e.exports={hasMillisRes:hasMillisRes,hasMillisResSync:hasMillisResSync,timeRemoveMillis:timeRemoveMillis,utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},433:(e,t,a)=>{var n;try{n=a(5158)}catch(e){n=a(9896)}function readFile(e,t,a){if(a==null){a=t;t={}}if(typeof t==="string"){t={encoding:t}}t=t||{};var r=t.fs||n;var i=true;if("throws"in t){i=t.throws}r.readFile(e,t,(function(n,r){if(n)return a(n);r=stripBom(r);var s;try{s=JSON.parse(r,t?t.reviver:null)}catch(t){if(i){t.message=e+": "+t.message;return a(t)}else{return a(null,null)}}a(null,s)}))}function readFileSync(e,t){t=t||{};if(typeof t==="string"){t={encoding:t}}var a=t.fs||n;var r=true;if("throws"in t){r=t.throws}try{var i=a.readFileSync(e,t);i=stripBom(i);return JSON.parse(i,t.reviver)}catch(t){if(r){t.message=e+": "+t.message;throw t}else{return null}}}function stringify(e,t){var a;var n="\n";if(typeof t==="object"&&t!==null){if(t.spaces){a=t.spaces}if(t.EOL){n=t.EOL}}var r=JSON.stringify(e,t?t.replacer:null,a);return r.replace(/\n/g,n)+n}function writeFile(e,t,a,r){if(r==null){r=a;a={}}a=a||{};var i=a.fs||n;var s="";try{s=stringify(t,a)}catch(e){if(r)r(e,null);return}i.writeFile(e,s,a,r)}function writeFileSync(e,t,a){a=a||{};var r=a.fs||n;var i=stringify(t,a);return r.writeFileSync(e,i,a)}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");e=e.replace(/^\uFEFF/,"");return e}var r={readFile:readFile,readFileSync:readFileSync,writeFile:writeFile,writeFileSync:writeFileSync};e.exports=r},2171:(e,t)=>{"use strict";t.S=function(e){return Object.defineProperty((function(){if(typeof arguments[arguments.length-1]==="function")e.apply(this,arguments);else{return new Promise(((t,a)=>{arguments[arguments.length]=(e,n)=>{if(e)return a(e);t(n)};arguments.length++;e.apply(this,arguments)}))}}),"name",{value:e.name})};t.z=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if(typeof t!=="function")return e.apply(this,arguments);else e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},7830:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var a={__proto__:t(e)};else var a=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(e,t))}));return a}},5158:(e,t,a)=>{var n=a(9896);var r=a(5055);var i=a(7540);var s=a(7830);var o=a(9023);var p;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){p=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{p="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,p,{get:function(){return t}})}var d=noop;if(o.debuglog)d=o.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))d=function(){var e=o.format.apply(o,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!n[p]){var c=global[p]||[];publishQueue(n,c);n.close=function(e){function close(t,a){return e.call(n,t,(function(e){if(!e){resetQueue()}if(typeof a==="function")a.apply(this,arguments)}))}Object.defineProperty(close,l,{value:e});return close}(n.close);n.closeSync=function(e){function closeSync(t){e.apply(n,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:e});return closeSync}(n.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){d(n[p]);a(2613).equal(n[p].length,0)}))}}if(!global[p]){publishQueue(global,n[p])}e.exports=patch(s(n));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched){e.exports=patch(n);n.__patched=true}function patch(e){r(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,a,n){if(typeof a==="function")n=a,a=null;return go$readFile(e,a,n);function go$readFile(e,a,n,r){return t(e,a,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,a,n],t,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var a=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,n,r){if(typeof n==="function")r=n,n=null;return go$writeFile(e,t,n,r);function go$writeFile(e,t,n,r,i){return a(e,t,n,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$writeFile,[e,t,n,r],a,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var n=e.appendFile;if(n)e.appendFile=appendFile;function appendFile(e,t,a,r){if(typeof a==="function")r=a,a=null;return go$appendFile(e,t,a,r);function go$appendFile(e,t,a,r,i){return n(e,t,a,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$appendFile,[e,t,a,r],n,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var s=e.copyFile;if(s)e.copyFile=copyFile;function copyFile(e,t,a,n){if(typeof a==="function"){n=a;a=0}return go$copyFile(e,t,a,n);function go$copyFile(e,t,a,n,r){return s(e,t,a,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$copyFile,[e,t,a,n],i,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var o=e.readdir;e.readdir=readdir;var p=/^v[0-5]\./;function readdir(e,t,a){if(typeof t==="function")a=t,t=null;var n=p.test(process.version)?function go$readdir(e,t,a,n){return o(e,fs$readdirCallback(e,t,a,n))}:function go$readdir(e,t,a,n){return o(e,t,fs$readdirCallback(e,t,a,n))};return n(e,t,a);function fs$readdirCallback(e,t,a,r){return function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([n,[e,t,a],i,r||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof a==="function")a.call(this,i,s)}}}}if(process.version.substr(0,4)==="v0.8"){var l=i(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var d=e.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var c=e.WriteStream;if(c){WriteStream.prototype=Object.create(c.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var u=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:true,configurable:true});var f=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,a){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=a;e.emit("open",a);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return c.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,a){if(t){e.destroy();e.emit("error",t)}else{e.fd=a;e.emit("open",a)}}))}function createReadStream(t,a){return new e.ReadStream(t,a)}function createWriteStream(t,a){return new e.WriteStream(t,a)}var m=e.open;e.open=open;function open(e,t,a,n){if(typeof a==="function")n=a,a=null;return go$open(e,t,a,n);function go$open(e,t,a,n,r){return m(e,t,a,(function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$open,[e,t,a,n],i,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}return e}function enqueue(e){d("ENQUEUE",e[0].name,e[1]);n[p].push(e);retry()}var u;function resetQueue(){var e=Date.now();for(var t=0;t<n[p].length;++t){if(n[p][t].length>2){n[p][t][3]=e;n[p][t][4]=e}}retry()}function retry(){clearTimeout(u);u=undefined;if(n[p].length===0)return;var e=n[p].shift();var t=e[0];var a=e[1];var r=e[2];var i=e[3];var s=e[4];if(i===undefined){d("RETRY",t.name,a);t.apply(null,a)}else if(Date.now()-i>=6e4){d("TIMEOUT",t.name,a);var o=a.pop();if(typeof o==="function")o.call(null,r)}else{var l=Date.now()-s;var c=Math.max(s-i,1);var f=Math.min(c*1.2,100);if(l>=f){d("RETRY",t.name,a);t.apply(null,a.concat([i]))}else{n[p].push(e)}}if(u===undefined){u=setTimeout(retry,0)}}},7540:(e,t,a)=>{var n=a(2203).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,a){if(!(this instanceof ReadStream))return new ReadStream(t,a);n.call(this);var r=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;a=a||{};var i=Object.keys(a);for(var s=0,o=i.length;s<o;s++){var p=i[s];this[p]=a[p]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){r._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){r.emit("error",e);r.readable=false;return}r.fd=t;r.emit("open",t);r._read()}))}function WriteStream(t,a){if(!(this instanceof WriteStream))return new WriteStream(t,a);n.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;a=a||{};var r=Object.keys(a);for(var i=0,s=r.length;i<s;i++){var o=r[i];this[o]=a[o]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},5055:(e,t,a)=>{var n=a(9140);var r=process.cwd;var i=null;var s=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!i)i=r.call(process);return i};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var o=process.chdir;process.chdir=function(e){i=null;o.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,o)}e.exports=patch;function patch(e){if(n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,a){if(a)process.nextTick(a)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,a,n){if(n)process.nextTick(n)};e.lchownSync=function(){}}if(s==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(a,n,r){var i=Date.now();var s=0;t(a,n,(function CB(o){if(o&&(o.code==="EACCES"||o.code==="EPERM"||o.code==="EBUSY")&&Date.now()-i<6e4){setTimeout((function(){e.stat(n,(function(e,i){if(e&&e.code==="ENOENT")t(a,n,CB);else r(o)}))}),s);if(s<100)s+=10;return}if(r)r(o)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(a,n,r,i,s,o){var p;if(o&&typeof o==="function"){var l=0;p=function(d,c,u){if(d&&d.code==="EAGAIN"&&l<10){l++;return t.call(e,a,n,r,i,s,p)}o.apply(this,arguments)}}return t.call(e,a,n,r,i,s,p)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(a,n,r,i,s){var o=0;while(true){try{return t.call(e,a,n,r,i,s)}catch(e){if(e.code==="EAGAIN"&&o<10){o++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,a,r){e.open(t,n.O_WRONLY|n.O_SYMLINK,a,(function(t,n){if(t){if(r)r(t);return}e.fchmod(n,a,(function(t){e.close(n,(function(e){if(r)r(t||e)}))}))}))};e.lchmodSync=function(t,a){var r=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,a);var i=true;var s;try{s=e.fchmodSync(r,a);i=false}finally{if(i){try{e.closeSync(r)}catch(e){}}else{e.closeSync(r)}}return s}}function patchLutimes(e){if(n.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,a,r,i){e.open(t,n.O_SYMLINK,(function(t,n){if(t){if(i)i(t);return}e.futimes(n,a,r,(function(t){e.close(n,(function(e){if(i)i(t||e)}))}))}))};e.lutimesSync=function(t,a,r){var i=e.openSync(t,n.O_SYMLINK);var s;var o=true;try{s=e.futimesSync(i,a,r);o=false}finally{if(o){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return s}}else if(e.futimes){e.lutimes=function(e,t,a,n){if(n)process.nextTick(n)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(a,n,r){return t.call(e,a,n,(function(e){if(chownErOk(e))e=null;if(r)r.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(a,n){try{return t.call(e,a,n)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(a,n,r,i){return t.call(e,a,n,r,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(a,n,r){try{return t.call(e,a,n,r)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(a,n,r){if(typeof n==="function"){r=n;n=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(r)r.apply(this,arguments)}return n?t.call(e,a,n,callback):t.call(e,a,callback)}}function statFixSync(t){if(!t)return t;return function(a,n){var r=n?t.call(e,a,n):t.call(e,a);if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}return r}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},3372:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t._dbcs=DBCSCodec;var r=-1,i=-2,s=-10,o=-1e3,p=new Array(256),l=-1;for(var d=0;d<256;d++)p[d]=r;function DBCSCodec(e,t){this.encodingName=e.encodingName;if(!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var a=e.table();this.decodeTables=[];this.decodeTables[0]=p.slice(0);this.decodeTableSeq=[];for(var n=0;n<a.length;n++)this._addDecodeChunk(a[n]);if(typeof e.gb18030==="function"){this.gb18030=e.gb18030();var s=this.decodeTables.length;this.decodeTables.push(p.slice(0));var l=this.decodeTables.length;this.decodeTables.push(p.slice(0));var d=this.decodeTables[0];for(var n=129;n<=254;n++){var c=this.decodeTables[o-d[n]];for(var u=48;u<=57;u++){if(c[u]===r){c[u]=o-s}else if(c[u]>o){throw new Error("gb18030 decode tables conflict at byte 2")}var f=this.decodeTables[o-c[u]];for(var m=129;m<=254;m++){if(f[m]===r){f[m]=o-l}else if(f[m]===o-l){continue}else if(f[m]>o){throw new Error("gb18030 decode tables conflict at byte 3")}var h=this.decodeTables[o-f[m]];for(var v=48;v<=57;v++){if(h[v]===r)h[v]=i}}}}}this.defaultCharUnicode=t.defaultCharUnicode;this.encodeTable=[];this.encodeTableSeq=[];var g={};if(e.encodeSkipVals)for(var n=0;n<e.encodeSkipVals.length;n++){var y=e.encodeSkipVals[n];if(typeof y==="number")g[y]=true;else for(var u=y.from;u<=y.to;u++)g[u]=true}this._fillEncodeTable(0,0,g);if(e.encodeAdd){for(var b in e.encodeAdd)if(Object.prototype.hasOwnProperty.call(e.encodeAdd,b))this._setEncodeChar(b.charCodeAt(0),e.encodeAdd[b])}this.defCharSB=this.encodeTable[0][t.defaultCharSingleByte.charCodeAt(0)];if(this.defCharSB===r)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===r)this.defCharSB="?".charCodeAt(0)}DBCSCodec.prototype.encoder=DBCSEncoder;DBCSCodec.prototype.decoder=DBCSDecoder;DBCSCodec.prototype._getDecodeTrieNode=function(e){var t=[];for(;e>0;e>>>=8)t.push(e&255);if(t.length==0)t.push(0);var a=this.decodeTables[0];for(var n=t.length-1;n>0;n--){var i=a[t[n]];if(i==r){a[t[n]]=o-this.decodeTables.length;this.decodeTables.push(a=p.slice(0))}else if(i<=o){a=this.decodeTables[o-i]}else throw new Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16))}return a};DBCSCodec.prototype._addDecodeChunk=function(e){var t=parseInt(e[0],16);var a=this._getDecodeTrieNode(t);t=t&255;for(var n=1;n<e.length;n++){var r=e[n];if(typeof r==="string"){for(var i=0;i<r.length;){var o=r.charCodeAt(i++);if(55296<=o&&o<56320){var p=r.charCodeAt(i++);if(56320<=p&&p<57344)a[t++]=65536+(o-55296)*1024+(p-56320);else throw new Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+e[0])}else if(4080<o&&o<=4095){var l=4095-o+2;var d=[];for(var c=0;c<l;c++)d.push(r.charCodeAt(i++));a[t++]=s-this.decodeTableSeq.length;this.decodeTableSeq.push(d)}else a[t++]=o}}else if(typeof r==="number"){var u=a[t-1]+1;for(var i=0;i<r;i++)a[t++]=u++}else throw new Error("Incorrect type '"+typeof r+"' given in "+this.encodingName+" at chunk "+e[0])}if(t>255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t)};DBCSCodec.prototype._getEncodeBucket=function(e){var t=e>>8;if(this.encodeTable[t]===undefined)this.encodeTable[t]=p.slice(0);return this.encodeTable[t]};DBCSCodec.prototype._setEncodeChar=function(e,t){var a=this._getEncodeBucket(e);var n=e&255;if(a[n]<=s)this.encodeTableSeq[s-a[n]][l]=t;else if(a[n]==r)a[n]=t};DBCSCodec.prototype._setEncodeSequence=function(e,t){var a=e[0];var n=this._getEncodeBucket(a);var i=a&255;var o;if(n[i]<=s){o=this.encodeTableSeq[s-n[i]]}else{o={};if(n[i]!==r)o[l]=n[i];n[i]=s-this.encodeTableSeq.length;this.encodeTableSeq.push(o)}for(var p=1;p<e.length-1;p++){var d=o[a];if(typeof d==="object")o=d;else{o=o[a]={};if(d!==undefined)o[l]=d}}a=e[e.length-1];o[a]=t};DBCSCodec.prototype._fillEncodeTable=function(e,t,a){var n=this.decodeTables[e];var r=false;var i={};for(var p=0;p<256;p++){var l=n[p];var d=t+p;if(a[d])continue;if(l>=0){this._setEncodeChar(l,d);r=true}else if(l<=o){var c=o-l;if(!i[c]){var u=d<<8>>>0;if(this._fillEncodeTable(c,u,a))r=true;else i[c]=true}}else if(l<=s){this._setEncodeSequence(this.decodeTableSeq[s-l],d);r=true}}return r};function DBCSEncoder(e,t){this.leadSurrogate=-1;this.seqObj=undefined;this.encodeTable=t.encodeTable;this.encodeTableSeq=t.encodeTableSeq;this.defaultCharSingleByte=t.defCharSB;this.gb18030=t.gb18030}DBCSEncoder.prototype.write=function(e){var t=n.alloc(e.length*(this.gb18030?4:3)),a=this.leadSurrogate,i=this.seqObj,o=-1,p=0,d=0;while(true){if(o===-1){if(p==e.length)break;var c=e.charCodeAt(p++)}else{var c=o;o=-1}if(55296<=c&&c<57344){if(c<56320){if(a===-1){a=c;continue}else{a=c;c=r}}else{if(a!==-1){c=65536+(a-55296)*1024+(c-56320);a=-1}else{c=r}}}else if(a!==-1){o=c;c=r;a=-1}var u=r;if(i!==undefined&&c!=r){var f=i[c];if(typeof f==="object"){i=f;continue}else if(typeof f=="number"){u=f}else if(f==undefined){f=i[l];if(f!==undefined){u=f;o=c}else{}}i=undefined}else if(c>=0){var m=this.encodeTable[c>>8];if(m!==undefined)u=m[c&255];if(u<=s){i=this.encodeTableSeq[s-u];continue}if(u==r&&this.gb18030){var h=findIdx(this.gb18030.uChars,c);if(h!=-1){var u=this.gb18030.gbChars[h]+(c-this.gb18030.uChars[h]);t[d++]=129+Math.floor(u/12600);u=u%12600;t[d++]=48+Math.floor(u/1260);u=u%1260;t[d++]=129+Math.floor(u/10);u=u%10;t[d++]=48+u;continue}}}if(u===r)u=this.defaultCharSingleByte;if(u<256){t[d++]=u}else if(u<65536){t[d++]=u>>8;t[d++]=u&255}else if(u<16777216){t[d++]=u>>16;t[d++]=u>>8&255;t[d++]=u&255}else{t[d++]=u>>>24;t[d++]=u>>>16&255;t[d++]=u>>>8&255;t[d++]=u&255}}this.seqObj=i;this.leadSurrogate=a;return t.slice(0,d)};DBCSEncoder.prototype.end=function(){if(this.leadSurrogate===-1&&this.seqObj===undefined)return;var e=n.alloc(10),t=0;if(this.seqObj){var a=this.seqObj[l];if(a!==undefined){if(a<256){e[t++]=a}else{e[t++]=a>>8;e[t++]=a&255}}else{}this.seqObj=undefined}if(this.leadSurrogate!==-1){e[t++]=this.defaultCharSingleByte;this.leadSurrogate=-1}return e.slice(0,t)};DBCSEncoder.prototype.findIdx=findIdx;function DBCSDecoder(e,t){this.nodeIdx=0;this.prevBytes=[];this.decodeTables=t.decodeTables;this.decodeTableSeq=t.decodeTableSeq;this.defaultCharUnicode=t.defaultCharUnicode;this.gb18030=t.gb18030}DBCSDecoder.prototype.write=function(e){var t=n.alloc(e.length*2),a=this.nodeIdx,p=this.prevBytes,l=this.prevBytes.length,d=-this.prevBytes.length,c;for(var u=0,f=0;u<e.length;u++){var m=u>=0?e[u]:p[u+l];var c=this.decodeTables[a][m];if(c>=0){}else if(c===r){c=this.defaultCharUnicode.charCodeAt(0);u=d}else if(c===i){if(u>=3){var h=(e[u-3]-129)*12600+(e[u-2]-48)*1260+(e[u-1]-129)*10+(m-48)}else{var h=(p[u-3+l]-129)*12600+((u-2>=0?e[u-2]:p[u-2+l])-48)*1260+((u-1>=0?e[u-1]:p[u-1+l])-129)*10+(m-48)}var v=findIdx(this.gb18030.gbChars,h);c=this.gb18030.uChars[v]+h-this.gb18030.gbChars[v]}else if(c<=o){a=o-c;continue}else if(c<=s){var g=this.decodeTableSeq[s-c];for(var y=0;y<g.length-1;y++){c=g[y];t[f++]=c&255;t[f++]=c>>8}c=g[g.length-1]}else throw new Error("iconv-lite internal error: invalid decoding table value "+c+" at "+a+"/"+m);if(c>=65536){c-=65536;var b=55296|c>>10;t[f++]=b&255;t[f++]=b>>8;c=56320|c&1023}t[f++]=c&255;t[f++]=c>>8;a=0;d=u+1}this.nodeIdx=a;this.prevBytes=d>=0?Array.prototype.slice.call(e,d):p.slice(d+l).concat(Array.prototype.slice.call(e));return t.slice(0,f).toString("ucs2")};DBCSDecoder.prototype.end=function(){var e="";while(this.prevBytes.length>0){e+=this.defaultCharUnicode;var t=this.prevBytes.slice(1);this.prevBytes=[];this.nodeIdx=0;if(t.length>0)e+=this.write(t)}this.prevBytes=[];this.nodeIdx=0;return e};function findIdx(e,t){if(e[0]>t)return-1;var a=0,n=e.length;while(a<n-1){var r=a+(n-a+1>>1);if(e[r]<=t)a=r;else n=r}return a}},4700:(e,t,a)=>{"use strict";e.exports={shiftjis:{type:"_dbcs",table:function(){return a(3851)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return a(4386)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return a(7004)}},gbk:{type:"_dbcs",table:function(){return a(7004).concat(a(5862))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return a(7004).concat(a(5862))},gb18030:function(){return a(7618)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return a(5970)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return a(7816)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return a(7816).concat(a(5263))},encodeSkipVals:[36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},7987:(e,t,a)=>{"use strict";var n=[a(725),a(9727),a(9617),a(2622),a(2679),a(3249),a(2105),a(3372),a(4700)];for(var r=0;r<n.length;r++){var i=n[r];for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s))t[s]=i[s]}},725:(e,t,a)=>{"use strict";var n=a(5237).Buffer;e.exports={utf8:{type:"_internal",bomAware:true},cesu8:{type:"_internal",bomAware:true},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:true},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:InternalCodec};function InternalCodec(e,t){this.enc=e.encodingName;this.bomAware=e.bomAware;if(this.enc==="base64")this.encoder=InternalEncoderBase64;else if(this.enc==="cesu8"){this.enc="utf8";this.encoder=InternalEncoderCesu8;if(n.from("eda0bdedb2a9","hex").toString()!=="💩"){this.decoder=InternalDecoderCesu8;this.defaultCharUnicode=t.defaultCharUnicode}}}InternalCodec.prototype.encoder=InternalEncoder;InternalCodec.prototype.decoder=InternalDecoder;var r=a(3193).StringDecoder;if(!r.prototype.end)r.prototype.end=function(){};function InternalDecoder(e,t){this.decoder=new r(t.enc)}InternalDecoder.prototype.write=function(e){if(!n.isBuffer(e)){e=n.from(e)}return this.decoder.write(e)};InternalDecoder.prototype.end=function(){return this.decoder.end()};function InternalEncoder(e,t){this.enc=t.enc}InternalEncoder.prototype.write=function(e){return n.from(e,this.enc)};InternalEncoder.prototype.end=function(){};function InternalEncoderBase64(e,t){this.prevStr=""}InternalEncoderBase64.prototype.write=function(e){e=this.prevStr+e;var t=e.length-e.length%4;this.prevStr=e.slice(t);e=e.slice(0,t);return n.from(e,"base64")};InternalEncoderBase64.prototype.end=function(){return n.from(this.prevStr,"base64")};function InternalEncoderCesu8(e,t){}InternalEncoderCesu8.prototype.write=function(e){var t=n.alloc(e.length*3),a=0;for(var r=0;r<e.length;r++){var i=e.charCodeAt(r);if(i<128)t[a++]=i;else if(i<2048){t[a++]=192+(i>>>6);t[a++]=128+(i&63)}else{t[a++]=224+(i>>>12);t[a++]=128+(i>>>6&63);t[a++]=128+(i&63)}}return t.slice(0,a)};InternalEncoderCesu8.prototype.end=function(){};function InternalDecoderCesu8(e,t){this.acc=0;this.contBytes=0;this.accBytes=0;this.defaultCharUnicode=t.defaultCharUnicode}InternalDecoderCesu8.prototype.write=function(e){var t=this.acc,a=this.contBytes,n=this.accBytes,r="";for(var i=0;i<e.length;i++){var s=e[i];if((s&192)!==128){if(a>0){r+=this.defaultCharUnicode;a=0}if(s<128){r+=String.fromCharCode(s)}else if(s<224){t=s&31;a=1;n=1}else if(s<240){t=s&15;a=2;n=1}else{r+=this.defaultCharUnicode}}else{if(a>0){t=t<<6|s&63;a--;n++;if(a===0){if(n===2&&t<128&&t>0)r+=this.defaultCharUnicode;else if(n===3&&t<2048)r+=this.defaultCharUnicode;else r+=String.fromCharCode(t)}}else{r+=this.defaultCharUnicode}}}this.acc=t;this.contBytes=a;this.accBytes=n;return r};InternalDecoderCesu8.prototype.end=function(){var e=0;if(this.contBytes>0)e+=this.defaultCharUnicode;return e}},2679:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t._sbcs=SBCSCodec;function SBCSCodec(e,t){if(!e)throw new Error("SBCS codec is called without the data.");if(!e.chars||e.chars.length!==128&&e.chars.length!==256)throw new Error("Encoding '"+e.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(e.chars.length===128){var a="";for(var r=0;r<128;r++)a+=String.fromCharCode(r);e.chars=a+e.chars}this.decodeBuf=n.from(e.chars,"ucs2");var i=n.alloc(65536,t.defaultCharSingleByte.charCodeAt(0));for(var r=0;r<e.chars.length;r++)i[e.chars.charCodeAt(r)]=r;this.encodeBuf=i}SBCSCodec.prototype.encoder=SBCSEncoder;SBCSCodec.prototype.decoder=SBCSDecoder;function SBCSEncoder(e,t){this.encodeBuf=t.encodeBuf}SBCSEncoder.prototype.write=function(e){var t=n.alloc(e.length);for(var a=0;a<e.length;a++)t[a]=this.encodeBuf[e.charCodeAt(a)];return t};SBCSEncoder.prototype.end=function(){};function SBCSDecoder(e,t){this.decodeBuf=t.decodeBuf}SBCSDecoder.prototype.write=function(e){var t=this.decodeBuf;var a=n.alloc(e.length*2);var r=0,i=0;for(var s=0;s<e.length;s++){r=e[s]*2;i=s*2;a[i]=t[r];a[i+1]=t[r+1]}return a.toString("ucs2")};SBCSDecoder.prototype.end=function(){}},2105:e=>{"use strict";e.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת���"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œں ،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûüے"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"
Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"
Ħ˘£¤�Ĥ§¨İŞĞĴ�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"
ĄĸŖ¤Ĩϧ¨ŠĒĢŦޝ°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"
ЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"
���¤�������،�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"
‘’£€₯¦§¨©ͺ«¬�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"
�¢£¤¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת���"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"
ĄĒĢĪĨͧĻĐŠŦŽŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"
กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"
”¢£¤„¦§Ø©Ŗ«¬®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"
Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"
¡¢£€¥Š§š©ª«¬®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"
ĄąŁ€„Чš©Ș«ŹźŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’±“¾¶§÷„°∙·¹³²■ "},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ "},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘§÷¸°¨˙űŘř■ "},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№ыЫзЗшШэЭщЩчЧ§■ "},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´±‗¾¶§÷¸°¨·¹³²■ "},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´±�¾¶§÷¸°¨·¹³²■ "},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ "},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"
ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"
¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"
ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"
¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"
�և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},3249:e=>{"use strict";e.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},cp720:{type:"_sbcs",chars:"éâàçêëèïîّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ "},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}},9617:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t.utf16be=Utf16BECodec;function Utf16BECodec(){}Utf16BECodec.prototype.encoder=Utf16BEEncoder;Utf16BECodec.prototype.decoder=Utf16BEDecoder;Utf16BECodec.prototype.bomAware=true;function Utf16BEEncoder(){}Utf16BEEncoder.prototype.write=function(e){var t=n.from(e,"ucs2");for(var a=0;a<t.length;a+=2){var r=t[a];t[a]=t[a+1];t[a+1]=r}return t};Utf16BEEncoder.prototype.end=function(){};function Utf16BEDecoder(){this.overflowByte=-1}Utf16BEDecoder.prototype.write=function(e){if(e.length==0)return"";var t=n.alloc(e.length+1),a=0,r=0;if(this.overflowByte!==-1){t[0]=e[0];t[1]=this.overflowByte;a=1;r=2}for(;a<e.length-1;a+=2,r+=2){t[r]=e[a+1];t[r+1]=e[a]}this.overflowByte=a==e.length-1?e[e.length-1]:-1;return t.slice(0,r).toString("ucs2")};Utf16BEDecoder.prototype.end=function(){this.overflowByte=-1};t.utf16=Utf16Codec;function Utf16Codec(e,t){this.iconv=t}Utf16Codec.prototype.encoder=Utf16Encoder;Utf16Codec.prototype.decoder=Utf16Decoder;function Utf16Encoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder("utf-16le",e)}Utf16Encoder.prototype.write=function(e){return this.encoder.write(e)};Utf16Encoder.prototype.end=function(){return this.encoder.end()};function Utf16Decoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf16Decoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<16)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var a="";for(var n=0;n<this.initialBufs.length;n++)a+=this.decoder.write(this.initialBufs[n]);this.initialBufs.length=this.initialBufsLen=0;return a}return this.decoder.write(e)};Utf16Decoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var a=0;a<this.initialBufs.length;a++)t+=this.decoder.write(this.initialBufs[a]);var n=this.decoder.end();if(n)t+=n;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var a=[];var n=0;var r=0,i=0;e:for(var s=0;s<e.length;s++){var o=e[s];for(var p=0;p<o.length;p++){a.push(o[p]);if(a.length===2){if(n===0){if(a[0]===255&&a[1]===254)return"utf-16le";if(a[0]===254&&a[1]===255)return"utf-16be"}if(a[0]===0&&a[1]!==0)i++;if(a[0]!==0&&a[1]===0)r++;a.length=0;n++;if(n>=100){break e}}}}if(i>r)return"utf-16be";if(i<r)return"utf-16le";return t||"utf-16le"}},9727:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t._utf32=Utf32Codec;function Utf32Codec(e,t){this.iconv=t;this.bomAware=true;this.isLE=e.isLE}t.utf32le={type:"_utf32",isLE:true};t.utf32be={type:"_utf32",isLE:false};t.ucs4le="utf32le";t.ucs4be="utf32be";Utf32Codec.prototype.encoder=Utf32Encoder;Utf32Codec.prototype.decoder=Utf32Decoder;function Utf32Encoder(e,t){this.isLE=t.isLE;this.highSurrogate=0}Utf32Encoder.prototype.write=function(e){var t=n.from(e,"ucs2");var a=n.alloc(t.length*2);var r=this.isLE?a.writeUInt32LE:a.writeUInt32BE;var i=0;for(var s=0;s<t.length;s+=2){var o=t.readUInt16LE(s);var p=55296<=o&&o<56320;var l=56320<=o&&o<57344;if(this.highSurrogate){if(p||!l){r.call(a,this.highSurrogate,i);i+=4}else{var d=(this.highSurrogate-55296<<10|o-56320)+65536;r.call(a,d,i);i+=4;this.highSurrogate=0;continue}}if(p)this.highSurrogate=o;else{r.call(a,o,i);i+=4;this.highSurrogate=0}}if(i<a.length)a=a.slice(0,i);return a};Utf32Encoder.prototype.end=function(){if(!this.highSurrogate)return;var e=n.alloc(4);if(this.isLE)e.writeUInt32LE(this.highSurrogate,0);else e.writeUInt32BE(this.highSurrogate,0);this.highSurrogate=0;return e};function Utf32Decoder(e,t){this.isLE=t.isLE;this.badChar=t.iconv.defaultCharUnicode.charCodeAt(0);this.overflow=[]}Utf32Decoder.prototype.write=function(e){if(e.length===0)return"";var t=0;var a=0;var r=n.alloc(e.length+4);var i=0;var s=this.isLE;var o=this.overflow;var p=this.badChar;if(o.length>0){for(;t<e.length&&o.length<4;t++)o.push(e[t]);if(o.length===4){if(s){a=o[t]|o[t+1]<<8|o[t+2]<<16|o[t+3]<<24}else{a=o[t+3]|o[t+2]<<8|o[t+1]<<16|o[t]<<24}o.length=0;i=_writeCodepoint(r,i,a,p)}}for(;t<e.length-3;t+=4){if(s){a=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}else{a=e[t+3]|e[t+2]<<8|e[t+1]<<16|e[t]<<24}i=_writeCodepoint(r,i,a,p)}for(;t<e.length;t++){o.push(e[t])}return r.slice(0,i).toString("ucs2")};function _writeCodepoint(e,t,a,n){if(a<0||a>1114111){a=n}if(a>=65536){a-=65536;var r=55296|a>>10;e[t++]=r&255;e[t++]=r>>8;var a=56320|a&1023}e[t++]=a&255;e[t++]=a>>8;return t}Utf32Decoder.prototype.end=function(){this.overflow.length=0};t.utf32=Utf32AutoCodec;t.ucs4="utf32";function Utf32AutoCodec(e,t){this.iconv=t}Utf32AutoCodec.prototype.encoder=Utf32AutoEncoder;Utf32AutoCodec.prototype.decoder=Utf32AutoDecoder;function Utf32AutoEncoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder(e.defaultEncoding||"utf-32le",e)}Utf32AutoEncoder.prototype.write=function(e){return this.encoder.write(e)};Utf32AutoEncoder.prototype.end=function(){return this.encoder.end()};function Utf32AutoDecoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf32AutoDecoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<32)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var a="";for(var n=0;n<this.initialBufs.length;n++)a+=this.decoder.write(this.initialBufs[n]);this.initialBufs.length=this.initialBufsLen=0;return a}return this.decoder.write(e)};Utf32AutoDecoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var a=0;a<this.initialBufs.length;a++)t+=this.decoder.write(this.initialBufs[a]);var n=this.decoder.end();if(n)t+=n;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var a=[];var n=0;var r=0,i=0;var s=0,o=0;e:for(var p=0;p<e.length;p++){var l=e[p];for(var d=0;d<l.length;d++){a.push(l[d]);if(a.length===4){if(n===0){if(a[0]===255&&a[1]===254&&a[2]===0&&a[3]===0){return"utf-32le"}if(a[0]===0&&a[1]===0&&a[2]===254&&a[3]===255){return"utf-32be"}}if(a[0]!==0||a[1]>16)i++;if(a[3]!==0||a[2]>16)r++;if(a[0]===0&&a[1]===0&&(a[2]!==0||a[3]!==0))o++;if((a[0]!==0||a[1]!==0)&&a[2]===0&&a[3]===0)s++;a.length=0;n++;if(n>=100){break e}}}}if(o-i>s-r)return"utf-32be";if(o-i<s-r)return"utf-32le";return t||"utf-32le"}},2622:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t.utf7=Utf7Codec;t.unicode11utf7="utf7";function Utf7Codec(e,t){this.iconv=t}Utf7Codec.prototype.encoder=Utf7Encoder;Utf7Codec.prototype.decoder=Utf7Decoder;Utf7Codec.prototype.bomAware=true;var r=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Utf7Encoder(e,t){this.iconv=t.iconv}Utf7Encoder.prototype.write=function(e){return n.from(e.replace(r,function(e){return"+"+(e==="+"?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))};Utf7Encoder.prototype.end=function(){};function Utf7Decoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var i=/[A-Za-z0-9\/+]/;var s=[];for(var o=0;o<256;o++)s[o]=i.test(String.fromCharCode(o));var p="+".charCodeAt(0),l="-".charCodeAt(0),d="&".charCodeAt(0);Utf7Decoder.prototype.write=function(e){var t="",a=0,r=this.inBase64,i=this.base64Accum;for(var o=0;o<e.length;o++){if(!r){if(e[o]==p){t+=this.iconv.decode(e.slice(a,o),"ascii");a=o+1;r=true}}else{if(!s[e[o]]){if(o==a&&e[o]==l){t+="+"}else{var d=i+this.iconv.decode(e.slice(a,o),"ascii");t+=this.iconv.decode(n.from(d,"base64"),"utf16-be")}if(e[o]!=l)o--;a=o+1;r=false;i=""}}}if(!r){t+=this.iconv.decode(e.slice(a),"ascii")}else{var d=i+this.iconv.decode(e.slice(a),"ascii");var c=d.length-d.length%8;i=d.slice(c);d=d.slice(0,c);t+=this.iconv.decode(n.from(d,"base64"),"utf16-be")}this.inBase64=r;this.base64Accum=i;return t};Utf7Decoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(n.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e};t.utf7imap=Utf7IMAPCodec;function Utf7IMAPCodec(e,t){this.iconv=t}Utf7IMAPCodec.prototype.encoder=Utf7IMAPEncoder;Utf7IMAPCodec.prototype.decoder=Utf7IMAPDecoder;Utf7IMAPCodec.prototype.bomAware=true;function Utf7IMAPEncoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=n.alloc(6);this.base64AccumIdx=0}Utf7IMAPEncoder.prototype.write=function(e){var t=this.inBase64,a=this.base64Accum,r=this.base64AccumIdx,i=n.alloc(e.length*5+10),s=0;for(var o=0;o<e.length;o++){var p=e.charCodeAt(o);if(32<=p&&p<=126){if(t){if(r>0){s+=i.write(a.slice(0,r).toString("base64").replace(/\//g,",").replace(/=+$/,""),s);r=0}i[s++]=l;t=false}if(!t){i[s++]=p;if(p===d)i[s++]=l}}else{if(!t){i[s++]=d;t=true}if(t){a[r++]=p>>8;a[r++]=p&255;if(r==a.length){s+=i.write(a.toString("base64").replace(/\//g,","),s);r=0}}}}this.inBase64=t;this.base64AccumIdx=r;return i.slice(0,s)};Utf7IMAPEncoder.prototype.end=function(){var e=n.alloc(10),t=0;if(this.inBase64){if(this.base64AccumIdx>0){t+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),t);this.base64AccumIdx=0}e[t++]=l;this.inBase64=false}return e.slice(0,t)};function Utf7IMAPDecoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var c=s.slice();c[",".charCodeAt(0)]=true;Utf7IMAPDecoder.prototype.write=function(e){var t="",a=0,r=this.inBase64,i=this.base64Accum;for(var s=0;s<e.length;s++){if(!r){if(e[s]==d){t+=this.iconv.decode(e.slice(a,s),"ascii");a=s+1;r=true}}else{if(!c[e[s]]){if(s==a&&e[s]==l){t+="&"}else{var o=i+this.iconv.decode(e.slice(a,s),"ascii").replace(/,/g,"/");t+=this.iconv.decode(n.from(o,"base64"),"utf16-be")}if(e[s]!=l)s--;a=s+1;r=false;i=""}}}if(!r){t+=this.iconv.decode(e.slice(a),"ascii")}else{var o=i+this.iconv.decode(e.slice(a),"ascii").replace(/,/g,"/");var p=o.length-o.length%8;i=o.slice(p);o=o.slice(0,p);t+=this.iconv.decode(n.from(o,"base64"),"utf16-be")}this.inBase64=r;this.base64Accum=i;return t};Utf7IMAPDecoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(n.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e}},8148:(e,t)=>{"use strict";var a="\ufeff";t.PrependBOM=PrependBOMWrapper;function PrependBOMWrapper(e,t){this.encoder=e;this.addBOM=true}PrependBOMWrapper.prototype.write=function(e){if(this.addBOM){e=a+e;this.addBOM=false}return this.encoder.write(e)};PrependBOMWrapper.prototype.end=function(){return this.encoder.end()};t.StripBOM=StripBOMWrapper;function StripBOMWrapper(e,t){this.decoder=e;this.pass=false;this.options=t||{}}StripBOMWrapper.prototype.write=function(e){var t=this.decoder.write(e);if(this.pass||!t)return t;if(t[0]===a){t=t.slice(1);if(typeof this.options.stripBOM==="function")this.options.stripBOM()}this.pass=true;return t};StripBOMWrapper.prototype.end=function(){return this.decoder.end()}},8538:(e,t,a)=>{"use strict";var n=a(5237).Buffer;var r=a(8148),i=e.exports;i.encodings=null;i.defaultCharUnicode="�";i.defaultCharSingleByte="?";i.encode=function encode(e,t,a){e=""+(e||"");var r=i.getEncoder(t,a);var s=r.write(e);var o=r.end();return o&&o.length>0?n.concat([s,o]):s};i.decode=function decode(e,t,a){if(typeof e==="string"){if(!i.skipDecodeWarning){console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");i.skipDecodeWarning=true}e=n.from(""+(e||""),"binary")}var r=i.getDecoder(t,a);var s=r.write(e);var o=r.end();return o?s+o:s};i.encodingExists=function encodingExists(e){try{i.getCodec(e);return true}catch(e){return false}};i.toEncoding=i.encode;i.fromEncoding=i.decode;i._codecDataCache={};i.getCodec=function getCodec(e){if(!i.encodings)i.encodings=a(7987);var t=i._canonicalizeEncoding(e);var n={};while(true){var r=i._codecDataCache[t];if(r)return r;var s=i.encodings[t];switch(typeof s){case"string":t=s;break;case"object":for(var o in s)n[o]=s[o];if(!n.encodingName)n.encodingName=t;t=s.type;break;case"function":if(!n.encodingName)n.encodingName=t;r=new s(n,i);i._codecDataCache[n.encodingName]=r;return r;default:throw new Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')")}}};i._canonicalizeEncoding=function(e){return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")};i.getEncoder=function getEncoder(e,t){var a=i.getCodec(e),n=new a.encoder(t,a);if(a.bomAware&&t&&t.addBOM)n=new r.PrependBOM(n,t);return n};i.getDecoder=function getDecoder(e,t){var a=i.getCodec(e),n=new a.decoder(t,a);if(a.bomAware&&!(t&&t.stripBOM===false))n=new r.StripBOM(n,t);return n};i.enableStreamingAPI=function enableStreamingAPI(e){if(i.supportsStreams)return;var t=a(5823)(e);i.IconvLiteEncoderStream=t.IconvLiteEncoderStream;i.IconvLiteDecoderStream=t.IconvLiteDecoderStream;i.encodeStream=function encodeStream(e,t){return new i.IconvLiteEncoderStream(i.getEncoder(e,t),t)};i.decodeStream=function decodeStream(e,t){return new i.IconvLiteDecoderStream(i.getDecoder(e,t),t)};i.supportsStreams=true};var s;try{s=a(2203)}catch(e){}if(s&&s.Transform){i.enableStreamingAPI(s)}else{i.encodeStream=i.decodeStream=function(){throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")}}if(false){}},5823:(e,t,a)=>{"use strict";var n=a(5237).Buffer;e.exports=function(e){var t=e.Transform;function IconvLiteEncoderStream(e,a){this.conv=e;a=a||{};a.decodeStrings=false;t.call(this,a)}IconvLiteEncoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteEncoderStream}});IconvLiteEncoderStream.prototype._transform=function(e,t,a){if(typeof e!="string")return a(new Error("Iconv encoding stream needs strings as its input."));try{var n=this.conv.write(e);if(n&&n.length)this.push(n);a()}catch(e){a(e)}};IconvLiteEncoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t);e()}catch(t){e(t)}};IconvLiteEncoderStream.prototype.collect=function(e){var t=[];this.on("error",e);this.on("data",(function(e){t.push(e)}));this.on("end",(function(){e(null,n.concat(t))}));return this};function IconvLiteDecoderStream(e,a){this.conv=e;a=a||{};a.encoding=this.encoding="utf8";t.call(this,a)}IconvLiteDecoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteDecoderStream}});IconvLiteDecoderStream.prototype._transform=function(e,t,a){if(!n.isBuffer(e)&&!(e instanceof Uint8Array))return a(new Error("Iconv decoding stream needs buffers as its input."));try{var r=this.conv.write(e);if(r&&r.length)this.push(r,this.encoding);a()}catch(e){a(e)}};IconvLiteDecoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t,this.encoding);e()}catch(t){e(t)}};IconvLiteDecoderStream.prototype.collect=function(e){var t="";this.on("error",e);this.on("data",(function(e){t+=e}));this.on("end",(function(){e(null,t)}));return this};return{IconvLiteEncoderStream:IconvLiteEncoderStream,IconvLiteDecoderStream:IconvLiteDecoderStream}}},5029:(e,t,a)=>{"use strict";const n=a(9896);let r;function hasDockerEnv(){try{n.statSync("/.dockerenv");return true}catch(e){return false}}function hasDockerCGroup(){try{return n.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return false}}e.exports=()=>{if(r===undefined){r=hasDockerEnv()||hasDockerCGroup()}return r}},7534:e=>{e.exports=isPromise;e.exports["default"]=isPromise;function isPromise(e){return!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function"}},7401:(e,t,a)=>{"use strict";const n=a(857);const r=a(9896);const i=a(5029);const isWsl=()=>{if(process.platform!=="linux"){return false}if(n.release().toLowerCase().includes("microsoft")){if(i()){return false}return true}try{return r.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!i():false}catch(e){return false}};if(process.env.__IS_WSL_TEST__){e.exports=isWsl}else{e.exports=isWsl()}},8026:(e,t,a)=>{var n=a(9896);var r;if(process.platform==="win32"||global.TESTING_WINDOWS){r=a(463)}else{r=a(9163)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,a){if(typeof t==="function"){a=t;t={}}if(!a){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(a,n){isexe(e,t||{},(function(e,t){if(e){n(e)}else{a(t)}}))}))}r(e,t||{},(function(e,n){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;n=false}}a(e,n)}))}function sync(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},9163:(e,t,a)=>{e.exports=isexe;isexe.sync=sync;var n=a(9896);function isexe(e,t,a){n.stat(e,(function(e,n){a(e,e?false:checkStat(n,t))}))}function sync(e,t){return checkStat(n.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var a=e.mode;var n=e.uid;var r=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var s=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var o=parseInt("100",8);var p=parseInt("010",8);var l=parseInt("001",8);var d=o|p;var c=a&l||a&p&&r===s||a&o&&n===i||a&d&&i===0;return c}},463:(e,t,a)=>{e.exports=isexe;isexe.sync=sync;var n=a(9896);function checkPathExt(e,t){var a=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!a){return true}a=a.split(";");if(a.indexOf("")!==-1){return true}for(var n=0;n<a.length;n++){var r=a[n].toLowerCase();if(r&&e.substr(-r.length).toLowerCase()===r){return true}}return false}function checkStat(e,t,a){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,a)}function isexe(e,t,a){n.stat(e,(function(n,r){a(n,n?false:checkStat(r,e,t))}))}function sync(e,t){return checkStat(n.statSync(e),e,t)}},9250:function(e,t,a){e=a.nmd(e);
|
|
1
|
+
(()=>{var __webpack_modules__={6057:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(1);const r=a(5110);const i=a(5472);const s=a(5614);const o=a(8832);const p=a(241);t["default"]=async(e,t)=>{var a;const l=await(0,n.getProjectConfig)();if(!l){return}const d=(0,p.createCatenvContext)(l);if(t===null||t===void 0?void 0:t.verbose){(0,i.printVerboseBanner)()}await Promise.all([(0,p.generatePipelineFiles)(d,(a=l.pipelineType)!==null&&a!==void 0?a:"gitlab"),(0,s.writeDotEnvFiles)(d,e),(0,o.writeDTsFiles)(d,e),(0,r.printVariables)(d,e)])}},5110:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.printVariables=void 0;const n=a(1);const r=a(1909);const getAllVariablesToPrint=async(e,t)=>{var a;const{env:i,currentComponent:s}=await(0,r.getCurrentComponentAndEnvFromChoice)(e,t);if(s){if((a=e.components[s].dotEnv)!==null&&a!==void 0?a:true){return{}}return await(0,n.getEnvVarsResolved)(null,i,s)}else{return await Object.keys(e.components).reduce((async(t,a)=>{var s;if((s=e.components[a].dotEnv)!==null&&s!==void 0?s:true){return await t}const o=await(0,n.getEnvVarsResolved)(null,i,a);delete o["_ALL_ENV_VAR_KEYS"];return{...await t,...o,...Object.fromEntries(Object.entries(o).map((([e,t])=>[`${(0,r.sanitizeEnvVarName)(a.toUpperCase())}_${e}`,t])))}}),Promise.resolve({}))}};const printVariables=async(e,t)=>{const a=await getAllVariablesToPrint(e.config,t);console.log(makeExportKeyValuestring(a))};t.printVariables=printVariables;const makeExportKeyValuestring=e=>(0,r.makeKeyValueString)(e,{keyPrefix:"export ",escapeOptions:{quoteMode:"always"}})},1909:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.sanitizeEnvVarName=t.makeKeyValueString=t.getCurrentComponentAndEnvFromChoice=t.getComponentFullPath=void 0;const n=a(6928);const r=a(7414);const i=a(241);const getComponentFullPath=(e,t,a)=>(0,n.join)(e,t.components[a].dir);t.getComponentFullPath=getComponentFullPath;const getCurrentComponentName=async e=>{const a=await(0,r.getGitRoot)();const n=process.cwd();return Object.keys(e.components).find((r=>n.startsWith((0,t.getComponentFullPath)(a,e,r))))};const getCurrentComponentAndEnvFromChoice=async(e,t)=>{var a,n;const r=(a=t===null||t===void 0?void 0:t.env)!==null&&a!==void 0?a:"local";const i=(n=t===null||t===void 0?void 0:t.componentName)!==null&&n!==void 0?n:await getCurrentComponentName(e);return{currentComponent:i,env:r}};t.getCurrentComponentAndEnvFromChoice=getCurrentComponentAndEnvFromChoice;const makeKeyValueString=(e,{keyPrefix:t,escapeOptions:a}={keyPrefix:""})=>Object.entries(e).map((([e,n])=>`${t}${e}=${(0,i.escapeForDotEnv)(n,a)}`)).join("\n");t.makeKeyValueString=makeKeyValueString;const sanitizeEnvVarName=e=>e.replace(/[\s\-.]+/g,"_");t.sanitizeEnvVarName=sanitizeEnvVarName},5472:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.printVerboseBanner=void 0;const n=a(1);const printVerboseBanner=async()=>{const e=await(0,n.getProjectConfig)();if(!e){return}const t=await Promise.all(Object.keys(e.components).map((async e=>{const t=await(0,n.getEnvironment)("local",e);const a=t.envVars.PORT;if(!a){return null}return`${e}: http://localhost:${a}`}))).then((e=>e.filter(Boolean)));const a=["catenv","-------","running on:","",...t];for(const e of a){console.log(e)}};t.printVerboseBanner=printVerboseBanner},5614:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeDotEnvFiles=void 0;const n=a(6928);const r=a(1);const i=a(7414);const s=a(1909);const writeDotEnvFiles=async(e,t)=>{const{env:a,currentComponent:o}=await(0,s.getCurrentComponentAndEnvFromChoice)(e.config,t);const p=Object.entries(e.config.components).filter((([,e])=>{var t;return(t=e===null||e===void 0?void 0:e.dotEnv)!==null&&t!==void 0?t:true})).map((([e])=>e));const l=o?p.includes(o)?[o]:[]:p;const d=await(0,i.getGitRoot)();for(const t of l){const i=await(0,r.getEnvVarsResolved)(null,a,t);delete i["_ALL_ENV_VAR_KEYS"];const o=(0,s.getComponentFullPath)(d,e.config,t);const p=(0,n.join)(o,".env");await e.fileWriter.writeGeneratedFile(p,(0,s.makeKeyValueString)(i),{commentChar:"#"})}};t.writeDotEnvFiles=writeDotEnvFiles},8832:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeDTsFiles=void 0;const n=a(6928);const r=a(1);const i=a(7414);const s=a(1909);const writeDTsFiles=async(e,t)=>{const{env:a,currentComponent:r}=await(0,s.getCurrentComponentAndEnvFromChoice)(e.config,t);const o=Object.entries(e.config.components).filter((([,e])=>{var t;return(t=e===null||e===void 0?void 0:e.envDTs)!==null&&t!==void 0?t:true})).map((([e])=>e));const p=r?o.includes(r)?[r]:[]:o;const l=await(0,i.getGitRoot)();for(const t of p){const r=await getEnvsForDTs(a,t);const i=createEnvDTsContent(r);const o=(0,s.getComponentFullPath)(l,e.config,t);const p=(0,n.join)(o,"env.d.ts");await e.fileWriter.writeGeneratedFile(p,i,{commentChar:"//"})}};t.writeDTsFiles=writeDTsFiles;async function getEnvsForDTs(e,t){const a=await(0,r.getEnvironment)(e,t);const n=Object.keys(a.envVars);const i=new Set(a.secretEnvVarKeys.filter((e=>e.hidden)).map((e=>e.key)).concat(["_ALL_ENV_VAR_KEYS"]));const s=n.filter((e=>!i.has(e)));return s}function createEnvDTsContent(e){return`/* tslint:disable prettier/prettier */\n/* eslint-disable prettier/prettier */\n/* prettier-ignore */\n\nexport {}\n\ndeclare global {\n namespace NodeJS {\n interface ProcessEnv {\n${e.map((e=>` ${e}: string`)).join("\n")}\n }\n }\n}\n`}},2994:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=n(a(6057));const i=a(4272);const s=process.argv.slice(2);const o=["--help","-h","help"];if(s.some((e=>o.includes(e)))){const e="https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";console.log(`\nUsage: catenv [env|env:component] [-v|--verbose]\n\nEnv variable and catenv documentation:\n${e}`);process.exit(0)}const p=s.some((e=>e==="-v"||e==="--verbose"));const l=s.find((e=>e!=="-v"&&e!=="--verbose"));(0,r.default)(l?(0,i.parseChoice)(l):null,{verbose:p}).then((()=>{process.exit()}))},1:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getJobOnlyEnvVarsResolved=t.getEnvVarsResolved=t.getGitlabVar=t.getEnvironment=t.getAllPipelineContexts=t.getAllComponentsWithAllEnvsHierarchical=t.getAllComponentsWithAllEnvsFlat=t.getPipelineContextByChoice=t.getProjectComponents=t.getProjectConfig=t.parseChoice=void 0;const n=a(241);const r=a(4508);const i=a(7414);const s=a(9896);var o=a(4272);Object.defineProperty(t,"parseChoice",{enumerable:true,get:function(){return o.parseChoice}});let p=null;const reloadConfigAndObserve=async()=>{const e=await(0,i.getGitRoot)();if(!e){return}const t=await(0,n.readConfig)(e);if(!t){return}const{config:a,path:r}=t;const o=(0,s.watch)(r,(()=>{o.close();reloadConfigAndObserve()}));p=a};const getProjectConfig=async()=>{if(!p){await reloadConfigAndObserve()}return p};t.getProjectConfig=getProjectConfig;const getProjectComponents=async()=>{const e=await(0,t.getProjectConfig)();if(!e)return[];return Object.keys(e.components)};t.getProjectComponents=getProjectComponents;const getPipelineContextByChoice=async(e,a)=>{const r=await(0,t.getProjectConfig)();return await(0,n.createComponentContext)({config:r,componentName:a,env:e})};t.getPipelineContextByChoice=getPipelineContextByChoice;const getAllComponentsWithAllEnvsFlat=async()=>{const e=await(0,t.getProjectConfig)();if(!e){return[]}return getAllComponentsWithAllEnvsFlatFromConfig(e)};t.getAllComponentsWithAllEnvsFlat=getAllComponentsWithAllEnvsFlat;const getAllComponentsWithAllEnvsHierarchical=async()=>{const e=await(0,t.getProjectConfig)();if(!e){return{}}return Object.fromEntries(Object.keys(e.components).map((t=>[t,(0,n.getAllEnvs)(e,t)])))};t.getAllComponentsWithAllEnvsHierarchical=getAllComponentsWithAllEnvsHierarchical;const getAllPipelineContexts=async e=>{const a=e?Array.isArray(e)?e:[e]:null;return Promise.all((await(0,t.getAllComponentsWithAllEnvsFlat)()).filter((e=>e.env!=="local")).filter((e=>!a||a.includes(e.componentName))).map((({env:e,componentName:a})=>(0,t.getPipelineContextByChoice)(e,a))))};t.getAllPipelineContexts=getAllPipelineContexts;const getEnvironment=async(e,a)=>{const r=await(0,t.getProjectConfig)();return(0,n.getEnvironment)({config:r,componentName:a,env:e})};t.getEnvironment=getEnvironment;const getGitlabVar=async(e,t,a,i)=>{const s=(0,n.getSecretVarName)(t,a,i);return await(0,r.getVariableValueByRawName)(e,s)};t.getGitlabVar=getGitlabVar;const resolveSecrets=async(e,t)=>{const a=await(0,r.getAllVariables)(e);return Object.fromEntries(t.flatMap((({envVars:e,secretEnvVarKeys:t})=>Object.entries(e).filter((([e,a])=>{var n;return a!==undefined&&a!==null&&!((n=t.find((t=>t.key===e)))===null||n===void 0?void 0:n.hidden)})).map((([e,t])=>[e,a.reduce(((e,t)=>e.replace(new RegExp("\\$"+t.key,"g"),t.value)),`${t}`)])))))};const getEnvVarsResolved=async(e,a,n)=>{if(!n){return{}}const r=await(0,t.getEnvironment)(a,n);return resolveSecrets(e,[{envVars:r.envVars,secretEnvVarKeys:r.secretEnvVarKeys}])};t.getEnvVarsResolved=getEnvVarsResolved;const getJobOnlyEnvVarsResolved=async(e,a,n)=>{const r=await(0,t.getEnvironment)(a,n);return resolveSecrets(e,[r.jobOnlyVars.build,r.jobOnlyVars.deploy])};t.getJobOnlyEnvVarsResolved=getJobOnlyEnvVarsResolved;function getAllComponentsWithAllEnvsFlatFromConfig(e){return Object.keys(e.components).flatMap((t=>(0,n.getAllEnvs)(e,t).map((e=>({env:e,componentName:t})))))}},4272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseChoice=void 0;const parseChoice=e=>{const[t,a]=e.split(":").map((e=>e||null));return{env:t,componentName:a}};t.parseChoice=parseChoice},6636:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gitConfigSet=t.gitConfigGet=void 0;const n=a(1748);const argsJoin=e=>e.filter(Boolean).join(" ");async function gitConfigGet(e,{location:t}={}){const{stdout:a}=await(0,n.exec)(`git config --get ${argsJoin([t?`--${t}`:undefined])} ${e}`);return a.trim()}t.gitConfigGet=gitConfigGet;const gitConfigSet=(e,t,{location:a,comment:r}={})=>(0,n.exec)(`git config --set ${argsJoin([a?`--${a}`:undefined,r?`--comment=${r}`:undefined])} ${e} ${t}`);t.gitConfigSet=gitConfigSet},1111:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gitProjectInformation=t.getGitRemoteHostAndPath=t.getProjectRootPath=void 0;const n=a(6636);const r=a(1748);const getProjectRootPath=async()=>{const{stdout:e}=await(0,r.exec)(`git rev-parse --show-toplevel`);return e.trim()};t.getProjectRootPath=getProjectRootPath;const getGitRemoteHostAndPath=async()=>{var e;const t=await(0,n.gitConfigGet)("remote.origin.url");const a=/(https:\/\/|git@)([^:/]+)[:/]([^.]*)(\.git)?/;const r=(e=t.match(a))!==null&&e!==void 0?e:[];const[,,i,s]=r;if(!(i===null||i===void 0?void 0:i.length)||!(s===null||s===void 0?void 0:s.length)){throw new Error(`Failed to parse git remote hostname and path from git configs remote.origin.url! ${t}`)}return{gitRemoteHost:i,gitRemotePath:s}};t.getGitRemoteHostAndPath=getGitRemoteHostAndPath;const gitProjectInformation=async()=>{const[{gitRemoteHost:e,gitRemotePath:a},n]=await Promise.all([(0,t.getGitRemoteHostAndPath)(),(0,t.getProjectRootPath)()]);return{gitRemoteHost:e,gitRemotePath:a,projectRootPath:n}};t.gitProjectInformation=gitProjectInformation},6172:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.readFileOrError=void 0;const n=a(6954);const readFile=e=>(0,n.readFile)(e,{encoding:"utf-8"});const readFileOrError=async e=>{try{const t=await readFile(e);return[null,t]}catch(e){return[e]}};t.readFileOrError=readFileOrError},4508:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.upsertAllVariables=t.clearBackups=t.getVariableValueByRawName=t.getAllVariables=t.getProjectInfo=t.doGitlabRequest=t.getGitlabToken=t.setupGitlabToken=t.hasGitlabToken=void 0;const r=a(241);const i=a(9250);const s=n(a(7009));const o=n(a(1479));const p=n(a(5186));const l=a(6261);const d=a(1111);const c="gitlab-personal-access-token";const hasGitlabToken=async()=>await(0,l.hasPreference)(c);t.hasGitlabToken=hasGitlabToken;const setupGitlabToken=async e=>{e.log("");e.log("☝ in order to access the api, we need a personal access token");e.log("Its best to create one specifically for catladder");e.log("Scopes needed: api");e.log("");e.log("☝ we open up the settings page for you!");e.log("");const[{shouldContinue:t},{gitRemoteHost:a}]=await Promise.all([e.prompt({default:true,message:"Ok",name:"shouldContinue",type:"prompt"}),(0,d.getGitRemoteHostAndPath)()]);(0,p.default)(`https://${a}/-/user_settings/personal_access_tokens`);e.log("Please type in gitlab's personal access token");const{personalToken:n}=await e.prompt({type:"string",name:"personalToken",default:"",message:"Your personal access token "});if(n){await(0,l.setPreference)(c,n)}};t.setupGitlabToken=setupGitlabToken;const getGitlabToken=async e=>{if(!await(0,t.hasGitlabToken)()){if(!e){console.error("⚠️ gitlab token missing, please run catladder to set it up");process.exit(1)}await(0,t.setupGitlabToken)(e)}return(0,l.getPreference)(c)};t.getGitlabToken=getGitlabToken;const doGitlabRequest=async(e,a,n=undefined,r="GET")=>{const[i,{gitRemoteHost:s}]=await Promise.all([(0,t.getGitlabToken)(e),(0,d.getGitRemoteHostAndPath)()]);const p=await(0,o.default)(`https://${s}/api/v4/${a}`,{method:r,headers:{"Content-Type":"application/json","Private-Token":i},body:n?JSON.stringify(n):undefined});if(p.status>=200&&p.status<400){if(p.headers.get("content-type")==="application/json"){return p.json()}return null}if(p.status===404){throw new Error("not found")}throw new Error(`Could not send request to gitlab api ${a}: ${p.status} "${p.statusText}".\nResponse: ${JSON.stringify(await p.json(),null,2)}`)};t.doGitlabRequest=doGitlabRequest;const getProjectInfo=async e=>{const{gitRemotePath:a}=await(0,d.getGitRemoteHostAndPath)();const n=await(0,t.doGitlabRequest)(e,`projects/${encodeURIComponent(a)}`);return n};t.getProjectInfo=getProjectInfo;t.getAllVariables=(0,s.default)((async(e,a=5)=>{const{id:n}=await(0,t.getProjectInfo)(e);let r=[];let i=[];let s=1;do{const o=Array.from({length:a},((a,r)=>(0,t.doGitlabRequest)(e,`projects/${n}/variables?per_page=100&page=${s+r}`)));i=await Promise.all(o);s+=a;r=[...r,...i.flat()]}while(i.length>0&&i[i.length-1].length>0);return r}),{promise:true});const getVariableValueByRawName=async(e,a)=>{var n;const r=await(0,t.getAllVariables)(e);return(n=r.find((e=>e.key===a)))===null||n===void 0?void 0:n.value};t.getVariableValueByRawName=getVariableValueByRawName;const u=new RegExp("^[a-zA-Z0-9_+=/@:.~-]{8,}$");const isMaskable=e=>u.test(e);const createVariable=async(e,a,n,r,i=true,s="*")=>await(0,t.doGitlabRequest)(e,`projects/${a}/variables`,{key:n,value:r,masked:i&&isMaskable(r),environment_scope:s},"POST");const updateVariable=async(e,a,n,r,i=true)=>await(0,t.doGitlabRequest)(e,`projects/${a}/variables/${n}`,{value:r,masked:i&&isMaskable(r)},"PUT");const deleteVariable=async(e,a,n)=>await(0,t.doGitlabRequest)(e,`projects/${a}/variables/${n}`,undefined,"DELETE");const getAllCatladderEnvVarsInGitlab=async e=>{const a=await(0,t.getAllVariables)(e).then((e=>e.reduce(((e,t)=>{var a,n,r,i;const{key:s}=t;if(s.startsWith("CL_")){const o=s.match(/(CL_.*)_backup_([0-9]+)/);if(o){const t=o[1];const i=Number(o[2]);const s=[...(n=(a=e[t])===null||a===void 0?void 0:a.backups)!==null&&n!==void 0?n:[],i];return{...e,[t]:{...(r=e[t])!==null&&r!==void 0?r:{},backups:s}}}return{...e,[s]:{backups:[],...(i=e[s])!==null&&i!==void 0?i:{},value:t.value}}}return e}),{})));return a};const getBackupKey=(e,t)=>`${e}_backup_${t}`;const clearBackups=async(e,a)=>{const n=await getAllCatladderEnvVarsInGitlab(e);const{id:r}=await(0,t.getProjectInfo)(e);for(const[t,{backups:i}]of Object.entries(n)){const n=i.sort(((e,t)=>t-e));const s=n.slice(a);for(const a of s){await deleteVariable(e,r,getBackupKey(t,a))}}};t.clearBackups=clearBackups;const upsertAllVariables=async(e,a,n,s,o=true,p=true)=>{var l;const{id:d}=await(0,t.getProjectInfo)(e);const c=await getAllCatladderEnvVarsInGitlab(e);for(const[t,u]of Object.entries(a!==null&&a!==void 0?a:{})){const a=(0,r.getSecretVarName)(n,s,t);const f=(0,i.isObject)(u)?JSON.stringify(u):`${u}`;const m=(0,i.has)(c,a);const h=(l=c[a])===null||l===void 0?void 0:l.value;const v=h!==f;if(v){if(m){e.log(`changed: ${t}`);await updateVariable(e,d,a,f,p);if(o){await createVariable(e,d,getBackupKey(a,(new Date).getTime()),h,p,"_backup")}}else{e.log(`new : ${t}`);await createVariable(e,d,a,f,p)}}else{e.log(`skip : ${t}`)}}t.getAllVariables.clear()};t.upsertAllVariables=upsertAllVariables},6261:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.setPreference=t.getPreference=t.hasPreference=t.getPreferences=void 0;const n=a(1943);const r=a(9896);const i=a(6928);const s=a(857);const o=a(6637);const p=(0,i.join)((0,s.homedir)(),".catladder/preferences.yml");const l=(0,i.join)((0,s.homedir)(),".config/catladder/preferences.yml");const ensurePreferencesFile=async()=>{if((0,r.existsSync)(l)){return}await(0,n.mkdir)((0,i.dirname)(l),{recursive:true,mode:448});if(!(0,r.existsSync)(p)){return(0,n.writeFile)(l,"---\n{}",{encoding:"utf-8",mode:384})}await(0,n.cp)(p,l);await(0,n.chmod)(l,384);await(0,n.cp)(l,(0,i.join)((0,i.dirname)(l),"old_preferences_backup.yml"))};const loadPreferences=async()=>{await ensurePreferencesFile();return(0,n.readFile)(l,{encoding:"utf-8"})};const getPreferences=async()=>{var e;const t=await loadPreferences();return(e=(0,o.parse)(t))!==null&&e!==void 0?e:{}};t.getPreferences=getPreferences;const hasPreference=async e=>{const a=await(0,t.getPreferences)();return e in a};t.hasPreference=hasPreference;const getPreference=async e=>{const a=await(0,t.getPreferences)();return a[e]};t.getPreference=getPreference;const setPreference=async(e,a)=>{const r=await(0,t.getPreferences)();const i={...r,[e]:a};await(0,n.writeFile)(l,(0,o.stringify)(i),{encoding:"utf-8",mode:384})};t.setPreference=setPreference},7414:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getProjectNamespace=t.hasGitlabCiFile=t.readRootGitlabCiFile=t.getRootGitlabCiFile=t.getGitRoot=void 0;const n=a(6928);const r=a(1);const i=a(6172);const s=a(1748);const getGitRoot=async()=>{try{return(await(0,s.exec)(`git rev-parse --show-toplevel`)).stdout.trim()}catch(e){return null}};t.getGitRoot=getGitRoot;const getRootGitlabCiFile=async()=>{const e=await(0,t.getGitRoot)();return(0,n.join)(e,".gitlab-ci.yml")};t.getRootGitlabCiFile=getRootGitlabCiFile;const readRootGitlabCiFile=async()=>(0,i.readFileOrError)(await(0,t.getRootGitlabCiFile)());t.readRootGitlabCiFile=readRootGitlabCiFile;const hasGitlabCiFile=async()=>{const[e,a]=await(0,t.readRootGitlabCiFile)();if(e){return false}return true};t.hasGitlabCiFile=hasGitlabCiFile;const getProjectNamespace=async e=>{const{env:t}=(0,r.parseChoice)(e);const a=await(0,r.getProjectConfig)();return`${a.customerName}-${a.appName}-${t}`};t.getProjectNamespace=getProjectNamespace},5354:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.joinBashExpressions=t.getBashVariable=t.BashExpression=void 0;class BashExpression{constructor(e){this.value=e}toJSON(){return this.toString()}toString(){return this.value.toString()}replace(e,t){return new BashExpression(this.value.toString().replace(e,t))}toLowerCase(){return this.transformWithCommand("awk '{print tolower($0)}'")}concat(...e){return new BashExpression(this.toString().concat(...e.map((e=>e.toString()))))}transformWithCommand(e){return new BashExpression(`$(printf %s "${this.toString()}" | ${e})`)}}t.BashExpression=BashExpression;const getBashVariable=e=>new BashExpression(`$${e}`);t.getBashVariable=getBashVariable;const joinBashExpressions=(e,t="")=>{const a=e.some((e=>e instanceof BashExpression));if(a){return new BashExpression(e.map((e=>e instanceof BashExpression?e.toString():e)).join(t))}else{return e.join(t)}};t.joinBashExpressions=joinBashExpressions},8127:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.escapeForDotEnv=t.escapeNewlines=t.escapeBackTicks=t.escapeSingleQuotes=t.escapeDoubleQuotes=t.escapeBashExpression=t.escapeString=t.bashEscape=void 0;const n=a(3891);const r=a(4396);const i=a(5354);const bashEscape=(e,a={quotes:"double"})=>{if(e instanceof i.BashExpression){return(0,t.escapeBashExpression)(e,a)}if(e instanceof r.VariableValueContainingReferences){return e.toString(a)}return(0,t.escapeString)(e,a)};t.bashEscape=bashEscape;const escapeString=(e,{quotes:a}={quotes:"double"})=>{const n=a?a==="single"?(0,t.escapeSingleQuotes)(e):(0,t.escapeDoubleQuotes)(e):e;return n};t.escapeString=escapeString;const escapeBashExpression=(e,t)=>e;t.escapeBashExpression=escapeBashExpression;const escapeDoubleQuotes=e=>e===null||e===void 0?void 0:e.toString().replace(/"/g,'\\"');t.escapeDoubleQuotes=escapeDoubleQuotes;const escapeSingleQuotes=e=>e===null||e===void 0?void 0:e.toString().replace(/'/g,"\\'");t.escapeSingleQuotes=escapeSingleQuotes;const escapeBackTicks=e=>e===null||e===void 0?void 0:e.toString().replace(/`/g,"\\`");t.escapeBackTicks=escapeBackTicks;const escapeNewlines=e=>e===null||e===void 0?void 0:e.toString().replace(/\n/g,"\\n");t.escapeNewlines=escapeNewlines;const escapeForDotEnv=(e,a={quoteMode:"auto"})=>{if(e===undefined||e===null){return""}if(typeof e==="string"){if(a.quoteMode==="always"||e.includes("\n")){const t=e.replace(/\n/g,"\\n");const a=e.includes(`"`)?e.includes(`'`)?e.includes("`")?'"':"`":"'":'"';return`${a}${t}${a}`}else{return e}}else if(e instanceof i.BashExpression){return escapeBashExpressionForDotEnv(e)}else if(e instanceof r.VariableValueContainingReferences){const a=e.parts.some((e=>e instanceof i.BashExpression));if(!a){return(0,t.escapeForDotEnv)(e.toString({quotes:"double"}))}else{const t=escapeBashExpressionForDotEnv(new i.BashExpression(e.toString({quotes:"double"})));return t}}else{return e}};t.escapeForDotEnv=escapeForDotEnv;const s=(0,n.registerGlobalScriptFunction)("escapeForDotEnv",`\n input="\${1:-$(cat)}"\n input="\${input//$'\\n'/\\\\n}"\n if [[ "$input" == *\\\\n* ]]; then\n if [[ "$input" == *\\"* && "$input" == *\\'* && "$input" == *\\\`* ]]; then\n printf "\\"%s\\"\\n" "$input" ${""}\n elif [[ "$input" == *\\"* && "$input" == *\\'* ]]; then\n printf "\`%s\`\\n" "$input"\n elif [[ "$input" == *\\"* ]]; then\n printf "'%s'\\n" "$input"\n else\n printf "\\"%s\\"\\n" "$input"\n fi\n else\n printf "%s\\n" "$input"\n fi\n `);const escapeBashExpressionForDotEnv=e=>e.transformWithCommand(s.name).toString()},1945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBashExpressionPerPipelineType=void 0;const getBashExpressionPerPipelineType=(e,t)=>{if(!t)return e.default;return e[t]||e.default};t.getBashExpressionPerPipelineType=getBashExpressionPerPipelineType},5103:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBashYamlToFileScript=t.yamlBashString=void 0;const n=a(6637);const r=a(5354);const i=a(4396);const s={tag:"",resolve:e=>new r.BashExpression(e),stringify(e,t){return"|-\n"+t.indent+indentNewlinesInBashExpression(e.value,t.indent)},identify:e=>e instanceof r.BashExpression};const indentNewlinesInBashExpression=(e,t)=>e.transformWithCommand(`sed '1!s/^/${t}/'`);const o={tag:"",resolve:e=>new i.VariableValueContainingReferences(e),stringify(e,t){const a=e.value;const n=a.parts.map((e=>e instanceof r.BashExpression?indentNewlinesInBashExpression(e,t.indent):e.toString().replace(/\n/g,`\n${t.indent}`))).join("");return"|-\n"+t.indent+n},identify:e=>e instanceof i.VariableValueContainingReferences};const yamlBashString=e=>(0,n.stringify)(e,{defaultStringType:"BLOCK_LITERAL",defaultKeyType:"PLAIN",customTags:[s,o],aliasDuplicateObjects:false,lineWidth:0});t.yamlBashString=yamlBashString;const writeBashYamlToFileScript=(e,a)=>[`cat > ${a} <<EOF\n${(0,t.yamlBashString)(e)}\nEOF\n`];t.writeBashYamlToFileScript=writeBashYamlToFileScript},436:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getInjectVarsScript=void 0;const n=a(9250);const r=a(8127);const getInjectVarsScript=e=>{if(!e)return[];return Object.entries(e).filter((([,e])=>!(0,n.isNil)(e))).map((([e,t])=>`export ${e}="${t?(0,r.bashEscape)(t,{quotes:"double"}):""}"`))};t.getInjectVarsScript=getInjectVarsScript},8016:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(8127),t);r(a(5354),t)},7677:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createBuildJobArtifacts=void 0;const n=a(6928);const r=a(5063);const i=a(9250);const s=a(7652);const uniqueAndAlphabeticalSort=e=>(0,i.uniq)(e).sort(((e,t)=>e.localeCompare(t)));const createBuildJobArtifacts=e=>{var t,a;const i=e.type==="workspace"?e.components.flatMap((e=>getArtifactsPathForComponent(e))):getArtifactsPathForComponent(e,["__build_info.json"]);const s=e.type==="workspace"?e.components.flatMap((e=>getAllArtifactExcludePathsForComponent(e))):getAllArtifactExcludePathsForComponent(e);return{paths:uniqueAndAlphabeticalSort(i),...s.length>0?{exclude:uniqueAndAlphabeticalSort(s)}:{},expire_in:"1 day",when:"always",reports:e.type==="component"&&(0,r.componentContextIsStandaloneBuild)(e)?{junit:(a=(t=e.build.config.artifactsReports)===null||t===void 0?void 0:t.junit)===null||a===void 0?void 0:a.map((t=>(0,n.join)(e.build.dir,t)))}:{}}};t.createBuildJobArtifacts=createBuildJobArtifacts;const _getArtifactPathsForComponent=(e,t,a)=>{var r,i;return(i=[...e.build.type!=="disabled"?(r=e.build.config[t])!==null&&r!==void 0?r:[]:[],...a!==null&&a!==void 0?a:[]])===null||i===void 0?void 0:i.flatMap((t=>e.build.getComponentDirs("all").flatMap((e=>(0,n.join)(e,t)))))};const getArtifactsPathForComponent=(e,t)=>_getArtifactPathsForComponent(e,"artifactsPaths",t);const getAllArtifactExcludePathsForComponent=e=>[...getDotEnvPathsForComponent(e),...getArtifactExcludePathsForComponent(e)];const getArtifactExcludePathsForComponent=(e,t)=>_getArtifactPathsForComponent(e,"artifactsExcludePaths",t);const getDotEnvPathsForComponent=e=>{if((0,s.componentContextNeedsBuildTimeDotEnv)(e)){return[(0,n.join)(e.build.dir,".env")]}return[]}},2727:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RUNNER_BUILD_RESOURCE_VARIABLES=t.APP_BUILD_JOB_NAME=void 0;t.APP_BUILD_JOB_NAME="🔨 app";t.RUNNER_BUILD_RESOURCE_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},1950:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAppBuildJob=void 0;const n=a(9250);const r=a(241);const i=a(595);const s=a(7677);const o=a(5644);const p=a(8897);const l=a(2727);const d=a(2877);const c=a(7652);const createAppBuildJob=(e,{script:t,variables:a,runnerVariables:u,cache:f,...m})=>{var h;return(0,n.merge)({name:l.APP_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build",image:(0,r.getRunnerImage)("jobs-default"),needs:[],cache:f?(0,o.createJobCacheFromCacheConfigs)(e,f):undefined,variables:{...a!==null&&a!==void 0?a:{},...e.type==="component"?{...e.environment.envVars,...e.environment.jobOnlyVars.build.envVars}:{}},runnerVariables:{...l.RUNNER_BUILD_RESOURCE_VARIABLES,...u!==null&&u!==void 0?u:{},...(h=e.build.config.runnerVariables)!==null&&h!==void 0?h:{}},script:[...e.type==="component"?(0,c.componentContextNeedsBuildTimeDotEnv)(e)?(0,c.writeDotEnv)(e):[]:e.type==="workspace"?e.components.filter((e=>(0,c.componentContextNeedsBuildTimeDotEnv)(e))).flatMap((e=>(0,c.writeDotEnv)(e))):[],...e.type==="component"?(0,d.writeBuildInfo)(e):[],...(0,p.ensureNodeVersion)(e),`cd ${e.build.dir}`,...(0,i.ensureArray)(t)],artifacts:(0,s.createBuildJobArtifacts)(e)},m)};t.createAppBuildJob=createAppBuildJob},3983:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createArtifactsConfig=void 0;const n=a(6928);const createArtifactsConfig=(e,t,a)=>{var r,i,s,o;return t||a?{artifacts:{paths:[],...a,reports:{...a===null||a===void 0?void 0:a.reports,junit:[t===null||t===void 0?void 0:t.junit,Array.isArray((r=a===null||a===void 0?void 0:a.reports)===null||r===void 0?void 0:r.junit)&&((i=a===null||a===void 0?void 0:a.reports)===null||i===void 0?void 0:i.junit),typeof((s=a===null||a===void 0?void 0:a.reports)===null||s===void 0?void 0:s.junit)==="string"&&[(o=a===null||a===void 0?void 0:a.reports)===null||o===void 0?void 0:o.junit]].filter(Array.isArray).reduce(((t,a)=>[...t,...a.map((t=>(0,n.join)(e,t)))]),[])}}}:undefined};t.createArtifactsConfig=createArtifactsConfig},6254:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createBuildJobDefinition=void 0;const n=a(2348);const r=a(595);const i=a(1255);const s=a(5497);const createBuildJobDefinition=(e,t,a={})=>{var o,p,l,d;if(t.buildCommand===null)return undefined;const c=(0,n.getRunnerImage)("jobs-default");return{image:(o=t.jobImage)!==null&&o!==void 0?o:c,runnerVariables:s.NODE_RUNNER_BUILD_VARIABLES,cache:[...(p=a.cache)!==null&&p!==void 0?p:[],...(0,i.getAllCacheConfigsFromConfig)(e,t)],services:"jobServices"in t?t.jobServices:undefined,script:[...(l=a.prescript)!==null&&l!==void 0?l:[],...(0,r.ensureArray)(t.buildCommand),...(d=a.postscript)!==null&&d!==void 0?d:[]],jobTags:t.jobTags}};t.createBuildJobDefinition=createBuildJobDefinition},8121:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceBuildJobs=t.createComponentBuildJobs=void 0;const n=a(9256);const r=a(3660);const i=a(2764);const s=a(4713);const o=a(2727);const p=a(1950);const createComponentBuildJobs=(e,t)=>{var a;return[...t.appBuild&&(0,r.componentContextIsStandaloneBuild)(e)?[(0,p.createAppBuildJob)(e,t.appBuild)]:[],...(0,i.requiresDockerBuild)(e)?[(0,i.createDockerBuildJobBase)(e,{...t.dockerBuild,needs:[...(a=t.dockerBuild.needs)!==null&&a!==void 0?a:[],...t.appBuild&&(0,r.componentContextIsStandaloneBuild)(e)?[o.APP_BUILD_JOB_NAME]:(0,r.componentContextHasWorkspaceBuild)(e)?[{job:o.APP_BUILD_JOB_NAME,artifacts:true,workspaceName:e.build.workspaceName}]:[]]})]:[],...(0,n.sbomDeactivated)(e)?[]:[(0,s.createSbomBuildJob)(e)]]};t.createComponentBuildJobs=createComponentBuildJobs;const createWorkspaceBuildJobs=(e,t)=>t.appBuild?[(0,p.createAppBuildJob)(e,t.appBuild)]:[];t.createWorkspaceBuildJobs=createWorkspaceBuildJobs},2877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBuildInfo=void 0;const writeBuildInfo=e=>[`echo '{"id":"${e.environment.envVars.BUILD_INFO_BUILD_ID}","time":"${e.environment.envVars.BUILD_INFO_BUILD_TIME}"}' > ${e.build.dir}/__build_info.json`];t.writeBuildInfo=writeBuildInfo},7652:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.componentContextNeedsBuildTimeDotEnv=t.writeDotEnv=void 0;const n=a(9250);const r=a(8127);const i=a(52);const s=a(3468);const writeDotEnv=e=>{const t=e.environment.envVars;const a=Object.entries(t).filter((([,e])=>!(0,n.isNil)(e))).filter((([e])=>!i.ALL_BUILD_VARIABLES.includes(e))).map((([e,t])=>`${e}=${(0,r.escapeForDotEnv)(t)}`)).join("\n");return(0,s.collapseableSection)("write-dotenv-"+e.name,"write dot env for "+e.name)([`cat <<EOF > ${e.build.dir}/.env\n${a}\nEOF`])};t.writeDotEnv=writeDotEnv;const componentContextNeedsBuildTimeDotEnv=e=>{var t;return((t=e.componentConfig.dotEnv)!==null&&t!==void 0?t:true)===true};t.componentContextNeedsBuildTimeDotEnv=componentContextNeedsBuildTimeDotEnv},5644:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.createJobCacheFromConfig=t.createJobCacheFromCacheConfigs=void 0;const r=a(6928);const i=a(1255);const s=n(a(4206));const createJobCacheFromCacheConfigs=(e,t)=>{if(t.length===0)return undefined;const a=t.filter((e=>!("key"in e)));const n=t.filter((e=>"key"in e));const i=a.length>0?[{key:e.name+"-default",policy:"pull-push",paths:a.flatMap((t=>t.paths.map((a=>{var n;const i=t.pathMode==="absolute"?"":(n=t.baseDir)!==null&&n!==void 0?n:e.build.dir;return(0,r.join)(i,a)}))))}]:[];const o=n.map((({key:t,paths:a,policy:n,scope:i,pathMode:o,buildDir:p,...l})=>{var d;const c=o==="absolute"?"":p!==null&&p!==void 0?p:e.build.dir;const u=i==="global"?t:typeof t==="string"?(i==="buildDir"?(0,s.default)(c):e.name)+"-"+t:{...t,files:(d=t.files)===null||d===void 0?void 0:d.map((e=>o==="absolute"?e:(0,r.join)(c,e)))};return{key:u,policy:n!==null&&n!==void 0?n:"pull-push",paths:o==="absolute"?a:a===null||a===void 0?void 0:a.map((e=>(0,r.join)(c,e))),...l}}));return[...o,...i]};t.createJobCacheFromCacheConfigs=createJobCacheFromCacheConfigs;const createJobCacheFromConfig=(e,a)=>(0,t.createJobCacheFromCacheConfigs)(e,(0,i.getAllCacheConfigsFromConfig)(e,a));t.createJobCacheFromConfig=createJobCacheFromConfig},1255:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getAllCacheConfigsFromConfig=void 0;const n=a(595);const r=a(3507);const getAllCacheConfigsFromConfig=(e,t)=>[..."jobCache"in t?(0,r.transformLegacyJobCache)(t.jobCache):[],...(0,n.ensureArray)(t.cache),...e.type==="workspace"?e.components.flatMap((e=>{var t;return e.build.type!=="disabled"?(t=(0,n.ensureArray)(e.build.config.cache).map((t=>({...t,baseDir:e.build.dir}))))!==null&&t!==void 0?t:[]:[]})):[]];t.getAllCacheConfigsFromConfig=getAllCacheConfigsFromConfig},3507:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transformLegacyJobCache=void 0;const n=a(595);function transformLegacyJobCache(e){return(0,n.ensureArray)(e).map((e=>{var t,a;return{pathMode:"absolute",...e,key:(t=e.key)!==null&&t!==void 0?t:"default",paths:(a=e.paths)!==null&&a!==void 0?a:[]}}))}t.transformLegacyJobCache=transformLegacyJobCache},985:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomBuildJobs=void 0;const n=a(2764);const r=a(9851);const i=a(8121);const s=a(6254);const createCustomBuildJobs=e=>{const t=e.build.config;if(!(0,r.isOfBuildType)(t,"custom")){throw new Error("deploy config is not custom")}return(0,i.createComponentBuildJobs)(e,{appBuild:t.buildCommand!==null?(0,s.createBuildJobDefinition)(e,t):undefined,dockerBuild:{script:(0,n.getDockerBuildScriptWithBuiltInDockerFile)(e),variables:{}}})};t.createCustomBuildJobs=createCustomBuildJobs},2924:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomJobs=void 0;const n=a(985);const r=a(7039);const createCustomJobs=e=>[...(0,r.createCustomTestJobs)(e),...(0,n.createCustomBuildJobs)(e)];t.createCustomJobs=createCustomJobs},7039:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomTestJobs=void 0;const n=a(595);const r=a(3983);const i=a(5644);const s=a(9851);const o={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"};const createCustomTestJobs=e=>{var t,a,p,l,d,c,u,f,m,h,v,g,y,b,w,_,S,N,C,A,O;if(e.trigger==="taggedRelease"){return[]}const I=e.build.config;if(!(0,s.isOfBuildType)(I,"custom")){throw new Error("deploy config is not custom")}const D={variables:{APP_PATH:e.build.dir,...e.environment.jobOnlyVars.build.envVars},services:I.jobServices,cache:(0,i.createJobCacheFromConfig)(e,I),stage:"test",needs:[]};const k=I.audit?{name:"🛡 audit",...D,runnerVariables:{...o,...(a=(t=I.audit)===null||t===void 0?void 0:t.runnerVariables)!==null&&a!==void 0?a:{}},image:(l=(p=I.audit)===null||p===void 0?void 0:p.jobImage)!==null&&l!==void 0?l:I.jobImage,cache:undefined,script:[...(0,n.ensureArray)((d=I.audit)===null||d===void 0?void 0:d.command)],allow_failure:true,...(0,r.createArtifactsConfig)(e.build.dir,(c=I.audit)===null||c===void 0?void 0:c.artifactsReports,(u=I.audit)===null||u===void 0?void 0:u.artifacts)}:null;const T=I.lint?{name:"👮 lint",...D,runnerVariables:{...o,...(m=(f=I.lint)===null||f===void 0?void 0:f.runnerVariables)!==null&&m!==void 0?m:{}},image:(v=(h=I.lint)===null||h===void 0?void 0:h.jobImage)!==null&&v!==void 0?v:I.jobImage,script:[...(0,n.ensureArray)((g=I.lint)===null||g===void 0?void 0:g.command)],...(0,r.createArtifactsConfig)(e.build.dir,(y=I.lint)===null||y===void 0?void 0:y.artifactsReports,(b=I.lint)===null||b===void 0?void 0:b.artifacts)}:null;const P=I.test?{name:"🧪 test",...D,runnerVariables:{...o,...(_=(w=I.test)===null||w===void 0?void 0:w.runnerVariables)!==null&&_!==void 0?_:{}},image:(N=(S=I.test)===null||S===void 0?void 0:S.jobImage)!==null&&N!==void 0?N:I.jobImage,script:[...(0,n.ensureArray)((C=I.test)===null||C===void 0?void 0:C.command)],...(0,r.createArtifactsConfig)(e.build.dir,(A=I.test)===null||A===void 0?void 0:A.artifactsReports,(O=I.test)===null||O===void 0?void 0:O.artifacts)}:null;return[k,T,P].filter(n.notNil)};t.createCustomTestJobs=createCustomTestJobs},2764:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.hasDockerfile=t.getDockerBuildDefaultScript=t.getDockerBuildScriptWithBuiltInDockerFile=t.gitlabDockerLogin=t.createDockerBuildJobBase=t.getDockerJobBaseProps=t.DOCKER_BUILD_JOB_NAME=t.getDockerBuildVariables=t.requiresDockerBuild=t.getDockerImageVariables=void 0;const r=a(9896);const i=a(9250);const s=n(a(6928));const o=a(8025);const p=a(4316);const l=a(1201);const d=a(2348);const c=a(3468);const u=a(5644);const f={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"2Gi"};const getDockerImageVariables=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;return{...(0,o.isOfDeployType)(a,"google-cloudrun")?{DOCKER_REGISTRY:(0,p.getArtifactsRegistryHost)(e),DOCKER_IMAGE:(0,p.getArtifactsRegistryImageName)(e),DOCKER_CACHE_IMAGE:(0,p.getArtifactsRegistryBuildCacheImage)(e)}:{DOCKER_REGISTRY:"$CI_REGISTRY",DOCKER_CACHE_IMAGE:"$CI_REGISTRY_IMAGE/caches/"+e.name,DOCKER_IMAGE_NAME:e.env+"/"+e.name,DOCKER_IMAGE:"$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME"},DOCKER_IMAGE_TAG:"$CI_COMMIT_SHA"}};t.getDockerImageVariables=getDockerImageVariables;const requiresDockerBuild=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;return(0,o.isOfDeployType)(a,"kubernetes","google-cloudrun","dockerTag")||(0,o.isOfDeployType)(a,"custom")&&a.requiresDocker};t.requiresDockerBuild=requiresDockerBuild;const getDockerBuildRunnerVariables=()=>({DOCKER_HOST:"tcp://docker:2375",DOCKER_TLS_CERTDIR:"",DOCKER_DRIVER:"overlay2",DOCKER_BUILDKIT:"1"});const getDockerAdditions=e=>{var t,a;if(!("docker"in e))return{};if(!e.docker)return{};return{DOCKERFILE_ADDITIONS:"additionsBegin"in e.docker?(t=e.docker.additionsBegin)===null||t===void 0?void 0:t.join("\n"):undefined,DOCKERFILE_ADDITIONS_END:"additionsEnd"in e.docker?(a=e.docker.additionsEnd)===null||a===void 0?void 0:a.join("\n"):undefined}};const getDockerBuildVariables=e=>{var a;return{...getDockerAdditions(e.build.config),APP_DIR:e.build.dir,DOCKER_BUILD_CONTEXT:"docker"in e.build.config&&e.build.config.docker&&"buildContextLocation"in e.build.config.docker&&((a=e.build.config.docker)===null||a===void 0?void 0:a.buildContextLocation)==="component"?e.build.dir:".",...(0,t.getDockerImageVariables)(e)}};t.getDockerBuildVariables=getDockerBuildVariables;t.DOCKER_BUILD_JOB_NAME="🔨 docker";const getDockerJobBaseProps=()=>({image:(0,d.getRunnerImage)("docker-build"),services:[{name:"docker:24.0.6-dind",command:["--tls=false","--registry-mirror=https://mirror.gcr.io"]}],variables:{},runnerVariables:getDockerBuildRunnerVariables()});t.getDockerJobBaseProps=getDockerJobBaseProps;const createDockerBuildJobBase=(e,{script:a,cache:n,...r})=>(0,i.merge)({name:t.DOCKER_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build",cache:n?(0,u.createJobCacheFromCacheConfigs)(e,n):undefined,...(0,t.getDockerJobBaseProps)(),script:a||[]},{variables:(0,t.getDockerBuildVariables)(e),runnerVariables:{...f,...getDockerBuildRunnerVariables()}},r);t.createDockerBuildJobBase=createDockerBuildJobBase;const gitlabDockerLogin=e=>e.deploy&&(0,o.isOfDeployType)(e.deploy.config,"google-cloudrun")?[...(0,l.gcloudServiceAccountLoginCommands)(e),`gcloud auth configure-docker ${(0,p.getArtifactsRegistryHost)(e)}`]:["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY"];t.gitlabDockerLogin=gitlabDockerLogin;const m={meteor:"ensureMeteorDockerfile",node:"ensureNodeDockerfile",nginx:"ensureNginxDockerfile",custom:null};const getEnsureDockerFileScript=(e,t)=>{var a,n,r,i,s,o;if("docker"in e.build.config&&e.build.config.docker&&"type"in e.build.config.docker){if(((a=e.build.config.docker)===null||a===void 0?void 0:a.type)==="custom"){if((n=e.build.config.docker)===null||n===void 0?void 0:n.dockerfileContent){return`\necho "Creating Dockerfile"\ncat >$APP_DIR/Dockerfile <<EOF\n${(i=(r=e.build.config.docker)===null||r===void 0?void 0:r.dockerfileContent)===null||i===void 0?void 0:i.join("\n")}\nEOF`}}const p=(o=(s=e.build.config.docker)===null||s===void 0?void 0:s.type)!==null&&o!==void 0?o:t;return p?m[p]:null}return t?m[t]:null};const getDockerBuildScriptWithBuiltInDockerFile=(e,a)=>(0,t.getDockerBuildDefaultScript)(e,getEnsureDockerFileScript(e,a));t.getDockerBuildScriptWithBuiltInDockerFile=getDockerBuildScriptWithBuiltInDockerFile;const getDockerBuildDefaultScript=(e,a)=>[a!==null&&a!==void 0?a:undefined,...(0,c.collapseableSection)("docker-login","Docker Login")((0,t.gitlabDockerLogin)(e)),...(0,c.collapseableSection)("docker-build","Docker build")(["docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile $DOCKER_BUILD_CONTEXT --build-arg BUILDKIT_INLINE_CACHE=1"]),...(0,c.collapseableSection)("docker-push","Docker push and tag")(["docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG","docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE","docker push $DOCKER_CACHE_IMAGE"])].filter(Boolean);t.getDockerBuildDefaultScript=getDockerBuildDefaultScript;const hasDockerfile=e=>(0,r.existsSync)(s.default.join(e.build.dir,"Dockerfile"));t.hasDockerfile=hasDockerfile},1398:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});t.WORKSPACE_BUILD_TYPES=t.BUILD_TYPES=void 0;const i=a(2924);const s=a(7667);const o=a(3260);r(a(7667),t);r(a(9851),t);t.BUILD_TYPES={node:{jobs:s.createNodeJobs,defaults:()=>({buildCommand:"yarn build",startCommand:"yarn start",artifactsPaths:["dist",".next"],artifactsExcludePaths:[".next/cache/**/*"]})},"node-static":{jobs:s.createNodeJobs,defaults:()=>({buildCommand:"yarn build",artifactsPaths:["dist"]})},storybook:{jobs:s.createStorybookJobs,defaults:()=>({buildCommand:["yarn build-storybook --quiet -o ./dist"],artifactsPaths:["dist"]})},meteor:{jobs:s.createMeteorJobs,defaults:()=>({startCommand:"node main.js",artifactsPaths:["dist"]})},custom:{jobs:i.createCustomJobs,defaults:()=>({artifactsPaths:["dist"]})},rails:{jobs:o.createRailsJobs,defaults:()=>({cnbBuilder:{image:"heroku/builder:24",packVersion:"0.36.4"}})}};t.WORKSPACE_BUILD_TYPES={node:{jobs:s.createNodeJobs,defaults:()=>({buildCommand:"yarn build",lint:{command:"yarn lint"},test:{command:"yarn test"}})}}},5464:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createNodeDockerJobDefinition=t.createNodeBuildJobDefinition=t.createNodeBuildJobs=void 0;const n=a(3660);const r=a(8121);const i=a(6254);const s=a(2764);const o=a(4189);const p=a(8897);const createNodeBuildJobs=e=>{if(e.type==="workspace"){return(0,r.createWorkspaceBuildJobs)(e,{appBuild:(0,t.createNodeBuildJobDefinition)(e)})}return(0,r.createComponentBuildJobs)(e,{appBuild:(0,n.componentContextIsStandaloneBuild)(e)?(0,t.createNodeBuildJobDefinition)(e):undefined,dockerBuild:(0,t.createNodeDockerJobDefinition)(e)})};t.createNodeBuildJobs=createNodeBuildJobs;const createNodeBuildJobDefinition=e=>{const t=e.build.config;const a=(0,p.getYarnInstall)(e);return(0,i.createBuildJobDefinition)(e,t,{prescript:a,cache:(0,o.getNodeCache)(e)})};t.createNodeBuildJobDefinition=createNodeBuildJobDefinition;const createNodeDockerJobDefinition=e=>{var t,a;const n=e.build.buildType==="node-static"||e.build.buildType==="storybook"?"nginx":"node";return{script:(0,s.getDockerBuildScriptWithBuiltInDockerFile)(e,n),cache:[...(0,o.getYarnCache)(e,"pull")],variables:{DOCKER_COPY_AND_INSTALL_APP:(0,p.getDockerAppCopyAndBuildScript)(e),DOCKER_COPY_WORKSPACE_FILES:(a=(t=e.packageManagerInfo)===null||t===void 0?void 0:t.pathsToCopyInDocker.map((e=>`COPY --chown=node:node ${e} /app/${e}`)))===null||a===void 0?void 0:a.join("\n")}}};t.createNodeDockerJobDefinition=createNodeDockerJobDefinition},4189:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getNodeCache=t.getNodeModulesCache=t.getYarnCache=void 0;const r=a(9250);const i=a(6928);const s=n(a(4206));const getYarnCache=(e,t="pull-push")=>{const a=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[{scope:a?"global":"buildDir",pathMode:a?"absolute":"relative",key:"yarn",policy:t,paths:[".yarn"]}]};t.getYarnCache=getYarnCache;const getNodeModulesCache=(e,t="pull-push")=>{var a,n;const o=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;const{isClassic:p}=e.packageManagerInfo;return[{scope:"global",pathMode:"absolute",key:o?"node-modules-workspace":(0,s.default)(e.build.dir)+"-node-modules",policy:t,paths:[...o?(0,r.uniq)(["node_modules",...(a=e.packageManagerInfo.workspaces.map((e=>(0,i.join)(e.location,"node_modules"))))!==null&&a!==void 0?a:[],...!p?[".yarn/install-state.gz",...(n=e.packageManagerInfo.workspaces.map((e=>(0,i.join)(e.location,".yarn/install-state.gz"))))!==null&&n!==void 0?n:[]]:[]]):[(0,i.join)(e.build.dir,"node_modules"),...!p?[(0,i.join)(e.build.dir,".yarn/install-state.gz")]:[]]]}]};t.getNodeModulesCache=getNodeModulesCache;const getNodeCache=(e,a="pull-push")=>[...(0,t.getYarnCache)(e,a),...(0,t.getNodeModulesCache)(e,a)];t.getNodeCache=getNodeCache},5497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NODE_RUNNER_BUILD_VARIABLES=void 0;t.NODE_RUNNER_BUILD_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},7667:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMeteorJobs=t.createStorybookJobs=t.createNodeJobs=void 0;const n=a(5464);const r=a(6055);const i=a(9884);const createNodeJobs=e=>[...(0,i.createNodeTestJobs)(e),...(0,n.createNodeBuildJobs)(e)];t.createNodeJobs=createNodeJobs;const createStorybookJobs=e=>[...(0,n.createNodeBuildJobs)(e)];t.createStorybookJobs=createStorybookJobs;const createMeteorJobs=e=>[...(0,i.createNodeTestJobs)(e),...(0,r.createMeteorBuildJobs)(e)];t.createMeteorJobs=createMeteorJobs},6055:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMeteorBuildJobs=void 0;const n=a(2348);const r=a(8121);const i=a(2764);const s=a(9851);const o=a(4189);const p=a(8897);const getMeteorCache=e=>[{key:"meteor-build-cache",policy:"pull-push",paths:[".meteor/local/resolver-result-cache.json",".meteor/local/plugin-cache",".meteor/local/isopacks",".meteor/local/bundler-cache/scanner"]}];const createMeteorBuildJobs=e=>{const t=e.build.config;if(!(0,s.isOfBuildType)(t,"meteor")){throw new Error("deploy config is not meteor")}const a=(0,p.getYarnInstall)(e);return(0,r.createComponentBuildJobs)(e,{appBuild:t.buildCommand!==null?{cache:[...(0,o.getNodeCache)(e),...getMeteorCache(e)],image:(0,n.getRunnerImage)("jobs-meteor"),variables:{METEOR_DISABLE_OPTIMISTIC_CACHING:"1"},script:[...a,'echo "add healthcheck package"',"meteor add panter:healthroute --allow-superuser","meteor add qualia:prod-shell --allow-superuser",'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory',"cp ./__build_info.json ./dist/bundle/programs/server"]}:undefined,dockerBuild:{script:(0,i.getDockerBuildScriptWithBuiltInDockerFile)(e,"meteor"),variables:{METEOR_INSTALL_SCRIPTS:t.installScripts?"true":""}}})};t.createMeteorBuildJobs=createMeteorBuildJobs},9884:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createNodeTestJobs=void 0;const n=a(2348);const r=a(3660);const i=a(595);const s=a(3983);const o=a(4189);const p=a(5497);const l=a(8897);const d=a(5644);const createNodeTestJobs=e=>{var t,a,c,u,f,m,h,v,g,y,b,w,_,S,N,C,A,O,I,D,k,T,P,R;if(e.trigger==="taggedRelease"){return[]}if(e.type==="component"&&!(0,r.componentContextIsStandaloneBuild)(e)){return[]}const L=(0,n.getRunnerImage)("jobs-default");const x={variables:{APP_PATH:e.build.dir,...e.type==="component"?{...e.environment.jobOnlyVars.build.envVars}:{}},stage:"test",needs:[]};const j=e.build.config;const B=(0,l.getYarnInstall)(e);const M=j.audit!==false?{name:"🛡 audit",...x,runnerVariables:{...p.NODE_RUNNER_BUILD_VARIABLES,...(a=(t=j.audit)===null||t===void 0?void 0:t.runnerVariables)!==null&&a!==void 0?a:{}},image:(u=(c=j.audit)===null||c===void 0?void 0:c.jobImage)!==null&&u!==void 0?u:L,cache:undefined,script:[`cd ${e.build.dir}`,...(m=(0,i.ensureArrayOrNull)((f=j.audit)===null||f===void 0?void 0:f.command))!==null&&m!==void 0?m:[e.packageManagerInfo.isClassic?"yarn audit":"yarn npm audit --environment production"]],allow_failure:true,...(0,s.createArtifactsConfig)(e.build.dir,(h=j.audit)===null||h===void 0?void 0:h.artifactsReports,(v=j.audit)===null||v===void 0?void 0:v.artifacts)}:null;const V=j.lint!==false?{name:"👮 lint",...x,runnerVariables:{...p.NODE_RUNNER_BUILD_VARIABLES,...(y=(g=j.lint)===null||g===void 0?void 0:g.runnerVariables)!==null&&y!==void 0?y:{}},image:(w=(b=j.lint)===null||b===void 0?void 0:b.jobImage)!==null&&w!==void 0?w:L,cache:(0,d.createJobCacheFromCacheConfigs)(e,(0,o.getNodeCache)(e)),script:[...(0,l.ensureNodeVersion)(e),`cd ${e.build.dir}`,...B,...(S=(0,i.ensureArrayOrNull)((_=j.lint)===null||_===void 0?void 0:_.command))!==null&&S!==void 0?S:["yarn lint"]],...(0,s.createArtifactsConfig)(e.build.dir,(N=j.lint)===null||N===void 0?void 0:N.artifactsReports,(C=j.lint)===null||C===void 0?void 0:C.artifacts)}:null;const U=j.test!==false?{name:"🧪 test",...x,runnerVariables:{...p.NODE_RUNNER_BUILD_VARIABLES,...(O=(A=j.test)===null||A===void 0?void 0:A.runnerVariables)!==null&&O!==void 0?O:{}},image:(D=(I=j.test)===null||I===void 0?void 0:I.jobImage)!==null&&D!==void 0?D:(0,n.getRunnerImage)("jobs-testing-chrome"),cache:(0,d.createJobCacheFromCacheConfigs)(e,(0,o.getNodeCache)(e)),script:[...(0,l.ensureNodeVersion)(e),`cd ${e.build.dir}`,...B,...(T=(0,i.ensureArrayOrNull)((k=j.test)===null||k===void 0?void 0:k.command))!==null&&T!==void 0?T:["yarn test"]],...(0,s.createArtifactsConfig)(e.build.dir,(P=j.test)===null||P===void 0?void 0:P.artifactsReports,(R=j.test)===null||R===void 0?void 0:R.artifacts)}:null;return[M,V,U].filter(i.notNil)};t.createNodeTestJobs=createNodeTestJobs},8897:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDockerAppCopyAndBuildScript=t.getYarnInstall=t.ensureNodeVersion=void 0;const n=a(5354);const r=a(595);const i=a(3468);const s=`yarn install --frozen-lockfile`;const o=`yarn workspaces focus --production`;const p=`yarn rebuild`;const getYarnInstallCommand=e=>{if(e.packageManagerInfo.isClassic){return s}return`yarn install --immutable --inline-builds`};const ensureNodeVersion=e=>(0,i.collapseableSection)("nodeinstall","Ensure node version")(["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi","if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi"]);t.ensureNodeVersion=ensureNodeVersion;const getYarnInstall=(e,a)=>{const n=e.type!=="workspace"&&e.build.type!=="disabled"&&"postInstall"in e.build.config?e.build.config.postInstall:null;return[...(0,t.ensureNodeVersion)(e),...(0,i.collapseableSection)("yarninstall","Yarn install")([getYarnInstallCommand(e)]),...n&&!(a===null||a===void 0?void 0:a.noCustomPostInstall)?(0,i.collapseableSection)("postinstall","Custom post install")((0,r.ensureArray)(n)):[]]};t.getYarnInstall=getYarnInstall;const l=`COPY --chown=node:node $APP_DIR .`;const getDockerAppCopyAndBuildScript=e=>{var t,a,r;if(e.packageManagerInfo.isClassic){return new n.BashExpression(`\nRUN ${s} --production --ignore-scripts\n${l}\nRUN ${s} --production \n `.trim())}const i=e.build.type==="fromWorkspace"?(a=(t=e.build.workspaceBuildConfig.dockerDefaults)===null||t===void 0?void 0:t.yarnRebuildEnabled)!==null&&a!==void 0?a:true:true;const d="docker"in e.build.config&&e.build.config.docker&&"yarnRebuildEnabled"in e.build.config.docker?(r=e.build.config.docker.yarnRebuildEnabled)!==null&&r!==void 0?r:i:i;const c=["2","3"].some((t=>e.packageManagerInfo.version.startsWith(t)));const u=c?"RUN yarn plugin import workspace-tools":"";return new n.BashExpression(`\n ENV YARN_ENABLE_INLINE_BUILDS=1\n${l}\n${u}\nRUN ${o}\n${d?`RUN ${p}`:""}\n\n `.trim())};t.getDockerAppCopyAndBuildScript=getDockerAppCopyAndBuildScript},3188:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRailsBuildJobs=void 0;const n=a(241);const r=a(8121);const i=a(2764);const s=a(9851);const createRailsBuildJobs=e=>{var t,a,o;const p=e.build.config;if(!(0,s.isOfBuildType)(p,"rails")){throw new Error("build type is not rails")}if(!(0,n.componentContextIsStandaloneBuild)(e)){throw new Error("workspace builds are not supported for rails apps")}if((0,i.hasDockerfile)(e)){return(0,r.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{script:(0,i.getDockerBuildDefaultScript)(e),variables:{}}})}const l=p.cnbBuilder;const d=Object.entries((t=l===null||l===void 0?void 0:l.buildVars)!==null&&t!==void 0?t:{}).map((([e,t])=>`--env '${e}${t?`=${t}`:""}'`)).join(" ");return(0,r.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{variables:{...e.environment.jobOnlyVars.build.envVars},script:[...(0,i.gitlabDockerLogin)(e),`cd ${e.build.dir}`,`wget --output-document=- https://github.com/buildpacks/pack/releases/download/v${l===null||l===void 0?void 0:l.packVersion}/pack-v${l===null||l===void 0?void 0:l.packVersion}-linux.tgz | tar -zx --directory /usr/local/bin pack`,`chmod +x /usr/local/bin/pack`,`sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock`,`pack build "$DOCKER_IMAGE:$DOCKER_IMAGE_TAG" --builder '${l===null||l===void 0?void 0:l.image}' --publish --cache-image "$DOCKER_CACHE_IMAGE" ${d} ${(o=(a=l===null||l===void 0?void 0:l.packExtraArgs)===null||a===void 0?void 0:a.join(" "))!==null&&o!==void 0?o:""}`]}})};t.createRailsBuildJobs=createRailsBuildJobs},3260:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRailsJobs=void 0;const n=a(3188);const r=a(7983);const createRailsJobs=e=>[...(0,r.createRailsTestJobs)(e),...(0,n.createRailsBuildJobs)(e)];t.createRailsJobs=createRailsJobs},7983:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRailsTestJobs=void 0;const n=a(241);const r=a(595);const createRailsTestJobs=e=>{var t,a,i,s,o,p,l,d,c,u,f,m,h,v,g,y,b;if(e.trigger==="taggedRelease"){return[]}if(!(0,n.componentContextIsStandaloneBuild)(e)){return[]}const w=e.build.config;const _={variables:{...e.environment.jobOnlyVars.build.envVars},stage:"test",needs:[]};const S="docker.io/ruby";const N="tmp/cache";const C=[`bundle config set path '${N}'`,"bundle install -j $(nproc)"];const A={key:{files:["Gemfile.lock"],prefix:"$CI_JOB_IMAGE"},paths:[N]};const O=w.audit!==false?{name:"🛡 audit",..._,cache:undefined,image:(i=(a=(t=w.audit)===null||t===void 0?void 0:t.jobImage)!==null&&a!==void 0?a:w.jobImage)!==null&&i!==void 0?i:S,script:[`cd ${e.build.dir}`,...(o=(0,r.ensureArrayOrNull)((s=w.audit)===null||s===void 0?void 0:s.command))!==null&&o!==void 0?o:["gem install bundler-audit","bundle audit check"]],allow_failure:true}:null;const I=w.lint!==false?{name:"👮 lint",..._,cache:A,image:(d=(l=(p=w.lint)===null||p===void 0?void 0:p.jobImage)!==null&&l!==void 0?l:w.jobImage)!==null&&d!==void 0?d:S,script:[`cd ${e.build.dir}`,...C,...(u=(0,r.ensureArrayOrNull)((c=w.lint)===null||c===void 0?void 0:c.command))!==null&&u!==void 0?u:["bundle exec rubocop"]]}:null;const D=w.test!==false?{name:"🧪 test",..._,cache:A,image:(h=(m=(f=w.test)===null||f===void 0?void 0:f.jobImage)!==null&&m!==void 0?m:w.jobImage)!==null&&h!==void 0?h:S,script:[`cd ${e.build.dir}`,...C,...(g=(0,r.ensureArrayOrNull)((v=w.test)===null||v===void 0?void 0:v.command))!==null&&g!==void 0?g:["bundle exec rake db:test:prepare","bundle exec rake assets:precompile assets:clean","bundle exec rspec"]],runnerVariables:{RAILS_ENV:"test",DATABASE_URL:"postgresql://postgres@database"},services:[{name:w.test&&"databaseImage"in w.test?(b=(y=w===null||w===void 0?void 0:w.test)===null||y===void 0?void 0:y.databaseImage)!==null&&b!==void 0?b:"docker.io/postgres:latest":"docker.io/postgres:latest",alias:"database",variables:{POSTGRES_HOST_AUTH_METHOD:"trust"}}]}:null;return[O,I,D].filter(r.notNil)};t.createRailsTestJobs=createRailsTestJobs},4713:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSbomBuildJob=t.SBOM_FILE=t.SBOM_BUILD_JOB_NAME=void 0;const n=a(1398);const r=a(595);t.SBOM_BUILD_JOB_NAME="🧾 sbom";t.SBOM_FILE="__sbom.json";const createSbomBuildJob=e=>{var a,i,s,o;const p=e.build.config;const l={name:"aquasec/trivy:0.58.2",entrypoint:[""]};const d=[`trivy fs --quiet --format cyclonedx --output "${t.SBOM_FILE}" ${e.packageManagerInfo.componentIsInWorkspace?".":e.build.dir}`];const c=(0,n.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(i=(a=p.sbom)===null||a===void 0?void 0:a.jobImage)!==null&&i!==void 0?i:l:l;const u=(0,n.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(o=(0,r.ensureArrayOrNull)((s=p.sbom)===null||s===void 0?void 0:s.command))!==null&&o!==void 0?o:d:d;return{name:t.SBOM_BUILD_JOB_NAME,stage:"build",envMode:"jobPerEnv",variables:{},cache:undefined,image:c,script:u,allow_failure:true,artifacts:{paths:[t.SBOM_FILE]}}};t.createSbomBuildJob=createSbomBuildJob},9851:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isOfBuildType=t.isStandaloneBuildConfig=void 0;const isStandaloneBuildConfig=e=>{if(!e)return false;return!("from"in e)};t.isStandaloneBuildConfig=isStandaloneBuildConfig;const isOfBuildType=(e,...a)=>{if(!(0,t.isStandaloneBuildConfig)(e))return false;return a.includes(e.type)};t.isOfBuildType=isOfBuildType},5233:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCatenvContext=void 0;const n=a(5585);const createCatenvContext=e=>({config:e,fileWriter:n.FileWriter.create(e)});t.createCatenvContext=createCatenvContext},6740:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getAllEnvsByTrigger=t.getAllEnvsInAllComponents=t.getAllEnvs=void 0;const n=a(5063);const getConfiguredAndDefaultEnvs=(e,t,a)=>{var n,r;const i=(n=e.components[t].env)!==null&&n!==void 0?n:{};const s=a.filter((e=>i[e]!==false));const o=Object.entries((r=e.components[t].env)!==null&&r!==void 0?r:{}).filter((([,e])=>e&&"type"in e&&e.type&&a.includes(e.type))).map((([e])=>e));return[...new Set([...s,...o])]};const getAllEnvs=(e,t)=>getConfiguredAndDefaultEnvs(e,t,n.DEFAULT_ENV_TYPES);t.getAllEnvs=getAllEnvs;const getAllEnvsInAllComponents=e=>[...new Set(Object.keys(e.components).flatMap((a=>(0,t.getAllEnvs)(e,a))))];t.getAllEnvsInAllComponents=getAllEnvsInAllComponents;const getAllEnvsByTrigger=(e,t,a)=>{const r=(0,n.getEnvTypesByTrigger)(a);return getConfiguredAndDefaultEnvs(e,t,r)};t.getAllEnvsByTrigger=getAllEnvsByTrigger},940:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(6740),t);r(a(3376),t)},3376:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.readConfig=void 0;const n=a(9896);const r=a(2896);const i=a(6637);const fullPath=(e,t)=>e+"/catladder."+t;const readConfigInternal=async(e=process.cwd())=>{const t=["ts","js","yml","yaml"].find((t=>(0,n.existsSync)(fullPath(e,t))));if(t){const a=fullPath(e,t);if(t==="ts"||t==="js"){const n=await r.require(a,e);const i=n.default.default||n.default;return{path:a,ext:t,config:i}}else{return{path:a,ext:t,config:(0,i.parse)((0,n.readFileSync)(a,{encoding:"utf-8"}))}}}return null};const readConfig=async(e=process.cwd())=>{try{return await readConfigInternal(e)}catch(t){console.error(`Error reading config in ${e}:`,t);console.error(`\nThis may happen due to various reasons:\n - Syntax errors in your catladder.ts file\n - tsx (the TypeScript loader used by catladder) needs to understand the syntax in your project.\n If your project uses newer TypeScript/JavaScript syntax, you may need to update catladder\n to get a newer version of tsx that supports it.\n - Missing or incorrect dependencies in your project\n - TypeScript configuration issues in your tsconfig.json\n`);return null}};t.readConfig=readConfig},3480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_REGISTRY=t.PIPELINE_IMAGE_TAG=void 0;t.PIPELINE_IMAGE_TAG=process.env.INLINE_PIPELINE_IMAGE_TAG||"latest";t.DOCKER_REGISTRY=process.env.INLINE_DOCKER_REGISTRY||"git.panter.ch:5001/catladder/catladder"},8347:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAllComponentsContext=void 0;const n=a(6740);const r=a(4847);const createAllComponentsContext=async({config:e,trigger:t,pipelineType:a})=>await Promise.all(Object.keys(e.components).flatMap((i=>{const s=(0,n.getAllEnvsByTrigger)(e,i,t);return s.map((async n=>await(0,r.createComponentContext)({config:e,componentName:i,env:n,trigger:t,pipelineType:a})))})));t.createAllComponentsContext=createAllComponentsContext},4847:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createComponentContext=void 0;const n=a(9250);const r=a(1398);const i=a(8025);const s=a(4041);const o=a(595);const p=a(4956);const l=a(5841);const createComponentContext=async e=>{var t;if(!/^[a-z0-9-]+$/.test(e.componentName)){throw new Error("componentName may only contain lower case letters, numbers and -")}const a=await(0,s.getPackageManagerInfoForComponent)(e.config,e.componentName);const d=(0,l.getEnvironmentContext)(e);const c=d.envConfigRaw;const u=c.build===false?false:(0,r.isStandaloneBuildConfig)(c.build)?c.build.type:(t=e.config.builds)===null||t===void 0?void 0:t[c.build.from].type;if(u===undefined){throw new Error("build type not found, is the build config correct?")}const f=c.deploy?{build:u&&r.BUILD_TYPES[u].defaults(d),deploy:i.DEPLOY_TYPES[c.deploy.type].defaults(d)}:{build:u&&r.BUILD_TYPES[u].defaults(d),deploy:{}};const m=(0,o.mergeWithMergingArrays)(f,c);const h=await(0,p.getEnvironment)(e);const{deploy:v,build:g,customJobs:y,dir:b}=m;const getComponentDirs=e=>{var t;return[b,...e==="all"?(t=a.currentWorkspaceDependencies)!==null&&t!==void 0?t:[]:[]]};const _getBuildContext=()=>{var t;if(g===false){return{type:"disabled",getComponentDirs:getComponentDirs,dir:b}}if((0,r.isStandaloneBuildConfig)(g)){return{dir:b,getComponentDirs:getComponentDirs,config:g,buildType:g.type,type:"standalone"}}const a=(t=e.config.builds)===null||t===void 0?void 0:t[g.from];if(!a){throw new Error("build.from not found in config")}return{dir:b,getComponentDirs:getComponentDirs,config:g,workspaceBuildConfig:a,workspaceName:g.from,buildType:a.type,type:"fromWorkspace"}};const w=_getBuildContext();const _={type:"component",name:e.componentName,env:e.env,fullConfig:e.config,componentConfig:m,build:w,deploy:v?{config:v}:null,environment:h,packageManagerInfo:a,pipelineType:e.pipelineType,trigger:e.trigger};const S=(0,n.isFunction)(y)?y(_):y;return{..._,customJobs:S}};t.createComponentContext=createComponentContext},2981:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceContext=void 0;const n=a(241);const r=a(4041);const i=a(595);const s=a(9250);async function createWorkspaceContext({env:e,components:t,workspaceName:a,config:o,pipelineType:p,trigger:l}){var d,c;const u=(d=o.builds)===null||d===void 0?void 0:d[a];if(!u){throw new Error(`Workspace ${a} not found in config`)}const f=n.WORKSPACE_BUILD_TYPES[u.type].defaults();const m=(0,i.mergeWithMergingArrays)(f,u);return{name:a,pipelineType:p,trigger:l,type:"workspace",workspaceConfig:m,env:e,components:t,fullConfig:o,packageManagerInfo:await(0,r.getPackageManagerInfoBase)(),build:{type:"workspace",dir:(c=m.dir)!==null&&c!==void 0?c:".",getComponentDirs:e=>(0,s.uniq)(t.flatMap((t=>t.build.getComponentDirs(e)))),buildType:m.type,config:m}}}t.createWorkspaceContext=createWorkspaceContext},52:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBuildInfoVariables=t.ALL_BUILD_VARIABLES=void 0;const n=a(5354);const r=a(1945);const i={BUILD_INFO_BUILD_ID:{default:new n.BashExpression(`$(git describe --tags 2>/dev/null || git rev-parse HEAD)`)},BUILD_INFO_BUILD_TIME:{default:"unknown-build-time",gitlab:new n.BashExpression(`$CI_JOB_STARTED_AT`)},BUILD_INFO_CURRENT_VERSION:{default:new n.BashExpression(`$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed 's/refs\\/tags\\/v//'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")`)}};t.ALL_BUILD_VARIABLES=Object.keys(i);const getBuildInfoVariables=e=>{const{pipelineType:t}=e;return Object.fromEntries(Object.entries(i).map((([e,a])=>[e,(0,r.getBashExpressionPerPipelineType)(a,t)])))};t.getBuildInfoVariables=getBuildInfoVariables},7044:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvConfig=void 0;const n=a(9250);const getEnvConfig=(e,t,a)=>{var r,i;const s=e.components[t];if(!s){throw new Error("unknown component "+t)}const o=(i=(r=s.env)===null||r===void 0?void 0:r[a])!==null&&i!==void 0?i:{};if(o===false){return s}return(0,n.mergeWith)((0,n.cloneDeep)(s),o,((e,t,a,n,r)=>{if(typeof t==="function"&&typeof e!=="function"){return t(e)}return undefined}))};t.getEnvConfig=getEnvConfig},8254:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvType=void 0;const n=a(5063);const getEnvType=(e,t)=>{if(t.type)return t.type;if((0,n.isKnowEnvType)(e)){return e}throw new Error("unknown env type: "+e)};t.getEnvType=getEnvType},4956:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvironment=void 0;const n=a(5841);const r=a(5855);const getEnvironment=async e=>{const{env:t}=e;const a=await(0,r.getEnvironmentVariables)(e);const i=(0,n.getEnvironmentContext)(e);const s=i.envType;return{envType:s,fullName:i.fullName,slugPrefix:i.environmentSlugPrefix,reviewSlug:i.reviewSlug,slug:i.environmentSlug,...a}};t.getEnvironment=getEnvironment},5841:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvironmentContext=void 0;const n=a(5354);const r=a(7044);const i=a(8254);const s=a(7342);const getEnvironmentSlugPrefix=(e,t)=>{if(t){return(0,n.joinBashExpressions)([e,t],"-")}return e};const getEnvironmentContext=({env:e,componentName:t,config:a,pipelineType:o})=>{const p=(0,r.getEnvConfig)(a,t,e);const l=(0,i.getEnvType)(e,p);const d=(0,s.getReviewSlug)(p,e,o);const c=getEnvironmentSlugPrefix(e,d);const u=c.concat(`-${t}`);const f=(0,n.joinBashExpressions)([a.customerName,a.appName,u],"-");return{envConfigRaw:p,deployConfigRaw:p.deploy,buildConfigRaw:p.build,environmentSlugPrefix:c,environmentSlug:u,reviewSlug:d,pipelineType:o,fullName:f,envType:l,componentName:t,env:e,fullConfig:a}};t.getEnvironmentContext=getEnvironmentContext},5855:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getSecretVarNameForContext=t.getSecretVarName=t.getEnvironmentVariables=void 0;const n=a(8025);const r=a(5354);const i=a(9851);const s=a(4396);const o=a(5598);const p=a(52);const l=a(5841);const d=a(98);const c=a(4946);const getBasePredefinedVariables=e=>({ENV_SHORT:e.env,APP_DIR:e.envConfigRaw.dir,ENV_TYPE:e.envType,...e.envType!=="local"?(0,p.getBuildInfoVariables)(e):{}});const getEnvironmentVariables=async(e,a={})=>{var p,u,f,m,h,v,g,y;const b=(0,l.getEnvironmentContext)(e);const{config:w,env:_,componentName:S}=e;const{envConfigRaw:N,deployConfigRaw:C,buildConfigRaw:A,envType:O}=b;const I=getBasePredefinedVariables(b);let D;let k;let T;if(O==="local"){const e=N;const t=e.port!==false?(p=e.port)!==null&&p!==void 0?p:3e3:null;k=t?"localhost:"+t.toString():null;T=k?"http://"+k:null;D={...I,ENV_SHORT:"local",...T?{ROOT_URL:T}:{},...k?{HOSTNAME:k}:{},...k?{HOSTNAME_INTERNAL:k}:{},...k?{ROOT_URL_INTERNAL:"http://"+k}:{},...t?{PORT:t.toString()}:{}}}else{const e=C?n.DEPLOY_TYPES[C.type].getAdditionalEnvVars(b):{};const t=(u=e.HOSTNAME_INTERNAL)!==null&&u!==void 0?u:"unknown-host.example.com";k=(f=N===null||N===void 0?void 0:N.host)!==null&&f!==void 0?f:t;T=(0,r.joinBashExpressions)(["https://",k]);D={...I,HOSTNAME:k,ROOT_URL:T,HOSTNAME_INTERNAL:t,ROOT_URL_INTERNAL:(0,r.joinBashExpressions)(["https://",t]),...e}}const P=(h=(m=N.vars)===null||m===void 0?void 0:m.public)!==null&&h!==void 0?h:{};const R=C?n.DEPLOY_TYPES[C.type].additionalSecretKeys(b):[];const L=[...(0,c.stringListToSecreteEnvVarList)((g=(v=N.vars)===null||v===void 0?void 0:v.secret)!==null&&g!==void 0?g:[]),...R];const x=(0,c.makeSecretEnvVarMapping)(_,S,L);const j=(0,c.stringifyValues)(P);const B=Object.fromEntries(Object.entries(j).map((([t,a])=>[t,(0,s.createVariableValueContainingReferencesFromString)(a,{componentName:e.componentName})])));const M=((y=a.shouldResolveReferences)!==null&&y!==void 0?y:true)?await(0,o.resolveAllReferences)(B,(async a=>{const{envVars:n}=await(0,t.getEnvironmentVariables)({...e,componentName:a},{shouldResolveReferences:false});return n})):B;const V=addIndexVar({...D,...x,...M});return{envVars:V,secretEnvVarKeys:L,jobOnlyVars:{build:await(0,d.transformJobOnlyVars)(_,S,A&&(0,i.isStandaloneBuildConfig)(A)&&A.jobVars||null),deploy:await(0,d.transformJobOnlyVars)(_,S,C&&C.jobVars||null)}}};t.getEnvironmentVariables=getEnvironmentVariables;const sanitizeForEnVar=e=>e.replace(/-/g,"_");const getSecretVarName=(e,t,a)=>`CL_${sanitizeForEnVar(e)}_${sanitizeForEnVar(t)}_${a}`;t.getSecretVarName=getSecretVarName;const addIndexVar=e=>({...e,_ALL_ENV_VAR_KEYS:JSON.stringify(Object.keys(e))});const getSecretVarNameForContext=(e,a)=>(0,t.getSecretVarName)(e.env,e.name,a);t.getSecretVarNameForContext=getSecretVarNameForContext},482:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getLabels=void 0;const r=n(a(4206));const sanitize=e=>{if(!e)return e;return(0,r.default)(e).toLowerCase()};const getLabels=e=>{var t,a;const n={"customer-name":sanitize(e.fullConfig.customerName),"component-name":sanitize(e.name),"app-name":sanitize(e.fullConfig.appName),"env-type":sanitize(e.environment.envType),"env-name":sanitize(e.env),"build-type":e.build.type==="disabled"?"disabled":sanitize(e.build.buildType),...(a=(t=e.fullConfig.meta)===null||t===void 0?void 0:t.labels)!==null&&a!==void 0?a:{}};return n};t.getLabels=getLabels},7342:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getReviewSlug=void 0;const n=a(5354);const r=a(1945);const i=a(8254);const s={default:"unknown-review-slug",gitlab:new n.BashExpression(`$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })`)};const getReviewSlug=(e,t,a)=>{const n=(0,i.getEnvType)(t,e);if(n==="review"){return(0,r.getBashExpressionPerPipelineType)(s,a)}return null};t.getReviewSlug=getReviewSlug},8045:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(4847),t);r(a(4956),t);r(a(5855),t)},98:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transformJobOnlyVars=void 0;const n=a(4946);const transformJobOnlyVars=async(e,t,a)=>{var r,i;if(!a){return{envVars:{},secretEnvVarKeys:[]}}const s=(0,n.stringifyValues)((r=a===null||a===void 0?void 0:a.public)!==null&&r!==void 0?r:{});const o=(0,n.stringListToSecreteEnvVarList)((i=a===null||a===void 0?void 0:a.secret)!==null&&i!==void 0?i:[]);const p=(a===null||a===void 0?void 0:a.secret)?(0,n.makeSecretEnvVarMapping)(e,t,o):{};const l={...p,...s};return{envVars:l,secretEnvVarKeys:o}};t.transformJobOnlyVars=transformJobOnlyVars},4946:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeSecretEnvVarMapping=t.stringListToSecreteEnvVarList=t.stringifyValues=void 0;const n=a(9250);const r=a(5855);const i=a(5354);const stringifyValues=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,n.isObject)(t)?JSON.stringify(t):`${t}`])));t.stringifyValues=stringifyValues;const stringListToSecreteEnvVarList=e=>e.map((e=>({key:e})));t.stringListToSecreteEnvVarList=stringListToSecreteEnvVarList;const makeSecretEnvVarMapping=(e,t,a)=>Object.fromEntries(a.map((({key:a})=>[a,(0,i.getBashVariable)((0,r.getSecretVarName)(e,t,a))])));t.makeSecretEnvVarMapping=makeSecretEnvVarMapping},4628:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_RETRY=void 0;t.BASE_RETRY={max:2}},4328:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createDeployJob=t.DEPLOY_JOB_NAME=void 0;const n=a(5644);const r=a(2764);const i=a(4713);const s=a(3660);const o=a(9256);const p=a(5044);const l=a(9415);const d=a(9666);t.DEPLOY_JOB_NAME="🚀 Deploy";const createDeployJob=(e,a)=>{var c,u,f,m,h,v;const g=(0,r.requiresDockerBuild)(e);const y=(0,p.contextIsStoppable)(e);const b=e.environment.envType==="review"?"1 week":e.environment.envType==="dev"?"4 weeks":undefined;const w=(c=e.deploy)===null||c===void 0?void 0:c.config;const _=w&&w.when?w.when:undefined;const S=e.environment.envType!=="prod"?"auto":((u=e.componentConfig.env)===null||u===void 0?void 0:u.stage)===false?"auto":"manual";const N=_?_:S;return{name:t.DEPLOY_JOB_NAME,script:a.script,image:a.image,cache:a.cache?(0,n.createJobCacheFromCacheConfigs)(e,a.cache):undefined,artifacts:a.artifacts,services:a.services,envMode:"stagePerEnv",needs:[...(0,o.sbomDeactivated)(e)?[]:[{job:i.SBOM_BUILD_JOB_NAME,artifacts:true}],...w?(m=(f=w.waitFor)===null||f===void 0?void 0:f.map((e=>({componentName:e,job:t.DEPLOY_JOB_NAME,artifacts:false}))))!==null&&m!==void 0?m:[]:[]],needsStages:[...(0,s.componentContextHasWorkspaceBuild)(e)?g?[{stage:"build",artifacts:false}]:[{stage:"build",artifacts:true,workspaceName:e.build.workspaceName}]:[{stage:"build",artifacts:g?false:true}],{stage:"test",artifacts:false,workspaceName:(0,s.componentContextHasWorkspaceBuild)(e)?e.build.workspaceName:undefined}],when:N==="auto"?"on_success":"manual",allow_failure:N==="manual"?true:false,stage:"deploy",variables:{...e.environment.envVars,...g?(0,r.getDockerImageVariables)(e):{},...e.environment.jobOnlyVars.deploy.envVars,...a.variables},runnerVariables:{...d.DEPLOY_RUNNER_VARIABLES,...(h=a.runnerVariables)!==null&&h!==void 0?h:{},...w?(v=w.runnerVariables)!==null&&v!==void 0?v:{}:{}},environment:y?{on_stop:l.STOP_JOB_NAME,auto_stop_in:b}:{},jobTags:w?w.jobTags:undefined}};t.createDeployJob=createDeployJob},8563:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createDeployementJobs=void 0;const n=a(4328);const r=a(2099);const i=a(9415);const createDeployementJobs=(e,t)=>[(0,n.createDeployJob)(e,t.deploy),...t.stop?[(0,i.createStopJob)(e,t.stop)]:[],...t.rollback?[(0,r.createRollbackJob)(e,t.rollback)]:[]];t.createDeployementJobs=createDeployementJobs},2099:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createRollbackJob=t.ROLLBACK_JOB_NAME=void 0;const n=a(9666);t.ROLLBACK_JOB_NAME="↩️ Rollback ⚠️";const createRollbackJob=(e,a)=>{var r;return{name:t.ROLLBACK_JOB_NAME,image:a.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",variables:{...e.environment.jobOnlyVars.deploy.envVars,...a.variables},runnerVariables:{...n.DEPLOY_RUNNER_VARIABLES,GIT_STRATEGY:"none",...(r=a.runnerVariables)!==null&&r!==void 0?r:{}},stage:"rollback",environment:{action:"access"},script:a.script}};t.createRollbackJob=createRollbackJob},9415:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createStopJob=t.STOP_JOB_NAME=void 0;const n=a(9666);t.STOP_JOB_NAME="🛑 Stop ⚠️";const createStopJob=(e,a)=>({name:t.STOP_JOB_NAME,image:a.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",rules:[{if:"$CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/",when:"on_success"}],variables:{...e.environment.jobOnlyVars.deploy.envVars,...a.variables},runnerVariables:{...n.DEPLOY_RUNNER_VARIABLES,GIT_STRATEGY:"none",...a.runnerVariables},stage:"stop",environment:{action:"stop"},script:a.script});t.createStopJob=createStopJob},9666:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_RUNNER_VARIABLES=void 0;t.DEPLOY_RUNNER_VARIABLES={KUBERNETES_CPU_REQUEST:"0.22",KUBERNETES_MEMORY_REQUEST:"200Mi",KUBERNETES_MEMORY_LIMIT:"400Mi"}},4316:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedImagesCommands=t.getArtifactsRegistryImage=t.getArtifactsRegistryBuildCacheImage=t.getArtifactsRegistryImageName=t.getArtifactsRegistryDockerUrl=t.getArtifactsRegistryHost=void 0;const n=a(5354);const r=a(3468);const i=a(2383);const s=a(9497);const getArtifactsRegistryHost=e=>{var t;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"google-cloudrun")){throw new Error("deploy config is wrong")}return`${e.deploy.config.region}-docker.pkg.dev`};t.getArtifactsRegistryHost=getArtifactsRegistryHost;const getArtifactsRegistryDockerUrl=e=>{var a;const n=(a=e.deploy)===null||a===void 0?void 0:a.config;if(!(0,i.isOfDeployType)(n,"google-cloudrun")){throw new Error("deploy config is wrong")}const r=`${e.fullConfig.customerName}-${e.fullConfig.appName}`;return`${(0,t.getArtifactsRegistryHost)(e)}/${n.projectId}/catladder-deploy/${r}`};t.getArtifactsRegistryDockerUrl=getArtifactsRegistryDockerUrl;const getArtifactsRegistryImageName=(e,a=false)=>{if(a&&e.environment.envType!=="review"){throw new Error("lecacyReviewImageName is only allowed for review app")}const r=(0,t.getArtifactsRegistryDockerUrl)(e);const i=[r,e.env,e.name,...e.environment.reviewSlug&&!a?[e.environment.reviewSlug]:[]];return(0,n.joinBashExpressions)(i,"/")};t.getArtifactsRegistryImageName=getArtifactsRegistryImageName;const getArtifactsRegistryBuildCacheImage=e=>{const a=(0,t.getArtifactsRegistryDockerUrl)(e);const n=[a,"caches",e.name];return n.join("/")};t.getArtifactsRegistryBuildCacheImage=getArtifactsRegistryBuildCacheImage;const getArtifactsRegistryImage=e=>`${(0,t.getArtifactsRegistryImageName)(e)}:$DOCKER_IMAGE_TAG`;t.getArtifactsRegistryImage=getArtifactsRegistryImage;const getDeleteImageCommands=(e,t=0)=>{if(t===0){return[`gcloud artifacts docker images delete ${e} --quiet --delete-tags`]}const a=`gcloud artifacts docker images list ${e} --sort-by=~CREATE_TIME --format="value(version)"`;const n=(0,s.removeFirstLinesFromCommandOutput)(a,t);const r=`gcloud artifacts docker images delete ${e}@$version --quiet --delete-tags`;const i=`${n} | while read -r version; do ${r}; done`;return[i]};const getDeleteUnusedImagesCommands=(e,a=0)=>{var n;const s=(n=e.deploy)===null||n===void 0?void 0:n.config;if(!(0,i.isOfDeployType)(s,"google-cloudrun")){throw new Error("deploy config is wrong")}const o=(0,t.getArtifactsRegistryImageName)(e);const p=(0,t.getArtifactsRegistryBuildCacheImage)(e);return[...getDeleteImageCommands(o,a),...getDeleteImageCommands(p,1),...e.environment.envType==="review"?(0,r.allowFailureInScripts)(getDeleteImageCommands((0,t.getArtifactsRegistryImageName)(e,true),0)):[]]};t.getDeleteUnusedImagesCommands=getDeleteUnusedImagesCommands},7744:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRemoveOldRevisionsAndImagesCommand=void 0;const n=a(3468);const r=a(4316);const i=a(4212);const getRemoveOldRevisionsAndImagesCommand=(e,t)=>{if(t==="onStop"){return(0,r.getDeleteUnusedImagesCommands)(e)}const a=e.environment.envType==="prod"?5:0;const s=a+1;const o=(0,i.getDeleteUnusedRevisionsCommands)(e,a);const p=(0,r.getDeleteUnusedImagesCommands)(e,s);return(0,n.allowFailureInScripts)([...o,...p])};t.getRemoveOldRevisionsAndImagesCommand=getRemoveOldRevisionsAndImagesCommand},4212:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedRevisionsCommands=void 0;const n=a(2383);const r=a(5516);const i=a(6428);const s=a(9497);const getListRevisionsCommand=(e,t)=>{var a;const s=(0,i.getServiceName)(e);const o=(a=e.deploy)===null||a===void 0?void 0:a.config;if(!o||!(0,n.isOfDeployType)(o,"google-cloudrun")){throw new Error("deploy config is wrong")}const p={project:o.projectId,region:o.region,service:s,limit:"unlimited","sort-by":"metadata.creationTimestamp",...t};return`gcloud run revisions list ${(0,r.createArgsString)(p)}`};const getDeleteUnusedRevisionsCommands=(e,t)=>{var a;const i=(a=e.deploy)===null||a===void 0?void 0:a.config;if(!(0,n.isOfDeployType)(i,"google-cloudrun")){throw new Error("deploy config is wrong")}const o=getListRevisionsCommand(e,{format:`"value(name)"`,filter:`'(status.conditions.status=False OR status.conditions.status=Unknown)'`});const p=(0,s.removeFirstLinesFromCommandOutput)(o,t);const l=`gcloud run revisions delete ${(0,r.createArgsString)({project:i.projectId,region:i.region,quiet:true})} $revisionname `;const d=`${p} | while read -r revisionname; do ${l}; done`;return[d]};t.getDeleteUnusedRevisionsCommands=getDeleteUnusedRevisionsCommands},2579:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunJobsWithNames=t.getJobCreateScripts=t.getDeleteJobsScripts=void 0;const n=a(482);const r=a(595);const i=a(5516);const s=a(6962);const o=a(4884);const p=a(7180);const l=a(7770);const d=a(2790);const getDeleteJobsScripts=e=>{const a=(0,o.getCommonCloudRunArgs)(e);const n=(0,i.createArgsString)(a);const r=(0,t.getCloudRunJobsWithNames)(e);return r.flatMap((({fullJobName:e})=>[`${(0,o.gcloudRunCmd)()} jobs executions list ${n} --job ${e} --format="value(name)" | xargs -I {} ${(0,o.gcloudRunCmd)()} jobs executions delete {} --quiet ${n}`,`${(0,o.gcloudRunCmd)()} jobs delete ${e} ${n}`]))};t.getDeleteJobsScripts=getDeleteJobsScripts;const getJobCreateScripts=e=>(0,t.getCloudRunJobsWithNames)(e).map((({job:t,fullJobName:a},s)=>{var c,u,f,m,h;const v=Array.isArray(t.command)?t.command:t.command.split(" ");const{image:g,project:y,region:b,...w}=(0,o.getCommonDeployArgs)(e);const _=(0,i.createArgsString)({command:`"${v.join(",")}"`,args:(0,d.getCloudRunServiceOrJobArgsArg)(t.args),labels:`"${(0,o.makeLabelString)((0,n.getLabels)(e))},cloud-run-job-name=$current_job_name"`,image:`"${(c=t.image)!==null&&c!==void 0?c:g}"`,project:y,region:b,cpu:t.cpu,memory:(u=t.memory)!==null&&u!==void 0?u:"512Mi",parallelism:(f=t.parallelism)!==null&&f!==void 0?f:1,"task-timeout":(m=t.timeout)!==null&&m!==void 0?m:"10m","env-vars-file":p.ENV_VARS_FILENAME,"max-retries":(h=t.maxRetries)!==null&&h!==void 0?h:0,...w,"vpc-connector":t===null||t===void 0?void 0:t.vpcConnector,"vpc-egress":t===null||t===void 0?void 0:t.vpcEgress,network:t===null||t===void 0?void 0:t.network,subnet:t===null||t===void 0?void 0:t.subnet},...(0,l.createVolumeConfig)(t.volumes,"job"));return[s===0?`exist_job_names="$(\n ${(0,o.gcloudRunCmd)()} jobs list --filter='metadata.name ~ ${e.env}.*${e.name}' --format='value(name)' --limit=999 --project='${y}' --region='${b}'\n)"`:null,`current_job_name="${a}"`,'if echo "$exist_job_names" | grep -Fx "$current_job_name" >/dev/null; then',` ${(0,o.gcloudRunCmd)()} jobs update "$current_job_name" ${_}`,"else",` ${(0,o.gcloudRunCmd)()} jobs create "$current_job_name" ${_}`,"fi"].filter(r.notNil).join("\n")}));t.getJobCreateScripts=getJobCreateScripts;const getCloudRunJobsWithNames=e=>{var t;const a=(0,o.getCloudRunDeployConfig)(e);const n=Object.entries((t=a.jobs)!==null&&t!==void 0?t:{}).filter((e=>Boolean(e[1]))).map((([t,a])=>({fullJobName:(0,s.getFullJobName)(e,t),job:a,jobName:t})));return n};t.getCloudRunJobsWithNames=getCloudRunJobsWithNames},675:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getServiceDeleteScript=t.getServiceDeployScript=void 0;const n=a(482);const r=a(5516);const i=a(2790);const s=a(6428);const o=a(4884);const p=a(7180);const l=a(6451);const d=a(7770);const getServiceDeployScript=(e,t,a)=>{var c,u,f,m,h,v;const g=(0,o.getCommonDeployArgs)(e);const y=(0,s.getServiceName)(e);const b=t!==true?t:undefined;const w=t!==true?(c=t===null||t===void 0?void 0:t.command)!==null&&c!==void 0?c:e.build.type!=="disabled"?e.build.config.startCommand:undefined:undefined;const _=w?Array.isArray(w)?w:w.split(" "):undefined;const S=y.concat(a!==null&&a!==void 0?a:"");const N=(0,r.createArgsString)({command:_?'"'+_.join(",")+'"':'""',args:(0,i.getCloudRunServiceOrJobArgsArg)(b===null||b===void 0?void 0:b.args),...g,image:(u=b===null||b===void 0?void 0:b.image)!==null&&u!==void 0?u:g.image,labels:(0,o.makeLabelString)({...(0,n.getLabels)(e),"cloud-run-service-name":S}),"env-vars-file":p.ENV_VARS_FILENAME,"min-instances":(f=b===null||b===void 0?void 0:b.minInstances)!==null&&f!==void 0?f:0,"max-instances":(m=b===null||b===void 0?void 0:b.maxInstances)!==null&&m!==void 0?m:100,"cpu-throttling":(b===null||b===void 0?void 0:b.noCpuThrottling)!==true,cpu:b===null||b===void 0?void 0:b.cpu,memory:b===null||b===void 0?void 0:b.memory,timeout:b===null||b===void 0?void 0:b.timeout,"vpc-connector":b===null||b===void 0?void 0:b.vpcConnector,"vpc-egress":b===null||b===void 0?void 0:b.vpcEgress,network:b===null||b===void 0?void 0:b.network,subnet:b===null||b===void 0?void 0:b.subnet,"use-http2":b===null||b===void 0?void 0:b.http2,"allow-unauthenticated":(h=b===null||b===void 0?void 0:b.allowUnauthenticated)!==null&&h!==void 0?h:true,ingress:(v=b===null||b===void 0?void 0:b.ingress)!==null&&v!==void 0?v:"all","cpu-boost":true,"execution-environment":b===null||b===void 0?void 0:b.executionEnvironment,gpu:b===null||b===void 0?void 0:b.gpu,"gpu-type":b===null||b===void 0?void 0:b.gpuType,...(0,l.healthCheckCliArgs)(b===null||b===void 0?void 0:b.healthCheck)},...(0,d.createVolumeConfig)(b===null||b===void 0?void 0:b.volumes,"service"));const C=requiresBeta(b)?"beta":undefined;return`${(0,o.gcloudRunCmd)(C)} deploy ${S} ${N}`};t.getServiceDeployScript=getServiceDeployScript;const getServiceDeleteScript=(e,t)=>{const a=(0,o.getCommonCloudRunArgs)(e);const n=(0,r.createArgsString)(a);const i=(0,s.getServiceName)(e);const p=t?`${i}-${t}`:i;return[`${(0,o.gcloudRunCmd)()} services delete ${p} ${n}`]};t.getServiceDeleteScript=getServiceDeleteScript;const requiresBeta=e=>{if(!e){return false}if(e.gpuType){return true}if(e.gpu&&e.gpu>0){return true}if(e.healthCheck!==undefined){return true}return false}},4884:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCommonDeployArgs=t.getCommonCloudRunArgs=t.getCloudRunDeployConfig=t.makeLabelString=t.setGoogleProjectNumberScript=t.gcloudSchedulerCmd=t.gcloudRunCmd=t.gcloudCmd=void 0;const n=a(2383);const r=a(4316);const gcloudCmd=e=>e?`gcloud ${e}`:"gcloud";t.gcloudCmd=gcloudCmd;const gcloudRunCmd=e=>`${(0,t.gcloudCmd)(e)} run`;t.gcloudRunCmd=gcloudRunCmd;const gcloudSchedulerCmd=e=>`${(0,t.gcloudCmd)(e)} scheduler`;t.gcloudSchedulerCmd=gcloudSchedulerCmd;const setGoogleProjectNumberScript=e=>[`export GCLOUD_PROJECT_NUMBER=$(${(0,t.gcloudCmd)()} projects describe ${e.projectId} --format="value(projectNumber)")`,'echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"'];t.setGoogleProjectNumberScript=setGoogleProjectNumberScript;const makeLabelString=e=>Object.entries(e).map((([e,t])=>`${e}=${t}`)).join(",");t.makeLabelString=makeLabelString;const getCloudRunDeployConfig=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,n.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}return a};t.getCloudRunDeployConfig=getCloudRunDeployConfig;function getCommonCloudRunArgs(e){const a=(0,t.getCloudRunDeployConfig)(e);return{project:a.projectId,region:a.region}}t.getCommonCloudRunArgs=getCommonCloudRunArgs;function getCommonDeployArgs(e){const a=getCommonCloudRunArgs(e);const n=(0,t.getCloudRunDeployConfig)(e);return{image:(0,r.getArtifactsRegistryImage)(e),...a,"set-cloudsql-instances":n.cloudSql?n.cloudSql.instanceConnectionName:undefined}}t.getCommonDeployArgs=getCommonDeployArgs},7180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ENV_VARS_FILENAME=void 0;t.ENV_VARS_FILENAME="____envvars.yaml"},9099:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getOnDeployExecuteScript=void 0;const n=a(595);const r=a(5516);const i=a(2790);const s=a(6962);const o=a(2579);const p=a(4884);const getOnDeployExecuteScript=(e,t)=>{const a=getExecutes(e);return a.filter((({config:e})=>e.when===t)).flatMap((t=>getJobRunScriptForExecute(e,t)))};t.getOnDeployExecuteScript=getOnDeployExecuteScript;const getExecutes=e=>{var t;const a=(0,p.getCloudRunDeployConfig)(e);return[...getLegacyExecutes(e),...Object.entries((t=a.execute)!==null&&t!==void 0?t:{}).flatMap((([e,t])=>{if(!t){return[]}return[{jobName:e,config:t}]}))]};const getLegacyExecutes=e=>{const t=(0,o.getCloudRunJobsWithNames)(e);return t.flatMap((({jobName:e,job:t})=>{if(!t.when||!["preDeploy","postDeploy","preStop","postStop"].includes(t.when)){return[]}return[{jobName:e,config:{job:e,type:"job",when:t.when,...t.when==="preDeploy"||t.when==="postDeploy"?{waitForCompletion:t.waitForCompletion}:{}}}]}))};const getJobRunScriptForExecute=(e,{jobName:t,config:a})=>{var o;const l=a.type;if(l==="script"){return(0,n.ensureArray)(a.script)}else if(l==="job"){const n=(0,p.getCommonCloudRunArgs)(e);const l=["preStop","postStop"].includes(a.when)?true:"waitForCompletion"in a?(o=a.waitForCompletion)!==null&&o!==void 0?o:false:false;const d=(0,r.createArgsString)({...n,wait:l===true?true:undefined,args:(0,i.getCloudRunServiceOrJobArgsArg)(a.args)});const c=(0,s.getFullJobName)(e,t);return[`${(0,p.gcloudRunCmd)()} jobs execute ${c.toString()} ${d}`]}throw new Error(`unsupported execute type: ${l}`)}},1503:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCreateScheduleScript=t.getDeleteSchedulesScript=void 0;const n=a(8016);const r=a(595);const i=a(5857);const s=a(5516);const o=a(6962);const p=a(2579);const l=a(4884);const getDeleteSchedulesScript=e=>{const t=(0,l.getCloudRunDeployConfig)(e);const a=getSchedules(e);const n=(0,s.createArgsString)({project:t.projectId,location:t.region});return a.map((({fullName:e})=>[`${(0,l.gcloudSchedulerCmd)()} jobs delete ${e} ${n}`])).flat()};t.getDeleteSchedulesScript=getDeleteSchedulesScript;const getCreateScheduleScript=e=>{const t=getSchedules(e);const{region:a,projectId:n}=(0,l.getCloudRunDeployConfig)(e);return t.map((({fullName:t,config:i},o)=>{var p;const{uri:d,...c}=getSchedulerArgs(i,e);const u=(0,s.createArgsString)({project:n,location:a,uri:`"$current_job_uri"`,...c,schedule:`"${i.schedule}"`,"max-retry-attempts":(p=i.maxRetryAttempts)!==null&&p!==void 0?p:0});return[o===0?`exist_scheduler_names="$(\n ${(0,l.gcloudSchedulerCmd)()} jobs list --filter='httpTarget.uri ~ ${e.env}.*${e.name}' --format='value(name)' --limit=999 --location='${a}' --project='${n}'\n)"`:null,`current_job_uri="${d}"`,`current_scheduler_name="${t}"`,`if echo "$exist_scheduler_names" | grep -Fx "$current_scheduler_name" >/dev/null; then`,` ${(0,l.gcloudSchedulerCmd)()} jobs update http "$current_scheduler_name" ${u}`,`else`,` ${(0,l.gcloudSchedulerCmd)()} jobs create http "$current_scheduler_name" ${u}`,`fi`].filter(r.notNil).join("\n")}))};t.getCreateScheduleScript=getCreateScheduleScript;const getSchedulerArgs=(e,t)=>{var a;if(e.type==="job"){const{projectId:r,region:s}=(0,l.getCloudRunDeployConfig)(t);const o=e.args!==undefined?{overrides:{containerOverrides:[((a=e.args)===null||a===void 0?void 0:a.length)>0?{args:e.args}:{args:[],clearArgs:true}]}}:null;return{uri:(0,i.getCloudRunJobExecuteUrl)(e.job,{appFullName:t.environment.fullName,projectId:r,region:s}),"message-body":o?'"'+(0,n.bashEscape)(JSON.stringify(o))+'"':undefined,"http-method":"POST","oauth-service-account-email":`"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"`}}if(e.type==="http"){return{uri:e.url,"message-body":e.body,"http-method":e.method,"oidc-service-account-email":`"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"`}}throw new Error(`Unknown scheduler type: ${e.type}`)};const getSchedules=e=>{const t=getLegacyJobSchedules(e);const a=getScheduledExecutes(e);return Object.entries({...t,...a}).map((([t,a])=>({name:t,fullName:(0,o.getFullSchedulerName)(e,t),config:a})))};const getLegacyJobSchedules=e=>{const t=(0,p.getCloudRunJobsWithNames)(e);return Object.fromEntries(t.filter((e=>e.job.when==="schedule")).map((({job:{maxRetryAttempts:e,schedule:t},jobName:a})=>{const n=a.concat("-scheduler");return[n,{type:"job",job:a,maxRetryAttempts:e,schedule:t,when:"schedule"}]})))};const getScheduledExecutes=e=>{var t;const a=(0,l.getCloudRunDeployConfig)(e);return Object.fromEntries(Object.entries((t=a.execute)!==null&&t!==void 0?t:{}).flatMap((([e,t])=>{if(!t||t.when!=="schedule"){return[]}return[[e,t]]})))}},9726:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunDeployScripts=void 0;const n=a(9250);const r=a(3468);const i=a(9256);const s=a(7728);const o=a(5103);const p=a(7744);const l=a(41);const d=a(1201);const c=a(2579);const u=a(9099);const f=a(675);const m=a(4884);const h=a(7180);const v=a(1503);function getCloudRunDeployScripts(e){var t;const a=(0,m.getCloudRunDeployConfig)(e);const g=(0,n.omit)(e.environment.envVars,s.GCLOUD_DEPLOY_CREDENTIALS_KEY);return[...(0,r.collapseableSection)("prepare","Prepare...")([...(0,d.gcloudServiceAccountLoginCommands)(e),...(0,m.setGoogleProjectNumberScript)(a)]),...(0,r.collapseableSection)("writeenvvars","Write env vars to file")((0,o.writeBashYamlToFileScript)(g,h.ENV_VARS_FILENAME)),...(0,r.collapseableSection)("deploy","Deploy to cloud run")([...a.cloudSql?(0,l.getDatabaseCreateScript)(e,a):[],...(0,v.getCreateScheduleScript)(e),...(0,c.getJobCreateScripts)(e),...(0,u.getOnDeployExecuteScript)(e,"preDeploy"),...a.service!==false?[(0,f.getServiceDeployScript)(e,a.service)]:[],...Object.entries((t=a.additionalServices)!==null&&t!==void 0?t:{}).filter((([e,t])=>t!==false&&t!==null)).map((([t,a])=>(0,f.getServiceDeployScript)(e,a,"-"+t))),...(0,u.getOnDeployExecuteScript)(e,"postDeploy")]),...(0,r.collapseableSection)("cleanup","Cleanup")((0,p.getRemoveOldRevisionsAndImagesCommand)(e,"postDeploy")),...(0,i.getDependencyTrackUploadScript)(e)]}t.getCloudRunDeployScripts=getCloudRunDeployScripts},9551:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunStopScripts=void 0;const n=a(9256);const r=a(7744);const i=a(41);const s=a(1201);const o=a(2579);const p=a(9099);const l=a(1503);const d=a(675);const c=a(4884);function getCloudRunStopScripts(e){var t;const a=(0,c.getCloudRunDeployConfig)(e);return[...(0,s.gcloudServiceAccountLoginCommands)(e),...(0,p.getOnDeployExecuteScript)(e,"preStop"),...a.service!==false?(0,d.getServiceDeleteScript)(e):[],...Object.entries((t=a.additionalServices)!==null&&t!==void 0?t:{}).filter((([e,t])=>t!==false&&t!==null)).flatMap((([t])=>(0,d.getServiceDeleteScript)(e,t))),...(0,p.getOnDeployExecuteScript)(e,"postStop"),...(0,l.getDeleteSchedulesScript)(e),...(0,o.getDeleteJobsScripts)(e),...a.cloudSql&&a.cloudSql.deleteDatabaseOnStop?(0,i.getDatabaseDeleteScript)(e,a):[],...(0,r.getRemoveOldRevisionsAndImagesCommand)(e,"onStop"),...(0,n.getDependencyTrackDeleteScript)(e)]}t.getCloudRunStopScripts=getCloudRunStopScripts},6451:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.healthCheckCliArgs=void 0;const n=a(2383);const r=8080;function healthCheckCliArgs(e){const t=e===undefined;if(t){return undefined}const a=e===true;if(a){return{"startup-probe":toArgValue(probeToKeyValuePairs(n.defaultStartupProbe)),"liveness-probe":toArgValue(probeToKeyValuePairs(n.defaultLivenessProbe))}}return{"startup-probe":toArgValue(probeToKeyValuePairs(e.startupProbe)),"liveness-probe":e.livenessProbe?toArgValue(probeToKeyValuePairs(e.livenessProbe)):""}}t.healthCheckCliArgs=healthCheckCliArgs;function probeToKeyValuePairs(e){const t=Object.entries({initialDelaySeconds:e.initialDelaySeconds,timeoutSeconds:e.timeoutSeconds,periodSeconds:e.periodSeconds,failureThreshold:e.failureThreshold});switch(e.type){case"tcp":return[...t,["tcpSocket.port",r]];case"http1":return[...t,["httpGet.port",r],["httpGet.path",e.path]];default:e;return[]}}function toArgValue(e){return e.map((([e,t])=>`${e}=${t}`)).join(",")}},933:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createGoogleCloudRunDeployJobs=void 0;const n=a(2348);const r=a(3468);const i=a(8563);const s=a(2383);const o=a(7180);const p=a(9726);const l=a(9551);const createGoogleCloudRunDeployJobs=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,s.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}const d=(0,p.getCloudRunDeployScripts)(e);const c=(0,l.getCloudRunStopScripts)(e);return(0,i.createDeployementJobs)(e,{deploy:{variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"},...a.debug?{artifacts:{paths:[o.ENV_VARS_FILENAME],when:"always"}}:{},image:(0,n.getRunnerImage)("gcloud"),script:d},stop:{image:(0,n.getRunnerImage)("gcloud"),variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"},script:(0,r.allowFailureInScripts)(c)}})};t.createGoogleCloudRunDeployJobs=createGoogleCloudRunDeployJobs},7770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createVolumeConfig=void 0;const createVolumeConfig=(e,t)=>{if(!e){return[]}return[...Object.entries(e).map((([e,{type:t,bucket:a,mountPath:n,readonly:r}])=>({"add-volume":`name=${e},type=${t},bucket=${a}${r?",readonly=true":""}`,"add-volume-mount":`volume=${e},mount-path=${n}`}))),t==="service"?{"execution-environment":"gen2"}:{}]};t.createVolumeConfig=createVolumeConfig},7728:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GCLOUD_RUN_DEPLOY_TYPE=t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX=t.GCLOUD_DEPLOY_CREDENTIALS_KEY=void 0;const n=a(5354);const r=a(8045);const i=a(3468);const s=a(7844);const o=a(933);const p=a(5857);const l=a(41);t.GCLOUD_DEPLOY_CREDENTIALS_KEY="GCLOUD_DEPLOY_credentialsKey";t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX="GCLOUD_RUN_canonicalHostSuffix";const getCloudSqlVariables=({deployConfigRaw:e,environmentSlugPrefix:t,env:a,componentName:n,fullConfig:i})=>{var o,p,d;if(e&&e.cloudSql){const c=(0,s.getFullDbName)(e.cloudSql,i,t,n);const u=Object.entries((o=e.cloudSql.dbAdditionalQueryParams)!==null&&o!==void 0?o:{}).map((([e,t])=>`&${e}=${t}`)).join("");const f={CLOUD_SQL_INSTANCE_CONNECTION_NAME:e.cloudSql.instanceConnectionName,DB_NAME:c,DB_USER:(p=e.cloudSql.dbUser)!==null&&p!==void 0?p:"postgres",DB_PASSWORD:"$"+(0,r.getSecretVarName)(a,n,"DB_PASSWORD")};return{...f,DATABASE_URL:(0,l.getDatabaseConnectionString)(e.cloudSql,f).concat(u),DATABASE_JDBC_URL:(0,l.getDatabaseJdbcUrl)(f,(d=e.cloudSql.dbConnectionStringVariablesMode)!==null&&d!==void 0?d:l.DEFAULT_DB_VARIABLES_MODE)}}return{}};t.GCLOUD_RUN_DEPLOY_TYPE={jobs:o.createGoogleCloudRunDeployJobs,defaults:({deployConfigRaw:e,envType:t})=>{if(e&&e.cloudSql){return{cloudSql:{deleteDatabaseOnStop:t==="review"}}}return{}},additionalSecretKeys:e=>[{key:t.GCLOUD_DEPLOY_CREDENTIALS_KEY,hidden:true},{key:t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX,hidden:true},...e.deployConfigRaw&&e.deployConfigRaw.cloudSql?[{key:"DB_PASSWORD"}]:[]],getAdditionalEnvVars:e=>{const{fullName:a,env:s,componentName:o,deployConfigRaw:l}=e;const d=(0,n.joinBashExpressions)([a,(0,n.getBashVariable)((0,r.getSecretVarName)(s,o,t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX))],"-").toLowerCase();const c=l&&l.jobs?Object.fromEntries(Object.entries(l.jobs).filter((([e,t])=>Boolean(t))).map((([e,t])=>["CLOUD_RUN_JOB_TRIGGER_URL_"+(0,i.sanitizeForBashVariable)(e),(0,p.getCloudRunJobExecuteUrl)(e,{appFullName:a,projectId:l.projectId,region:l.region})]))):{};return{HOSTNAME_INTERNAL:d,...getCloudSqlVariables(e),...c,DEPLOY_CLOUD_RUN_PROJECT_ID:l?l.projectId:undefined,DEPLOY_CLOUD_RUN_REGION:l?l.region:undefined}}}},5857:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunJobExecuteUrl=void 0;const n=a(6962);function getCloudRunJobExecuteUrl(e,{region:t,projectId:a,appFullName:r}){const i=`https://${t}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${a}/jobs`;const s=(0,n.getCloudRunJobName)(r,e);return`${i}/${s}:run`}t.getCloudRunJobExecuteUrl=getCloudRunJobExecuteUrl},5516:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createArgsString=void 0;const n=a(9250);const createArgsString=(...e)=>e.map((e=>Object.entries(e).filter((([,e])=>!(0,n.isNil)(e))).map((([e,t])=>{if(t===true){return`--${e}`}else if(t===false){return`--no-${e}`}return`--${e}=${t}`})))).flat().join(" ");t.createArgsString=createArgsString},41:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDatabaseConnectionString=t.getPrismaDatabaseConnectionString=t.getRailsDatabaseConnectionString=t.getDatabaseJdbcUrl=t.DEFAULT_DB_VARIABLES_MODE=t.getDatabaseCreateScript=t.getDatabaseDeleteScript=void 0;const n=a(8016);const r=a(3468);const getDatabaseDeleteScript=(e,t)=>{if(!t.cloudSql||!t.cloudSql.deleteDatabaseOnStop){throw new Error("not possible")}const a=e.environment.envVars["DB_NAME"];if(!a){throw new Error("error: env vars did not specify DB_NAME")}const[n,i,s]=t.cloudSql.instanceConnectionName.split(":");return[`echo "deleting database ${a}..."`,`echo "👆 this can take multiple attemps (3-5min), because google cloud run may still have a connection to the database after the cloud run service is shut down"`,(0,r.repeatOnFailure)(`gcloud sql databases delete ${a} --instance=${s} --project ${n}`,{pauseInSeconds:10})]};t.getDatabaseDeleteScript=getDatabaseDeleteScript;const getDatabaseCreateScript=(e,t)=>{if(!t.cloudSql){throw new Error("not possible")}const a=e.environment.envVars["DB_NAME"];if(!a){throw new Error("error: env vars did not specify DB_NAME")}const[n,i,s]=t.cloudSql.instanceConnectionName.split(":");return(0,r.allowFailureInScripts)([`echo "ensuring Database..."`,`gcloud sql databases create ${a} --instance=${s} --project ${n}`])};t.getDatabaseCreateScript=getDatabaseCreateScript;t.DEFAULT_DB_VARIABLES_MODE="legacy";const getVariableOrValue=(e,t,a)=>a==="legacy"?`$${e}`:t[e];const getDatabaseJdbcUrl=(e,t)=>{const a=["jdbc:postgresql:///",getVariableOrValue("DB_NAME",e,t),"?cloudSqlInstance=",getVariableOrValue("CLOUD_SQL_INSTANCE_CONNECTION_NAME",e,t),"&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=",getVariableOrValue("DB_USER",e,t),"&password=",getVariableOrValue("DB_PASSWORD",e,t)];return(0,n.joinBashExpressions)(a)};t.getDatabaseJdbcUrl=getDatabaseJdbcUrl;const getRailsDatabaseConnectionString=(e,t)=>{const a=["postgresql://",getVariableOrValue("DB_USER",e,t),":",getVariableOrValue("DB_PASSWORD",e,t),"@",encodeURIComponent(`/cloudsql/${e.CLOUD_SQL_INSTANCE_CONNECTION_NAME}`),"/",getVariableOrValue("DB_NAME",e,t),"?"];return(0,n.joinBashExpressions)(a)};t.getRailsDatabaseConnectionString=getRailsDatabaseConnectionString;const getPrismaDatabaseConnectionString=(e,t)=>{const a=["postgresql://",getVariableOrValue("DB_USER",e,t),":",getVariableOrValue("DB_PASSWORD",e,t),"@localhost/",getVariableOrValue("DB_NAME",e,t),"?host=/cloudsql/",getVariableOrValue("CLOUD_SQL_INSTANCE_CONNECTION_NAME",e,t)];return(0,n.joinBashExpressions)(a)};t.getPrismaDatabaseConnectionString=getPrismaDatabaseConnectionString;const getDatabaseConnectionString=(e,a)=>{var n;const r=(n=e.dbConnectionStringVariablesMode)!==null&&n!==void 0?n:t.DEFAULT_DB_VARIABLES_MODE;switch(e.dbConnectionStringFormat){case"jdbc":return(0,t.getDatabaseJdbcUrl)(a,r);case"rails":return(0,t.getRailsDatabaseConnectionString)(a,r);default:return(0,t.getPrismaDatabaseConnectionString)(a,r)}};t.getDatabaseConnectionString=getDatabaseConnectionString},1201:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gcloudServiceAccountLoginCommands=void 0;const n=a(7728);const r=a(8045);const gcloudServiceAccountLoginCommands=e=>[`gcloud auth activate-service-account --key-file=<(echo "$${(0,r.getSecretVarNameForContext)(e,n.GCLOUD_DEPLOY_CREDENTIALS_KEY)}")`];t.gcloudServiceAccountLoginCommands=gcloudServiceAccountLoginCommands},2790:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunServiceOrJobArgsArg=void 0;const getCloudRunServiceOrJobArgsArg=e=>e!==undefined?e.length>0?e===null||e===void 0?void 0:e.map((e=>`"${e}"`)).join(","):"":undefined;t.getCloudRunServiceOrJobArgsArg=getCloudRunServiceOrJobArgsArg},6428:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getServiceName=void 0;const getServiceName=e=>e.environment.fullName.toLowerCase();t.getServiceName=getServiceName},6962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullSchedulerName=t.getCloudRunSchedulerName=t.getFullJobName=t.getCloudRunJobName=void 0;const getCloudRunJobName=(e,t)=>e.toLowerCase().concat("-"+t.toLowerCase());t.getCloudRunJobName=getCloudRunJobName;const getFullJobName=(e,a)=>(0,t.getCloudRunJobName)(e.environment.fullName,a);t.getFullJobName=getFullJobName;const getCloudRunSchedulerName=(e,t)=>e.toLowerCase().concat("-"+t.toLowerCase());t.getCloudRunSchedulerName=getCloudRunSchedulerName;const getFullSchedulerName=(e,a)=>(0,t.getCloudRunSchedulerName)(e.environment.fullName,a);t.getFullSchedulerName=getFullSchedulerName},9497:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeFirstLinesFromCommandOutput=void 0;const removeFirstLinesFromCommandOutput=(e,t)=>t===0?e:`${e} | tail -n +${t+1}`;t.removeFirstLinesFromCommandOutput=removeFirstLinesFromCommandOutput},7844:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullDbName=void 0;const n=a(5354);const getFullDbName=(e,t,a,r)=>{var i,s;return(0,n.joinBashExpressions)([(i=e.dbNamePrefix)!==null&&i!==void 0?i:`${t.customerName}-${t.appName}`,a,(s=e.dbBaseName)!==null&&s!==void 0?s:r].flatMap((e=>e?[e]:[])),"-")};t.getFullDbName=getFullDbName},5935:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCustomDeployJobs=void 0;const n=a(1255);const r=a(8897);const i=a(2348);const s=a(8563);const o=a(9256);const p=a(2383);const createCustomDeployJobs=e=>{var t,a,l;const d=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,p.isOfDeployType)(d,"custom")){throw new Error("deploy config is not custom")}const c=(0,r.getYarnInstall)(e,{noCustomPostInstall:true});const u=(0,s.createDeployementJobs)(e,{deploy:{image:(a=d.jobImage)!==null&&a!==void 0?a:(0,i.getRunnerImage)("jobs-default"),cache:(0,n.getAllCacheConfigsFromConfig)(e,d),script:[`cd ${e.build.dir}`,...d.requiresYarnInstall?c:[],...d.script,...(0,o.getDependencyTrackUploadScript)(e)],variables:{}},stop:d.stopScript?{image:(l=d.jobImage)!==null&&l!==void 0?l:(0,i.getRunnerImage)("jobs-default"),script:[...d.stopScript,...(0,o.getDependencyTrackDeleteScript)(e)],variables:{}}:undefined});return u};t.createCustomDeployJobs=createCustomDeployJobs},4697:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CUSTOM_DEPLOY_TYPE=void 0;const n=a(5935);t.CUSTOM_DEPLOY_TYPE={jobs:n.createCustomDeployJobs,defaults:()=>({}),additionalSecretKeys:()=>[],getAdditionalEnvVars:()=>({})}},5200:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createDockerTagDeployJobs=void 0;const n=a(2764);const r=a(8563);const i=a(2383);const createDockerTagDeployJobs=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(a,"dockerTag")){throw new Error("deploy config is not dockerTag")}const s=a.tag;return(0,r.createDeployementJobs)(e,{deploy:{...(0,n.getDockerJobBaseProps)(),script:[...(0,n.gitlabDockerLogin)(e),`docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG`,`docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_IMAGE:${s}`,`docker push $DOCKER_IMAGE:${s}`,`echo "pushed as $DOCKER_IMAGE:${s}"`]}})};t.createDockerTagDeployJobs=createDockerTagDeployJobs},8098:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_TAG_DEPLOY_TYPE=void 0;const n=a(5200);t.DOCKER_TAG_DEPLOY_TYPE={jobs:n.createDockerTagDeployJobs,defaults:()=>({}),additionalSecretKeys:()=>[],getAdditionalEnvVars:()=>({})}},8025:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_TYPES=void 0;const i=a(7728);const s=a(4697);const o=a(8098);const p=a(6198);r(a(7728),t);r(a(6198),t);r(a(2383),t);r(a(5044),t);t.DEPLOY_TYPES={kubernetes:p.KUBERNETES_DEPLOY_TYPE,custom:s.CUSTOM_DEPLOY_TYPE,dockerTag:o.DOCKER_TAG_DEPLOY_TYPE,"google-cloudrun":i.GCLOUD_RUN_DEPLOY_TYPE}},6877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.additionalKubernetesSecretKeys=void 0;const additionalKubernetesSecretKeys=({deployConfigRaw:e})=>{var t,a,n,r;if(!e){return[]}const i=[];if((a=(t=e.values)===null||t===void 0?void 0:t.mongodb)===null||a===void 0?void 0:a.enabled){i.push("MONGODB_ROOT_PASSWORD");if(e.values.mongodb.architecture==="replicaset"){i.push("MONGODB_REPLICASET_KEY")}}if((r=(n=e.values)===null||n===void 0?void 0:n.cloudsql)===null||r===void 0?void 0:r.enabled){i.push("POSTGRESQL_PASSWORD");i.push("cloudsqlProxyCredentials")}return i.map((e=>({key:e})))};t.additionalKubernetesSecretKeys=additionalKubernetesSecretKeys},5032:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesCloudsqlBaseValues=t.hasKubernetesCloudSQL=void 0;const n=a(8045);const r=a(7844);const i=a(2383);const hasKubernetesCloudSQL=e=>{var t,a,n;const r=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,i.isOfDeployType)(r,"kubernetes")){return(n=(a=r.values)===null||a===void 0?void 0:a.cloudsql)===null||n===void 0?void 0:n.enabled}return false};t.hasKubernetesCloudSQL=hasKubernetesCloudSQL;const createKubernetesCloudsqlBaseValues=e=>{var t,a,s;const o=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(o,"kubernetes")){throw new Error("cannot get cloud sql config")}const p=(a=o.values)===null||a===void 0?void 0:a.cloudsql;if(!p){throw new Error("cannot get cloud sql config")}const l=`$${(0,n.getSecretVarNameForContext)(e,"cloudsqlProxyCredentials")}`;if(p.type==="unmanaged"){return{cloudsql:{enabled:p.enabled,dbUser:(s=p.dbUser)!==null&&s!==void 0?s:"postgres",instanceConnectionName:p.instanceConnectionName,proxyCredentials:l,fullDbName:(0,r.getFullDbName)(p,e.fullConfig,e.environment.slugPrefix,e.name)}}}else{throw new Error("unknonw type")}};t.createKubernetesCloudsqlBaseValues=createKubernetesCloudsqlBaseValues},7444:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesDeployJobs=void 0;const n=a(5855);const r=a(2348);const i=a(8563);const s=a(9256);const o=a(2383);const p=a(6143);const l=a(5103);const d=a(3468);const c="__all_values.yml";const createKubernetesDeployJobs=e=>{var t,a,u;const f=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,o.isOfDeployType)(f,"kubernetes")){throw new Error("deploy config is not kubernetes")}const m={image:(0,r.getRunnerImage)("kubernetes"),...f.debug?{artifacts:{paths:[c],when:"always"}}:{},variables:{...e.environment.envVars,RELEASE_NAME:e.environment.fullName,HELM_EXPERIMENTAL_OCI:"1",KUBE_DOCKER_IMAGE_PULL_SECRET:`gitlab-registry-${e.name}`,HELM_GITLAB_CHART_NAME:(a=f.chartName)!==null&&a!==void 0?a:"/helm-charts/the-panter-chart",HELM_ARGS:[...f.debug?["--debug"]:[],...(u=f.additionalHelmArgs)!==null&&u!==void 0?u:[]].join(" "),COMPONENT_NAME:e.name}};const h=`kube-${e.environment.fullName}`;const v=[`kubectl config set-cluster "${h}" --server="$${(0,n.getSecretVarNameForContext)(e,"KUBE_URL")}" --certificate-authority <(echo $${(0,n.getSecretVarNameForContext)(e,"KUBE_CA_PEM")} | base64 -d) --embed-certs=true`,`kubectl config set-credentials "${h}" --token="$${(0,n.getSecretVarNameForContext)(e,"KUBE_TOKEN")}"`,`kubectl config set-context "${h}" --cluster="${h}" --user="${h}" --namespace="${e.environment.envVars.KUBE_NAMESPACE}"`,`kubectl config use-context "${h}"`];return(0,i.createDeployementJobs)(e,{deploy:{...m,script:[...v,...(0,d.collapseableSection)("writeallvalues","Write "+c+" for helm deployment")((0,l.writeBashYamlToFileScript)((0,p.createKubeValues)(e),c)),"kubernetesCreateSecret","kubernetesDeploy",...(0,s.getDependencyTrackUploadScript)(e),"echo deployment successful 😻"]},stop:{...m,script:[...v,"kubernetesDelete",...(0,s.getDependencyTrackDeleteScript)(e)]},rollback:{...m,script:[...v,"kubernetesRollback"]}})};t.createKubernetesDeployJobs=createKubernetesDeployJobs},6198:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.KUBERNETES_DEPLOY_TYPE=void 0;const s=i(a(4206));const o=a(8025);const p=a(5354);const l=a(6877);const d=a(7444);r(a(5032),t);t.KUBERNETES_DEPLOY_TYPE={jobs:d.createKubernetesDeployJobs,defaults:()=>({}),additionalSecretKeys:l.additionalKubernetesSecretKeys,getAdditionalEnvVars:({componentName:e,fullConfig:t,deployConfigRaw:a,env:n,reviewSlug:r,envType:i})=>{var l;const d=i==="review"&&r?r.concat("-"):"";const c=d.concat(e);const u=(0,o.getKubernetesNamespace)(t,n);const f=(0,s.default)(e);const m=a&&((l=a.cluster)===null||l===void 0?void 0:l.domainCanonical)||t.domainCanonical||"panter.cloud";const h=(0,p.joinBashExpressions)([f,...i==="review"&&r?[r]:[],n,t.appName,t.customerName,m],".");return{KUBE_NAMESPACE:u,KUBE_APP_NAME:c,KUBE_APP_NAME_PREFIX:d,HOSTNAME_INTERNAL:h}}}},4894:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubeEnv=void 0;const n=a(2383);const shouldGoIntoSecrets=(e,t)=>{var a;if(!t)return false;if((a=String(t))===null||a===void 0?void 0:a.includes("$CL_")){return true}return false};const createKubeEnv=e=>{var t;if(!(0,n.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("deploy config is not kubernetes")}const a=e.environment.envVars;const r=Object.entries(a).reduce(((e,[t,a])=>{if(shouldGoIntoSecrets(t,a===null||a===void 0?void 0:a.toString())){e.secret={...e.secret,[t]:a!==null&&a!==void 0?a:""};return e}e.public={...e.public,[t]:a!==null&&a!==void 0?a:""};return e}),{secret:{},public:{}});return r};t.createKubeEnv=createKubeEnv},6143:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubeValues=void 0;const n=a(9250);const r=a(595);const i=a(2383);const s=a(5032);const o=a(4894);const p=a(8400);const createAppConfig=(e,t)=>{if(t===false){return{enabled:false}}const{healthRoute:a,command:n,...i}=t!==null&&t!==void 0?t:{};return(0,r.mergeWithMergingArrays)({host:e.environment.envVars.HOSTNAME,command:n!==null&&n!==void 0?n:e.build.type!=="disabled"?e.build.config.startCommand:undefined,livenessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},readinessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},startupProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}}},i)};const removeFalsy=e=>{if(!e)return undefined;return Object.fromEntries(Object.entries(e).filter((([,e])=>e!==false)))};const createKubeValues=e=>{var t,a,l;const d=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!d){return[]}if(!(0,i.isOfDeployType)(d,"kubernetes")){throw new Error("deploy config is not kubernetes")}const{values:c}=d;const{application:u,jobs:f,cronjobs:m,...h}=c!==null&&c!==void 0?c:{};const v=(0,o.createKubeEnv)(e);const g=(0,n.merge)({env:v,application:createAppConfig(e,u)},(0,s.hasKubernetesCloudSQL)(e)?(0,s.createKubernetesCloudsqlBaseValues)(e):{},((l=(a=d.values)===null||a===void 0?void 0:a.mongodb)===null||l===void 0?void 0:l.enabled)?(0,p.createMongodbBaseConfig)(e):{});const y=(0,r.mergeWithMergingArrays)(g,{jobs:removeFalsy(f),cronjobs:removeFalsy(m),...h});return y};t.createKubeValues=createKubeValues},8400:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMongodbBaseConfig=void 0;const n=a(9250);const r=a(5855);const i=a(2383);const getCredentialString=e=>`root:$${(0,r.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD")}@`;const getMongodbHost=(e,t)=>{const a=e.environment.envVars.KUBE_NAMESPACE;return`${t}.${a}.svc.cluster.local:27017`};const getMongodbStandaloneHost=e=>{const t=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,`${t}-mongodb`)};const getMongodbReplicasetHost=(e,t)=>{const a=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,`${a}-mongodb-${t}.${a}-mongodb-headless`)};const createMongodbUrl=(e,t)=>{var a,r,s,o;if(!(0,i.isOfDeployType)((a=e.deploy)===null||a===void 0?void 0:a.config,"kubernetes")){throw new Error("can only createMongodbUrl on supported deploys")}const p=(s=(r=e.deploy)===null||r===void 0?void 0:r.config.values)===null||s===void 0?void 0:s.mongodb;let l=undefined;let d="";if((p===null||p===void 0?void 0:p.architecture)==="replicaset"){d=(0,n.range)(0,(o=p===null||p===void 0?void 0:p.replicaCount)!==null&&o!==void 0?o:2).map((t=>getMongodbReplicasetHost(e,t))).join(",");l="replicaSet=rs0&authSource=admin"}else{d=getMongodbStandaloneHost(e);l="authSource=admin"}return`mongodb://${getCredentialString(e)}${d}/${t}${l?`?${l}`:""}`};const createMongoBackupDefaultConfig=e=>{var t,a,n;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}const r=(n=(a=e.deploy)===null||a===void 0?void 0:a.config.values)===null||n===void 0?void 0:n.mongodb;const s=e.environment.envVars.KUBE_APP_NAME;const o=["prod","stage"].includes(e.environment.envType);let p;let l;if((r===null||r===void 0?void 0:r.architecture)==="replicaset"){const t=(r===null||r===void 0?void 0:r.architecture)==="replicaset"&&r.replicaCount&&r.replicaCount>1?1:0;p=getMongodbReplicasetHost(e,t);l=`datadir-${s}-mongodb-${t}`}else{p=getMongodbStandaloneHost(e);l=`${s}-mongodb`}return{enabled:o,hostToBackup:p,pvcToBackup:l,image:"mrelite/kubectlmongoshell:v1.0",schedule:"0 4 * * *",volumeSnapshotClass:"snapshotclass"}};const createMongodbBaseConfig=e=>{var t,a,n,s;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}const o=(n=(a=e.deploy)===null||a===void 0?void 0:a.config.values)===null||n===void 0?void 0:n.mongodb;return{mongodb:{enabled:true,auth:{enabled:true,rootPassword:"$"+(0,r.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD"),replicaSetKey:"$"+(0,r.getSecretVarNameForContext)(e,"MONGODB_REPLICASET_KEY")},persistence:{storageClass:"standard-rwo"},image:{registry:"bitnamilegacy",repository:"mongodb"},backup:createMongoBackupDefaultConfig(e)},env:{secret:{MONGO_URL:createMongodbUrl(e,(s=o===null||o===void 0?void 0:o.dbName)!==null&&s!==void 0?s:"app"),...(o===null||o===void 0?void 0:o.architecture)==="replicaset"?{MONGO_OPLOG_URL:createMongodbUrl(e,"local")}:{}}}}};t.createMongodbBaseConfig=createMongodbBaseConfig},9256:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDependencyTrackDeleteScript=t.getDependencyTrackUploadScript=t.sbomDeactivated=void 0;const n=a(5354);const r=a(4713);const i=a(3660);const sbomDeactivated=e=>e.build.type==="disabled"||(0,i.componentContextIsStandaloneBuild)(e)&&e.build.config.type==="custom"&&e.build.config.sbom===false;t.sbomDeactivated=sbomDeactivated;const getDependencyTrackUploadScript=e=>(0,t.sbomDeactivated)(e)?[]:["echo 'Uploading SBOM to Dependency Track'",`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "${e.fullConfig.customerName}-${e.fullConfig.appName}/${e.name}" "${(0,n.getBashVariable)("ROOT_URL")}" "${r.SBOM_FILE}" vex.json || true`];t.getDependencyTrackUploadScript=getDependencyTrackUploadScript;const getDependencyTrackDeleteScript=e=>(0,t.sbomDeactivated)(e)?[]:["echo 'Disabling component in Dependency Track'",`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "${e.fullConfig.customerName}-${e.fullConfig.appName}/${e.name}" "${(0,n.getBashVariable)("CI_ENVIRONMENT_URL")}" || true`];t.getDependencyTrackDeleteScript=getDependencyTrackDeleteScript},8252:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1086:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultLivenessProbe=t.defaultStartupProbe=void 0;t.defaultStartupProbe={type:"http1",path:"/__health",initialDelaySeconds:5,timeoutSeconds:1,periodSeconds:30,failureThreshold:3};t.defaultLivenessProbe={...t.defaultStartupProbe,initialDelaySeconds:0,timeoutSeconds:10,periodSeconds:30,failureThreshold:3}},2383:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});t.getDeployConfigType=t.isOfDeployType=void 0;r(a(8252),t);r(a(1086),t);r(a(5383),t);r(a(508),t);const isOfDeployType=(e,...t)=>e&&t.includes(e.type)?true:false;t.isOfDeployType=isOfDeployType;const getDeployConfigType=e=>{if(!e)return undefined;return e.type};t.getDeployConfigType=getDeployConfigType},5383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5044:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contextIsStoppable=t.getKubernetesNamespace=t.getFullKubernetesClusterName=void 0;const n=a(2383);const getFullKubernetesClusterName=e=>{if(e.type==="gcloud"){return`gke_${e.projectId}_${e.region}_${e.name}`}};t.getFullKubernetesClusterName=getFullKubernetesClusterName;const getKubernetesNamespace=(e,t)=>`${e.customerName}-${e.appName}-${t}`;t.getKubernetesNamespace=getKubernetesNamespace;const contextIsStoppable=e=>{var t;const a=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,n.isOfDeployType)(a,"kubernetes")){return true}if((0,n.isOfDeployType)(a,"google-cloudrun")){return true}if((0,n.isOfDeployType)(a,"custom")&&a.stopScript){return true}return false};t.contextIsStoppable=contextIsStoppable},3891:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.registerGlobalScriptFunction=t.globalScriptFunctions=void 0;class GlobalScriptFunction{constructor(e,t){this.name=e;this.script=t}toBashFunction(){return`function ${this.name} () {\n${this.script.trim()}\n}`.trim()}invoke(...e){return`${this.name} ${e.join(" ")}`}}t.globalScriptFunctions=new Map;const registerGlobalScriptFunction=(e,a)=>{if(t.globalScriptFunctions.has(e)){throw new Error(`Global script function ${e} already exists`)}const n=new GlobalScriptFunction(e,a);t.globalScriptFunctions.set(e,n);return n};t.registerGlobalScriptFunction=registerGlobalScriptFunction},241:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(6940),t);r(a(5063),t);r(a(4565),t);r(a(2348),t);r(a(940),t);r(a(8045),t);r(a(1398),t);r(a(8025),t);r(a(5585),t);r(a(250),t);r(a(8016),t);r(a(5233),t)},9212:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAgentContext=t.AgentContext=void 0;class AgentContext{constructor(e,t){this.agentName=e;this.config=t;this.type="agent"}get name(){return this.agentName}get agentConfig(){var e;const t=(e=this.config.agents)===null||e===void 0?void 0:e[this.agentName];if(!t){throw new Error(`Agent ${this.agentName} not found in config`)}return t}get agentUser(){var e,t,a,n;return{username:(t=(e=this.agentConfig.agentUser)===null||e===void 0?void 0:e.username)!==null&&t!==void 0?t:"agent.claude",userId:(n=(a=this.agentConfig.agentUser)===null||a===void 0?void 0:a.userId)!==null&&n!==void 0?n:"$DEFAULT_AGENT_USER_ID"}}get reviews(){var e,t;return{byUser:(t=(e=this.agentConfig.reviews)===null||e===void 0?void 0:e.byUser)!==null&&t!==void 0?t:{[this.agentUser.username]:{automatic:true}}}}get fullConfig(){return this.config}}t.AgentContext=AgentContext;const createAgentContext=async e=>new AgentContext(e.agentName,e.config);t.createAgentContext=createAgentContext},8756:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAgentEventJob=void 0;const n=a(7781);const r=a(5729);const i=a(5687);const createAgentEventJob=e=>{const t=(0,r.createBaseAgentJob)(e);const a=(0,i.getAgentUserId)(e);const s=(0,i.getAgentUserName)(e);return{interruptible:false,...t,variables:{...t.variables},name:e.name+"-agent-event",rules:[{if:`$CI_PIPELINE_SOURCE == "trigger" && ($ASSIGNEE_USER_ID == ${a} || $OBJECT_DESCRIPTION =~ /@${s}/)`,when:"always"},{when:"never"}],script:[...r.baseSetupScript,...(0,r.callClaude)({prompt:(0,n.getEventPrompt)({agentUserName:s})})]}};t.createAgentEventJob=createAgentEventJob},2651:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAgentReviewJob=void 0;const n=a(4565);const r=a(7781);const i=a(5729);const s=a(5687);const createAgentReviewJob=e=>{const t=(0,i.createBaseAgentJob)(e);const a=(0,s.getAgentUserName)(e);const o=e.reviews.byUser==="all-automatic"?[{...n.RULE_IS_MERGE_REQUEST,when:"always"}]:Object.entries(e.reviews.byUser).filter((([e,{automatic:t}])=>t)).map((([e])=>({if:`${n.RULE_IS_MERGE_REQUEST.if} && $GITLAB_USER_LOGIN == "${e}"`,when:"always"})));return{...t,envMode:"jobPerEnv",name:e.name+"-agent-review",allow_failure:true,rules:[...o,{...n.RULE_IS_MERGE_REQUEST,when:"manual"},{when:"never"}],script:[...i.baseSetupScript,...(0,i.callClaude)({prompt:(0,r.getMergeRequestPrompt)({agentUserName:a})})]}};t.createAgentReviewJob=createAgentReviewJob},9161:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForAgentContext=void 0;const n=a(8756);const r=a(2651);const createJobsForAgentContext=e=>[(0,n.createAgentEventJob)(e),(0,r.createAgentReviewJob)(e)];t.createJobsForAgentContext=createJobsForAgentContext},7781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getMergeRequestPrompt=t.getEventPrompt=void 0;const header=()=>`\nProject ID: $CI_PROJECT_ID\nGitLab Host: $CI_SERVER_URL\nDefault Branch: $CI_DEFAULT_BRANCH\n`;const identity=({agentUserName:e})=>`\n## Identity\n- Your GitLab username is "${e}".\n`;const goldenRules=({agentUserName:e})=>`\n## Golden Rules\n- Use the \`gitlab-mcp\` tool for ALL GitLab actions. Do not call any other APIs.\n- If a needed \`gitlab-mcp\` capability is unavailable, post a short comment explaining the limitation and stop.\n- NEVER mention yourself ("@${e}") anywhere (comments, descriptions, titles, commit messages).\n- NEVER push to $CI_DEFAULT_BRANCH or any protected branch. Always create a new branch and open a Merge Request (MR).\n- Always assign yourself as the assignee of any MR you create.\n- Do not create an MR for a **closed** issue.\n- Keep actions minimal and idempotent. Avoid duplicate comments or duplicate MRs.\n- Use ONE stable \`source_branch\` per run; do not regenerate its name later.\n`;const conversationsIntake=({agentUserName:e})=>`\n## Conversations Intake & Threading (MANDATORY before acting)\nAlways load and reason about the current conversation to avoid duplicates and to respond in the right place.\n\n- **MRs**: Use \`mr_discussions({ projectId: $CI_PROJECT_ID, mergeRequestIid })\`.\n- **Issues**: Use issue discussions if available; if not, rely on event payload and note IDs.\n\nRules:\n1) Detect latest human note (exclude "${e}"). If it replies to you or is in a discussion you started, reply **in the same thread**.\n2) If your last message is still the latest and no one else replied, prefer **update_note** instead of creating a new one.\n3) For MR code discussions: reply inline in the same discussion.\n4) Always sanitize (see Self-mention Guard) before writing.\n`;const selfMentionGuard=({agentUserName:e})=>`\n## Self-mention Guard\nBefore ANY write (comment/MR/issue/commit message):\n- Remove all occurrences of "@${e}" (case-insensitive).\n- If the text becomes empty, skip the write.\n- If the last actor is you, skip acknowledgement comments.\n- To assign yourself, use assignee fields, not mentions.\n`;const commentGuidelines=()=>`\n## Comment Guidelines\n- Professional, friendly, concise.\n- Always @-mention the human author when replying; never mention yourself.\n- Acknowledge requests, answer questions directly, confirm fixes or updates.\n- Avoid repeating boilerplate.\n`;const mcpOnly=()=>`\n## gitlab-mcp Operations\n\n- **Comments / Notes**\n - create_issue_note({ projectId, issueIid, body })\n - update_issue_note({ projectId, issueIid, noteId, body })\n - create_merge_request_note({ projectId, mergeRequestIid, body })\n - update_merge_request_note({ projectId, mergeRequestIid, noteId, body })\n - mr_discussions({ projectId, mergeRequestIid })\n\n- **Issues**\n - create_issue({ projectId, title, description, assigneeUsernames?: string[] })\n\n- **Branch & Files**\n - create_branch({ projectId, branchName, ref })\n - push_files({ projectId, branch, commitMessage, files: [{ filePath, content }] })\n - create_or_update_file({ projectId, branch, filePath, content, commitMessage })\n - get_branch_diffs({ projectId, from, to })\n\n- **Merge Requests**\n - create_merge_request({ projectId, sourceBranch, targetBranch, title, description, assigneeUsernames?: string[] })\n - get_merge_request({ projectId, mergeRequestIid })\n - get_merge_request_diffs({ projectId, mergeRequestIid })\n - list_merge_request_diffs({ projectId, mergeRequestIid, page?, perPage? })\n - update_merge_request({ projectId, mergeRequestIid, title?, description?, draft?, assigneeUsernames? })\n\n- **Pipelines / Jobs**\n - list_pipelines({ projectId, ref?, sha?, status?, orderBy?, sort? })\n - list_pipeline_jobs({ projectId, pipelineId })\n - get_pipeline_job_output({ projectId, pipelineId, jobId })\n - play_pipeline_job({ projectId, jobId })\n - cancel_pipeline_job({ projectId, jobId })\n`;const outputDiscipline=({agentUserName:e})=>`\n## Output Discipline\n- Output only \`gitlab-mcp\` tool calls and plain-text summaries where requested.\n- Keep comments concise and professional.\n- Never include "@${e}" in any body.\n`;const eventSelfParse=()=>`\n## Self-Parse Raw Payload\nFrom \`event_json\`, extract:\n- kind: "issue" | "merge_request" | "note"\n- iid from URL (/issues/<n>, /merge_requests/<n>)\n- note_id if present (#note_<id>)\n- description/body, state, author, timestamps\n- project id/path\n- discussion id if available for inline replies\n`;const resolveMrPipeline=()=>`\n## Resolve MR Pipeline\n1) get_merge_request({ projectId, mergeRequestIid }) → sourceBranch, sha\n2) Prefer: list_pipelines({ projectId, sha })\n3) Else: list_pipelines({ projectId, ref: sourceBranch, orderBy: "updated_at", sort: "desc" })\n4) Pick newest → mr_pipeline_id\n`;const singleRunnerGuard=()=>`\n## Single-Runner Guard\n- If mr_pipeline_id available:\n - list_pipeline_jobs({ projectId, pipelineId: mr_pipeline_id })\n - cancel_pipeline_job on any running/pending job ending with "agent-review"\n- If not available, note limitation and proceed\n`;const reviewOnDemandFromEvents=()=>`\n## Review-on-Demand\nIf the text asks for a review ("review", "please review", "PTAL", "needs review", "can you look at", "LGTM?"):\n1) Resolve MR IID (from target or text).\n2) Resolve MR pipeline (do NOT use the event pipeline).\n3) If a manual "agent-review" job exists, play it → confirm in-thread → STOP.\n4) Else run Single-Runner Guard, then enter MR Review Mode.\n`;const eventWorkflow=({agentUserName:e})=>`\n## Event Workflow\n0) Conversations Intake first\n1) Acknowledge with note (unless last actor is you)\n2) Default branch: use \`$CI_DEFAULT_BRANCH\`\n3) Create branch from \`$CI_DEFAULT_BRANCH\`:\n create_branch({ projectId: $CI_PROJECT_ID, branchName: "<source_branch>", ref: $CI_DEFAULT_BRANCH })\n4) Write changes → commit → push:\n push_files({ projectId: $CI_PROJECT_ID, branch: "<source_branch>", commitMessage, files })\n - Ensure files list is not empty before calling push_files; if empty, skip pushing.\n5) Verify:\n get_branch_diffs({ projectId: $CI_PROJECT_ID, from: $CI_DEFAULT_BRANCH, to: "<source_branch>" })\n - Require non-empty diffs\n6) Create MR (if diffs exist):\n create_merge_request({\n projectId: $CI_PROJECT_ID,\n sourceBranch: "<source_branch>",\n targetBranch: $CI_DEFAULT_BRANCH,\n title,\n description, // include "Closes #<issue_iid>" when applicable\n assigneeUsernames: ["${e}"]\n })\n7) Follow-up note (in correct thread) with branch, short SHA if available, files-changed count, and MR link (unless last actor is you)\n8) If verification fails: comment error and STOP\n\n## Stdout Summary (Event)\nPrint a plain-text summary with:\n- action: "event"\n- source_branch\n- target_branch: $CI_DEFAULT_BRANCH\n- diff_count (from get_branch_diffs)\n- mr_iid and/or mr_url if created\n- any note ids created/updated\n- any limitations encountered (e.g., missing discussions tool)\n`;const mrScope=({agentUserName:e})=>`\n## MR Scope\n- You are reviewing a single MR\n- Never merge the MR yourself\n- Work only on the MR's source branch\n`;const mrWorkflow=()=>`\n## MR Workflow\n1) get_merge_request + get_merge_request_diffs + mr_discussions\n2) Conversations Intake\n3) Post review comments first via create_merge_request_note (sanitize)\n4) If will_push_changes = true:\n - push_files to source branch\n - verify with get_branch_diffs({ from: targetBranch || $CI_DEFAULT_BRANCH, to: sourceBranch })\n - follow-up note summarizing changes in the right thread (sanitize)\n\n## Stdout Summary (MR)\nPrint a plain-text summary with:\n- action: "mr"\n- mr_iid\n- source_branch and target_branch (fallback to $CI_DEFAULT_BRANCH)\n- will_push_changes: true|false\n- diff_count (post-push, if applicable)\n- discussions: number of notes added/updated\n- ci: whether mr_pipeline_id was resolved\n- blocking_failed_jobs (names+stages) if inspected\n`;const ciInspection=()=>`\n## CI Inspection (diagnose only)\n- Use mr_pipeline_id if available\n- list_pipeline_jobs → for each failed + allow_failure=false:\n - get_pipeline_job_output\n - classify: code vs infra\n - Do not retry; only report diagnosis in a note\n- If no mr_pipeline_id, note limitation\n`;const outputDisciplineMR=({agentUserName:e})=>`\n## Output Discipline (MR)\n- Only gitlab-mcp calls + final summary\n- Never merge MR\n- Never mention "@${e}"\n`;const mrReviewBundle=e=>`\n## MR Review Mode\n${mrScope(e)}\n${mrWorkflow()}\n${ciInspection()}\n`;const getEventPrompt=e=>`\nYou are a GitLab assistant bot. You receive ONE raw GitLab webhook JSON payload.\n\n${header()}\n---\nevent_json:\n$(cat $TRIGGER_PAYLOAD)\n---\n\n${identity(e)}\n${goldenRules(e)}\n${selfMentionGuard(e)}\n${conversationsIntake(e)}\n${eventSelfParse()}\n${resolveMrPipeline()}\n${singleRunnerGuard()}\n${reviewOnDemandFromEvents()}\n${mrReviewBundle(e)}\n${eventWorkflow(e)}\n${commentGuidelines()}\n${mcpOnly()}\n${outputDiscipline(e)}\n`;t.getEventPrompt=getEventPrompt;const getMergeRequestPrompt=e=>`\nYou are a GitLab assistant bot reviewing and updating a single Merge Request (MR).\n\n${header()}\n---\nmerge_request_iid: $CI_MERGE_REQUEST_IID\ntitle: $CI_MERGE_REQUEST_TITLE\ndescription: $CI_MERGE_REQUEST_DESCRIPTION\n---\n\n${mrScope(e)}\n${goldenRules(e)}\n${selfMentionGuard(e)}\n${conversationsIntake(e)}\n${mrWorkflow()}\n${ciInspection()}\n${commentGuidelines()}\n${mcpOnly()}\n${outputDisciplineMR(e)}\n`;t.getMergeRequestPrompt=getMergeRequestPrompt},5729:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.callClaude=t.baseSetupScript=t.createBaseAgentJob=void 0;const n=a(8127);const r=a(2348);const createBaseAgentJob=e=>({stage:"agents",image:(0,r.getRunnerImage)("agent-claude"),variables:{MAX_MCP_OUTPUT_TOKENS:"75000",GITLAB_PERSONAL_ACCESS_TOKEN:"$AGENT_GITLAB_PERSONAL_ACCESS_TOKEN",GITLAB_API_URL:"$CI_API_V4_URL"}});t.createBaseAgentJob=createBaseAgentJob;t.baseSetupScript=["claude mcp add gitlab --env GITLAB_PERSONAL_ACCESS_TOKEN=$GITLAB_PERSONAL_ACCESS_TOKEN --env GITLAB_API_URL=$GITLAB_API_URL --env USE_PIPELINE='true' -- npx -y @zereight/mcp-gitlab"];const callClaude=({prompt:e})=>[`export PROMPT="${(0,n.escapeNewlines)((0,n.escapeDoubleQuotes)((0,n.escapeBackTicks)(e)))}"`,`claude -p "$PROMPT" --permission-mode acceptEdits --allowedTools "Bash Read(*) Edit(*) Write(*) mcp__gitlab" --verbose --debug`];t.callClaude=callClaude},5687:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getAgentUserId=t.getAgentUserName=void 0;const getAgentUserName=e=>{var t,a;return(a=(t=e.agentConfig.agentUser)===null||t===void 0?void 0:t.username)!==null&&a!==void 0?a:"agent.claude"};t.getAgentUserName=getAgentUserName;const getAgentUserId=e=>{var t,a;return(a=(t=e.agentConfig.agentUser)===null||t===void 0?void 0:t.userId)!==null&&a!==void 0?a:"$DEFAULT_AGENT_USER_ID"};t.getAgentUserId=getAgentUserId},3671:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createAllJobs=void 0;const n=a(8347);const r=a(2981);const i=a(5063);const s=a(2424);const o=a(426);const p=a(9161);const l=a(9212);const createAllJobs=async({config:e,trigger:t,pipelineType:a})=>{var d,c;const u=await(0,n.createAllComponentsContext)({config:e,trigger:t,pipelineType:a});return{workspaces:await Promise.all(Object.keys((d=e.builds)!==null&&d!==void 0?d:{}).map((async n=>{const s=u.filter((e=>(0,i.componentContextHasWorkspaceBuild)(e)&&e.build.workspaceName===n));const p=[...new Set(s.map((({env:e})=>e)))];return await Promise.all(p.map((async i=>{const p=await(0,r.createWorkspaceContext)({components:s.filter((({env:e})=>e===i)),workspaceName:n,config:e,trigger:t,pipelineType:a,env:i});return{context:p,jobs:(0,o.createJobsForWorkspace)(p)}})))}))).then((e=>e.flat())),components:u.map((e=>({context:e,jobs:(0,s.createJobsForComponentContext)(e)}))),agents:await Promise.all(Object.keys((c=e.agents)!==null&&c!==void 0?c:{}).map((async t=>{const a=await(0,l.createAgentContext)({agentName:t,config:e});return{context:a,jobs:(0,p.createJobsForAgentContext)(a)}}))).then((e=>e.flat()))}};t.createAllJobs=createAllJobs},2424:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForComponentContext=void 0;const n=a(1398);const r=a(8025);const injectDefaultVarsInCustomJobs=(e,t)=>t.map((({variables:t,...a})=>{var n;return{variables:{...(n=e.environment.envVars)!==null&&n!==void 0?n:{},...t!==null&&t!==void 0?t:{}},...a}}));const getCustomJobs=e=>{if(!e.customJobs){return[]}const t=e.customJobs;return injectDefaultVarsInCustomJobs(e,t)};const createJobsForComponentContext=e=>{const t=e.build.type!=="disabled"?n.BUILD_TYPES[e.build.buildType].jobs(e):[];const a=e.componentConfig.deploy!==false?r.DEPLOY_TYPES[e.componentConfig.deploy.type].jobs(e):[];const i=getCustomJobs(e);return[...t,...a,...i]};t.createJobsForComponentContext=createJobsForComponentContext},426:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForWorkspace=void 0;const n=a(1398);const createJobsForWorkspace=e=>{const t=n.WORKSPACE_BUILD_TYPES[e.build.buildType].jobs(e);return t};t.createJobsForWorkspace=createJobsForWorkspace},402:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createMainPipeline=void 0;const n=a(4565);const r=a(6925);const i=a(3671);const s=a(2453);const o=a(4519);const p=a(6441);const l=a(8705);const createMainPipeline=async(e,t)=>{const a=(0,s.getPipelineStages)(t);if(e==="gitlab"){const n=await Promise.all(r.ALL_PIPELINE_TRIGGERS.map((async a=>await(0,o.createGitlabJobs)(await(0,i.createAllJobs)({config:t,trigger:a,pipelineType:e}),getGitlabRulesForTrigger(a))))).then((e=>e.flat()));const s=n.filter((e=>{var t;return((t=e.context)===null||t===void 0?void 0:t.type)==="workspace"})).sort(((e,a)=>{var n;const r=Object.keys((n=t.builds)!==null&&n!==void 0?n:{});const i=r.findIndex((t=>t===e.context.name));const s=r.findIndex((e=>e===a.context.name));return i-s}));const d=n.filter((e=>{var t;return((t=e.context)===null||t===void 0?void 0:t.type)==="component"})).sort(((e,a)=>{const n=Object.keys(t.components);const r=n.findIndex((t=>t===e.context.name));const i=n.findIndex((e=>e===a.context.name));return r-i}));const c=n.filter((e=>{var t;return((t=e.context)===null||t===void 0?void 0:t.type)==="agent"}));const u=[...s,...d,...c].reduce(((e,{gitlabJob:t,name:a,context:n})=>{var r,i;if(e[a]){e[a].gitlabJob.rules=[...(r=e[a].gitlabJob.rules)!==null&&r!==void 0?r:[],...(i=t.rules)!==null&&i!==void 0?i:[]]}else{e[a]={context:n,gitlabJob:t}}return e}),{});return(0,p.createGitlabPipelineWithDefaults)({stages:[...a,"release"],jobs:{...u,...Object.fromEntries(Object.entries((0,l.getGitlabReleaseJobs)(t)).map((([e,t])=>[e,{gitlabJob:t,context:null}])))},variables:t.runnerVariables})}throw new Error(`${e} is not supported`)};t.createMainPipeline=createMainPipeline;function getGitlabRulesForTrigger(e){switch(e){case"mainBranch":return[n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT];case"mr":return[n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_IS_MERGE_REQUEST];case"taggedRelease":return[n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_IS_TAGGED_RELEASE]}throw new Error(`${e} is not supported`)}},8860:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGitlabCompletePipeline=t.generatePipelineFiles=void 0;const n=a(1943);const r=a(6928);const i=a(402);const s=a(8215);const o=".catladder-generated";const p=o+"/gitlab";async function generatePipelineFiles(e,t){if(t!=="gitlab"){throw new Error("Pipeline type not supported")}const a=await getGitlabPipelineIncludes(e.config);const i={path:".gitlab-ci.yml",content:{include:a.map((e=>e.path))}};const s=[i,...a];await(0,n.rm)(p,{force:true,recursive:true});await Promise.all(s.map((async({path:t,content:a})=>{await(0,n.mkdir)((0,r.dirname)(t),{recursive:true});await e.fileWriter.writeYamlfile(t,a)})))}t.generatePipelineFiles=generatePipelineFiles;async function getGitlabPipelineIncludes(e){const{jobs:t,image:a,stages:n,variables:r,workflow:o,...l}=await(0,i.createMainPipeline)("gitlab",e);const d=Object.entries(t).reduce(((e,[t,{gitlabJob:a,context:n}])=>{const r=!n?"global-jobs":(n===null||n===void 0?void 0:n.type)+"/"+n.name;if(!e[r]){e[r]={}}e[r][t]=(0,s.sortGitLabJobDefProps)(a);return e}),{});const c=Object.entries(d).map((([e,t])=>({path:p+"/"+e+".yaml",content:t})));const u={path:p+"/main.yaml",content:{image:a,stages:n,variables:r,workflow:o,...l}};const f=[u,...c];return f}async function getGitlabCompletePipeline(e){const t=await getGitlabPipelineIncludes(e);return t.reduce(((e,{content:t})=>({...e,...t})),{})}t.getGitlabCompletePipeline=getGitlabCompletePipeline},2453:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPipelineStages=void 0;const n=a(940);const r=a(1507);function getPipelineStages(e){const t=(0,n.getAllEnvsInAllComponents)(e).filter((e=>e!=="local"));const a=r.BASE_STAGES.reduce(((e,a)=>[...e,a,...t.map((e=>`${a} ${e}`))]),[]);return a}t.getPipelineStages=getPipelineStages},8932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.addCacheFallback=t.getCacheKeyWithFallbackForMR=void 0;const getCacheKeyWithFallbackForMR=(e,t)=>{if(t.trigger==="mr"){return{key:e+"-mr$CI_MERGE_REQUEST_IID",fallback_keys:[e]}}return{key:e}};t.getCacheKeyWithFallbackForMR=getCacheKeyWithFallbackForMR;const addCacheFallback=(e,t)=>{if(t.type!=="agent"&&t.trigger==="mr"){if(Array.isArray(e)){return e.map((e=>addCacheFallbackToSingleCacheForMR(e,t)))}return addCacheFallbackToSingleCacheForMR(e,t)}return e};t.addCacheFallback=addCacheFallback;const addCacheFallbackToSingleCacheForMR=(e,a)=>{if(typeof e.key==="string"){return{...e,...(0,t.getCacheKeyWithFallbackForMR)(e.key,a)}}return e}},4519:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createGitlabJobs=t.makeGitlabJob=t.GITLAB_ENVIRONMENT_URL_VARIABLE=void 0;const n=a(9250);const r=a(436);const i=a(4628);const s=a(595);const o=a(3468);const p=a(4195);const l=a(5354);const d=a(8932);t.GITLAB_ENVIRONMENT_URL_VARIABLE="CL_GITLAB_ENVIRONMENT_URL";const getFullJobName=({type:e,name:t,baseName:a,allJobs:n,env:r})=>{const i=n.workspaces.length>0;const s=e==="component"?"🔹":e==="agent"?"🤖":"🔸";const o=i?s+" ":"";if(r){return`${o}${a} ${t} | ${r} `}return`${o}${a} ${t}`};const getFullReferencedJobNameFromComponent=(e,t,a,n)=>{var r,i;const s=(i=(r=n.components.find((e=>e.context.name===t&&e.context.env===a)))===null||r===void 0?void 0:r.jobs)===null||i===void 0?void 0:i.find((t=>t.name===e));if(!s){throw new Error(`unknown job referenced: '${e}' from '${a}:${t}'`)}return getFullJobName({type:"component",name:e,baseName:t,env:a,allJobs:n})};const getFullReferencedJobNameFromWorkspace=(e,t,a,n)=>{var r,i;const s=(i=(r=n.workspaces.find((e=>e.context.name===t)))===null||r===void 0?void 0:r.jobs)===null||i===void 0?void 0:i.find((t=>t.name===e));if(!s){throw new Error(`unknown job referenced: '${e}' from workspace ${a}:${t}'`)}return getFullJobName({type:"workspace",name:e,baseName:t,env:a,allJobs:n})};const getJobName=e=>(0,n.isObject)(e)?e.job:e;const makeGitlabJob=(e,t,a,n)=>{var l,c;const{environment:u,envMode:f,needsStages:m,name:h,needs:v,jobTags:g,script:y,variables:b,runnerVariables:w,when:_,cache:S,...N}=t;const C=f==="stagePerEnv"&&e.type!=="agent"?`${t.stage} ${e.env}`:t.stage;const A=getGitlabNeeds(e,t,a);const O=getFullJobName({type:e.type,name:h,baseName:e.name,env:e.type!=="agent"?e.env:undefined,allJobs:a});const I=["KUBERNETES_CPU_REQUEST","KUBERNETES_MEMORY_REQUEST","KUBERNETES_CPU_LIMIT","KUBERNETES_MEMORY_LIMIT"];const D=(0,o.collapseableSection)("injectvars","Injecting variables")([...(0,r.getInjectVarsScript)(Object.fromEntries(Object.entries(b!==null&&b!==void 0?b:{}).filter((([e])=>!I.includes(e)))))]);const k=Object.fromEntries(Object.entries(b!==null&&b!==void 0?b:{}).filter((([e])=>I.includes(e))));if(Object.keys(k).length>0){console.warn(`Legacy variables detected in ${O}: ${Object.keys(k).join(", ")}. Please move them to the runnerVariables key.`)}const T=[...(l=t.rules)!==null&&l!==void 0?l:[],...n?n.map((e=>({when:_,...e}))):_?[{when:_}]:[]];const P={retry:i.BASE_RETRY,interruptible:true,...N,cache:S?(0,d.addCacheFallback)(S,e):undefined,rules:T.length>0?T:undefined,variables:{...k,...w},script:[...D,...(c=y===null||y===void 0?void 0:y.filter(s.notNil))!==null&&c!==void 0?c:[]],tags:g,stage:C,needs:A};const R=addGitlabEnvironment(e,u,P,a);return[O,(0,p.removeUndefined)(R)]};t.makeGitlabJob=makeGitlabJob;const addGitlabEnvironment=(e,a,r,i)=>{var s,o;if(!a){return r}if(e.type!=="component"){return r}const{env:p,name:d,environment:c}=e;const{envVars:u,envType:f}=c;const{on_stop:m,...h}=a;const v="gitlab_environment.env";const g=!a.action||a.action==="start";const y=(0,n.merge)((s=r.artifacts)!==null&&s!==void 0?s:{},g?{reports:{dotenv:v}}:{});const b=[`echo "${t.GITLAB_ENVIRONMENT_URL_VARIABLE}=${(0,l.getBashVariable)("ROOT_URL")}" >> ${v}`];const w=f==="review"?`${p}/$CI_COMMIT_REF_NAME/${d}`:`${p}/${d}`;return{...r,environment:{name:w,...g?{url:`$${t.GITLAB_ENVIRONMENT_URL_VARIABLE}`}:{},...m?{on_stop:getFullReferencedJobNameFromComponent(m,d,p,i)}:{},...h},...!(0,n.isEmpty)(y)?{artifacts:y}:{},script:[...(o=r.script)!==null&&o!==void 0?o:[],...g?b:[]]}};const createGitlabJobs=async(e,a)=>[...e.workspaces,...e.components,...e.agents].flatMap((({context:n,jobs:r})=>r.map((r=>{const[i,s]=(0,t.makeGitlabJob)(n,r,e,a);return{name:i,gitlabJob:s,context:n}}))));t.createGitlabJobs=createGitlabJobs;function getGitlabNeeds(e,t,a){var n;const r=e.type==="workspace"?getGitlabNeedsForWorkspaceJob(e,t,a):e.type==="agent"?(n=t.needs)!==null&&n!==void 0?n:null:getGitlabNeedsForComponentJob(e,t,a);return r?deduplicateNeeds(r):undefined}function deduplicateNeeds(e){return e?[...new Map(e.map((e=>[(0,n.isObject)(e)?e.job:e,e]))).values()]:undefined}function getGitlabNeedsForComponentJob(e,{needsStages:t,needs:a},r){const i=t===null||t===void 0?void 0:t.flatMap((t=>{var a,n,i,s,o,p,l,d;const c=e.name;if(!t.workspaceName){const s=(i=(n=(a=r.components.filter((t=>t.context.name===c&&t.context.env===e.env)).flatMap((e=>e.jobs)))===null||a===void 0?void 0:a.filter((e=>e.stage===t.stage)))===null||n===void 0?void 0:n.map((e=>e.name)))!==null&&i!==void 0?i:[];return s.map((e=>{var a;return{job:e,artifacts:(a=t.artifacts)!==null&&a!==void 0?a:false,componentName:c}}))}else{const a=(d=(l=(p=(o=(s=r.workspaces.find((a=>a.context.name===t.workspaceName&&a.context.env===e.env)))===null||s===void 0?void 0:s.jobs)===null||o===void 0?void 0:o.flatMap((e=>e)))===null||p===void 0?void 0:p.filter((e=>e.stage===t.stage)))===null||l===void 0?void 0:l.map((e=>e.name)))!==null&&d!==void 0?d:[];return a.map((e=>{var a;return{job:e,artifacts:(a=t.artifacts)!==null&&a!==void 0?a:false,workspaceName:t.workspaceName}}))}}));const s=[...i!==null&&i!==void 0?i:[],...a!==null&&a!==void 0?a:[]];return s===null||s===void 0?void 0:s.map((t=>{var a;return(0,n.isObject)(t)?"workspaceName"in t?{job:getFullReferencedJobNameFromWorkspace(t.job,t.workspaceName,e.env,r),artifacts:t.artifacts}:{job:getFullReferencedJobNameFromComponent(t.job,(a=t.componentName)!==null&&a!==void 0?a:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromComponent(t,e.name,e.env,r)})).sort(((e,t)=>getJobName(e).localeCompare(getJobName(t))))}function getGitlabNeedsForWorkspaceJob(e,{needsStages:t,needs:a},r){const i=t===null||t===void 0?void 0:t.flatMap((t=>{var a,n,i,s;const o=(a=t.workspaceName)!==null&&a!==void 0?a:e.name;const p=(s=(i=(n=r.workspaces.filter((t=>t.context.name===o&&t.context.env===e.env)).flatMap((e=>e.jobs)))===null||n===void 0?void 0:n.filter((e=>e.stage===t.stage)))===null||i===void 0?void 0:i.map((e=>e.name)))!==null&&s!==void 0?s:[];return p.map((e=>{var a;return{job:e,artifacts:(a=t.artifacts)!==null&&a!==void 0?a:false,workspaceName:o}}))}));const s=[...i!==null&&i!==void 0?i:[],...a!==null&&a!==void 0?a:[]];return s===null||s===void 0?void 0:s.map((t=>(0,n.isObject)(t)?{job:getFullReferencedJobNameFromWorkspace(t.job,"workspaceName"in t&&t.workspaceName?t.workspaceName:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromWorkspace(t,e.name,e.env,r))).sort(((e,t)=>getJobName(e).localeCompare(getJobName(t))))}},6441:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createGitlabPipelineWithDefaults=void 0;const n=a(2348);const r=a(3891);const i=a(4565);const createGitlabPipelineWithDefaults=({image:e,variables:t,before_script:a,...s})=>({image:e!==null&&e!==void 0?e:(0,n.getRunnerImage)("jobs-default"),variables:{FF_USE_FASTZIP:"true",ARTIFACT_COMPRESSION_LEVEL:"fast",CACHE_COMPRESSION_LEVEL:"fast",TRANSFER_METER_FREQUENCY:"5s",GIT_DEPTH:"1",...t!==null&&t!==void 0?t:{}},before_script:[...[...r.globalScriptFunctions.values()].map((e=>e.toBashFunction())),...a!==null&&a!==void 0?a:[]],workflow:{name:"$PIPELINE_ICON $PIPELINE_NAME",rules:[{if:'$CI_PIPELINE_SOURCE == "trigger"',variables:{PIPELINE_ICON:"🤖",PIPELINE_NAME:"Thinking..."}},{if:i.RULE_IS_MERGE_REQUEST.if,variables:{PIPELINE_ICON:"🐱🔨",PIPELINE_NAME:"mr$CI_MERGE_REQUEST_IID - $CI_MERGE_REQUEST_TITLE"}},{if:i.RULE_IS_TAGGED_RELEASE.if,variables:{PIPELINE_ICON:"🐱📦",PIPELINE_NAME:"Release $CI_COMMIT_TAG"}},{if:i.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT.if,variables:{PIPELINE_ICON:"🐱🔨",PIPELINE_NAME:"Main - $CI_COMMIT_TITLE"}},{when:"always",variables:{PIPELINE_ICON:"🐱❓",PIPELINE_NAME:"Default"}}]},...s});t.createGitlabPipelineWithDefaults=createGitlabPipelineWithDefaults},8705:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGitlabReleaseJobs=void 0;const n=a(4565);const r=a(2348);const i="echo '👉 If this job failed with access denied, the project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";const s=[n.RULE_NEVER_ON_RELEASE_COMMIT,n.RULE_NEVER_ON_AGENT_TRIGGER,n.RULE_NEVER_ON_SCHEDULE];const getGitlabReleaseJobs=e=>{var t;return{["create release"]:{stage:"release",image:(0,r.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],rules:[...s,{if:n.RULE_CONDITION_MAIN_BRANCH,when:((t=e.releases)===null||t===void 0?void 0:t.when)==="auto"?"on_success":"manual"},{if:n.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}]},["⚠️ force create release"]:{stage:"release",image:(0,r.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],needs:[],rules:[...s,{if:n.RULE_CONDITION_MAIN_BRANCH,when:"manual"},{if:n.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}]}}};t.getGitlabReleaseJobs=getGitlabReleaseJobs},8215:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.sortGitLabJobDefProps=void 0;const a=["stage","tags","image","services","variables","before_script","script","after_script","cache","coverage","environment","release","artifacts","rules","only","except","needs","dependencies","trigger","retry","interruptible","allow_failure","parallel","hooks","resource_group"];const sortGitLabJobDefKeys=e=>Object.keys(e).sort(((e,t)=>a.indexOf(e)===-1&&a.indexOf(t)===-1?0:a.indexOf(e)===-1?1:a.indexOf(t)===-1?-1:a.indexOf(e)-a.indexOf(t)));const sortGitLabJobDefProps=e=>sortGitLabJobDefKeys(e).reduce(((t,a)=>e[a]!==undefined?Object.assign(t,{[a]:e[a]}):t),{});t.sortGitLabJobDefProps=sortGitLabJobDefProps},6940:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(2424),t);r(a(8860),t);r(a(8705),t)},4041:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getPackageManagerInfoBase=t.getPackageManagerInfoForComponent=void 0;const r=a(9896);const i=a(6928);const s=a(3728);const o=a(9688);const p=n(a(7009));const getPackageManagerInfoForComponent=async(e,a)=>{const n=await(0,t.getPackageManagerInfoBase)();const{workspaces:p}=n;const l=e.components[a];const d=p.find((e=>(0,s.pathEqual)(l.dir,e.location)));const c=Boolean(d);const u=".";const f=(0,i.join)(l.dir,"package.json");const m=c?(0,i.join)(u,"package.json"):null;const h=c?(0,i.join)(u,"yarn.lock"):(0,i.join)(l.dir,"yarn.lock");const v=[".yarnrc",".yarnrc.yml",".npmrc",".yarn"];const g=[...v,...v.map((e=>(0,i.join)(l.dir,e)))].filter((e=>(0,r.existsSync)(e)));const y=d?(0,o.getWorkspaceDependencies)(d,p):[];const b=[...new Set([f,...m?[m]:[],h,...g,...y])];return{...n,currentWorkspace:d,currentWorkspaceDependencies:y,componentIsInWorkspace:c,pathsToCopyInDocker:b}};t.getPackageManagerInfoForComponent=getPackageManagerInfoForComponent;const _getPackageManagerInfoBase=async()=>{const e=await(0,o.getYarnVersion)();if(!e)throw new Error("could not get yarn version");const t=e.startsWith("1");const a=await(0,o.getWorkspaces)(t);return{type:"yarn",workspaces:a,version:e,isClassic:t}};t.getPackageManagerInfoBase=(0,p.default)(_getPackageManagerInfoBase,{promise:true})},9688:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getWorkspaceDependencies=t.getWorkspaces=t.getYarnVersion=void 0;const r=a(1748);const i=n(a(7009));const s=a(502);const execOrFail=async(e,t)=>{try{return await(0,r.exec)(e).then((e=>e.stdout))}catch(e){return t!==null&&t!==void 0?t:null}};t.getYarnVersion=(0,i.default)((async()=>await execOrFail("yarn --version","")),{promise:true});t.getWorkspaces=(0,i.default)((async e=>{var t,a;return e?Object.values((0,s.jsonParseOrThrow)((a=(t=(0,s.jsonParseOrThrow)(await execOrFail("yarn workspaces --json info","{}")))===null||t===void 0?void 0:t.data)!==null&&a!==void 0?a:"{}")):(0,s.jsonParseOrThrow)(`[${(await execOrFail("yarn workspaces list --json --verbose","")).trim().split("\n").join(",")}]`)}),{promise:true});const getWorkspaceDependencies=(e,a)=>e?[...e.workspaceDependencies,...e.mismatchedWorkspaceDependencies].flatMap((e=>{const n=a.find((t=>t.location===e));if(n){return[...(0,t.getWorkspaceDependencies)(n,a),n.location]}return[]})).filter(Boolean):[];t.getWorkspaceDependencies=getWorkspaceDependencies},4565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RULE_CONDITION_HOTFIX_BRANCH=t.RULE_IS_TAGGED_RELEASE=t.RULE_IS_MERGE_REQUEST=t.RULE_NEVER_ON_SCHEDULE=t.RULE_NEVER_ON_AGENT_TRIGGER=t.RULE_NEVER_ON_RELEASE_COMMIT=t.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT=t.RULE_IS_MAIN_BRANCH=t.RULE_CONDITION_NOT_RELEASE_COMMIT=t.RULE_CONDITION_RELEASE_COMMIT=t.RULE_CONDITION_MAIN_BRANCH=void 0;t.RULE_CONDITION_MAIN_BRANCH="$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";t.RULE_CONDITION_RELEASE_COMMIT="$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/";t.RULE_CONDITION_NOT_RELEASE_COMMIT="$CI_COMMIT_MESSAGE !~ /^chore\\(release\\).*/";t.RULE_IS_MAIN_BRANCH={if:t.RULE_CONDITION_MAIN_BRANCH};t.RULE_IS_MAIN_BRANCH_AND_NOT_RELEASE_COMMIT={if:t.RULE_CONDITION_MAIN_BRANCH+" && "+t.RULE_CONDITION_NOT_RELEASE_COMMIT};t.RULE_NEVER_ON_RELEASE_COMMIT={if:t.RULE_CONDITION_RELEASE_COMMIT,when:"never"};t.RULE_NEVER_ON_AGENT_TRIGGER={if:'$CI_PIPELINE_SOURCE == "trigger"',when:"never"};t.RULE_NEVER_ON_SCHEDULE={if:'$CI_PIPELINE_SOURCE == "schedule"',when:"never"};t.RULE_IS_MERGE_REQUEST={if:"$CI_MERGE_REQUEST_ID"};t.RULE_IS_TAGGED_RELEASE={if:"$CI_COMMIT_TAG"};t.RULE_CONDITION_HOTFIX_BRANCH="$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/"},2348:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRunnerImage=void 0;const n=a(3480);const getRunnerImage=e=>n.DOCKER_REGISTRY+"/"+e+":"+n.PIPELINE_IMAGE_TAG;t.getRunnerImage=getRunnerImage},2766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKnowEnvType=t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS=t.getEnvTypesByTrigger=t.ENV_TYPES=t.ALL_PIPELINE_TRIGGERS=void 0;t.ALL_PIPELINE_TRIGGERS=["mainBranch","mr","taggedRelease"];t.ENV_TYPES={dev:{triggers:["mainBranch"]},review:{triggers:["mr"]},stage:{triggers:["taggedRelease"]},prod:{triggers:["taggedRelease"]},local:{triggers:[]}};const getEnvTypesByTrigger=e=>Object.entries(t.ENV_TYPES).filter((([,t])=>t.triggers.includes(e))).map((([e])=>e));t.getEnvTypesByTrigger=getEnvTypesByTrigger;t.DEFAULT_ENVS=Object.keys(t.ENV_TYPES);t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS;const isKnowEnvType=e=>e in t.ENV_TYPES;t.isKnowEnvType=isKnowEnvType},3660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.componentContextHasWorkspaceBuild=t.componentContextIsStandaloneBuild=void 0;const componentContextIsStandaloneBuild=e=>e.build.type==="standalone";t.componentContextIsStandaloneBuild=componentContextIsStandaloneBuild;const componentContextHasWorkspaceBuild=e=>e.build.type==="fromWorkspace";t.componentContextHasWorkspaceBuild=componentContextHasWorkspaceBuild},3928:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5063:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){if(n===undefined)n=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,n,r)}:function(e,t,a,n){if(n===undefined)n=a;e[n]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))n(t,e,a)};Object.defineProperty(t,"__esModule",{value:true});r(a(6925),t);r(a(3928),t);r(a(3660),t);r(a(2349),t);r(a(7197),t);r(a(1507),t);r(a(2766),t)},2349:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1507:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_STAGES=void 0;t.BASE_STAGES=["setup","test","build","deploy","verify","agents","rollback","stop"]},7197:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},3468:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.collapseableSection=t.repeatOnFailure=t.sanitizeForBashVariable=t.allowFailureInScripts=void 0;const n=a(3891);const allowFailureInScripts=e=>["set +e",...e,"set -e"];t.allowFailureInScripts=allowFailureInScripts;const sanitizeForBashVariable=e=>e.replace(/-/g,"_");t.sanitizeForBashVariable=sanitizeForBashVariable;const repeatOnFailure=(e,t)=>`\n until ${e}\n do\n echo "Trying again."\n sleep ${t.pauseInSeconds}\n done\n `;t.repeatOnFailure=repeatOnFailure;const r=(0,n.registerGlobalScriptFunction)("collapseable_section_start",`local section_title="\${1}"\n local section_description="\${2:-$section_title}"\n echo -e "section_start:\`date +%s\`:\${section_title}[collapsed=true]\\r\\e[0K\${section_description}"\n`);const i=(0,n.registerGlobalScriptFunction)("collapseable_section_end",`local section_title="\${1}"\n echo -e "section_end:\`date +%s\`:\${section_title}\\r\\e[0K"\n`);const collapseableSection=(e,t)=>a=>[r.invoke(`"${e}"`,`"${t}"`),...a,i.invoke(`"${e}"`)];t.collapseableSection=collapseableSection},595:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.mergeWithMergingArrays=t.ensureArray=t.ensureArrayOrNull=t.notNil=void 0;const n=a(9250);function notNil(e){return e!==null&&e!==undefined}t.notNil=notNil;const ensureArrayOrNull=e=>(0,n.isNil)(e)?null:Array.isArray(e)?e:[e];t.ensureArrayOrNull=ensureArrayOrNull;const ensureArray=e=>{var a;return(a=(0,t.ensureArrayOrNull)(e))!==null&&a!==void 0?a:[]};t.ensureArray=ensureArray;const mergeWithMergingArrays=(e,t)=>(0,n.mergeWith)({},e,t,((e,t)=>Array.isArray(e)&&Array.isArray(t)?[...e,...t]:undefined));t.mergeWithMergingArrays=mergeWithMergingArrays},502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.jsonParseOrThrow=void 0;const jsonParseOrThrow=e=>{try{return JSON.parse(e)}catch(t){throw new Error(`could not parse json: ${e}`)}};t.jsonParseOrThrow=jsonParseOrThrow},4195:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeUndefined=void 0;const removeUndefined=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>e!==undefined)));t.removeUndefined=removeUndefined},5585:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.FileWriter=t.yamlStringifyOptions=void 0;const n=a(1943);const r=a(6637);t.yamlStringifyOptions={lineWidth:0,doubleQuotedAsJSON:true,singleQuote:true};class FileWriter{static create(e){return new FileWriter(e)}constructor(e){this.config=e;this.config=e}async writeTheFile(e,t){var a,r;const i=await((r=(a=this.config.hooks)===null||a===void 0?void 0:a.transformFileBeforeWrite)===null||r===void 0?void 0:r.call(a,{...await this.getBaseHookContext(e),content:t}));await(0,n.writeFile)(e,i!==null&&i!==void 0?i:t,{encoding:"utf-8"})}async getBaseHookContext(e){var t,a;const n=(t=e.split("/").pop())!==null&&t!==void 0?t:"";return{filename:n,path:e,extension:(a=e.split(".").pop())!==null&&a!==void 0?a:""}}async writeGeneratedFile(e,t,a){await this.writeTheFile(e,[this.getAutoGeneratedHeader(a.commentChar),t].join("\n"))}async writeYamlfile(e,a){var n,i;const s=await((i=(n=this.config.hooks)===null||n===void 0?void 0:n.transformYamlBeforeWrite)===null||i===void 0?void 0:i.call(n,{...await this.getBaseHookContext(e),data:a}));return this.writeGeneratedFile(e,(0,r.stringify)(s!==null&&s!==void 0?s:a,t.yamlStringifyOptions),{commentChar:"#"})}getAutoGeneratedHeader(e){return["-------------------------------------------------",`🐱 🔨 This file is generated by catladder`,`🚨 Do not edit this file manually 🚨`,"-------------------------------------------------"].map((t=>`${e} ${t}`)).join("\n").concat("\n")}}t.FileWriter=FileWriter},250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},4396:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createVariableValueContainingReferencesFromString=t.VariableValueContainingReferences=t.VariableReference=t.UnresolvableReference=void 0;const n=a(5354);const r=a(8127);class UnresolvableReference{constructor(e){this.reference=e}toString(){return`Unresolvable reference: ${this.reference.toString()}`}}t.UnresolvableReference=UnresolvableReference;class VariableReference{constructor(e,t){this.componentName=e;this.variableName=t}toString(){return`\${${this.componentName}:${this.variableName}}`}}t.VariableReference=VariableReference;class VariableValueContainingReferences{constructor(e){this.parts=(Array.isArray(e)?e:[e]).flatMap((e=>e instanceof VariableValueContainingReferences?e.parts:e===""?[]:[e]))}toString(e={quotes:false}){return this.parts.map((t=>{if(typeof t==="string"){return(0,r.escapeString)(t,e)}else if(t instanceof n.BashExpression){return(0,r.escapeBashExpression)(t,e)}else{return t.toString()}})).join("")}}t.VariableValueContainingReferences=VariableValueContainingReferences;const i=/\$\{(([^:}]+):)?([^}]+)}/gm;const createVariableValueContainingReferencesFromString=(e,t)=>{const a=[];let n;let r=0;while((n=i.exec(e))!==null){const[s,o,p,l]=n;a.push(e.slice(r,n.index));a.push(new VariableReference(p||t.componentName,l));r=i.lastIndex}a.push(e.slice(r));return new VariableValueContainingReferences(a)};t.createVariableValueContainingReferencesFromString=createVariableValueContainingReferencesFromString},5598:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveAllReferences=void 0;const n=a(4396);const r=a(8843);const resolveAllReferences=async(e,t)=>{let a=e;let i=0;while(Object.values(a).some((e=>e.parts.some((e=>e instanceof n.VariableReference))))){const e=await(0,r.resolveAllReferencesOnce)(a,t);a=e;i++;if(i>1e3){const e=Object.entries(a).filter((([e,t])=>t.parts.some((e=>e instanceof n.VariableReference))));throw new Error("Infinite loop detected in these variables: "+e.map((([e,t])=>`${e} (last reference: ${t.parts.find((e=>e instanceof n.VariableReference))})`)).join(", "))}}return a};t.resolveAllReferences=resolveAllReferences},8843:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveAllReferencesOnce=void 0;const n=a(4396);const r=a(6080);const resolveAllReferencesOnce=async(e,t)=>{const a=Object.values(e).flatMap((e=>e===null||e===void 0?void 0:e.parts.filter((e=>e instanceof n.VariableReference))));const i=Array.from(new Set(a.map((e=>e.componentName))));const s=Object.fromEntries(await Promise.all(i.map((async e=>[e,await t(e)]))));return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,t!==null&&t!==undefined?(0,r.resolveReferencesOnce)(t,(({componentName:e,variableName:t})=>s[e][t])):t])))};t.resolveAllReferencesOnce=resolveAllReferencesOnce},6080:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveReferencesOnce=void 0;const n=a(4396);const resolveReferencesOnce=(e,t)=>{const a=e.parts.map((e=>{if(e instanceof n.VariableReference){const a=t({componentName:e.componentName,variableName:e.variableName});return a!==null&&a!==void 0?a:new n.UnresolvableReference(e)}else{return e}}));return new n.VariableValueContainingReferences(a)};t.resolveReferencesOnce=resolveReferencesOnce},1748:(e,t,a)=>{"use strict";if(a(7819).major>=4){e.exports=a(5232)}else{e.exports=a(930)}},9177:e=>{"use strict";function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var t=function(e){_inherits(ChildProcessError,e);function ChildProcessError(e,t,a,n,r){_classCallCheck(this,ChildProcessError);var i=_possibleConstructorReturn(this,(ChildProcessError.__proto__||Object.getPrototypeOf(ChildProcessError)).call(this,e));Error.captureStackTrace(i,i.constructor);i.name=i.constructor.name;i.code=t;i.childProcess=a;i.stdout=n;i.stderr=r;return i}return ChildProcessError}(Error);e.exports=t},1458:(e,t,a)=>{"use strict";var n=function(){function defineProperties(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}return function(e,t,a){if(t)defineProperties(e.prototype,t);if(a)defineProperties(e,a);return e}}();var r=function get(e,t,a){if(e===null)e=Function.prototype;var n=Object.getOwnPropertyDescriptor(e,t);if(n===undefined){var r=Object.getPrototypeOf(e);if(r===null){return undefined}else{return get(r,t,a)}}else if("value"in n){return n.value}else{var i=n.get;if(i===undefined){return undefined}return i.call(a)}};function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var i;if(a(7819).major>=4){i=global.Promise}else{i=a(3352)}var s=function(e){_inherits(ChildProcessPromise,e);function ChildProcessPromise(e){_classCallCheck(this,ChildProcessPromise);var t;var a;var n=_possibleConstructorReturn(this,(ChildProcessPromise.__proto__||Object.getPrototypeOf(ChildProcessPromise)).call(this,(function(n,r){t=n;a=r;if(e){e(t,a)}})));n._cpResolve=t;n._cpReject=a;n.childProcess=undefined;return n}n(ChildProcessPromise,[{key:"progress",value:function progress(e){var t=this;process.nextTick((function(){e(t.childProcess)}));return this}},{key:"then",value:function then(e,t){var a=r(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"then",this).call(this,e,t);a.childProcess=this.childProcess;return a}},{key:"catch",value:function _catch(e){var t=r(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"catch",this).call(this,e);t.childProcess=this.childProcess;return t}},{key:"done",value:function done(){this.catch((function(e){process.nextTick((function(){throw e}))}))}}]);return ChildProcessPromise}(i);s.prototype.fail=s.prototype.catch;e.exports=s},930:(e,t,a)=>{"use strict";var n=a(5317);var r=a(4782);var i=a(1458);var s=a(9177);var o=Array.prototype.slice;function doExec(e,t){var a;var r=new i;var p=r._cpReject;var l=r._cpResolve;var d=o.call(t,0);d.push(callback);a=n[e].apply(n,d);function callback(e,r,i){if(e){var o=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+o+"` (exited with error code "+e.code+")";e.stdout=r;e.stderr=i;var d=new s(e.message,e.code,n,r,i);p(d)}else{l({childProcess:a,stdout:r,stderr:i})}}r.childProcess=a;return r}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,a,n){var r={};var o;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=n&&n.successfulExitCodes||[0];o=e(t,a,n);var u=false;var f=false;var m=n&&n.capture;if(m){for(var h=0,v=m.length;h<v;h++){var g=m[h];if(g==="stdout"){u=true}else if(g==="stderr"){f=true}}}r.childProcess=o;if(u){r.stdout="";o.stdout.on("data",(function(e){r.stdout+=e}))}if(f){r.stderr="";o.stderr.on("data",(function(e){r.stderr+=e}))}o.on("error",l);o.on("close",(function(e){if(c.indexOf(e)===-1){var n=t+(a.length?" "+a.join(" "):"");var i="`"+n+"` failed with code "+e;var p=new s(i,e,o);if(f){p.stderr=r.stderr.toString()}if(u){p.stdout=r.stdout.toString()}l(p)}else{r.code=e;d(r)}}));p.childProcess=o;return p}function spawn(e,t,a){return doSpawn(r,e,t,a)}function fork(e,t,a){return doSpawn(n.fork,e,t,a)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},4019:e=>{"use strict";class ChildProcessError extends Error{constructor(e,t,a,n,r){super(e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=t;this.childProcess=a;this.stdout=n;this.stderr=r}}e.exports=ChildProcessError},6008:(e,t,a)=>{"use strict";var n;if(a(7819).major>=4){n=global.Promise}else{n=a(3352)}class ChildProcessPromise extends n{constructor(e){var t;var a;super(((n,r)=>{t=n;a=r;if(e){e(t,a)}}));this._cpResolve=t;this._cpReject=a;this.childProcess=undefined}progress(e){process.nextTick((()=>{e(this.childProcess)}));return this}then(e,t){var a=super.then(e,t);a.childProcess=this.childProcess;return a}catch(e){var t=super.catch(e);t.childProcess=this.childProcess;return t}done(){this.catch((e=>{process.nextTick((()=>{throw e}))}))}}ChildProcessPromise.prototype.fail=ChildProcessPromise.prototype.catch;e.exports=ChildProcessPromise},5232:(e,t,a)=>{"use strict";var n=a(5317);var r=a(4782);var i=a(6008);var s=a(4019);var o=Array.prototype.slice;function doExec(e,t){var a;var r=new i;var p=r._cpReject;var l=r._cpResolve;var d=o.call(t,0);d.push(callback);a=n[e].apply(n,d);function callback(e,r,i){if(e){var o=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+o+"` (exited with error code "+e.code+")";e.stdout=r;e.stderr=i;var d=new s(e.message,e.code,n,r,i);p(d)}else{l({childProcess:a,stdout:r,stderr:i})}}r.childProcess=a;return r}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,a,n){var r={};var o;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=n&&n.successfulExitCodes||[0];o=e(t,a,n);var u=false;var f=false;var m=n&&n.capture;if(m){for(var h=0,v=m.length;h<v;h++){var g=m[h];if(g==="stdout"){u=true}else if(g==="stderr"){f=true}}}r.childProcess=o;if(u){r.stdout="";o.stdout.on("data",(function(e){r.stdout+=e}))}if(f){r.stderr="";o.stderr.on("data",(function(e){r.stderr+=e}))}o.on("error",l);o.on("close",(function(e){if(c.indexOf(e)===-1){var n=t+(a.length?" "+a.join(" "):"");var i="`"+n+"` failed with code "+e;var p=new s(i,e,o);if(f){p.stderr=r.stderr.toString()}if(u){p.stdout=r.stdout.toString()}l(p)}else{r.code=e;d(r)}}));p.childProcess=o;return p}function spawn(e,t,a){return doSpawn(r,e,t,a)}function fork(e,t,a){return doSpawn(n.fork,e,t,a)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},4782:(e,t,a)=>{"use strict";var n=a(5317);var r=a(5057);var i=a(2097);var s=n.spawnSync;function spawn(e,t,a){var s;var o;s=r(e,t,a);o=n.spawn(s.command,s.args,s.options);i.hookChildProcess(o,s);return o}function spawnSync(e,t,n){var o;var p;if(!s){try{s=a(4584)}catch(e){throw new Error("In order to use spawnSync on node 0.10 or older, you must "+"install spawn-sync:\n\n"+" npm install spawn-sync --save")}}o=r(e,t,n);p=s(o.command,o.args,o.options);p.error=p.error||i.verifyENOENTSync(p.status,o);return p}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=r;e.exports._enoent=i},2097:(e,t,a)=>{"use strict";var n=process.platform==="win32";var r=a(173);var i=process.version.indexOf("v0.10.")===0;function notFoundError(e,t){var a;a=new Error(t+" "+e+" ENOENT");a.code=a.errno="ENOENT";a.syscall=t+" "+e;return a}function hookChildProcess(e,t){var a;if(!n){return}a=e.emit;e.emit=function(n,r){var i;if(n==="exit"){i=verifyENOENT(r,t,"spawn");if(i){return a.call(e,"error",i)}}return a.apply(e,arguments)}}function verifyENOENT(e,t){if(n&&e===1&&!t.file){return notFoundError(t.original,"spawn")}return null}function verifyENOENTSync(e,t){if(n&&e===1&&!t.file){return notFoundError(t.original,"spawnSync")}if(i&&e===-1){t.file=n?t.file:r(t.original);if(!t.file){return notFoundError(t.original,"spawnSync")}}return null}e.exports.hookChildProcess=hookChildProcess;e.exports.verifyENOENT=verifyENOENT;e.exports.verifyENOENTSync=verifyENOENTSync;e.exports.notFoundError=notFoundError},176:e=>{"use strict";e.exports=function(){if(process.platform!=="win32"){return false}var e=process.version.substr(1).split(".").map((function(e){return parseInt(e,10)}));return e[0]===0&&e[1]<12}()},5057:(e,t,a)=>{"use strict";var n=a(9896);var r=a(166);var i=a(173);var s=a(176);var o=process.platform==="win32";var p=new r({max:50,maxAge:30*1e3});function readShebang(e){var t;var a;var r;var i;if(p.has(e)){return p.get(e)}t=new Buffer(150);try{a=n.openSync(e,"r");n.readSync(a,t,0,150,0);n.closeSync(a)}catch(e){}r=t.toString().trim().match(/#!(.+)/i);if(r){i=r[1].replace(/\/usr\/bin\/env\s+/i,"")}p.set(e,i);return i}function escapeArg(e,t){e=""+e;if(!t){e=e.replace(/([\(\)%!\^<>&|;,"'\s])/g,"^$1")}else{e=e.replace(/(\\*)"/g,'$1$1\\"');e=e.replace(/(\\*)$/,"$1$1");e='"'+e+'"'}return e}function escapeCommand(e){return/^[a-z0-9_-]+$/i.test(e)?e:escapeArg(e,true)}function requiresShell(e){return!/\.(?:com|exe)$/i.test(e)}function parse(e,t,a){var n;var r;var p;var l;var d;if(t&&!Array.isArray(t)){a=t;t=null}t=t?t.slice(0):[];a=a||{};l=e;if(o){p=i(e);p=p||i(e,true);n=p&&readShebang(p);d=a.shell||s;if(n){t.unshift(p);e=n;d=d||requiresShell(i(n)||i(n,true))}else{d=d||requiresShell(p)}if(d){r=e!=="echo";e=escapeCommand(e);t=t.map((function(e){return escapeArg(e,r)}));t=["/s","/c",'"'+e+(t.length?" "+t.join(" "):"")+'"'];e=process.env.comspec||"cmd.exe";a.windowsVerbatimArguments=true}}return{command:e,args:t,options:a,file:p,original:l}}e.exports=parse},173:(e,t,a)=>{"use strict";var n=a(6928);var r=a(2788);var i=a(166);var s=new i({max:50,maxAge:30*1e3});function resolveCommand(e,t){var a;t=!!t;a=s.get(e+"!"+t);if(s.has(e)){return s.get(e)}try{a=!t?r.sync(e):r.sync(e,{pathExt:n.delimiter+(process.env.PATHEXT||"")})}catch(e){}s.set(e+"!"+t,a);return a}e.exports=resolveCommand},166:(e,t,a)=>{"use strict";e.exports=LRUCache;var n=a(9100);var r=a(9023);var i=a(7516);var s=typeof Symbol==="function"&&process.env._nodeLRUCacheForceNoSymbol!=="1";var o;if(s){o=function(e){return Symbol(e)}}else{o=function(e){return"_"+e}}var p=o("max");var l=o("length");var d=o("lengthCalculator");var c=o("allowStale");var u=o("maxAge");var f=o("dispose");var m=o("noDisposeOnSet");var h=o("lruList");var v=o("cache");function naiveLength(){return 1}function LRUCache(e){if(!(this instanceof LRUCache)){return new LRUCache(e)}if(typeof e==="number"){e={max:e}}if(!e){e={}}var t=this[p]=e.max;if(!t||!(typeof t==="number")||t<=0){this[p]=Infinity}var a=e.length||naiveLength;if(typeof a!=="function"){a=naiveLength}this[d]=a;this[c]=e.stale||false;this[u]=e.maxAge||0;this[f]=e.dispose;this[m]=e.noDisposeOnSet||false;this.reset()}Object.defineProperty(LRUCache.prototype,"max",{set:function(e){if(!e||!(typeof e==="number")||e<=0){e=Infinity}this[p]=e;trim(this)},get:function(){return this[p]},enumerable:true});Object.defineProperty(LRUCache.prototype,"allowStale",{set:function(e){this[c]=!!e},get:function(){return this[c]},enumerable:true});Object.defineProperty(LRUCache.prototype,"maxAge",{set:function(e){if(!e||!(typeof e==="number")||e<0){e=0}this[u]=e;trim(this)},get:function(){return this[u]},enumerable:true});Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(e){if(typeof e!=="function"){e=naiveLength}if(e!==this[d]){this[d]=e;this[l]=0;this[h].forEach((function(e){e.length=this[d](e.value,e.key);this[l]+=e.length}),this)}trim(this)},get:function(){return this[d]},enumerable:true});Object.defineProperty(LRUCache.prototype,"length",{get:function(){return this[l]},enumerable:true});Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return this[h].length},enumerable:true});LRUCache.prototype.rforEach=function(e,t){t=t||this;for(var a=this[h].tail;a!==null;){var n=a.prev;forEachStep(this,e,a,t);a=n}};function forEachStep(e,t,a,n){var r=a.value;if(isStale(e,r)){del(e,a);if(!e[c]){r=undefined}}if(r){t.call(n,r.value,r.key,e)}}LRUCache.prototype.forEach=function(e,t){t=t||this;for(var a=this[h].head;a!==null;){var n=a.next;forEachStep(this,e,a,t);a=n}};LRUCache.prototype.keys=function(){return this[h].toArray().map((function(e){return e.key}),this)};LRUCache.prototype.values=function(){return this[h].toArray().map((function(e){return e.value}),this)};LRUCache.prototype.reset=function(){if(this[f]&&this[h]&&this[h].length){this[h].forEach((function(e){this[f](e.key,e.value)}),this)}this[v]=new n;this[h]=new i;this[l]=0};LRUCache.prototype.dump=function(){return this[h].map((function(e){if(!isStale(this,e)){return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}}}),this).toArray().filter((function(e){return e}))};LRUCache.prototype.dumpLru=function(){return this[h]};LRUCache.prototype.inspect=function(e,t){var a="LRUCache {";var n=false;var i=this[c];if(i){a+="\n allowStale: true";n=true}var s=this[p];if(s&&s!==Infinity){if(n){a+=","}a+="\n max: "+r.inspect(s,t);n=true}var o=this[u];if(o){if(n){a+=","}a+="\n maxAge: "+r.inspect(o,t);n=true}var f=this[d];if(f&&f!==naiveLength){if(n){a+=","}a+="\n length: "+r.inspect(this[l],t);n=true}var m=false;this[h].forEach((function(e){if(m){a+=",\n "}else{if(n){a+=",\n"}m=true;a+="\n "}var i=r.inspect(e.key).split("\n").join("\n ");var s={value:e.value};if(e.maxAge!==o){s.maxAge=e.maxAge}if(f!==naiveLength){s.length=e.length}if(isStale(this,e)){s.stale=true}s=r.inspect(s,t).split("\n").join("\n ");a+=i+" => "+s}));if(m||n){a+="\n"}a+="}";return a};LRUCache.prototype.set=function(e,t,a){a=a||this[u];var n=a?Date.now():0;var r=this[d](t,e);if(this[v].has(e)){if(r>this[p]){del(this,this[v].get(e));return false}var i=this[v].get(e);var s=i.value;if(this[f]){if(!this[m]){this[f](e,s.value)}}s.now=n;s.maxAge=a;s.value=t;this[l]+=r-s.length;s.length=r;this.get(e);trim(this);return true}var o=new Entry(e,t,r,n,a);if(o.length>this[p]){if(this[f]){this[f](e,t)}return false}this[l]+=o.length;this[h].unshift(o);this[v].set(e,this[h].head);trim(this);return true};LRUCache.prototype.has=function(e){if(!this[v].has(e))return false;var t=this[v].get(e).value;if(isStale(this,t)){return false}return true};LRUCache.prototype.get=function(e){return get(this,e,true)};LRUCache.prototype.peek=function(e){return get(this,e,false)};LRUCache.prototype.pop=function(){var e=this[h].tail;if(!e)return null;del(this,e);return e.value};LRUCache.prototype.del=function(e){del(this,this[v].get(e))};LRUCache.prototype.load=function(e){this.reset();var t=Date.now();for(var a=e.length-1;a>=0;a--){var n=e[a];var r=n.e||0;if(r===0){this.set(n.k,n.v)}else{var i=r-t;if(i>0){this.set(n.k,n.v,i)}}}};LRUCache.prototype.prune=function(){var e=this;this[v].forEach((function(t,a){get(e,a,false)}))};function get(e,t,a){var n=e[v].get(t);if(n){var r=n.value;if(isStale(e,r)){del(e,n);if(!e[c])r=undefined}else{if(a){e[h].unshiftNode(n)}}if(r)r=r.value}return r}function isStale(e,t){if(!t||!t.maxAge&&!e[u]){return false}var a=false;var n=Date.now()-t.now;if(t.maxAge){a=n>t.maxAge}else{a=e[u]&&n>e[u]}return a}function trim(e){if(e[l]>e[p]){for(var t=e[h].tail;e[l]>e[p]&&t!==null;){var a=t.prev;del(e,t);t=a}}}function del(e,t){if(t){var a=t.value;if(e[f]){e[f](a.key,a.value)}e[l]-=a.length;e[v].delete(a.key);e[h].removeNode(t)}}function Entry(e,t,a,n,r){this.key=e;this.value=t;this.length=a;this.now=n;this.maxAge=r||0}},2788:(e,t,a)=>{e.exports=which;which.sync=whichSync;var n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";var r=a(6928);var i=n?";":":";var s=a(8026);function getNotFoundError(e){var t=new Error("not found: "+e);t.code="ENOENT";return t}function getPathInfo(e,t){var a=t.colon||i;var r=t.path||process.env.PATH||"";var s=[""];r=r.split(a);var o="";if(n){r.unshift(process.cwd());o=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM";s=o.split(a);if(e.indexOf(".")!==-1&&s[0]!=="")s.unshift("")}if(e.match(/\//)||n&&e.match(/\\/))r=[""];return{env:r,ext:s,extExe:o}}function which(e,t,a){if(typeof t==="function"){a=t;t={}}var n=getPathInfo(e,t);var i=n.env;var o=n.ext;var p=n.extExe;var l=[];(function F(n,d){if(n===d){if(t.all&&l.length)return a(null,l);else return a(getNotFoundError(e))}var c=i[n];if(c.charAt(0)==='"'&&c.slice(-1)==='"')c=c.slice(1,-1);var u=r.join(c,e);if(!c&&/^\.[\\\/]/.test(e)){u=e.slice(0,2)+u}(function E(e,r){if(e===r)return F(n+1,d);var i=o[e];s(u+i,{pathExt:p},(function(n,s){if(!n&&s){if(t.all)l.push(u+i);else return a(null,u+i)}return E(e+1,r)}))})(0,o.length)})(0,i.length)}function whichSync(e,t){t=t||{};var a=getPathInfo(e,t);var n=a.env;var i=a.ext;var o=a.extExe;var p=[];for(var l=0,d=n.length;l<d;l++){var c=n[l];if(c.charAt(0)==='"'&&c.slice(-1)==='"')c=c.slice(1,-1);var u=r.join(c,e);if(!c&&/^\.[\\\/]/.test(e)){u=e.slice(0,2)+u}for(var f=0,m=i.length;f<m;f++){var h=u+i[f];var v;try{v=s.sync(h,{pathExt:o});if(v){if(t.all)p.push(h);else return h}}catch(e){}}}if(t.all&&p.length)return p;if(t.nothrow)return null;throw getNotFoundError(e)}},7516:e=>{e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var a=0,n=arguments.length;a<n;a++){t.push(arguments[a])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var a=e.prev;if(t){t.prev=a}if(a){a.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=a}e.list.length--;e.next=null;e.prev=null;e.list=null};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var a=this.head,n=0;a!==null;n++){e.call(t,a.value,n,this);a=a.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var a=this.tail,n=this.length-1;a!==null;n--){e.call(t,a.value,n,this);a=a.prev}};Yallist.prototype.get=function(e){for(var t=0,a=this.head;a!==null&&t<e;t++){a=a.next}if(t===e&&a!==null){return a.value}};Yallist.prototype.getReverse=function(e){for(var t=0,a=this.tail;a!==null&&t<e;t++){a=a.prev}if(t===e&&a!==null){return a.value}};Yallist.prototype.map=function(e,t){t=t||this;var a=new Yallist;for(var n=this.head;n!==null;){a.push(e.call(t,n.value,this));n=n.next}return a};Yallist.prototype.mapReverse=function(e,t){t=t||this;var a=new Yallist;for(var n=this.tail;n!==null;){a.push(e.call(t,n.value,this));n=n.prev}return a};Yallist.prototype.reduce=function(e,t){var a;var n=this.head;if(arguments.length>1){a=t}else if(this.head){n=this.head.next;a=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=0;n!==null;r++){a=e(a,n.value,r);n=n.next}return a};Yallist.prototype.reduceReverse=function(e,t){var a;var n=this.tail;if(arguments.length>1){a=t}else if(this.tail){n=this.tail.prev;a=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var r=this.length-1;n!==null;r--){a=e(a,n.value,r);n=n.prev}return a};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,a=this.head;a!==null;t++){e[t]=a.value;a=a.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,a=this.tail;a!==null;t++){e[t]=a.value;a=a.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var a=new Yallist;if(t<e||t<0){return a}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=0,r=this.head;r!==null&&n<e;n++){r=r.next}for(;r!==null&&n<t;n++,r=r.next){a.push(r.value)}return a};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var a=new Yallist;if(t<e||t<0){return a}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=this.length,r=this.tail;r!==null&&n>t;n--){r=r.prev}for(;r!==null&&n>e;n--,r=r.prev){a.push(r.value)}return a};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var a=e;a!==null;a=a.prev){var n=a.prev;a.prev=a.next;a.next=n}this.head=t;this.tail=e;return this};function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,a,n){if(!(this instanceof Node)){return new Node(e,t,a,n)}this.list=n;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(a){a.prev=this;this.next=a}else{this.next=null}}},90:(e,t,a)=>{"use strict";var n=a(9358),r=a(9214),i=a(6377),s=a(9707),o=a(6905);var p=e.exports=function(e,t){var a,r,p,l,d;if(arguments.length<2||typeof e!=="string"){l=t;t=e;e=null}else{l=arguments[2]}if(n(e)){a=o.call(e,"c");r=o.call(e,"e");p=o.call(e,"w")}else{a=p=true;r=false}d={value:t,configurable:a,enumerable:r,writable:p};return!l?d:i(s(l),d)};p.gs=function(e,t,a){var p,l,d,c;if(typeof e!=="string"){d=a;a=t;t=e;e=null}else{d=arguments[3]}if(!n(t)){t=undefined}else if(!r(t)){d=t;t=a=undefined}else if(!n(a)){a=undefined}else if(!r(a)){d=a;a=undefined}if(n(e)){p=o.call(e,"c");l=o.call(e,"e")}else{p=true;l=false}c={get:t,set:a,configurable:p,enumerable:l};return!d?c:i(s(d),c)}},2116:e=>{"use strict";e.exports=(e,t,a)=>{const define=a=>Object.defineProperty(e,t,{value:a,enumerable:true,writable:true});Object.defineProperty(e,t,{configurable:true,enumerable:true,get(){const e=a();define(e);return e},set(e){define(e)}});return e}},9926:(e,t,a)=>{"use strict";var n=a(8538);e.exports.C=convert;function convert(e,t,a){a=checkEncoding(a||"UTF-8");t=checkEncoding(t||"UTF-8");e=e||"";var n;if(a!=="UTF-8"&&typeof e==="string"){e=Buffer.from(e,"binary")}if(a===t){if(typeof e==="string"){n=Buffer.from(e)}else{n=e}}else{try{n=convertIconvLite(e,t,a)}catch(t){console.error(t);n=e}}if(typeof n==="string"){n=Buffer.from(n,"utf-8")}return n}function convertIconvLite(e,t,a){if(t==="UTF-8"){return n.decode(e,a)}else if(a==="UTF-8"){return n.encode(e,t)}else{return n.encode(n.decode(e,a),t)}}function checkEncoding(e){return(e||"").toString().trim().replace(/^latin[\-_]?(\d+)$/i,"ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i,"WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i,"UTF-$1").replace(/^ks_c_5601\-1987$/i,"CP949").replace(/^us[\-_]?ascii$/i,"ASCII").toUpperCase()}},2907:(e,t,a)=>{"use strict";var n=a(6546),r=a(6648),i=a(6349),s=Array.prototype.indexOf,o=Object.prototype.hasOwnProperty,p=Math.abs,l=Math.floor;e.exports=function(e){var t,a,d,c;if(!n(e))return s.apply(this,arguments);a=r(i(this).length);d=arguments[1];if(isNaN(d))d=0;else if(d>=0)d=l(d);else d=r(this.length)-l(p(d));for(t=d;t<a;++t){if(o.call(this,t)){c=this[t];if(n(c))return t}}return-1}},7998:(e,t,a)=>{"use strict";e.exports=a(8853)()?Array.from:a(8857)},8853:e=>{"use strict";e.exports=function(){var e=Array.from,t,a;if(typeof e!=="function")return false;t=["raz","dwa"];a=e(t);return Boolean(a&&a!==t&&a[1]==="dwa")}},8857:(e,t,a)=>{"use strict";var n=a(6219).iterator,r=a(9131),i=a(7743),s=a(6648),o=a(5370),p=a(6349),l=a(6163),d=a(2707),c=Array.isArray,u=Function.prototype.call,f={configurable:true,enumerable:true,writable:true,value:null},m=Object.defineProperty;e.exports=function(e){var t=arguments[1],a=arguments[2],h,v,g,y,b,w,_,S,N,C;e=Object(p(e));if(l(t))o(t);if(!this||this===Array||!i(this)){if(!t){if(r(e)){b=e.length;if(b!==1)return Array.apply(null,e);y=new Array(1);y[0]=e[0];return y}if(c(e)){y=new Array(b=e.length);for(v=0;v<b;++v)y[v]=e[v];return y}}y=[]}else{h=this}if(!c(e)){if((N=e[n])!==undefined){_=o(N).call(e);if(h)y=new h;S=_.next();v=0;while(!S.done){C=t?u.call(t,a,S.value,v):S.value;if(h){f.value=C;m(y,v,f)}else{y[v]=C}S=_.next();++v}b=v}else if(d(e)){b=e.length;if(h)y=new h;for(v=0,g=0;v<b;++v){C=e[v];if(v+1<b){w=C.charCodeAt(0);if(w>=55296&&w<=56319)C+=e[++v]}C=t?u.call(t,a,C,g):C;if(h){f.value=C;m(y,g,f)}else{y[g]=C}++g}b=g}}if(b===undefined){b=s(e.length);if(h)y=new h(b);for(v=0;v<b;++v){C=t?u.call(t,a,e[v],v):e[v];if(h){f.value=C;m(y,v,f)}else{y[v]=C}}}if(h){f.value=null;y.length=b}return y}},2984:(e,t,a)=>{"use strict";var n=a(7998),r=Array.isArray;e.exports=function(e){return r(e)?e:n(e)}},7775:(e,t,a)=>{"use strict";var n=a(6377),r=a(3115),i=a(6163),s=Error.captureStackTrace;e.exports=function(t){var a=new Error(t),o=arguments[1],p=arguments[2];if(!i(p)){if(r(o)){p=o;o=null}}if(i(p))n(a,p);if(i(o))a.code=o;if(s)s(a,e.exports);return a}},7447:(e,t,a)=>{"use strict";var n=a(6648);var test=function(e,t){return t};var r,i,s,o;try{Object.defineProperty(test,"length",{configurable:true,writable:false,enumerable:false,value:1})}catch(e){}if(test.length===1){r={configurable:true,writable:false,enumerable:false};i=Object.defineProperty;e.exports=function(e,t){t=n(t);if(e.length===t)return e;r.value=t;return i(e,"length",r)}}else{o=a(6554);s=function(){var e=[];return function(t){var a,n=0;if(e[t])return e[t];a=[];while(t--)a.push("a"+(++n).toString(36));return new Function("fn","return function ("+a.join(", ")+") { return fn.apply(this, arguments); };")}}();e.exports=function(e,t){var a;t=n(t);if(e.length===t)return e;a=s(t)(e);try{o(a,e)}catch(e){}return a}}},9131:e=>{"use strict";var t=Object.prototype.toString,a=t.call(function(){return arguments}());e.exports=function(e){return t.call(e)===a}},7743:e=>{"use strict";var t=Object.prototype.toString,a=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return typeof e==="function"&&a(t.call(e))}},9334:e=>{"use strict";e.exports=function(){}},9618:(e,t,a)=>{"use strict";e.exports=a(1769)()?Math.sign:a(8021)},1769:e=>{"use strict";e.exports=function(){var e=Math.sign;if(typeof e!=="function")return false;return e(10)===1&&e(-20)===-1}},8021:e=>{"use strict";e.exports=function(e){e=Number(e);if(isNaN(e)||e===0)return e;return e>0?1:-1}},6546:(e,t,a)=>{"use strict";e.exports=a(1273)()?Number.isNaN:a(4373)},1273:e=>{"use strict";e.exports=function(){var e=Number.isNaN;if(typeof e!=="function")return false;return!e({})&&e(NaN)&&!e(34)}},4373:e=>{"use strict";e.exports=function(e){return e!==e}},3247:(e,t,a)=>{"use strict";var n=a(9618),r=Math.abs,i=Math.floor;e.exports=function(e){if(isNaN(e))return 0;e=Number(e);if(e===0||!isFinite(e))return e;return n(e)*i(r(e))}},6648:(e,t,a)=>{"use strict";var n=a(3247),r=Math.max;e.exports=function(e){return r(0,n(e))}},8486:(e,t,a)=>{"use strict";var n=a(5370),r=a(6349),i=Function.prototype.bind,s=Function.prototype.call,o=Object.keys,p=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(a,l){var d,c=arguments[2],u=arguments[3];a=Object(r(a));n(l);d=o(a);if(u){d.sort(typeof u==="function"?i.call(u,a):undefined)}if(typeof e!=="function")e=d[e];return s.call(e,d,(function(e,n){if(!p.call(a,e))return t;return s.call(l,c,a[e],e,a,n)}))}}},6377:(e,t,a)=>{"use strict";e.exports=a(2144)()?Object.assign:a(5404)},2144:e=>{"use strict";e.exports=function(){var e=Object.assign,t;if(typeof e!=="function")return false;t={foo:"raz"};e(t,{bar:"dwa"},{trzy:"trzy"});return t.foo+t.bar+t.trzy==="razdwatrzy"}},5404:(e,t,a)=>{"use strict";var n=a(6300),r=a(6349),i=Math.max;e.exports=function(e,t){var a,s,o=i(arguments.length,2),p;e=Object(r(e));p=function(n){try{e[n]=t[n]}catch(e){if(!a)a=e}};for(s=1;s<o;++s){t=arguments[s];n(t).forEach(p)}if(a!==undefined)throw a;return e}},7904:(e,t,a)=>{"use strict";e.exports=a(8486)("forEach")},3152:e=>{"use strict";e.exports=function(e){return typeof e==="function"}},3115:(e,t,a)=>{"use strict";var n=a(6163);var r={function:true,object:true};e.exports=function(e){return n(e)&&r[typeof e]||false}},6163:(e,t,a)=>{"use strict";var n=a(9334)();e.exports=function(e){return e!==n&&e!==null}},6300:(e,t,a)=>{"use strict";e.exports=a(1235)()?Object.keys:a(8659)},1235:e=>{"use strict";e.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},8659:(e,t,a)=>{"use strict";var n=a(6163);var r=Object.keys;e.exports=function(e){return r(n(e)?Object(e):e)}},2929:(e,t,a)=>{"use strict";var n=a(5370),r=a(7904),i=Function.prototype.call;e.exports=function(e,t){var a={},s=arguments[2];n(t);r(e,(function(e,n,r,o){a[n]=i.call(t,s,e,n,r,o)}));return a}},6554:(e,t,a)=>{"use strict";var n=a(6349),r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols;e.exports=function(e,t){var a,p=Object(n(t));e=Object(n(e));s(p).forEach((function(n){try{r(e,n,i(t,n))}catch(e){a=e}}));if(typeof o==="function"){o(p).forEach((function(n){try{r(e,n,i(t,n))}catch(e){a=e}}))}if(a!==undefined)throw a;return e}},9707:(e,t,a)=>{"use strict";var n=a(6163);var r=Array.prototype.forEach,i=Object.create;var process=function(e,t){var a;for(a in e)t[a]=e[a]};e.exports=function(e){var t=i(null);r.call(arguments,(function(e){if(!n(e))return;process(Object(e),t)}));return t}},4579:e=>{"use strict";var t=Array.prototype.forEach,a=Object.create;e.exports=function(e){var n=a(null);t.call(arguments,(function(e){n[e]=true}));return n}},5370:e=>{"use strict";e.exports=function(e){if(typeof e!=="function")throw new TypeError(e+" is not a function");return e}},6349:(e,t,a)=>{"use strict";var n=a(6163);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},9861:(e,t,a)=>{"use strict";var n=a(6349),r=a(8013);e.exports=function(e){return r(n(e))}},8013:(e,t,a)=>{"use strict";var n=a(3152);e.exports=function(e){try{if(e&&n(e.toString))return e.toString();return String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},9110:(e,t,a)=>{"use strict";var n=a(3152);e.exports=function(e){try{if(e&&n(e.toString))return e.toString();return String(e)}catch(e){return"<Non-coercible to string value>"}}},6905:(e,t,a)=>{"use strict";e.exports=a(528)()?String.prototype.contains:a(588)},528:e=>{"use strict";var t="razdwatrzy";e.exports=function(){if(typeof t.contains!=="function")return false;return t.contains("dwa")===true&&t.contains("foo")===false}},588:e=>{"use strict";var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},2707:e=>{"use strict";var t=Object.prototype.toString,a=t.call("");e.exports=function(e){return typeof e==="string"||e&&typeof e==="object"&&(e instanceof String||t.call(e)===a)||false}},4625:(e,t,a)=>{"use strict";var n=a(9110);var r=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=n(e);if(t.length>100)t=t.slice(0,99)+"…";t=t.replace(r,(function(e){return JSON.stringify(e).slice(1,-1)}));return t}},6219:(e,t,a)=>{"use strict";e.exports=a(9506)()?a(1328).Symbol:a(8696)},9506:(e,t,a)=>{"use strict";var n=a(1328),r={object:true,symbol:true};e.exports=function(){var e=n.Symbol;var t;if(typeof e!=="function")return false;t=e("test symbol");try{String(t)}catch(e){return false}if(!r[typeof e.iterator])return false;if(!r[typeof e.toPrimitive])return false;if(!r[typeof e.toStringTag])return false;return true}},5764:e=>{"use strict";e.exports=function(e){if(!e)return false;if(typeof e==="symbol")return true;if(!e.constructor)return false;if(e.constructor.name!=="Symbol")return false;return e[e.constructor.toStringTag]==="Symbol"}},7138:(e,t,a)=>{"use strict";var n=a(90);var r=Object.create,i=Object.defineProperty,s=Object.prototype;var o=r(null);e.exports=function(e){var t=0,a,r;while(o[e+(t||"")])++t;e+=t||"";o[e]=true;a="@@"+e;i(s,a,n.gs(null,(function(e){if(r)return;r=true;i(this,a,n(e));r=false})));return a}},9320:(e,t,a)=>{"use strict";var n=a(90),r=a(1328).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:n("",r&&r.hasInstance||e("hasInstance")),isConcatSpreadable:n("",r&&r.isConcatSpreadable||e("isConcatSpreadable")),iterator:n("",r&&r.iterator||e("iterator")),match:n("",r&&r.match||e("match")),replace:n("",r&&r.replace||e("replace")),search:n("",r&&r.search||e("search")),species:n("",r&&r.species||e("species")),split:n("",r&&r.split||e("split")),toPrimitive:n("",r&&r.toPrimitive||e("toPrimitive")),toStringTag:n("",r&&r.toStringTag||e("toStringTag")),unscopables:n("",r&&r.unscopables||e("unscopables"))})}},2777:(e,t,a)=>{"use strict";var n=a(90),r=a(5358);var i=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:n((function(t){if(i[t])return i[t];return i[t]=e(String(t))})),keyFor:n((function(e){var t;r(e);for(t in i){if(i[t]===e)return t}return undefined}))})}},8696:(e,t,a)=>{"use strict";var n=a(90),r=a(5358),i=a(1328).Symbol,s=a(7138),o=a(9320),p=a(2777);var l=Object.create,d=Object.defineProperties,c=Object.defineProperty;var u,f,m;if(typeof i==="function"){try{String(i());m=true}catch(e){}}else{i=null}f=function Symbol(e){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return u(e)};e.exports=u=function Symbol(e){var t;if(this instanceof Symbol)throw new TypeError("Symbol is not a constructor");if(m)return i(e);t=l(f.prototype);e=e===undefined?"":String(e);return d(t,{__description__:n("",e),__name__:n("",s(e))})};o(u);p(u);d(f.prototype,{constructor:n(u),toString:n("",(function(){return this.__name__}))});d(u.prototype,{toString:n((function(){return"Symbol ("+r(this).__description__+")"})),valueOf:n((function(){return r(this)}))});c(u.prototype,u.toPrimitive,n("",(function(){var e=r(this);if(typeof e==="symbol")return e;return e.toString()})));c(u.prototype,u.toStringTag,n("c","Symbol"));c(f.prototype,u.toStringTag,n("c",u.prototype[u.toStringTag]));c(f.prototype,u.toPrimitive,n("c",u.prototype[u.toPrimitive]))},5358:(e,t,a)=>{"use strict";var n=a(5764);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}},7045:(e,t,a)=>{"use strict";var n=a(90),r=a(5370),i=Function.prototype.apply,s=Function.prototype.call,o=Object.create,p=Object.defineProperty,l=Object.defineProperties,d=Object.prototype.hasOwnProperty,c={configurable:true,enumerable:false,writable:true},u,f,m,h,v,g,y;u=function(e,t){var a;r(t);if(!d.call(this,"__ee__")){a=c.value=o(null);p(this,"__ee__",c);c.value=null}else{a=this.__ee__}if(!a[e])a[e]=t;else if(typeof a[e]==="object")a[e].push(t);else a[e]=[a[e],t];return this};f=function(e,t){var a,n;r(t);n=this;u.call(this,e,a=function(){m.call(n,e,a);i.call(t,this,arguments)});a.__eeOnceListener__=t;return this};m=function(e,t){var a,n,i,s;r(t);if(!d.call(this,"__ee__"))return this;a=this.__ee__;if(!a[e])return this;n=a[e];if(typeof n==="object"){for(s=0;i=n[s];++s){if(i===t||i.__eeOnceListener__===t){if(n.length===2)a[e]=n[s?0:1];else n.splice(s,1)}}}else{if(n===t||n.__eeOnceListener__===t){delete a[e]}}return this};h=function(e){var t,a,n,r,o;if(!d.call(this,"__ee__"))return;r=this.__ee__[e];if(!r)return;if(typeof r==="object"){a=arguments.length;o=new Array(a-1);for(t=1;t<a;++t)o[t-1]=arguments[t];r=r.slice();for(t=0;n=r[t];++t){i.call(n,this,o)}}else{switch(arguments.length){case 1:s.call(r,this);break;case 2:s.call(r,this,arguments[1]);break;case 3:s.call(r,this,arguments[1],arguments[2]);break;default:a=arguments.length;o=new Array(a-1);for(t=1;t<a;++t){o[t-1]=arguments[t]}i.call(r,this,o)}}};v={on:u,once:f,off:m,emit:h};g={on:n(u),once:n(f),off:n(m),emit:n(h)};y=l({},g);e.exports=t=function(e){return e==null?o(y):l(Object(e),g)};t.methods=v},5588:e=>{var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}()},1328:(e,t,a)=>{"use strict";e.exports=a(4359)()?globalThis:a(5588)},4359:e=>{"use strict";e.exports=function(){if(typeof globalThis!=="object")return false;if(!globalThis)return false;return globalThis.Array===Array}},2457:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(1063).mkdirsSync;const s=a(4668).utimesMillisSync;const o=Symbol("notExist");function copySync(e,t,a){if(typeof a==="function"){a={filter:a}}a=a||{};a.clobber="clobber"in a?!!a.clobber:true;a.overwrite="overwrite"in a?!!a.overwrite:a.clobber;if(a.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}const s=checkPaths(e,t);if(a.filter&&!a.filter(e,t))return;const o=r.dirname(t);if(!n.existsSync(o))i(o);return startCopy(s,e,t,a)}function startCopy(e,t,a,n){if(n.filter&&!n.filter(t,a))return;return getStats(e,t,a,n)}function getStats(e,t,a,r){const i=r.dereference?n.statSync:n.lstatSync;const s=i(t);if(s.isDirectory())return onDir(s,e,t,a,r);else if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return onFile(s,e,t,a,r);else if(s.isSymbolicLink())return onLink(e,t,a,r)}function onFile(e,t,a,n,r){if(t===o)return copyFile(e,a,n,r);return mayCopyFile(e,a,n,r)}function mayCopyFile(e,t,a,r){if(r.overwrite){n.unlinkSync(a);return copyFile(e,t,a,r)}else if(r.errorOnExist){throw new Error(`'${a}' already exists`)}}function copyFile(e,t,a,r){if(typeof n.copyFileSync==="function"){n.copyFileSync(t,a);n.chmodSync(a,e.mode);if(r.preserveTimestamps){return s(a,e.atime,e.mtime)}return}return copyFileFallback(e,t,a,r)}function copyFileFallback(e,t,r,i){const s=64*1024;const o=a(1925)(s);const p=n.openSync(t,"r");const l=n.openSync(r,"w",e.mode);let d=0;while(d<e.size){const e=n.readSync(p,o,0,s,d);n.writeSync(l,o,0,e);d+=e}if(i.preserveTimestamps)n.futimesSync(l,e.atime,e.mtime);n.closeSync(p);n.closeSync(l)}function onDir(e,t,a,n,r){if(t===o)return mkDirAndCopy(e,a,n,r);if(t&&!t.isDirectory()){throw new Error(`Cannot overwrite non-directory '${n}' with directory '${a}'.`)}return copyDir(a,n,r)}function mkDirAndCopy(e,t,a,r){n.mkdirSync(a);copyDir(t,a,r);return n.chmodSync(a,e.mode)}function copyDir(e,t,a){n.readdirSync(e).forEach((n=>copyDirItem(n,e,t,a)))}function copyDirItem(e,t,a,n){const i=r.join(t,e);const s=r.join(a,e);const o=checkPaths(i,s);return startCopy(o,i,s,n)}function onLink(e,t,a,i){let s=n.readlinkSync(t);if(i.dereference){s=r.resolve(process.cwd(),s)}if(e===o){return n.symlinkSync(s,a)}else{let e;try{e=n.readlinkSync(a)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return n.symlinkSync(s,a);throw e}if(i.dereference){e=r.resolve(process.cwd(),e)}if(isSrcSubdir(s,e)){throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${e}'.`)}if(n.statSync(a).isDirectory()&&isSrcSubdir(e,s)){throw new Error(`Cannot overwrite '${e}' with '${s}'.`)}return copyLink(s,a)}}function copyLink(e,t){n.unlinkSync(t);return n.symlinkSync(e,t)}function isSrcSubdir(e,t){const a=r.resolve(e).split(r.sep);const n=r.resolve(t).split(r.sep);return a.reduce(((e,t,a)=>e&&n[a]===t),true)}function checkStats(e,t){const a=n.statSync(e);let r;try{r=n.statSync(t)}catch(e){if(e.code==="ENOENT")return{srcStat:a,destStat:o};throw e}return{srcStat:a,destStat:r}}function checkPaths(e,t){const{srcStat:a,destStat:n}=checkStats(e,t);if(n.ino&&n.ino===a.ino){throw new Error("Source and destination must not be the same.")}if(a.isDirectory()&&isSrcSubdir(e,t)){throw new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`)}return n}e.exports=copySync},6942:(e,t,a)=>{"use strict";e.exports={copySync:a(2457)}},9761:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(1063).mkdirs;const s=a(2535).pathExists;const o=a(4668).utimesMillis;const p=Symbol("notExist");function copy(e,t,a,n){if(typeof a==="function"&&!n){n=a;a={}}else if(typeof a==="function"){a={filter:a}}n=n||function(){};a=a||{};a.clobber="clobber"in a?!!a.clobber:true;a.overwrite="overwrite"in a?!!a.overwrite:a.clobber;if(a.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}checkPaths(e,t,((r,i)=>{if(r)return n(r);if(a.filter)return handleFilter(checkParentDir,i,e,t,a,n);return checkParentDir(i,e,t,a,n)}))}function checkParentDir(e,t,a,n,o){const p=r.dirname(a);s(p,((r,s)=>{if(r)return o(r);if(s)return startCopy(e,t,a,n,o);i(p,(r=>{if(r)return o(r);return startCopy(e,t,a,n,o)}))}))}function handleFilter(e,t,a,n,r,i){Promise.resolve(r.filter(a,n)).then((s=>{if(s){if(t)return e(t,a,n,r,i);return e(a,n,r,i)}return i()}),(e=>i(e)))}function startCopy(e,t,a,n,r){if(n.filter)return handleFilter(getStats,e,t,a,n,r);return getStats(e,t,a,n,r)}function getStats(e,t,a,r,i){const s=r.dereference?n.stat:n.lstat;s(t,((n,s)=>{if(n)return i(n);if(s.isDirectory())return onDir(s,e,t,a,r,i);else if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return onFile(s,e,t,a,r,i);else if(s.isSymbolicLink())return onLink(e,t,a,r,i)}))}function onFile(e,t,a,n,r,i){if(t===p)return copyFile(e,a,n,r,i);return mayCopyFile(e,a,n,r,i)}function mayCopyFile(e,t,a,r,i){if(r.overwrite){n.unlink(a,(n=>{if(n)return i(n);return copyFile(e,t,a,r,i)}))}else if(r.errorOnExist){return i(new Error(`'${a}' already exists`))}else return i()}function copyFile(e,t,a,r,i){if(typeof n.copyFile==="function"){return n.copyFile(t,a,(t=>{if(t)return i(t);return setDestModeAndTimestamps(e,a,r,i)}))}return copyFileFallback(e,t,a,r,i)}function copyFileFallback(e,t,a,r,i){const s=n.createReadStream(t);s.on("error",(e=>i(e))).once("open",(()=>{const t=n.createWriteStream(a,{mode:e.mode});t.on("error",(e=>i(e))).on("open",(()=>s.pipe(t))).once("close",(()=>setDestModeAndTimestamps(e,a,r,i)))}))}function setDestModeAndTimestamps(e,t,a,r){n.chmod(t,e.mode,(n=>{if(n)return r(n);if(a.preserveTimestamps){return o(t,e.atime,e.mtime,r)}return r()}))}function onDir(e,t,a,n,r,i){if(t===p)return mkDirAndCopy(e,a,n,r,i);if(t&&!t.isDirectory()){return i(new Error(`Cannot overwrite non-directory '${n}' with directory '${a}'.`))}return copyDir(a,n,r,i)}function mkDirAndCopy(e,t,a,r,i){n.mkdir(a,(s=>{if(s)return i(s);copyDir(t,a,r,(t=>{if(t)return i(t);return n.chmod(a,e.mode,i)}))}))}function copyDir(e,t,a,r){n.readdir(e,((n,i)=>{if(n)return r(n);return copyDirItems(i,e,t,a,r)}))}function copyDirItems(e,t,a,n,r){const i=e.pop();if(!i)return r();return copyDirItem(e,i,t,a,n,r)}function copyDirItem(e,t,a,n,i,s){const o=r.join(a,t);const p=r.join(n,t);checkPaths(o,p,((t,r)=>{if(t)return s(t);startCopy(r,o,p,i,(t=>{if(t)return s(t);return copyDirItems(e,a,n,i,s)}))}))}function onLink(e,t,a,i,s){n.readlink(t,((t,o)=>{if(t)return s(t);if(i.dereference){o=r.resolve(process.cwd(),o)}if(e===p){return n.symlink(o,a,s)}else{n.readlink(a,((t,p)=>{if(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return n.symlink(o,a,s);return s(t)}if(i.dereference){p=r.resolve(process.cwd(),p)}if(isSrcSubdir(o,p)){return s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${p}'.`))}if(e.isDirectory()&&isSrcSubdir(p,o)){return s(new Error(`Cannot overwrite '${p}' with '${o}'.`))}return copyLink(o,a,s)}))}}))}function copyLink(e,t,a){n.unlink(t,(r=>{if(r)return a(r);return n.symlink(e,t,a)}))}function isSrcSubdir(e,t){const a=r.resolve(e).split(r.sep);const n=r.resolve(t).split(r.sep);return a.reduce(((e,t,a)=>e&&n[a]===t),true)}function checkStats(e,t,a){n.stat(e,((e,r)=>{if(e)return a(e);n.stat(t,((e,t)=>{if(e){if(e.code==="ENOENT")return a(null,{srcStat:r,destStat:p});return a(e)}return a(null,{srcStat:r,destStat:t})}))}))}function checkPaths(e,t,a){checkStats(e,t,((n,r)=>{if(n)return a(n);const{srcStat:i,destStat:s}=r;if(s.ino&&s.ino===i.ino){return a(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&isSrcSubdir(e,t)){return a(new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`))}return a(null,s)}))}e.exports=copy},5494:(e,t,a)=>{"use strict";const n=a(2171).S;e.exports={copy:n(a(9761))}},4832:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(9896);const i=a(6928);const s=a(1063);const o=a(4099);const p=n((function emptyDir(e,t){t=t||function(){};r.readdir(e,((a,n)=>{if(a)return s.mkdirs(e,t);n=n.map((t=>i.join(e,t)));deleteItem();function deleteItem(){const e=n.pop();if(!e)return t();o.remove(e,(e=>{if(e)return t(e);deleteItem()}))}}))}));function emptyDirSync(e){let t;try{t=r.readdirSync(e)}catch(t){return s.mkdirsSync(e)}t.forEach((t=>{t=i.join(e,t);o.removeSync(t)}))}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:p,emptydir:p}},4363:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(6928);const i=a(5158);const s=a(1063);const o=a(2535).pathExists;function createFile(e,t){function makeFile(){i.writeFile(e,"",(e=>{if(e)return t(e);t()}))}i.stat(e,((a,n)=>{if(!a&&n.isFile())return t();const i=r.dirname(e);o(i,((e,a)=>{if(e)return t(e);if(a)return makeFile();s.mkdirs(i,(e=>{if(e)return t(e);makeFile()}))}))}))}function createFileSync(e){let t;try{t=i.statSync(e)}catch(e){}if(t&&t.isFile())return;const a=r.dirname(e);if(!i.existsSync(a)){s.mkdirsSync(a)}i.writeFileSync(e,"")}e.exports={createFile:n(createFile),createFileSync:createFileSync}},8937:(e,t,a)=>{"use strict";const n=a(4363);const r=a(2469);const i=a(1638);e.exports={createFile:n.createFile,createFileSync:n.createFileSync,ensureFile:n.createFile,ensureFileSync:n.createFileSync,createLink:r.createLink,createLinkSync:r.createLinkSync,ensureLink:r.createLink,ensureLinkSync:r.createLinkSync,createSymlink:i.createSymlink,createSymlinkSync:i.createSymlinkSync,ensureSymlink:i.createSymlink,ensureSymlinkSync:i.createSymlinkSync}},2469:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(6928);const i=a(5158);const s=a(1063);const o=a(2535).pathExists;function createLink(e,t,a){function makeLink(e,t){i.link(e,t,(e=>{if(e)return a(e);a(null)}))}o(t,((n,p)=>{if(n)return a(n);if(p)return a(null);i.lstat(e,(n=>{if(n){n.message=n.message.replace("lstat","ensureLink");return a(n)}const i=r.dirname(t);o(i,((n,r)=>{if(n)return a(n);if(r)return makeLink(e,t);s.mkdirs(i,(n=>{if(n)return a(n);makeLink(e,t)}))}))}))}))}function createLinkSync(e,t){const a=i.existsSync(t);if(a)return undefined;try{i.lstatSync(e)}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const n=r.dirname(t);const o=i.existsSync(n);if(o)return i.linkSync(e,t);s.mkdirsSync(n);return i.linkSync(e,t)}e.exports={createLink:n(createLink),createLinkSync:createLinkSync}},7355:(e,t,a)=>{"use strict";const n=a(6928);const r=a(5158);const i=a(2535).pathExists;function symlinkPaths(e,t,a){if(n.isAbsolute(e)){return r.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return a(t)}return a(null,{toCwd:e,toDst:e})}))}else{const s=n.dirname(t);const o=n.join(s,e);return i(o,((t,i)=>{if(t)return a(t);if(i){return a(null,{toCwd:o,toDst:e})}else{return r.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return a(t)}return a(null,{toCwd:e,toDst:n.relative(s,e)})}))}}))}}function symlinkPathsSync(e,t){let a;if(n.isAbsolute(e)){a=r.existsSync(e);if(!a)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const i=n.dirname(t);const s=n.join(i,e);a=r.existsSync(s);if(a){return{toCwd:s,toDst:e}}else{a=r.existsSync(e);if(!a)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:n.relative(i,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},3135:(e,t,a)=>{"use strict";const n=a(5158);function symlinkType(e,t,a){a=typeof t==="function"?t:a;t=typeof t==="function"?false:t;if(t)return a(null,t);n.lstat(e,((e,n)=>{if(e)return a(null,"file");t=n&&n.isDirectory()?"dir":"file";a(null,t)}))}function symlinkTypeSync(e,t){let a;if(t)return t;try{a=n.lstatSync(e)}catch(e){return"file"}return a&&a.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},1638:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(6928);const i=a(5158);const s=a(1063);const o=s.mkdirs;const p=s.mkdirsSync;const l=a(7355);const d=l.symlinkPaths;const c=l.symlinkPathsSync;const u=a(3135);const f=u.symlinkType;const m=u.symlinkTypeSync;const h=a(2535).pathExists;function createSymlink(e,t,a,n){n=typeof a==="function"?a:n;a=typeof a==="function"?false:a;h(t,((s,p)=>{if(s)return n(s);if(p)return n(null);d(e,t,((s,p)=>{if(s)return n(s);e=p.toDst;f(p.toCwd,a,((a,s)=>{if(a)return n(a);const p=r.dirname(t);h(p,((a,r)=>{if(a)return n(a);if(r)return i.symlink(e,t,s,n);o(p,(a=>{if(a)return n(a);i.symlink(e,t,s,n)}))}))}))}))}))}function createSymlinkSync(e,t,a){const n=i.existsSync(t);if(n)return undefined;const s=c(e,t);e=s.toDst;a=m(s.toCwd,a);const o=r.dirname(t);const l=i.existsSync(o);if(l)return i.symlinkSync(e,t,a);p(o);return i.symlinkSync(e,t,a)}e.exports={createSymlink:n(createSymlink),createSymlinkSync:createSymlinkSync}},612:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(5158);const i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>typeof r[e]==="function"));Object.keys(r).forEach((e=>{if(e==="promises"){return}t[e]=r[e]}));i.forEach((e=>{t[e]=n(r[e])}));t.exists=function(e,t){if(typeof t==="function"){return r.exists(e,t)}return new Promise((t=>r.exists(e,t)))};t.read=function(e,t,a,n,i,s){if(typeof s==="function"){return r.read(e,t,a,n,i,s)}return new Promise(((s,o)=>{r.read(e,t,a,n,i,((e,t,a)=>{if(e)return o(e);s({bytesRead:t,buffer:a})}))}))};t.write=function(e,t,...a){if(typeof a[a.length-1]==="function"){return r.write(e,t,...a)}return new Promise(((n,i)=>{r.write(e,t,...a,((e,t,a)=>{if(e)return i(e);n({bytesWritten:t,buffer:a})}))}))}},6954:(e,t,a)=>{"use strict";e.exports=Object.assign({},a(612),a(6942),a(5494),a(4832),a(8937),a(5553),a(1063),a(3526),a(782),a(4338),a(2535),a(4099));const n=a(9896);if(Object.getOwnPropertyDescriptor(n,"promises")){Object.defineProperty(e.exports,"promises",{get(){return n.promises}})}},5553:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(4741);r.outputJson=n(a(2851));r.outputJsonSync=a(3251);r.outputJSON=r.outputJson;r.outputJSONSync=r.outputJsonSync;r.writeJSON=r.writeJson;r.writeJSONSync=r.writeJsonSync;r.readJSON=r.readJson;r.readJSONSync=r.readJsonSync;e.exports=r},4741:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(433);e.exports={readJson:n(r.readFile),readJsonSync:r.readFileSync,writeJson:n(r.writeFile),writeJsonSync:r.writeFileSync}},3251:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(1063);const s=a(4741);function outputJsonSync(e,t,a){const o=r.dirname(e);if(!n.existsSync(o)){i.mkdirsSync(o)}s.writeJsonSync(e,t,a)}e.exports=outputJsonSync},2851:(e,t,a)=>{"use strict";const n=a(6928);const r=a(1063);const i=a(2535).pathExists;const s=a(4741);function outputJson(e,t,a,o){if(typeof a==="function"){o=a;a={}}const p=n.dirname(e);i(p,((n,i)=>{if(n)return o(n);if(i)return s.writeJson(e,t,a,o);r.mkdirs(p,(n=>{if(n)return o(n);s.writeJson(e,t,a,o)}))}))}e.exports=outputJson},1063:(e,t,a)=>{"use strict";const n=a(2171).S;const r=n(a(9563));const i=a(603);e.exports={mkdirs:r,mkdirsSync:i,mkdirp:r,mkdirpSync:i,ensureDir:r,ensureDirSync:i}},603:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(2832).invalidWin32Path;const s=parseInt("0777",8);function mkdirsSync(e,t,a){if(!t||typeof t!=="object"){t={mode:t}}let o=t.mode;const p=t.fs||n;if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";throw t}if(o===undefined){o=s&~process.umask()}if(!a)a=null;e=r.resolve(e);try{p.mkdirSync(e,o);a=a||e}catch(n){if(n.code==="ENOENT"){if(r.dirname(e)===e)throw n;a=mkdirsSync(r.dirname(e),t,a);mkdirsSync(e,t,a)}else{let t;try{t=p.statSync(e)}catch(e){throw n}if(!t.isDirectory())throw n}}return a}e.exports=mkdirsSync},9563:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(2832).invalidWin32Path;const s=parseInt("0777",8);function mkdirs(e,t,a,o){if(typeof t==="function"){a=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";return a(t)}let p=t.mode;const l=t.fs||n;if(p===undefined){p=s&~process.umask()}if(!o)o=null;a=a||function(){};e=r.resolve(e);l.mkdir(e,p,(n=>{if(!n){o=o||e;return a(null,o)}switch(n.code){case"ENOENT":if(r.dirname(e)===e)return a(n);mkdirs(r.dirname(e),t,((n,r)=>{if(n)a(n,r);else mkdirs(e,t,a,r)}));break;default:l.stat(e,((e,t)=>{if(e||!t.isDirectory())a(n,o);else a(null,o)}));break}}))}e.exports=mkdirs},2832:(e,t,a)=>{"use strict";const n=a(6928);function getRootPath(e){e=n.normalize(n.resolve(e)).split(n.sep);if(e.length>0)return e[0];return null}const r=/[<>:"|?*]/;function invalidWin32Path(e){const t=getRootPath(e);e=e.replace(t,"");return r.test(e)}e.exports={getRootPath:getRootPath,invalidWin32Path:invalidWin32Path}},3526:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(6942).copySync;const s=a(4099).removeSync;const o=a(1063).mkdirsSync;const p=a(1925);function moveSync(e,t,a){a=a||{};const i=a.overwrite||a.clobber||false;e=r.resolve(e);t=r.resolve(t);if(e===t)return n.accessSync(e);if(isSrcSubdir(e,t))throw new Error(`Cannot move '${e}' into itself '${t}'.`);o(r.dirname(t));tryRenameSync();function tryRenameSync(){if(i){try{return n.renameSync(e,t)}catch(n){if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"){s(t);a.overwrite=false;return moveSync(e,t,a)}if(n.code!=="EXDEV")throw n;return moveSyncAcrossDevice(e,t,i)}}else{try{n.linkSync(e,t);return n.unlinkSync(e)}catch(a){if(a.code==="EXDEV"||a.code==="EISDIR"||a.code==="EPERM"||a.code==="ENOTSUP"){return moveSyncAcrossDevice(e,t,i)}throw a}}}}function moveSyncAcrossDevice(e,t,a){const r=n.statSync(e);if(r.isDirectory()){return moveDirSyncAcrossDevice(e,t,a)}else{return moveFileSyncAcrossDevice(e,t,a)}}function moveFileSyncAcrossDevice(e,t,a){const r=64*1024;const i=p(r);const s=a?"w":"wx";const o=n.openSync(e,"r");const l=n.fstatSync(o);const d=n.openSync(t,s,l.mode);let c=0;while(c<l.size){const e=n.readSync(o,i,0,r,c);n.writeSync(d,i,0,e);c+=e}n.closeSync(o);n.closeSync(d);return n.unlinkSync(e)}function moveDirSyncAcrossDevice(e,t,a){const n={overwrite:false};if(a){s(t);tryCopySync()}else{tryCopySync()}function tryCopySync(){i(e,t,n);return s(e)}}function isSrcSubdir(e,t){try{return n.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(r.dirname(e)+r.sep)[1].split(r.sep)[0]===r.basename(e)}catch(e){return false}}e.exports={moveSync:moveSync}},782:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(5158);const i=a(6928);const s=a(5494).copy;const o=a(4099).remove;const p=a(1063).mkdirp;const l=a(2535).pathExists;function move(e,t,a,n){if(typeof a==="function"){n=a;a={}}const s=a.overwrite||a.clobber||false;e=i.resolve(e);t=i.resolve(t);if(e===t)return r.access(e,n);r.stat(e,((a,r)=>{if(a)return n(a);if(r.isDirectory()&&isSrcSubdir(e,t)){return n(new Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`))}p(i.dirname(t),(a=>{if(a)return n(a);return doRename(e,t,s,n)}))}))}function doRename(e,t,a,n){if(a){return o(t,(r=>{if(r)return n(r);return rename(e,t,a,n)}))}l(t,((r,i)=>{if(r)return n(r);if(i)return n(new Error("dest already exists."));return rename(e,t,a,n)}))}function rename(e,t,a,n){r.rename(e,t,(r=>{if(!r)return n();if(r.code!=="EXDEV")return n(r);return moveAcrossDevice(e,t,a,n)}))}function moveAcrossDevice(e,t,a,n){const r={overwrite:a,errorOnExist:true};s(e,t,r,(t=>{if(t)return n(t);return o(e,n)}))}function isSrcSubdir(e,t){const a=e.split(i.sep);const n=t.split(i.sep);return a.reduce(((e,t,a)=>e&&n[a]===t),true)}e.exports={move:n(move)}},4338:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(5158);const i=a(6928);const s=a(1063);const o=a(2535).pathExists;function outputFile(e,t,a,n){if(typeof a==="function"){n=a;a="utf8"}const p=i.dirname(e);o(p,((i,o)=>{if(i)return n(i);if(o)return r.writeFile(e,t,a,n);s.mkdirs(p,(i=>{if(i)return n(i);r.writeFile(e,t,a,n)}))}))}function outputFileSync(e,...t){const a=i.dirname(e);if(r.existsSync(a)){return r.writeFileSync(e,...t)}s.mkdirsSync(a);r.writeFileSync(e,...t)}e.exports={outputFile:n(outputFile),outputFileSync:outputFileSync}},2535:(e,t,a)=>{"use strict";const n=a(2171).z;const r=a(612);function pathExists(e){return r.access(e).then((()=>true)).catch((()=>false))}e.exports={pathExists:n(pathExists),pathExistsSync:r.existsSync}},4099:(e,t,a)=>{"use strict";const n=a(2171).S;const r=a(1250);e.exports={remove:n(r),removeSync:r.sync}},1250:(e,t,a)=>{"use strict";const n=a(5158);const r=a(6928);const i=a(2613);const s=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||n[t];t=t+"Sync";e[t]=e[t]||n[t]}));e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,a){let n=0;if(typeof t==="function"){a=t;t={}}i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i.strictEqual(typeof a,"function","rimraf: callback function required");i(t,"rimraf: invalid options argument provided");i.strictEqual(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,(function CB(r){if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&n<t.maxBusyTries){n++;const a=n*100;return setTimeout((()=>rimraf_(e,t,CB)),a)}if(r.code==="ENOENT")r=null}a(r)}))}function rimraf_(e,t,a){i(e);i(t);i(typeof a==="function");t.lstat(e,((n,r)=>{if(n&&n.code==="ENOENT"){return a(null)}if(n&&n.code==="EPERM"&&s){return fixWinEPERM(e,t,n,a)}if(r&&r.isDirectory()){return rmdir(e,t,n,a)}t.unlink(e,(n=>{if(n){if(n.code==="ENOENT"){return a(null)}if(n.code==="EPERM"){return s?fixWinEPERM(e,t,n,a):rmdir(e,t,n,a)}if(n.code==="EISDIR"){return rmdir(e,t,n,a)}}return a(n)}))}))}function fixWinEPERM(e,t,a,n){i(e);i(t);i(typeof n==="function");if(a){i(a instanceof Error)}t.chmod(e,438,(r=>{if(r){n(r.code==="ENOENT"?null:a)}else{t.stat(e,((r,i)=>{if(r){n(r.code==="ENOENT"?null:a)}else if(i.isDirectory()){rmdir(e,t,a,n)}else{t.unlink(e,n)}}))}}))}function fixWinEPERMSync(e,t,a){let n;i(e);i(t);if(a){i(a instanceof Error)}try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw a}}try{n=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw a}}if(n.isDirectory()){rmdirSync(e,t,a)}else{t.unlinkSync(e)}}function rmdir(e,t,a,n){i(e);i(t);if(a){i(a instanceof Error)}i(typeof n==="function");t.rmdir(e,(r=>{if(r&&(r.code==="ENOTEMPTY"||r.code==="EEXIST"||r.code==="EPERM")){rmkids(e,t,n)}else if(r&&r.code==="ENOTDIR"){n(a)}else{n(r)}}))}function rmkids(e,t,a){i(e);i(t);i(typeof a==="function");t.readdir(e,((n,i)=>{if(n)return a(n);let s=i.length;let o;if(s===0)return t.rmdir(e,a);i.forEach((n=>{rimraf(r.join(e,n),t,(n=>{if(o){return}if(n)return a(o=n);if(--s===0){t.rmdir(e,a)}}))}))}))}function rimrafSync(e,t){let a;t=t||{};defaults(t);i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i(t,"rimraf: missing options");i.strictEqual(typeof t,"object","rimraf: options should be object");try{a=t.lstatSync(e)}catch(a){if(a.code==="ENOENT"){return}if(a.code==="EPERM"&&s){fixWinEPERMSync(e,t,a)}}try{if(a&&a.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(a){if(a.code==="ENOENT"){return}else if(a.code==="EPERM"){return s?fixWinEPERMSync(e,t,a):rmdirSync(e,t,a)}else if(a.code!=="EISDIR"){throw a}rmdirSync(e,t,a)}}function rmdirSync(e,t,a){i(e);i(t);if(a){i(a instanceof Error)}try{t.rmdirSync(e)}catch(n){if(n.code==="ENOTDIR"){throw a}else if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"){rmkidsSync(e,t)}else if(n.code!=="ENOENT"){throw n}}}function rmkidsSync(e,t){i(e);i(t);t.readdirSync(e).forEach((a=>rimrafSync(r.join(e,a),t)));if(s){const a=Date.now();do{try{const a=t.rmdirSync(e,t);return a}catch(e){}}while(Date.now()-a<500)}else{const a=t.rmdirSync(e,t);return a}}e.exports=rimraf;rimraf.sync=rimrafSync},1925:e=>{"use strict";e.exports=function(e){if(typeof Buffer.allocUnsafe==="function"){try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}}return new Buffer(e)}},4668:(e,t,a)=>{"use strict";const n=a(5158);const r=a(857);const i=a(6928);function hasMillisResSync(){let e=i.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=i.join(r.tmpdir(),e);const t=new Date(1435410243862);n.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");const a=n.openSync(e,"r+");n.futimesSync(a,t,t);n.closeSync(a);return n.statSync(e).mtime>1435410243e3}function hasMillisRes(e){let t=i.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));t=i.join(r.tmpdir(),t);const a=new Date(1435410243862);n.writeFile(t,"https://github.com/jprichardson/node-fs-extra/pull/141",(r=>{if(r)return e(r);n.open(t,"r+",((r,i)=>{if(r)return e(r);n.futimes(i,a,a,(a=>{if(a)return e(a);n.close(i,(a=>{if(a)return e(a);n.stat(t,((t,a)=>{if(t)return e(t);e(null,a.mtime>1435410243e3)}))}))}))}))}))}function timeRemoveMillis(e){if(typeof e==="number"){return Math.floor(e/1e3)*1e3}else if(e instanceof Date){return new Date(Math.floor(e.getTime()/1e3)*1e3)}else{throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}}function utimesMillis(e,t,a,r){n.open(e,"r+",((e,i)=>{if(e)return r(e);n.futimes(i,t,a,(e=>{n.close(i,(t=>{if(r)r(e||t)}))}))}))}function utimesMillisSync(e,t,a){const r=n.openSync(e,"r+");n.futimesSync(r,t,a);return n.closeSync(r)}e.exports={hasMillisRes:hasMillisRes,hasMillisResSync:hasMillisResSync,timeRemoveMillis:timeRemoveMillis,utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},433:(e,t,a)=>{var n;try{n=a(5158)}catch(e){n=a(9896)}function readFile(e,t,a){if(a==null){a=t;t={}}if(typeof t==="string"){t={encoding:t}}t=t||{};var r=t.fs||n;var i=true;if("throws"in t){i=t.throws}r.readFile(e,t,(function(n,r){if(n)return a(n);r=stripBom(r);var s;try{s=JSON.parse(r,t?t.reviver:null)}catch(t){if(i){t.message=e+": "+t.message;return a(t)}else{return a(null,null)}}a(null,s)}))}function readFileSync(e,t){t=t||{};if(typeof t==="string"){t={encoding:t}}var a=t.fs||n;var r=true;if("throws"in t){r=t.throws}try{var i=a.readFileSync(e,t);i=stripBom(i);return JSON.parse(i,t.reviver)}catch(t){if(r){t.message=e+": "+t.message;throw t}else{return null}}}function stringify(e,t){var a;var n="\n";if(typeof t==="object"&&t!==null){if(t.spaces){a=t.spaces}if(t.EOL){n=t.EOL}}var r=JSON.stringify(e,t?t.replacer:null,a);return r.replace(/\n/g,n)+n}function writeFile(e,t,a,r){if(r==null){r=a;a={}}a=a||{};var i=a.fs||n;var s="";try{s=stringify(t,a)}catch(e){if(r)r(e,null);return}i.writeFile(e,s,a,r)}function writeFileSync(e,t,a){a=a||{};var r=a.fs||n;var i=stringify(t,a);return r.writeFileSync(e,i,a)}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");e=e.replace(/^\uFEFF/,"");return e}var r={readFile:readFile,readFileSync:readFileSync,writeFile:writeFile,writeFileSync:writeFileSync};e.exports=r},2171:(e,t)=>{"use strict";t.S=function(e){return Object.defineProperty((function(){if(typeof arguments[arguments.length-1]==="function")e.apply(this,arguments);else{return new Promise(((t,a)=>{arguments[arguments.length]=(e,n)=>{if(e)return a(e);t(n)};arguments.length++;e.apply(this,arguments)}))}}),"name",{value:e.name})};t.z=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if(typeof t!=="function")return e.apply(this,arguments);else e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},7830:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var a={__proto__:t(e)};else var a=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(e,t))}));return a}},5158:(e,t,a)=>{var n=a(9896);var r=a(5055);var i=a(7540);var s=a(7830);var o=a(9023);var p;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){p=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{p="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,p,{get:function(){return t}})}var d=noop;if(o.debuglog)d=o.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))d=function(){var e=o.format.apply(o,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!n[p]){var c=global[p]||[];publishQueue(n,c);n.close=function(e){function close(t,a){return e.call(n,t,(function(e){if(!e){resetQueue()}if(typeof a==="function")a.apply(this,arguments)}))}Object.defineProperty(close,l,{value:e});return close}(n.close);n.closeSync=function(e){function closeSync(t){e.apply(n,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:e});return closeSync}(n.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){d(n[p]);a(2613).equal(n[p].length,0)}))}}if(!global[p]){publishQueue(global,n[p])}e.exports=patch(s(n));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched){e.exports=patch(n);n.__patched=true}function patch(e){r(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,a,n){if(typeof a==="function")n=a,a=null;return go$readFile(e,a,n);function go$readFile(e,a,n,r){return t(e,a,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,a,n],t,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var a=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,n,r){if(typeof n==="function")r=n,n=null;return go$writeFile(e,t,n,r);function go$writeFile(e,t,n,r,i){return a(e,t,n,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$writeFile,[e,t,n,r],a,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var n=e.appendFile;if(n)e.appendFile=appendFile;function appendFile(e,t,a,r){if(typeof a==="function")r=a,a=null;return go$appendFile(e,t,a,r);function go$appendFile(e,t,a,r,i){return n(e,t,a,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$appendFile,[e,t,a,r],n,i||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var s=e.copyFile;if(s)e.copyFile=copyFile;function copyFile(e,t,a,n){if(typeof a==="function"){n=a;a=0}return go$copyFile(e,t,a,n);function go$copyFile(e,t,a,n,r){return s(e,t,a,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$copyFile,[e,t,a,n],i,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var o=e.readdir;e.readdir=readdir;var p=/^v[0-5]\./;function readdir(e,t,a){if(typeof t==="function")a=t,t=null;var n=p.test(process.version)?function go$readdir(e,t,a,n){return o(e,fs$readdirCallback(e,t,a,n))}:function go$readdir(e,t,a,n){return o(e,t,fs$readdirCallback(e,t,a,n))};return n(e,t,a);function fs$readdirCallback(e,t,a,r){return function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([n,[e,t,a],i,r||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof a==="function")a.call(this,i,s)}}}}if(process.version.substr(0,4)==="v0.8"){var l=i(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var d=e.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var c=e.WriteStream;if(c){WriteStream.prototype=Object.create(c.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var u=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:true,configurable:true});var f=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,a){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=a;e.emit("open",a);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return c.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,a){if(t){e.destroy();e.emit("error",t)}else{e.fd=a;e.emit("open",a)}}))}function createReadStream(t,a){return new e.ReadStream(t,a)}function createWriteStream(t,a){return new e.WriteStream(t,a)}var m=e.open;e.open=open;function open(e,t,a,n){if(typeof a==="function")n=a,a=null;return go$open(e,t,a,n);function go$open(e,t,a,n,r){return m(e,t,a,(function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$open,[e,t,a,n],i,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}return e}function enqueue(e){d("ENQUEUE",e[0].name,e[1]);n[p].push(e);retry()}var u;function resetQueue(){var e=Date.now();for(var t=0;t<n[p].length;++t){if(n[p][t].length>2){n[p][t][3]=e;n[p][t][4]=e}}retry()}function retry(){clearTimeout(u);u=undefined;if(n[p].length===0)return;var e=n[p].shift();var t=e[0];var a=e[1];var r=e[2];var i=e[3];var s=e[4];if(i===undefined){d("RETRY",t.name,a);t.apply(null,a)}else if(Date.now()-i>=6e4){d("TIMEOUT",t.name,a);var o=a.pop();if(typeof o==="function")o.call(null,r)}else{var l=Date.now()-s;var c=Math.max(s-i,1);var f=Math.min(c*1.2,100);if(l>=f){d("RETRY",t.name,a);t.apply(null,a.concat([i]))}else{n[p].push(e)}}if(u===undefined){u=setTimeout(retry,0)}}},7540:(e,t,a)=>{var n=a(2203).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,a){if(!(this instanceof ReadStream))return new ReadStream(t,a);n.call(this);var r=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;a=a||{};var i=Object.keys(a);for(var s=0,o=i.length;s<o;s++){var p=i[s];this[p]=a[p]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){r._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){r.emit("error",e);r.readable=false;return}r.fd=t;r.emit("open",t);r._read()}))}function WriteStream(t,a){if(!(this instanceof WriteStream))return new WriteStream(t,a);n.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;a=a||{};var r=Object.keys(a);for(var i=0,s=r.length;i<s;i++){var o=r[i];this[o]=a[o]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},5055:(e,t,a)=>{var n=a(9140);var r=process.cwd;var i=null;var s=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!i)i=r.call(process);return i};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var o=process.chdir;process.chdir=function(e){i=null;o.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,o)}e.exports=patch;function patch(e){if(n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,a){if(a)process.nextTick(a)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,a,n){if(n)process.nextTick(n)};e.lchownSync=function(){}}if(s==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(a,n,r){var i=Date.now();var s=0;t(a,n,(function CB(o){if(o&&(o.code==="EACCES"||o.code==="EPERM"||o.code==="EBUSY")&&Date.now()-i<6e4){setTimeout((function(){e.stat(n,(function(e,i){if(e&&e.code==="ENOENT")t(a,n,CB);else r(o)}))}),s);if(s<100)s+=10;return}if(r)r(o)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(a,n,r,i,s,o){var p;if(o&&typeof o==="function"){var l=0;p=function(d,c,u){if(d&&d.code==="EAGAIN"&&l<10){l++;return t.call(e,a,n,r,i,s,p)}o.apply(this,arguments)}}return t.call(e,a,n,r,i,s,p)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(a,n,r,i,s){var o=0;while(true){try{return t.call(e,a,n,r,i,s)}catch(e){if(e.code==="EAGAIN"&&o<10){o++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,a,r){e.open(t,n.O_WRONLY|n.O_SYMLINK,a,(function(t,n){if(t){if(r)r(t);return}e.fchmod(n,a,(function(t){e.close(n,(function(e){if(r)r(t||e)}))}))}))};e.lchmodSync=function(t,a){var r=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,a);var i=true;var s;try{s=e.fchmodSync(r,a);i=false}finally{if(i){try{e.closeSync(r)}catch(e){}}else{e.closeSync(r)}}return s}}function patchLutimes(e){if(n.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,a,r,i){e.open(t,n.O_SYMLINK,(function(t,n){if(t){if(i)i(t);return}e.futimes(n,a,r,(function(t){e.close(n,(function(e){if(i)i(t||e)}))}))}))};e.lutimesSync=function(t,a,r){var i=e.openSync(t,n.O_SYMLINK);var s;var o=true;try{s=e.futimesSync(i,a,r);o=false}finally{if(o){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return s}}else if(e.futimes){e.lutimes=function(e,t,a,n){if(n)process.nextTick(n)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(a,n,r){return t.call(e,a,n,(function(e){if(chownErOk(e))e=null;if(r)r.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(a,n){try{return t.call(e,a,n)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(a,n,r,i){return t.call(e,a,n,r,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(a,n,r){try{return t.call(e,a,n,r)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(a,n,r){if(typeof n==="function"){r=n;n=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(r)r.apply(this,arguments)}return n?t.call(e,a,n,callback):t.call(e,a,callback)}}function statFixSync(t){if(!t)return t;return function(a,n){var r=n?t.call(e,a,n):t.call(e,a);if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}return r}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},3372:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t._dbcs=DBCSCodec;var r=-1,i=-2,s=-10,o=-1e3,p=new Array(256),l=-1;for(var d=0;d<256;d++)p[d]=r;function DBCSCodec(e,t){this.encodingName=e.encodingName;if(!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var a=e.table();this.decodeTables=[];this.decodeTables[0]=p.slice(0);this.decodeTableSeq=[];for(var n=0;n<a.length;n++)this._addDecodeChunk(a[n]);if(typeof e.gb18030==="function"){this.gb18030=e.gb18030();var s=this.decodeTables.length;this.decodeTables.push(p.slice(0));var l=this.decodeTables.length;this.decodeTables.push(p.slice(0));var d=this.decodeTables[0];for(var n=129;n<=254;n++){var c=this.decodeTables[o-d[n]];for(var u=48;u<=57;u++){if(c[u]===r){c[u]=o-s}else if(c[u]>o){throw new Error("gb18030 decode tables conflict at byte 2")}var f=this.decodeTables[o-c[u]];for(var m=129;m<=254;m++){if(f[m]===r){f[m]=o-l}else if(f[m]===o-l){continue}else if(f[m]>o){throw new Error("gb18030 decode tables conflict at byte 3")}var h=this.decodeTables[o-f[m]];for(var v=48;v<=57;v++){if(h[v]===r)h[v]=i}}}}}this.defaultCharUnicode=t.defaultCharUnicode;this.encodeTable=[];this.encodeTableSeq=[];var g={};if(e.encodeSkipVals)for(var n=0;n<e.encodeSkipVals.length;n++){var y=e.encodeSkipVals[n];if(typeof y==="number")g[y]=true;else for(var u=y.from;u<=y.to;u++)g[u]=true}this._fillEncodeTable(0,0,g);if(e.encodeAdd){for(var b in e.encodeAdd)if(Object.prototype.hasOwnProperty.call(e.encodeAdd,b))this._setEncodeChar(b.charCodeAt(0),e.encodeAdd[b])}this.defCharSB=this.encodeTable[0][t.defaultCharSingleByte.charCodeAt(0)];if(this.defCharSB===r)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===r)this.defCharSB="?".charCodeAt(0)}DBCSCodec.prototype.encoder=DBCSEncoder;DBCSCodec.prototype.decoder=DBCSDecoder;DBCSCodec.prototype._getDecodeTrieNode=function(e){var t=[];for(;e>0;e>>>=8)t.push(e&255);if(t.length==0)t.push(0);var a=this.decodeTables[0];for(var n=t.length-1;n>0;n--){var i=a[t[n]];if(i==r){a[t[n]]=o-this.decodeTables.length;this.decodeTables.push(a=p.slice(0))}else if(i<=o){a=this.decodeTables[o-i]}else throw new Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16))}return a};DBCSCodec.prototype._addDecodeChunk=function(e){var t=parseInt(e[0],16);var a=this._getDecodeTrieNode(t);t=t&255;for(var n=1;n<e.length;n++){var r=e[n];if(typeof r==="string"){for(var i=0;i<r.length;){var o=r.charCodeAt(i++);if(55296<=o&&o<56320){var p=r.charCodeAt(i++);if(56320<=p&&p<57344)a[t++]=65536+(o-55296)*1024+(p-56320);else throw new Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+e[0])}else if(4080<o&&o<=4095){var l=4095-o+2;var d=[];for(var c=0;c<l;c++)d.push(r.charCodeAt(i++));a[t++]=s-this.decodeTableSeq.length;this.decodeTableSeq.push(d)}else a[t++]=o}}else if(typeof r==="number"){var u=a[t-1]+1;for(var i=0;i<r;i++)a[t++]=u++}else throw new Error("Incorrect type '"+typeof r+"' given in "+this.encodingName+" at chunk "+e[0])}if(t>255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t)};DBCSCodec.prototype._getEncodeBucket=function(e){var t=e>>8;if(this.encodeTable[t]===undefined)this.encodeTable[t]=p.slice(0);return this.encodeTable[t]};DBCSCodec.prototype._setEncodeChar=function(e,t){var a=this._getEncodeBucket(e);var n=e&255;if(a[n]<=s)this.encodeTableSeq[s-a[n]][l]=t;else if(a[n]==r)a[n]=t};DBCSCodec.prototype._setEncodeSequence=function(e,t){var a=e[0];var n=this._getEncodeBucket(a);var i=a&255;var o;if(n[i]<=s){o=this.encodeTableSeq[s-n[i]]}else{o={};if(n[i]!==r)o[l]=n[i];n[i]=s-this.encodeTableSeq.length;this.encodeTableSeq.push(o)}for(var p=1;p<e.length-1;p++){var d=o[a];if(typeof d==="object")o=d;else{o=o[a]={};if(d!==undefined)o[l]=d}}a=e[e.length-1];o[a]=t};DBCSCodec.prototype._fillEncodeTable=function(e,t,a){var n=this.decodeTables[e];var r=false;var i={};for(var p=0;p<256;p++){var l=n[p];var d=t+p;if(a[d])continue;if(l>=0){this._setEncodeChar(l,d);r=true}else if(l<=o){var c=o-l;if(!i[c]){var u=d<<8>>>0;if(this._fillEncodeTable(c,u,a))r=true;else i[c]=true}}else if(l<=s){this._setEncodeSequence(this.decodeTableSeq[s-l],d);r=true}}return r};function DBCSEncoder(e,t){this.leadSurrogate=-1;this.seqObj=undefined;this.encodeTable=t.encodeTable;this.encodeTableSeq=t.encodeTableSeq;this.defaultCharSingleByte=t.defCharSB;this.gb18030=t.gb18030}DBCSEncoder.prototype.write=function(e){var t=n.alloc(e.length*(this.gb18030?4:3)),a=this.leadSurrogate,i=this.seqObj,o=-1,p=0,d=0;while(true){if(o===-1){if(p==e.length)break;var c=e.charCodeAt(p++)}else{var c=o;o=-1}if(55296<=c&&c<57344){if(c<56320){if(a===-1){a=c;continue}else{a=c;c=r}}else{if(a!==-1){c=65536+(a-55296)*1024+(c-56320);a=-1}else{c=r}}}else if(a!==-1){o=c;c=r;a=-1}var u=r;if(i!==undefined&&c!=r){var f=i[c];if(typeof f==="object"){i=f;continue}else if(typeof f=="number"){u=f}else if(f==undefined){f=i[l];if(f!==undefined){u=f;o=c}else{}}i=undefined}else if(c>=0){var m=this.encodeTable[c>>8];if(m!==undefined)u=m[c&255];if(u<=s){i=this.encodeTableSeq[s-u];continue}if(u==r&&this.gb18030){var h=findIdx(this.gb18030.uChars,c);if(h!=-1){var u=this.gb18030.gbChars[h]+(c-this.gb18030.uChars[h]);t[d++]=129+Math.floor(u/12600);u=u%12600;t[d++]=48+Math.floor(u/1260);u=u%1260;t[d++]=129+Math.floor(u/10);u=u%10;t[d++]=48+u;continue}}}if(u===r)u=this.defaultCharSingleByte;if(u<256){t[d++]=u}else if(u<65536){t[d++]=u>>8;t[d++]=u&255}else if(u<16777216){t[d++]=u>>16;t[d++]=u>>8&255;t[d++]=u&255}else{t[d++]=u>>>24;t[d++]=u>>>16&255;t[d++]=u>>>8&255;t[d++]=u&255}}this.seqObj=i;this.leadSurrogate=a;return t.slice(0,d)};DBCSEncoder.prototype.end=function(){if(this.leadSurrogate===-1&&this.seqObj===undefined)return;var e=n.alloc(10),t=0;if(this.seqObj){var a=this.seqObj[l];if(a!==undefined){if(a<256){e[t++]=a}else{e[t++]=a>>8;e[t++]=a&255}}else{}this.seqObj=undefined}if(this.leadSurrogate!==-1){e[t++]=this.defaultCharSingleByte;this.leadSurrogate=-1}return e.slice(0,t)};DBCSEncoder.prototype.findIdx=findIdx;function DBCSDecoder(e,t){this.nodeIdx=0;this.prevBytes=[];this.decodeTables=t.decodeTables;this.decodeTableSeq=t.decodeTableSeq;this.defaultCharUnicode=t.defaultCharUnicode;this.gb18030=t.gb18030}DBCSDecoder.prototype.write=function(e){var t=n.alloc(e.length*2),a=this.nodeIdx,p=this.prevBytes,l=this.prevBytes.length,d=-this.prevBytes.length,c;for(var u=0,f=0;u<e.length;u++){var m=u>=0?e[u]:p[u+l];var c=this.decodeTables[a][m];if(c>=0){}else if(c===r){c=this.defaultCharUnicode.charCodeAt(0);u=d}else if(c===i){if(u>=3){var h=(e[u-3]-129)*12600+(e[u-2]-48)*1260+(e[u-1]-129)*10+(m-48)}else{var h=(p[u-3+l]-129)*12600+((u-2>=0?e[u-2]:p[u-2+l])-48)*1260+((u-1>=0?e[u-1]:p[u-1+l])-129)*10+(m-48)}var v=findIdx(this.gb18030.gbChars,h);c=this.gb18030.uChars[v]+h-this.gb18030.gbChars[v]}else if(c<=o){a=o-c;continue}else if(c<=s){var g=this.decodeTableSeq[s-c];for(var y=0;y<g.length-1;y++){c=g[y];t[f++]=c&255;t[f++]=c>>8}c=g[g.length-1]}else throw new Error("iconv-lite internal error: invalid decoding table value "+c+" at "+a+"/"+m);if(c>=65536){c-=65536;var b=55296|c>>10;t[f++]=b&255;t[f++]=b>>8;c=56320|c&1023}t[f++]=c&255;t[f++]=c>>8;a=0;d=u+1}this.nodeIdx=a;this.prevBytes=d>=0?Array.prototype.slice.call(e,d):p.slice(d+l).concat(Array.prototype.slice.call(e));return t.slice(0,f).toString("ucs2")};DBCSDecoder.prototype.end=function(){var e="";while(this.prevBytes.length>0){e+=this.defaultCharUnicode;var t=this.prevBytes.slice(1);this.prevBytes=[];this.nodeIdx=0;if(t.length>0)e+=this.write(t)}this.prevBytes=[];this.nodeIdx=0;return e};function findIdx(e,t){if(e[0]>t)return-1;var a=0,n=e.length;while(a<n-1){var r=a+(n-a+1>>1);if(e[r]<=t)a=r;else n=r}return a}},4700:(e,t,a)=>{"use strict";e.exports={shiftjis:{type:"_dbcs",table:function(){return a(3851)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return a(4386)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return a(7004)}},gbk:{type:"_dbcs",table:function(){return a(7004).concat(a(5862))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return a(7004).concat(a(5862))},gb18030:function(){return a(7618)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return a(5970)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return a(7816)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return a(7816).concat(a(5263))},encodeSkipVals:[36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},7987:(e,t,a)=>{"use strict";var n=[a(725),a(9727),a(9617),a(2622),a(2679),a(3249),a(2105),a(3372),a(4700)];for(var r=0;r<n.length;r++){var i=n[r];for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s))t[s]=i[s]}},725:(e,t,a)=>{"use strict";var n=a(5237).Buffer;e.exports={utf8:{type:"_internal",bomAware:true},cesu8:{type:"_internal",bomAware:true},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:true},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:InternalCodec};function InternalCodec(e,t){this.enc=e.encodingName;this.bomAware=e.bomAware;if(this.enc==="base64")this.encoder=InternalEncoderBase64;else if(this.enc==="cesu8"){this.enc="utf8";this.encoder=InternalEncoderCesu8;if(n.from("eda0bdedb2a9","hex").toString()!=="💩"){this.decoder=InternalDecoderCesu8;this.defaultCharUnicode=t.defaultCharUnicode}}}InternalCodec.prototype.encoder=InternalEncoder;InternalCodec.prototype.decoder=InternalDecoder;var r=a(3193).StringDecoder;if(!r.prototype.end)r.prototype.end=function(){};function InternalDecoder(e,t){this.decoder=new r(t.enc)}InternalDecoder.prototype.write=function(e){if(!n.isBuffer(e)){e=n.from(e)}return this.decoder.write(e)};InternalDecoder.prototype.end=function(){return this.decoder.end()};function InternalEncoder(e,t){this.enc=t.enc}InternalEncoder.prototype.write=function(e){return n.from(e,this.enc)};InternalEncoder.prototype.end=function(){};function InternalEncoderBase64(e,t){this.prevStr=""}InternalEncoderBase64.prototype.write=function(e){e=this.prevStr+e;var t=e.length-e.length%4;this.prevStr=e.slice(t);e=e.slice(0,t);return n.from(e,"base64")};InternalEncoderBase64.prototype.end=function(){return n.from(this.prevStr,"base64")};function InternalEncoderCesu8(e,t){}InternalEncoderCesu8.prototype.write=function(e){var t=n.alloc(e.length*3),a=0;for(var r=0;r<e.length;r++){var i=e.charCodeAt(r);if(i<128)t[a++]=i;else if(i<2048){t[a++]=192+(i>>>6);t[a++]=128+(i&63)}else{t[a++]=224+(i>>>12);t[a++]=128+(i>>>6&63);t[a++]=128+(i&63)}}return t.slice(0,a)};InternalEncoderCesu8.prototype.end=function(){};function InternalDecoderCesu8(e,t){this.acc=0;this.contBytes=0;this.accBytes=0;this.defaultCharUnicode=t.defaultCharUnicode}InternalDecoderCesu8.prototype.write=function(e){var t=this.acc,a=this.contBytes,n=this.accBytes,r="";for(var i=0;i<e.length;i++){var s=e[i];if((s&192)!==128){if(a>0){r+=this.defaultCharUnicode;a=0}if(s<128){r+=String.fromCharCode(s)}else if(s<224){t=s&31;a=1;n=1}else if(s<240){t=s&15;a=2;n=1}else{r+=this.defaultCharUnicode}}else{if(a>0){t=t<<6|s&63;a--;n++;if(a===0){if(n===2&&t<128&&t>0)r+=this.defaultCharUnicode;else if(n===3&&t<2048)r+=this.defaultCharUnicode;else r+=String.fromCharCode(t)}}else{r+=this.defaultCharUnicode}}}this.acc=t;this.contBytes=a;this.accBytes=n;return r};InternalDecoderCesu8.prototype.end=function(){var e=0;if(this.contBytes>0)e+=this.defaultCharUnicode;return e}},2679:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t._sbcs=SBCSCodec;function SBCSCodec(e,t){if(!e)throw new Error("SBCS codec is called without the data.");if(!e.chars||e.chars.length!==128&&e.chars.length!==256)throw new Error("Encoding '"+e.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(e.chars.length===128){var a="";for(var r=0;r<128;r++)a+=String.fromCharCode(r);e.chars=a+e.chars}this.decodeBuf=n.from(e.chars,"ucs2");var i=n.alloc(65536,t.defaultCharSingleByte.charCodeAt(0));for(var r=0;r<e.chars.length;r++)i[e.chars.charCodeAt(r)]=r;this.encodeBuf=i}SBCSCodec.prototype.encoder=SBCSEncoder;SBCSCodec.prototype.decoder=SBCSDecoder;function SBCSEncoder(e,t){this.encodeBuf=t.encodeBuf}SBCSEncoder.prototype.write=function(e){var t=n.alloc(e.length);for(var a=0;a<e.length;a++)t[a]=this.encodeBuf[e.charCodeAt(a)];return t};SBCSEncoder.prototype.end=function(){};function SBCSDecoder(e,t){this.decodeBuf=t.decodeBuf}SBCSDecoder.prototype.write=function(e){var t=this.decodeBuf;var a=n.alloc(e.length*2);var r=0,i=0;for(var s=0;s<e.length;s++){r=e[s]*2;i=s*2;a[i]=t[r];a[i+1]=t[r+1]}return a.toString("ucs2")};SBCSDecoder.prototype.end=function(){}},2105:e=>{"use strict";e.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת���"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œں ،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûüے"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"
Ą˘Ł¤ĽŚ§¨ŠŞŤŹŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"
Ħ˘£¤�Ĥ§¨İŞĞĴ�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"
ĄĸŖ¤Ĩϧ¨ŠĒĢŦޝ°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"
ЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"
���¤�������،�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"
‘’£€₯¦§¨©ͺ«¬�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"
�¢£¤¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת���"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"
ĄĒĢĪĨͧĻĐŠŦŽŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"
กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"
”¢£¤„¦§Ø©Ŗ«¬®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"
Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"
¡¢£€¥Š§š©ª«¬®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"
ĄąŁ€„Чš©Ș«ŹźŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’±“¾¶§÷„°∙·¹³²■ "},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ "},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘§÷¸°¨˙űŘř■ "},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№ыЫзЗшШэЭщЩчЧ§■ "},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´±‗¾¶§÷¸°¨·¹³²■ "},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´±�¾¶§÷¸°¨·¹³²■ "},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ "},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"
ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"
¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"
ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"
¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"
�և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},3249:e=>{"use strict";e.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},cp720:{type:"_sbcs",chars:"éâàçêëèïîّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ "},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}},9617:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t.utf16be=Utf16BECodec;function Utf16BECodec(){}Utf16BECodec.prototype.encoder=Utf16BEEncoder;Utf16BECodec.prototype.decoder=Utf16BEDecoder;Utf16BECodec.prototype.bomAware=true;function Utf16BEEncoder(){}Utf16BEEncoder.prototype.write=function(e){var t=n.from(e,"ucs2");for(var a=0;a<t.length;a+=2){var r=t[a];t[a]=t[a+1];t[a+1]=r}return t};Utf16BEEncoder.prototype.end=function(){};function Utf16BEDecoder(){this.overflowByte=-1}Utf16BEDecoder.prototype.write=function(e){if(e.length==0)return"";var t=n.alloc(e.length+1),a=0,r=0;if(this.overflowByte!==-1){t[0]=e[0];t[1]=this.overflowByte;a=1;r=2}for(;a<e.length-1;a+=2,r+=2){t[r]=e[a+1];t[r+1]=e[a]}this.overflowByte=a==e.length-1?e[e.length-1]:-1;return t.slice(0,r).toString("ucs2")};Utf16BEDecoder.prototype.end=function(){this.overflowByte=-1};t.utf16=Utf16Codec;function Utf16Codec(e,t){this.iconv=t}Utf16Codec.prototype.encoder=Utf16Encoder;Utf16Codec.prototype.decoder=Utf16Decoder;function Utf16Encoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder("utf-16le",e)}Utf16Encoder.prototype.write=function(e){return this.encoder.write(e)};Utf16Encoder.prototype.end=function(){return this.encoder.end()};function Utf16Decoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf16Decoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<16)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var a="";for(var n=0;n<this.initialBufs.length;n++)a+=this.decoder.write(this.initialBufs[n]);this.initialBufs.length=this.initialBufsLen=0;return a}return this.decoder.write(e)};Utf16Decoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var a=0;a<this.initialBufs.length;a++)t+=this.decoder.write(this.initialBufs[a]);var n=this.decoder.end();if(n)t+=n;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var a=[];var n=0;var r=0,i=0;e:for(var s=0;s<e.length;s++){var o=e[s];for(var p=0;p<o.length;p++){a.push(o[p]);if(a.length===2){if(n===0){if(a[0]===255&&a[1]===254)return"utf-16le";if(a[0]===254&&a[1]===255)return"utf-16be"}if(a[0]===0&&a[1]!==0)i++;if(a[0]!==0&&a[1]===0)r++;a.length=0;n++;if(n>=100){break e}}}}if(i>r)return"utf-16be";if(i<r)return"utf-16le";return t||"utf-16le"}},9727:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t._utf32=Utf32Codec;function Utf32Codec(e,t){this.iconv=t;this.bomAware=true;this.isLE=e.isLE}t.utf32le={type:"_utf32",isLE:true};t.utf32be={type:"_utf32",isLE:false};t.ucs4le="utf32le";t.ucs4be="utf32be";Utf32Codec.prototype.encoder=Utf32Encoder;Utf32Codec.prototype.decoder=Utf32Decoder;function Utf32Encoder(e,t){this.isLE=t.isLE;this.highSurrogate=0}Utf32Encoder.prototype.write=function(e){var t=n.from(e,"ucs2");var a=n.alloc(t.length*2);var r=this.isLE?a.writeUInt32LE:a.writeUInt32BE;var i=0;for(var s=0;s<t.length;s+=2){var o=t.readUInt16LE(s);var p=55296<=o&&o<56320;var l=56320<=o&&o<57344;if(this.highSurrogate){if(p||!l){r.call(a,this.highSurrogate,i);i+=4}else{var d=(this.highSurrogate-55296<<10|o-56320)+65536;r.call(a,d,i);i+=4;this.highSurrogate=0;continue}}if(p)this.highSurrogate=o;else{r.call(a,o,i);i+=4;this.highSurrogate=0}}if(i<a.length)a=a.slice(0,i);return a};Utf32Encoder.prototype.end=function(){if(!this.highSurrogate)return;var e=n.alloc(4);if(this.isLE)e.writeUInt32LE(this.highSurrogate,0);else e.writeUInt32BE(this.highSurrogate,0);this.highSurrogate=0;return e};function Utf32Decoder(e,t){this.isLE=t.isLE;this.badChar=t.iconv.defaultCharUnicode.charCodeAt(0);this.overflow=[]}Utf32Decoder.prototype.write=function(e){if(e.length===0)return"";var t=0;var a=0;var r=n.alloc(e.length+4);var i=0;var s=this.isLE;var o=this.overflow;var p=this.badChar;if(o.length>0){for(;t<e.length&&o.length<4;t++)o.push(e[t]);if(o.length===4){if(s){a=o[t]|o[t+1]<<8|o[t+2]<<16|o[t+3]<<24}else{a=o[t+3]|o[t+2]<<8|o[t+1]<<16|o[t]<<24}o.length=0;i=_writeCodepoint(r,i,a,p)}}for(;t<e.length-3;t+=4){if(s){a=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}else{a=e[t+3]|e[t+2]<<8|e[t+1]<<16|e[t]<<24}i=_writeCodepoint(r,i,a,p)}for(;t<e.length;t++){o.push(e[t])}return r.slice(0,i).toString("ucs2")};function _writeCodepoint(e,t,a,n){if(a<0||a>1114111){a=n}if(a>=65536){a-=65536;var r=55296|a>>10;e[t++]=r&255;e[t++]=r>>8;var a=56320|a&1023}e[t++]=a&255;e[t++]=a>>8;return t}Utf32Decoder.prototype.end=function(){this.overflow.length=0};t.utf32=Utf32AutoCodec;t.ucs4="utf32";function Utf32AutoCodec(e,t){this.iconv=t}Utf32AutoCodec.prototype.encoder=Utf32AutoEncoder;Utf32AutoCodec.prototype.decoder=Utf32AutoDecoder;function Utf32AutoEncoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder(e.defaultEncoding||"utf-32le",e)}Utf32AutoEncoder.prototype.write=function(e){return this.encoder.write(e)};Utf32AutoEncoder.prototype.end=function(){return this.encoder.end()};function Utf32AutoDecoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf32AutoDecoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<32)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var a="";for(var n=0;n<this.initialBufs.length;n++)a+=this.decoder.write(this.initialBufs[n]);this.initialBufs.length=this.initialBufsLen=0;return a}return this.decoder.write(e)};Utf32AutoDecoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var a=0;a<this.initialBufs.length;a++)t+=this.decoder.write(this.initialBufs[a]);var n=this.decoder.end();if(n)t+=n;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var a=[];var n=0;var r=0,i=0;var s=0,o=0;e:for(var p=0;p<e.length;p++){var l=e[p];for(var d=0;d<l.length;d++){a.push(l[d]);if(a.length===4){if(n===0){if(a[0]===255&&a[1]===254&&a[2]===0&&a[3]===0){return"utf-32le"}if(a[0]===0&&a[1]===0&&a[2]===254&&a[3]===255){return"utf-32be"}}if(a[0]!==0||a[1]>16)i++;if(a[3]!==0||a[2]>16)r++;if(a[0]===0&&a[1]===0&&(a[2]!==0||a[3]!==0))o++;if((a[0]!==0||a[1]!==0)&&a[2]===0&&a[3]===0)s++;a.length=0;n++;if(n>=100){break e}}}}if(o-i>s-r)return"utf-32be";if(o-i<s-r)return"utf-32le";return t||"utf-32le"}},2622:(e,t,a)=>{"use strict";var n=a(5237).Buffer;t.utf7=Utf7Codec;t.unicode11utf7="utf7";function Utf7Codec(e,t){this.iconv=t}Utf7Codec.prototype.encoder=Utf7Encoder;Utf7Codec.prototype.decoder=Utf7Decoder;Utf7Codec.prototype.bomAware=true;var r=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Utf7Encoder(e,t){this.iconv=t.iconv}Utf7Encoder.prototype.write=function(e){return n.from(e.replace(r,function(e){return"+"+(e==="+"?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))};Utf7Encoder.prototype.end=function(){};function Utf7Decoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var i=/[A-Za-z0-9\/+]/;var s=[];for(var o=0;o<256;o++)s[o]=i.test(String.fromCharCode(o));var p="+".charCodeAt(0),l="-".charCodeAt(0),d="&".charCodeAt(0);Utf7Decoder.prototype.write=function(e){var t="",a=0,r=this.inBase64,i=this.base64Accum;for(var o=0;o<e.length;o++){if(!r){if(e[o]==p){t+=this.iconv.decode(e.slice(a,o),"ascii");a=o+1;r=true}}else{if(!s[e[o]]){if(o==a&&e[o]==l){t+="+"}else{var d=i+this.iconv.decode(e.slice(a,o),"ascii");t+=this.iconv.decode(n.from(d,"base64"),"utf16-be")}if(e[o]!=l)o--;a=o+1;r=false;i=""}}}if(!r){t+=this.iconv.decode(e.slice(a),"ascii")}else{var d=i+this.iconv.decode(e.slice(a),"ascii");var c=d.length-d.length%8;i=d.slice(c);d=d.slice(0,c);t+=this.iconv.decode(n.from(d,"base64"),"utf16-be")}this.inBase64=r;this.base64Accum=i;return t};Utf7Decoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(n.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e};t.utf7imap=Utf7IMAPCodec;function Utf7IMAPCodec(e,t){this.iconv=t}Utf7IMAPCodec.prototype.encoder=Utf7IMAPEncoder;Utf7IMAPCodec.prototype.decoder=Utf7IMAPDecoder;Utf7IMAPCodec.prototype.bomAware=true;function Utf7IMAPEncoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=n.alloc(6);this.base64AccumIdx=0}Utf7IMAPEncoder.prototype.write=function(e){var t=this.inBase64,a=this.base64Accum,r=this.base64AccumIdx,i=n.alloc(e.length*5+10),s=0;for(var o=0;o<e.length;o++){var p=e.charCodeAt(o);if(32<=p&&p<=126){if(t){if(r>0){s+=i.write(a.slice(0,r).toString("base64").replace(/\//g,",").replace(/=+$/,""),s);r=0}i[s++]=l;t=false}if(!t){i[s++]=p;if(p===d)i[s++]=l}}else{if(!t){i[s++]=d;t=true}if(t){a[r++]=p>>8;a[r++]=p&255;if(r==a.length){s+=i.write(a.toString("base64").replace(/\//g,","),s);r=0}}}}this.inBase64=t;this.base64AccumIdx=r;return i.slice(0,s)};Utf7IMAPEncoder.prototype.end=function(){var e=n.alloc(10),t=0;if(this.inBase64){if(this.base64AccumIdx>0){t+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),t);this.base64AccumIdx=0}e[t++]=l;this.inBase64=false}return e.slice(0,t)};function Utf7IMAPDecoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var c=s.slice();c[",".charCodeAt(0)]=true;Utf7IMAPDecoder.prototype.write=function(e){var t="",a=0,r=this.inBase64,i=this.base64Accum;for(var s=0;s<e.length;s++){if(!r){if(e[s]==d){t+=this.iconv.decode(e.slice(a,s),"ascii");a=s+1;r=true}}else{if(!c[e[s]]){if(s==a&&e[s]==l){t+="&"}else{var o=i+this.iconv.decode(e.slice(a,s),"ascii").replace(/,/g,"/");t+=this.iconv.decode(n.from(o,"base64"),"utf16-be")}if(e[s]!=l)s--;a=s+1;r=false;i=""}}}if(!r){t+=this.iconv.decode(e.slice(a),"ascii")}else{var o=i+this.iconv.decode(e.slice(a),"ascii").replace(/,/g,"/");var p=o.length-o.length%8;i=o.slice(p);o=o.slice(0,p);t+=this.iconv.decode(n.from(o,"base64"),"utf16-be")}this.inBase64=r;this.base64Accum=i;return t};Utf7IMAPDecoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(n.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e}},8148:(e,t)=>{"use strict";var a="\ufeff";t.PrependBOM=PrependBOMWrapper;function PrependBOMWrapper(e,t){this.encoder=e;this.addBOM=true}PrependBOMWrapper.prototype.write=function(e){if(this.addBOM){e=a+e;this.addBOM=false}return this.encoder.write(e)};PrependBOMWrapper.prototype.end=function(){return this.encoder.end()};t.StripBOM=StripBOMWrapper;function StripBOMWrapper(e,t){this.decoder=e;this.pass=false;this.options=t||{}}StripBOMWrapper.prototype.write=function(e){var t=this.decoder.write(e);if(this.pass||!t)return t;if(t[0]===a){t=t.slice(1);if(typeof this.options.stripBOM==="function")this.options.stripBOM()}this.pass=true;return t};StripBOMWrapper.prototype.end=function(){return this.decoder.end()}},8538:(e,t,a)=>{"use strict";var n=a(5237).Buffer;var r=a(8148),i=e.exports;i.encodings=null;i.defaultCharUnicode="�";i.defaultCharSingleByte="?";i.encode=function encode(e,t,a){e=""+(e||"");var r=i.getEncoder(t,a);var s=r.write(e);var o=r.end();return o&&o.length>0?n.concat([s,o]):s};i.decode=function decode(e,t,a){if(typeof e==="string"){if(!i.skipDecodeWarning){console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");i.skipDecodeWarning=true}e=n.from(""+(e||""),"binary")}var r=i.getDecoder(t,a);var s=r.write(e);var o=r.end();return o?s+o:s};i.encodingExists=function encodingExists(e){try{i.getCodec(e);return true}catch(e){return false}};i.toEncoding=i.encode;i.fromEncoding=i.decode;i._codecDataCache={};i.getCodec=function getCodec(e){if(!i.encodings)i.encodings=a(7987);var t=i._canonicalizeEncoding(e);var n={};while(true){var r=i._codecDataCache[t];if(r)return r;var s=i.encodings[t];switch(typeof s){case"string":t=s;break;case"object":for(var o in s)n[o]=s[o];if(!n.encodingName)n.encodingName=t;t=s.type;break;case"function":if(!n.encodingName)n.encodingName=t;r=new s(n,i);i._codecDataCache[n.encodingName]=r;return r;default:throw new Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')")}}};i._canonicalizeEncoding=function(e){return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")};i.getEncoder=function getEncoder(e,t){var a=i.getCodec(e),n=new a.encoder(t,a);if(a.bomAware&&t&&t.addBOM)n=new r.PrependBOM(n,t);return n};i.getDecoder=function getDecoder(e,t){var a=i.getCodec(e),n=new a.decoder(t,a);if(a.bomAware&&!(t&&t.stripBOM===false))n=new r.StripBOM(n,t);return n};i.enableStreamingAPI=function enableStreamingAPI(e){if(i.supportsStreams)return;var t=a(5823)(e);i.IconvLiteEncoderStream=t.IconvLiteEncoderStream;i.IconvLiteDecoderStream=t.IconvLiteDecoderStream;i.encodeStream=function encodeStream(e,t){return new i.IconvLiteEncoderStream(i.getEncoder(e,t),t)};i.decodeStream=function decodeStream(e,t){return new i.IconvLiteDecoderStream(i.getDecoder(e,t),t)};i.supportsStreams=true};var s;try{s=a(2203)}catch(e){}if(s&&s.Transform){i.enableStreamingAPI(s)}else{i.encodeStream=i.decodeStream=function(){throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")}}if(false){}},5823:(e,t,a)=>{"use strict";var n=a(5237).Buffer;e.exports=function(e){var t=e.Transform;function IconvLiteEncoderStream(e,a){this.conv=e;a=a||{};a.decodeStrings=false;t.call(this,a)}IconvLiteEncoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteEncoderStream}});IconvLiteEncoderStream.prototype._transform=function(e,t,a){if(typeof e!="string")return a(new Error("Iconv encoding stream needs strings as its input."));try{var n=this.conv.write(e);if(n&&n.length)this.push(n);a()}catch(e){a(e)}};IconvLiteEncoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t);e()}catch(t){e(t)}};IconvLiteEncoderStream.prototype.collect=function(e){var t=[];this.on("error",e);this.on("data",(function(e){t.push(e)}));this.on("end",(function(){e(null,n.concat(t))}));return this};function IconvLiteDecoderStream(e,a){this.conv=e;a=a||{};a.encoding=this.encoding="utf8";t.call(this,a)}IconvLiteDecoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteDecoderStream}});IconvLiteDecoderStream.prototype._transform=function(e,t,a){if(!n.isBuffer(e)&&!(e instanceof Uint8Array))return a(new Error("Iconv decoding stream needs buffers as its input."));try{var r=this.conv.write(e);if(r&&r.length)this.push(r,this.encoding);a()}catch(e){a(e)}};IconvLiteDecoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t,this.encoding);e()}catch(t){e(t)}};IconvLiteDecoderStream.prototype.collect=function(e){var t="";this.on("error",e);this.on("data",(function(e){t+=e}));this.on("end",(function(){e(null,t)}));return this};return{IconvLiteEncoderStream:IconvLiteEncoderStream,IconvLiteDecoderStream:IconvLiteDecoderStream}}},5029:(e,t,a)=>{"use strict";const n=a(9896);let r;function hasDockerEnv(){try{n.statSync("/.dockerenv");return true}catch(e){return false}}function hasDockerCGroup(){try{return n.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return false}}e.exports=()=>{if(r===undefined){r=hasDockerEnv()||hasDockerCGroup()}return r}},7534:e=>{e.exports=isPromise;e.exports["default"]=isPromise;function isPromise(e){return!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function"}},7401:(e,t,a)=>{"use strict";const n=a(857);const r=a(9896);const i=a(5029);const isWsl=()=>{if(process.platform!=="linux"){return false}if(n.release().toLowerCase().includes("microsoft")){if(i()){return false}return true}try{return r.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!i():false}catch(e){return false}};if(process.env.__IS_WSL_TEST__){e.exports=isWsl}else{e.exports=isWsl()}},8026:(e,t,a)=>{var n=a(9896);var r;if(process.platform==="win32"||global.TESTING_WINDOWS){r=a(463)}else{r=a(9163)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,a){if(typeof t==="function"){a=t;t={}}if(!a){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(a,n){isexe(e,t||{},(function(e,t){if(e){n(e)}else{a(t)}}))}))}r(e,t||{},(function(e,n){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;n=false}}a(e,n)}))}function sync(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},9163:(e,t,a)=>{e.exports=isexe;isexe.sync=sync;var n=a(9896);function isexe(e,t,a){n.stat(e,(function(e,n){a(e,e?false:checkStat(n,t))}))}function sync(e,t){return checkStat(n.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var a=e.mode;var n=e.uid;var r=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var s=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var o=parseInt("100",8);var p=parseInt("010",8);var l=parseInt("001",8);var d=o|p;var c=a&l||a&p&&r===s||a&o&&n===i||a&d&&i===0;return c}},463:(e,t,a)=>{e.exports=isexe;isexe.sync=sync;var n=a(9896);function checkPathExt(e,t){var a=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!a){return true}a=a.split(";");if(a.indexOf("")!==-1){return true}for(var n=0;n<a.length;n++){var r=a[n].toLowerCase();if(r&&e.substr(-r.length).toLowerCase()===r){return true}}return false}function checkStat(e,t,a){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,a)}function isexe(e,t,a){n.stat(e,(function(n,r){a(n,n?false:checkStat(r,e,t))}))}function sync(e,t){return checkStat(n.statSync(e),e,t)}},9250:function(e,t,a){e=a.nmd(e);
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Lodash <https://lodash.com/>
|