@zuplo/core 5.2238.0 → 5.2240.0
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.
- package/create.index.minified.js +1 -1
- package/index.minified.js +1 -1
- package/package.json +1 -1
package/index.minified.js
CHANGED
|
@@ -299,7 +299,7 @@ globstar while`,t,_,r,m,g),this.matchOne(t.slice(_),r.slice(m),n))return this.de
|
|
|
299
299
|
`)}s(Tut,"generateRefs");function Nut(e,t,r,n,i,o,a){let u=[];u.push(`${r}: {`);let c=p1(e,t,n,i,o,a);return u.push(c),u.push("}"),u.join(`
|
|
300
300
|
`)}s(Nut,"getJsonEntry");function p1(e,t,r,n,i,o){let a=[];for(let u in r){let c=r[u];if(u==="$ref")return(0,zm.chaseRefs)(e,t,(0,zm.getFullyQualifiedRefName)(e,c),n,i,o),`$REF:${Xoe(t,o.get((0,zm.getFullyQualifiedRefName)(e,c)))}`;switch(typeof c){case"string":{a.push(`"${u}": ${JSON.stringify(c)},`);break}case"number":case"boolean":{a.push(`"${u}":${c},`);break}default:if(Array.isArray(c))a.push(`"${u}":[`),c.forEach(l=>{if(typeof l=="object"){let f=p1(e,t,l,n,i,o);if(f.startsWith("$REF")){let d=f.split(":")[1];a.push(`${d},`)}else a.push("{"),a.push(f),a.push("},")}else a.push(`${JSON.stringify(l)},`)}),a.push("],");else{let l=p1(e,t,c,n,i,o);if(l.startsWith("$REF")){let f=l.split(":")[1];a.push(`${u}: ${f},`)}else a.push(`"${u}":{`),a.push(l),a.push("},")}}}return a.join(`
|
|
301
301
|
`)}s(p1,"processNode");function Xoe(e,t){return(0,Woe.sanitizedIdentifierName)(e)+`_refsData_${t}`}s(Xoe,"getRefIdentifierName")});var eae=h(Hm=>{"use strict";var m1=Hm&&Hm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hm,"__esModule",{value:!0});Hm.runtimeConfigPlugin=void 0;var Aut=m1(gn()),Rut=m1(require("fs/promises")),FF=m1(require("path")),Cut=m1(_n()),h1="runtime-config",Zoe="runtime-config-plugin";function $ut(){return{name:h1,setup(e){e.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},t=>({namespace:Zoe,path:FF.default.isAbsolute(t.path)?t.path:FF.default.join(t.resolveDir,t.path),pluginName:h1})),e.onLoad({filter:/.*/,namespace:Zoe},async t=>Cut.default.timeFn("Generating zuplo.runtime.ts data",async()=>{let r="export const runtimeInit = undefined;",n=[];return await Aut.default.fileExists(t.path)?(r=await Rut.default.readFile(t.path,"utf-8"),{contents:r,loader:"ts",resolveDir:FF.default.dirname(t.path),errors:n,pluginName:h1,watchFiles:[t.path]}):{contents:r,loader:"ts",errors:n,pluginName:h1}}))}}}s($ut,"runtimeConfigPlugin");Hm.runtimeConfigPlugin=$ut});var oae=h(js=>{"use strict";var Fd=js&&js.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(js,"__esModule",{value:!0});js.isPolicyPresentInOperation=js.getPolicyNamesReferencingPolicyHandlers=js.schemaValidationSource=js.schemaValidationPlugin=void 0;var Km=Gf(),VE=require("@zuplo/runtime/internal"),tae=Fd(gn()),Dut=Fd(aU()),Lut=Fd(uU()),_1=Fd(require("fs/promises")),Qc=Fd(require("path")),jut=Fd(require("prettier")),kF=kt(),Mut=Fd(Xs()),BF="schema-validation-plugin",rae="schema-validation",Uut="module.exports = {}";function xut(e){return{name:"schema-validation-plugin",setup(t){t.onResolve({filter:/ajv-schema.json$/},r=>({namespace:rae,path:r.path,pluginName:BF})),t.onLoad({filter:/.*/,namespace:rae},async r=>{let n=Qc.default.resolve(e.sourceDirectory,kF.USER_CONFIG_DIR_NAME,"policies.json");if(!e.isOpenApiBased||!await tae.default.fileExists(n))return{contents:Uut,loader:"js",resolveDir:Qc.default.dirname(r.path),pluginName:BF};let i=await qut(e.sourceDirectory),o=Qc.default.resolve(e.sourceDirectory,kF.USER_CONFIG_DIR_NAME),a=await(0,Km.getOpenApiFilesByAlphabetical)(o),u=await kut(a,i),c=await nae({oasFiles:a,routesWithSchemaValidation:u,sourceDirectory:e.sourceDirectory,logger:e.logger});if(Mut.default.DEBUG_BUILD_MODE&&c){let l=Qc.default.join(e.sourceDirectory,kF.BUILD_OUTPUT_DIR),f=Qc.default.resolve(l,"schema-validation.js");await tae.default.mkdirForFilePathIfNotExits(f);let d=await jut.default.format(c,{parser:"babel"});await _1.default.writeFile(f,d,"utf-8")}return{contents:c,loader:"js",resolveDir:Qc.default.dirname(r.path),pluginName:BF}})}}}s(xut,"schemaValidationPlugin");js.schemaValidationPlugin=xut;async function nae({oasFiles:e,routesWithSchemaValidation:t,sourceDirectory:r,logger:n}){let i="",o=new Km.RefParser(r,n);if(t.length===0)return i;let a=new Dut.default({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let u of e){let c=await _1.default.readFile(u,"utf-8"),l=Qc.default.basename(u,".oas.json"),f=t.filter(y=>y.fileName===l),d=await o.resolve(u),_=JSON.parse(c),m=[],g=new Map;f.forEach(y=>{let b=_.paths[y.path][y.method];if(b.requestBody){let E;if(b.requestBody.$ref){let v=b.requestBody.$ref;E=d.get(v)?.content}else b.requestBody.content&&(E=b.requestBody.content);if(E)for(let v in E){let O=E[v].schema,I=(0,VE.getIdForRequestBodySchema)(y.path,y.method,v);O.$id=I,a.addSchema(O),GF(O,u,l,a,d,m,g)}}if(b.parameters)for(let E of b.parameters){let v=E.$ref?d.get(E.$ref):E,O=v.schema.$ref?d.get(v.schema.$ref):v.schema,I=(0,VE.getIdForParameterSchema)(y.path,y.method,v.in,v.name);O.$id=I,a.addSchema(O),GF(v,u,l,a,d,m,g)}});for(let y of m){let b=d.get(y),E=(0,VE.getIdForRefSchema)(l,y);a.addSchema(b,E)}}return i=(0,Lut.default)(a),i}s(nae,"schemaValidationSource");js.schemaValidationSource=nae;function GF(e,t,r,n,i,o,a){for(let u in e){let c=e[u];if(u==="$ref"){let l=(0,VE.getIdForRefSchema)(r,(0,Km.getFullyQualifiedRefName)(t,c));e[u]=l,(0,Km.chaseRefs)(t,r,(0,Km.getFullyQualifiedRefName)(t,c),i,o,a,(f,d)=>(0,VE.getIdForRefSchema)(f,(0,Km.getFullyQualifiedRefName)(t,d)))}else typeof c=="object"&&GF(c,t,r,n,i,o,a)}}s(GF,"addRefsToSchema");async function qut(e){let t=new Set(["RequestValidationInboundPolicy"]),r=await _1.default.readFile(`${e}/config/policies.json`,"utf-8"),n=JSON.parse(r);return iae(n,t)}s(qut,"getPolicyNamesUsingSchemaValidationPolicies");function iae(e,t){let r=new Set;e.policies?.forEach(i=>{i.handler?.export&&t.has(i.handler.export)&&i.handler.module==="$import(@zuplo/runtime)"&&r.add(i.name)});let n=Fut(e,r);return new Set([...r,...n])}s(iae,"getPolicyNamesReferencingPolicyHandlers");js.getPolicyNamesReferencingPolicyHandlers=iae;function Fut(e,t){let r=new Set;return e.policies?.forEach(n=>{n.handler?.export==="CompositeInboundPolicy"&&n.handler?.options?.policies?.forEach(i=>{t.has(i)&&r.add(n.name)})}),r}s(Fut,"getCompositePoliciesContainingPolicy");function sae(e,t){if(!e["x-zuplo-route"]||!e["x-zuplo-route"].policies)return!1;let r=e["x-zuplo-route"].policies.inbound;if(r){for(let i of r)if(t.has(i))return!0}let n=e["x-zuplo-route"].policies.outbound;if(n){for(let i of n)if(t.has(i))return!0}return!1}s(sae,"isPolicyPresentInOperation");js.isPolicyPresentInOperation=sae;async function kut(e,t){let r=[];for(let n of e){let i=await _1.default.readFile(n,"utf-8"),a=JSON.parse(i).paths;for(let u in a){let c=a[u];for(let l in c){let f=c[l];sae(f,t)&&r.push({fileName:Qc.default.basename(n,".oas.json"),path:u,method:l})}}}return r}s(kut,"getRoutesContainingPolicies")});var VF=h(Zc=>{"use strict";var But=Zc&&Zc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.BUILD_CONDITIONS=void 0;var Gut=w9(),g1=But(require("path")),Vut=kt(),zut=T9(),Hut=C9(),Kut=j9(),Wut=KX(),Yut=JX(),Jut=zoe(),Xut=Qoe(),Qut=eae(),Zut=oae(),ect=(0,Gut.debug)("zuplo:core:build");Zc.BUILD_CONDITIONS=["workerd","worker","browser"];var aae=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],g1.default.resolve(__dirname,"..","..","..","node_modules"),g1.default.resolve(__dirname,"..","..","..","..","..","node_modules"),...require.main?.paths??[]];async function tct({dev:e=!1,systemDirectory:t,outputDirectory:r,sourceDirectory:n,logger:i,flags:o}){let a=g1.default.join(t,Vut.WORKER_ENTRY_NAME);ect(`Building with node paths: ${aae.join(", ")}`);let u=e===!1?{minify:!0}:{minify:!1,keepNames:!0,metafile:!0},c={platform:"browser",target:"es2022",outfile:g1.default.join(r,"worker.js")};return{format:o?.esmWorker===!0?"esm":"iife",banner:{js:`'use strict';
|
|
302
|
-
`},nodePaths:aae,entryPoints:[a],...c,sourcemap:"linked",legalComments:"linked",treeShaking:!0,bundle:!0,...u,external:[],logLevel:"silent",conditions:Zc.BUILD_CONDITIONS,plugins:[(0,Kut.environmentPlugin)({sourceDirectory:n}),(0,zut.blockRemoteModulePlugin)({logger:i}),(0,Jut.openApiRoutesPlugin)({sourceDirectory:n,outputDirectory:r}),(0,Xut.rawRoutePlugin)({sourceDirectory:n,logger:i}),(0,Zut.schemaValidationPlugin)({sourceDirectory:n,logger:i,isOpenApiBased:!0}),(0,Qut.runtimeConfigPlugin)(),(0,Hut.devPortalConfigPlugin)({sourceDirectory:n}),(0,Wut.jsonSchemaPlugin)({sourceDirectory:n,outputDirectory:r}),(0,Yut.nodejsCompatPlugin)({nodeCompatEnabled:o?.esmWorker===!0,sourceDirectory:n})]}}s(tct,"getBaseESBuildConfig");Zc.default=tct});var E1=h(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatBuildResult=Ms.BUILD_TASK_PLUGIN_NAME=Ms.ESBUILD_PLUGIN_NAME=void 0;Ms.ESBUILD_PLUGIN_NAME="run-esbuild";Ms.BUILD_TASK_PLUGIN_NAME="build-task";var rct=s((e,t)=>{let r=t;if(t.includes(e)){let n=new RegExp(`.*(${e})`,"g");r=t.replace(n,"")}return r.match(/^(\/)?(\.\.(\/)?)+/)&&(r=r.replace(/^(\/)?(\.\.(\/)?)+/,"/")),r},"removePrefixFromString"),nct=s((e,t)=>{let r=t;if(r.includes(e)){let n=new RegExp(`[a-zA-Z0-9-_.\\/]+(${e})`,"g");r=r.replace(n,"")}return r},"cleanFilePathsInMessage"),y1=s((e,t,r)=>{if(!e||e.length<=0)return e;let n=e.filter(i=>i.message!=='Could not resolve "@zuplo/runtime"');return n&&n.length>0&&n.forEach(i=>{i.location&&i.location.file&&(i.location.file=rct(t,i.location.file)),i.location&&i.location.lineText&&i.location.lineText.includes("@zuplo/core/index.minified.js")&&(i.location.lineText=i.location.lineText.substring(0,200)+"...<Truncated>"),i.message=nct(t,i.message),i.notes&&i.notes.length>0&&delete i.notes,i.text&&delete i.text,i.pluginName===""&&(i.pluginName=r)}),n},"cleanDataOnBuildIssue");function ict(e,t,r){try{e.buildTaskResult&&(e.buildTaskResult.errors&&(e.buildTaskResult.errors=y1(e.buildTaskResult.errors,t,Ms.BUILD_TASK_PLUGIN_NAME)),e.buildTaskResult.warnings&&(e.buildTaskResult.warnings=y1(e.buildTaskResult.warnings,t,Ms.BUILD_TASK_PLUGIN_NAME))),e.compilerResult&&(e.compilerResult.errors&&(e.compilerResult.errors=y1(e.compilerResult.errors,t,Ms.ESBUILD_PLUGIN_NAME)),e.compilerResult.warnings&&(e.compilerResult.warnings=y1(e.compilerResult.warnings,t,Ms.ESBUILD_PLUGIN_NAME)))}catch(n){r.error("Error while formatting buildResult. Err: ",n)}return e}s(ict,"formatBuildResult");Ms.formatBuildResult=ict});var lae=h(Us=>{"use strict";var sct=Us&&Us.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),oct=Us&&Us.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),act=Us&&Us.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&sct(t,e,r);return oct(t,e),t},cae=Us&&Us.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getRunEsBuildPlugin=void 0;var uct=Gf(),uae=Yo(),cct=act(require("esbuild")),lct=cae(_n()),fct=AP(),dct=cae(VF()),zF=E1(),pct=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,generateSourceMaps:a,buildId:u,logger:c,config:l}){return lct.default.timeFn("Running esbuild",async()=>{c.info(`Running build_id: ${u}`);let f=await(0,dct.default)({systemDirectory:r,outputDirectory:n,generateSourceMaps:a,sourceDirectory:i,dev:o,logger:c,flags:l.flags}),d,_=new Date;try{if(!await(0,uct.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");d=await cct.build(f)}catch(g){if(c.error(g),g.errors||g.warnings)d=g;else if(g.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))d={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:zF.ESBUILD_PLUGIN_NAME,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw g}let m=new Date;if(e(new fct.CompilerResult(d,{endBuildTime:m,startBuildTime:_,buildId:u??""})),d.errors.length>0){d.errors.length>1&&(d.errors.length=1);let g=d.errors[0];c.debug(g)}return{warnings:[...d.warnings.map(g=>({message:g.text,pluginName:zF.ESBUILD_PLUGIN_NAME,severity:uae.WARNING_SEVERITY}))],errors:[...d.errors.map(g=>({message:g.text,pluginName:zF.ESBUILD_PLUGIN_NAME,severity:uae.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Us.getRunEsBuildPlugin=pct});var KF=h(Ym=>{"use strict";var dae=Ym&&Ym.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ym,"__esModule",{value:!0});Ym.build=void 0;var Wm=Yo(),hct=require("crypto"),mct=require("fs"),zE=dae(require("path")),fae=kt(),_ct=rc(),gct=dae(_n()),yct=Fz(),Ect=Bz(),bct=Gz(),Sct=Vz(),vct=Yz(),Oct=Jz(),Pct=eH(),Ict=l9(),wct=d9(),Tct=lae(),HF=E1(),b1;try{let e=(0,mct.readFileSync)(zE.default.resolve(__dirname,"../../package.json"),"utf-8");b1=JSON.parse(e).version}catch{b1="0.0.0"}async function Nct({sourceDirectory:e,deploymentName:t=zE.default.basename(e),dev:r,entitlements:n,environmentType:i,generateSourceMaps:o=!1,logger:a,noCompile:u=!1,postBuildTasks:c,projectId:l,publicZuploEnvironmentVariables:f={}}){let d=(0,hct.randomUUID)(),_=a.child({buildId:d});return gct.default.timeFn(`Run build with build_id: ${d}`,async()=>{let m=await(0,yct.getZuploConfig)(e),g=zE.default.join(e,fae.BUILD_OUTPUT_DIR),y;if("errors"in m)y={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:b1,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:Wm.FAILURE_STATUS,buildId:d,warnings:[],errors:m.errors}};else{let E={dev:r,generateSourceMaps:o,deploymentName:t,sourceDirectory:e,outputDirectory:g,systemDirectory:zE.default.join(e,fae.GENERATED_SOURCE_DIR_NAME),buildId:d,logger:_,config:m.config,publicZuploEnvironmentVariables:f,projectId:l,entitlements:n,environmentType:i},v=[];v.push(Ect.cleanOutput),v.push(bct.createSystemDir),v.push(Sct.checkForDeprecations),v.push(vct.generateBuildData),v.push(Pct.validateDevPortalJSON),v.push(Ict.validateOpenAPIFiles),v.push(Oct.generateWorker);let O,I=s(K=>{O=K},"compileCallback");u||v.push((0,Tct.getRunEsBuildPlugin)(I)),v.push(wct.verifyWorkerOutput),c&&v.push(...c);let w=await(0,_ct.runPlugins)(v,E),j=w.errors.length>0?Wm.FAILURE_STATUS:w.warnings.length>0?Wm.WARNING_STATUS:Wm.GOOD_STATUS;y={status:j==="Failed"||O===void 0||O.status==="Failed"?"Failed":j==="Warnings"||O.status==="Warnings"?"Warnings":"Good",compatibilityDate:m.config.compatibilityDate,runtimeVersion:b1,outputPath:g,compilerResult:O,buildTaskResult:{buildTime:"",buildTimeMs:0,status:j,buildId:d,warnings:w.warnings,errors:w.errors},flags:m.config.flags}}if(y.buildTaskResult.warnings.length>0){y.buildTaskResult.warnings.forEach(v=>{_.warn(v)});let E=y.buildTaskResult.warnings.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==HF.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.warnings=E),y.buildTaskResult.status=Wm.WARNING_STATUS}if(y.buildTaskResult.errors.length>0){y.buildTaskResult.errors.forEach(v=>{_.error(v)});let E=y.buildTaskResult.errors.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==HF.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.errors=E),y.buildTaskResult.status=Wm.FAILURE_STATUS}if(_.debug(`Build ${y.compilerResult?.buildId??d} completed ${u?"on watch mode":"with compiler status "+y.compilerResult?.status} and build task status ${y.buildTaskResult.status}`),y.compilerResult){let{metafile:E,...v}=y.compilerResult;_.debug(`Compiler results for build ${y.compilerResult?.buildId??d}`,v)}_.debug(`Build task results for build ${y.buildTaskResult?.buildId??d}`,y.buildTaskResult);let b=zE.default.basename(e);return(0,HF.formatBuildResult)(y,b,_)})}s(Nct,"build");Ym.build=Nct});var v1=h(xs=>{"use strict";var Act=xs&&xs.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Rct=xs&&xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cct=xs&&xs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Act(t,e,r);return Rct(t,e),t},S1=xs&&xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.BuildWatcher=void 0;var pae=Yo(),$ct=S1(require("chokidar")),Dct=Cct(require("esbuild")),hae=require("crypto"),Lct=S1(require("events")),HE=S1(require("path")),mae=kt(),jct=KF(),_ae=AP(),Mct=S1(VF()),gae=E1(),WF=class extends Lct.default{static{s(this,"WatchEmitter")}},YF=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new WF;envFilesWatcher;outputDirectory;sourceDirectory;dev;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,generateSourceMaps:n,logger:i,publicZuploEnvironmentVariables:o={}}){this.sourceDirectory=t,this.dev=r,this.outputDirectory=HE.default.join(t,mae.BUILD_OUTPUT_DIR),this.generateSourceMaps=n??!1,this.logger=i,this.publicZuploEnvironmentVariables=o,this.projectName=HE.default.basename(t),this.envFilesWatcher=$ct.default.watch([HE.default.join(t,".env"),HE.default.join(t,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",async()=>{this.emitter.emit("reload",null,null)})}onReload=t=>{this.emitter.on("reload",t)};async start(){let{sourceDirectory:t}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let r=await(0,jct.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,Mct.default)({systemDirectory:HE.default.join(t,mae.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,sourceDirectory:t,dev:this.dev,generateSourceMaps:this.generateSourceMaps,logger:this.logger,flags:r.flags}),i=this;n.plugins?.push({name:"on-end",setup(o){o.onEnd(a=>{i.logger.debug("Watcher (build) reloaded");let u;if(a)if(u=new _ae.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:pae.FAILURE_STATUS,buildId:(0,hae.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,gae.formatBuildResult)(c,i.projectName,i.logger),i.logger.error(c.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${u.buildId}`);i.emitter.emit("reload",r,null,u)})}}),this.esbuildContext=await Dct.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let a={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:pae.FAILURE_STATUS,buildId:(0,hae.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new _ae.CompilerResult(o),(0,gae.formatBuildResult)(a,this.projectName,this.logger),this.logger.error(a.compilerResult.errors,"Build errors")}}catch(o){throw await this.close(),o}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(t){this.logger.error(t)}}};xs.BuildWatcher=YF});var JF=h(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});O1.HttpStatusCode=void 0;var yae;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(yae||(O1.HttpStatusCode=yae={}))});var Eae=h(P1=>{"use strict";Object.defineProperty(P1,"__esModule",{value:!0});P1.getSourceControlProviderLabel=void 0;function Uct(e){let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="BitBucket";break;default:t=e;break}return t}s(Uct,"getSourceControlProviderLabel");P1.getSourceControlProviderLabel=Uct});var Sae=h(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_NO_ACCESS=S.INVALID_SOURCE_REPO_URL=S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=S.PROJECT_MUST_HAVE_ONE_MEMBER=S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=S.PROJECT_MEMBER_ALREADY_EXISTS=S.PROJECT_MEMBER_NOT_FOUND=S.INVALID_TEMPLATE_REPOSITORY=S.INCORRECT_PROJECT_TEMPLATE=S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=S.PROJECT_NOT_FOUND=S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=S.PROJECT_SHARING_DISABLED_ON_ACCOUNT=S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=S.ACCOUNT_MEMBER_INVITE_INVALID=S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_INFO_MISSING=S.ACCOUNT_MEMBER_ALREADY_EXISTS=S.ACCOUNT_UPDATE_INFO_MISSING=S.ACCOUNT_INFO_MISSING=S.ACCOUNT_DOES_NOT_EXISTS=S.INVALID_ACCOUNT_LABEL_ENDING=S.INVALID_ACCOUNT_NAME_ENDING=S.ACCOUNT_NAME_ALREADY_IN_USE=S.INVALID_ACCOUNT_LABEL=S.INVALID_ACCOUNT_NAME=S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=S.ACCOUNT_NAME_USES_RESERVED_KEYWORD=S.ACCOUNT_ALREADY_EXISTS=S.ACCOUNT_NOT_FOUND=S.USER_IS_NOT_SERVICE_ACCOUNT=S.USER_REMOVE_NOT_MEMBER_ACCOUNT=S.USER_HAS_NO_ACCESS_TO_ACCOUNT=S.USER_DETAILS_CANNOT_BE_FOUND=S.USER_ALREADY_EXISTS=S.CLIENT_NOT_FOUND=S.FORBIDDEN=S.UNAUTHORIZED=S.METHOD_NOT_ALLOWED=S.NOT_FOUND=S.CONFLICT=S.BAD_REQUEST=S.INTERNAL_SERVER_ERROR=void 0;S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=S.GITHUB_INTEGRATION_ALREADY_EXISTS=S.FEATURE_FLAGS_NOT_FOUND=S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=S.PROJECT_ALREADY_HAS_REPO=S.PROJECT_INVALID_NAME=S.FAILED_TO_REVOKE_GH_TOKEN=S.USER_ACCOUNT_NOT_FS_MIGRATED=S.USER_NO_ACCESS_GITLAB_REPO=S.USER_NO_ACCESS_BITBUCKET_REPO=S.GITHUB_APP_CONFIGURATION_NOT_FOUND=S.GITHUB_APP_NO_USER_ACCESS_=S.GITHUB_APP_NO_NAMESPACE_ACCESS=S.GENERIC_GITHUB_BRANCH_INFO_ERROR=S.GITHUB_USER_NO_READ_ACCESS_REPO=S.USER_NO_PULL_ACCESS_GITHUB_REPO=S.USER_NO_ACCESS_GITHUB_REPO=S.PROJECT_SHARING_REQUIRES_GIT_REPO=S.PROJECT_INVALID_GIT_REPO=S.PROJECT_INVALID_GIT_CLONE=S.USER_IS_PROJECT_MEMBER=S.USER_HAS_NO_ACCESS_TO_PROJECT=S.RUNTIME_FLAG_KEY_NOT_VALID=S.RUNTIME_FLAG_NOT_FOUND=S.RUNTIME_FLAG_ALREADY_EXISTS=S.PROJECT_NO_MEMBERS=S.PROJECT_ALREADY_EXISTS=S.SERVICE_CONFIGURATION_FAILED_DECRYPTION=S.WORKING_COPY_SERVICE_NOT_CREATED=S.WORKING_COPY_SERVICE_NOT_DELETED=S.WORKING_COPY_SERVICE_NOT_FOUND=S.SERVICE_CONFIGURATION_NOT_FOUND=S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=S.DEPLOYMENT_INCORRECT_STATUS_PAUSE=S.DEPLOYMENT_NOT_WORKING_COPY=S.DEPLOYMENT_LOG_NOT_FOUND=S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=S.DEPLOYMENT_DELETE_ERROR=S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=void 0;S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS=S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=S.SOURCE_CONTROL_REPO_OPERATION_ERROR=S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=S.SOURCE_CONTROL_REPO_NOT_FOUND=S.SOURCE_CONTROL_AUTHENTICATION_FAILED=S.EXTERNAL_SERVICE_GENERIC_ERROR=S.API_USER_NO_ACCESS=S.EXTERNAL_USER_NOT_CONFIGURED=S.EXTERNAL_USER_NO_ACCESS=S.API_KEY_CANNOT_BE_CREATED=S.CONSUMER_CANNOT_BE_CREATED=S.CONSUMER_DOES_NOT_EXIST=S.CONSUMER_NO_ACCESS=S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=S.GITLAB_DUPLICATE_REPO=S.GITLAB_FAILED_DURING_REPO_CREATION=S.GITLAB_QUERY_USER_INFO_FAILED=S.BITBUCKET_FAILED_DURING_REPO_CREATION=S.BITBUCKET_WORKSPACE_MISCONFIGURATION=S.BITBUCKET_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=S.GITHUB_INTEGRATION_DUPLICATE_REPO=S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=S.GITHUB_INTEGRATION_BRANCH_BEHIND=S.GITHUB_INTEGRATION_NOT_FOUND=S.GITHUB_REPOSITORY_NOT_FOUND=void 0;S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS=S.RBACCONFIGURATION_DOES_NOT_EXISTS=S.RBAC_INVALID_EXPIRATION_DATE=S.ACCOUNT_RBAC_DISABLED=S.METERING_BUCKET_CREATION_FAILED=S.UNABLE_UPGRADE_PLAN=S.BUCKET_NOT_FOUND=S.BUCKET_API_KEY_SERVICE_CONFLICT=S.DIRECTORY_DELETE_FAILED=S.FILE_DELETE_FAILED=S.CANNOT_DELETE_SOLE_OPEN_API_FILE=S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=S.CANNOT_DELETE_ESSENTIAL_FILE=S.FILE_WRITE_FAILED=S.FILE_RENAME_FAILED=S.FILE_RENAME_FILE_ALREADY_EXISTS=S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=S.FILE_RENAME_PATHS_MATCH=S.DIRECTORY_CREATION_FAILED=S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=S.DIRECTORY_DOES_NOT_EXIST=S.DIRECTORY_ALREADY_EXISTS=S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=S.FAILED_DOWNLOAD_FROM_STORAGE=S.CANNOT_FIND_SRC_DIRECTORY=S.CANNOT_READ_PACKAGE_JSON=S.PACKAGE_JSON_NOT_FOUND=S.RUNTIME_VERSION_INCORRECT_FORMAT=S.MIGRATIONS_ONLY_ON_WORKING_COPY=S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=S.NO_GLOBAL_SYMBOLS=S.NO_ZUPLO_PREFIXED_VARIABLES=S.NON_EMPTY_TARGETS_REQUIRED=S.CONFLICTING_TYPES=S.OVERLAPPING_TARGETS=S.INVALID_BRANCH_NAME=S.TARGET_BRANCH_ONLY_FOR_PREVIEW=S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=S.DEPLOYMENT_NAME_MISSING=S.NON_EXISTENT_ENVIRONMENT_VARIABLE=S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=S.DUPLICATE_ENVIRONMENT_VARIABLE=S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=void 0;S.RBACCONFIGURATION_DELETE_MISCONFIGURATION=S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG=S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED=S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS=S.RBACCONFIGURATION_REQUIRE_PROJECTS=S.RBACCONFIGURATION_INVALID_ENVIRONMENTS=void 0;var N=JF(),bae=Eae(),xct="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:N.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:N.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:N.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:N.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:N.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:N.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:N.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:N.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:N.HttpStatusCode.UNAUTHORIZED};S.USER_REMOVE_NOT_MEMBER_ACCOUNT={type:"https://zup.fail/removed-user-not-account-member",title:"The user being removed is not a member of the account",status:N.HttpStatusCode.BAD_REQUEST};S.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:N.HttpStatusCode.CONFLICT};S.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD={type:"https://zup.fail/account-use-reserved-keyword",title:"The account name can not start with a reserved keyword",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-name-length-limit",title:"The account name exceeds the 200 character limit",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-label-length-limit",title:"The account label exceeds the 200 character limit",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME={type:"https://zup.fail/invalid-account-name",title:"The account name can only contain lower-cased characters, numbers, dashes and underscores",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL={type:"https://zup.fail/invalid-account-label",title:"The account label can only contain alpha-numeric characters, spaces, dashes and underscores",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_ALREADY_IN_USE={type:"https://zup.fail/account-name-in-use",title:"The account name is already taken. Please try again using a different name.",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME_ENDING={type:"https://zup.fail/invalid-account-name-ending",title:"The account name can not end with a dash or underscore character",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL_ENDING={type:"https://zup.fail/invalid-account-label-ending",title:"The account label can not end with a dash or underscore character",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND={type:"https://zup.fail/account-member-invite-failed-send",title:"We were not able to send the account member invite. Please try again or contact support.",status:N.HttpStatusCode.BAD_REQUEST};S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:N.HttpStatusCode.BAD_REQUEST};S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE={type:"https://zup.fail/existing-pending-account-member-invites",title:"The user has a pending invitation to this account.",status:N.HttpStatusCode.BAD_REQUEST};S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED={type:"https://zup.fail/account-members-limit-reached",title:"This account has reached the limit of users allowed by its current billing plan.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:N.HttpStatusCode.FORBIDDEN};S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:N.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:N.HttpStatusCode.NOT_FOUND};S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS={type:"https://zup.fail/project-cannot-be-deleted-protected-deployments-exists",title:"Project cannot be deleted because it has protected deployments",detail:"Project has protected deployments. Make sure to remove the use of custom domains before trying to delete the project.",status:N.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:N.HttpStatusCode.BAD_REQUEST};var qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:N.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=qct;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:N.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:N.HttpStatusCode.BAD_REQUEST};S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS={type:"https://zup.fail/cannt-delete-your-own-project-member",title:"Can not delete your own Project Member record",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:N.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_SOURCE_REPO_URL={type:"https://zup.fail/invalid-source-repo-url",title:"Project is not connected to source control, a sourceRepoUrl property must be specified and valid",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH={type:"https://zup.fail/deployment-branch-does-not-exist",title:"A deployment record cannot be found for the provided branch.",detail:"You can only update a project's default branch to one that has been deployed.",status:N.HttpStatusCode.FORBIDDEN};S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST={type:"https://zup.fail/default-deployment-does-not-exist",title:"A default deployment record cannot be found for the project.",detail:"You can only update a project's default branch to one that has been deployed.",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED={type:"https://zup.fail/deployment-is-protected-cannot-be-deleted",title:"Deployment is protected and cannot be deleted",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid account",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid project name",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid user sub",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY={type:"https://zup.fail/deployment-cannot-be-deleted",title:"Deployment cannot be deleted since is a working copy",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:N.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:N.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:N.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:N.HttpStatusCode.BAD_REQUEST};S.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:N.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:N.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:N.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:N.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:N.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:N.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_REPO={type:"https://zup.fail/project-invalid-git-repo",title:"The current source control repository is already in use by a Zuplo project",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_REQUIRES_GIT_REPO={type:"https://zup.fail/project-sharing-requires-git-repo",title:"The current project is not connected to a source control repository.",status:N.HttpStatusCode.BAD_REQUEST};var Fct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=Fct;var kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have pull access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=kct;var Bct=s(({repositoryUrl:e})=>({type:"https://zup.fail/no-read-access-github-repo",title:"You do not have read access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=Bct;S.GENERIC_GITHUB_BRANCH_INFO_ERROR={type:"https://zup.fail/gh-branch-info-error",title:"There was an error getting branch information for the GitHub repository associated to the project.",status:N.HttpStatusCode.BAD_REQUEST};S.GITHUB_APP_NO_NAMESPACE_ACCESS={type:"https://zup.fail/no-namespace-access-github-app",title:"The Zuplo GitHub app does not have access to the repositories under the namespace provided. Make sure to configure the GitHub Zuplo App on the repository.",status:N.HttpStatusCode.FORBIDDEN};var Gct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:"The Zuplo GitHub app does not have access to the repository. Make sure to configure the GitHub Zuplo App on the repository.",detail:`The Zuplo GitHub app has not been granted access to the repository '${e}'. Go to '${xct}' to add the repository.`,status:N.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=Gct;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:N.HttpStatusCode.NOT_FOUND};var Vct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-bitbucket-repo",title:"You do not have access to the Bitbucket repository associated to the project. Ask your Bitbucket admin for access and try again.",detail:`User does not have access to the Bitbucket repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=Vct;var zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-gitlab-repo",title:"You do not have access to the GitLab repository associated to the project. Ask your GitLab admin for access and try again.",detail:`User does not have access to the GitLab repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=zct;S.USER_ACCOUNT_NOT_FS_MIGRATED={type:"https://zup.fail/user-account-not-fs-migrated",title:"User account is in a plan that does not allow project sharing. Please contact your account admin.",status:N.HttpStatusCode.FORBIDDEN};S.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_HAS_REPO={type:"https://zup.fail/project-already-has-repo",title:"The current project has been previously linked to a source control repository",status:N.HttpStatusCode.BAD_REQUEST};S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED={type:"https://zup.fail/max-allowed-projects-limit-reached",title:"Your account has reached the maximum number of projects allowed.",status:N.HttpStatusCode.BAD_REQUEST};S.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:N.HttpStatusCode.BAD_REQUEST};var Hct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:N.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=Hct;var Kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:N.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=Kct;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:N.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};S.GITHUB_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/github-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:N.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:N.HttpStatusCode.FORBIDDEN};S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED={type:"https://zup.fail/github-integration-query-user-info-failed",title:"Failed while requesting basic user info from GitHub",status:N.HttpStatusCode.FORBIDDEN};var Wct=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${e}' already exists on GitHub org '${t}'.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=Wct;var Yct=s(({repositoryName:e,details:t})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:t,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=Yct;var Jct=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-empty-repo",title:"The repository is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=Jct;var Xct=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-git-repo",title:"We can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=Xct;var Qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-invalid-repo",title:"We can only connect to an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.",details:`Repository '${e}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=Qct;S.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:N.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:N.HttpStatusCode.FORBIDDEN};var Zct=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:N.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=Zct;S.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:N.HttpStatusCode.FORBIDDEN};var elt=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=elt;var tlt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${e}' already exists in GitLab team '${t}'.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=tlt;var rlt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-create-repo-perm",title:"The user's GitLab group access level does not allow for repository creation.",details:"The user's GitLab group access level does not allow for repository creation.",instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=rlt;var nlt=s(({namespaceLabel:e})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${e}'.`,details:`The user's GitLab access level does not allow the use of namespace '${e}'.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=nlt;var ilt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=ilt;S.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:N.HttpStatusCode.UNAUTHORIZED};S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist or cannot be accessed.",status:N.HttpStatusCode.NOT_FOUND};S.CONSUMER_CANNOT_BE_CREATED={type:"https://zup.fail/consumer-not-created",title:"Failed to create consumer",status:N.HttpStatusCode.BAD_GATEWAY};S.API_KEY_CANNOT_BE_CREATED={type:"https://zup.fail/api-key-not-created",title:"Failed to create api key",status:N.HttpStatusCode.BAD_GATEWAY};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:N.HttpStatusCode.UNAUTHORIZED};S.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:N.HttpStatusCode.FORBIDDEN};S.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:N.HttpStatusCode.FORBIDDEN};S.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};var slt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,bae.getSourceControlProviderLabel)(e)}`,status:N.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=slt;var olt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-repo-not-found",title:"We cannot connect to the repository associated to the project, verify your source control access configuration and try again.",detail:`Could not connect to ${(0,bae.getSourceControlProviderLabel)(e)} repository`,status:N.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=olt;S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE={type:"https://zup.fail/source-control-empty-commit",title:"Commit operation failed because you provided an empty message. Please try again by providing a commit message.",status:N.HttpStatusCode.BAD_REQUEST};var alt=s(({repoURL:e,operation:t})=>({type:`https://zup.fail/source-control-repo-${t}-error`,title:`Failed on ${t} operation to repository '${e}'. Verify you have read & write access to the repository and try again.`,detail:"Verify your source control configuration and make sure you have been granted read & write access to the repository",status:N.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=alt;S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE={type:"https://zup.fail/source-control-write-access-issue",title:"You do not have write access to the repository, verify your source control access configuration and try again.",detail:"Verify your source control configuration and make sure you have been granted access to the repository",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:N.HttpStatusCode.NOT_FOUND};S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND={type:"https://zup.fail/source-control-credentials-not-found",title:"Source control credentials not found for this user. Verify your user's source control connection and try again.",status:N.HttpStatusCode.NOT_FOUND};S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-refresh-source-control-credentials",title:"Failed to refresh Source Control credentials. Verify your user's source control connection and try again.",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED={type:"https://zup.fail/new-gh-config-required",title:"Current Source Control credentials are using the previous Zuplo GitHup App. Re-authenticate using the latest Zuplo GitHup App via Profile UI and try again.",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS={type:"https://zup.fail/gh-app-revoked-access",title:"Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.",status:N.HttpStatusCode.UNAUTHORIZED};S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-revoke-source-control-credentials",title:"Failed to revoke Source Control access token for the user",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING={type:"https://zup.fail/source-control-configuration-info-missing",title:"Source Control Configuration information is insufficient for this operation.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING={type:"https://zup.fail/source-control-configuration-bb-workspace-missing",title:"Source Control Configuration for Bitbucket must include a workspace configuration (additionalMetadata).",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION={type:"https://zup.fail/preexisiting-source-control-configuration-on-account",title:"This account already has a Source Control Configuration for this provider.",detail:"This account has a pre-existing Source Control Configuration for this provider. Delete or update the existing configuration.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/source-control-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS={type:"https://zup.fail/source-control-integration-branch-behind",title:"The branch exists in the remote repository. Please try again with a different branch name.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:N.HttpStatusCode.FORBIDDEN};S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR={type:"https://zup.fail/third-party-app-auth0-clients-endpoint-error",title:"Error Creating an Auth0 Client through tenant api",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST={type:"https://zup.fail/third-party-app-auth0-config-does-not-exist",title:"Auth0 Configuration does not exist for account and environment",status:N.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR={type:"https://zup.fail/third-party-app-auth0-client-not-found-error",title:"Third Party App Not Found",status:N.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR={type:"https://zup.fail/third-party-app-auth-scope-config-error",title:"API Scope configuration at Auth0 end Error",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:N.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND={type:"https://zup.fail/third-party-app-connection-not-found",title:"Cannot find connection with the given name",status:N.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION={type:"https://zup.fail/third-party-app-cannot-link-tpa-to-connection",title:"Cannot link a connection to a third party app",status:N.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:N.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:N.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE={type:"https://zup.fail/environment-variables-cannot-be-retrieved-invalid-env-type",title:"Env vars will not be retrieved since the deployment is from non valid environment type",status:N.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:N.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:N.HttpStatusCode.BAD_REQUEST};S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY={type:"https://zup.fail/personal-override-only-for-working-copy",title:"A personal override can only be used for a working-copy environment variable",status:N.HttpStatusCode.BAD_REQUEST};S.TARGET_BRANCH_ONLY_FOR_PREVIEW={type:"https://zup.fail/target-branch-only-for-preview",title:"A target branch can only be used for preview environment variables",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:N.HttpStatusCode.BAD_REQUEST};S.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:N.HttpStatusCode.BAD_REQUEST};S.CONFLICTING_TYPES={type:"https://zup.fail/conflicting-types",title:"The type of this environment variable conflicts with an existing environment variable with the same name",status:N.HttpStatusCode.BAD_REQUEST};S.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:N.HttpStatusCode.BAD_REQUEST};S.NO_ZUPLO_PREFIXED_VARIABLES={type:"https://zup.fail/no-zuplo-prefixed-variables",title:"Environment variables should not start with the reserved prefix of ZUPLO or __ZUPLO",status:N.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE={type:"https://zup.fail/deployer-non-valid-deployment-environment-type",title:"Deployment cannot be different than preview or production",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2={type:"https://zup.fail/deployer-cannot-deploy-using-env-vars-v2",title:"Deployer was not able to deploy zup using environment variables v2",status:N.HttpStatusCode.FORBIDDEN};S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:N.HttpStatusCode.NOT_FOUND};var ult=s(({operation:e,path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${e} file ${t} for a read-only environment. Read-only environments cannot be edited.`,status:N.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=ult;var clt=s(()=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify files on read-only environment",detail:"Cannot save files on a read-only environment. Read-only environments cannot be edited.",status:N.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=clt;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:N.HttpStatusCode.BAD_REQUEST};S.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:N.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:N.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:N.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:N.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:N.HttpStatusCode.BAD_REQUEST};var llt=s(({path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${e} for a read-only environment. Read-only environments cannot be edited.`,status:N.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=llt;var flt=s(({path:e})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${e} is not allowed.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=flt;var dlt=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:N.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=dlt;var plt=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:N.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=plt;var hlt=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:N.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=hlt;var mlt=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=mlt;var _lt=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:N.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${e} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");S.FILE_RENAME_PATHS_MATCH=_lt;var glt=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:N.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=glt;var ylt=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:N.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${e}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");S.FILE_RENAME_FILE_ALREADY_EXISTS=ylt;var Elt=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=Elt;var blt=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=blt;var Slt=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:N.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=Slt;var vlt=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:N.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=vlt;var Olt=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:N.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");S.CANNOT_DELETE_SOLE_OPEN_API_FILE=Olt;var Plt=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=Plt;var Ilt=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=Ilt;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:N.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:N.HttpStatusCode.BAD_REQUEST};S.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.ACCOUNT_RBAC_DISABLED={type:"https://zup.fail/account_rbac_disabled",title:"Account does not have RBAC enabled. Please contact support to get this feature enabled.",status:N.HttpStatusCode.FORBIDDEN};S.RBAC_INVALID_EXPIRATION_DATE={type:"https://zup.fail/rbac_invalid_expiration_date",title:"Invalid expiration date provided",detail:"The expiration date provided must be greater than the current date",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DOES_NOT_EXISTS={type:"https://zup.fail/rbacconfiguration-does-not-exists",title:"RBAC Configuration can not be found",status:N.HttpStatusCode.NOT_FOUND};S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-required-environments",title:"RBAC Configuration must provide environment configuration",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-invalid-environments",title:"RBAC Configuration must provide valid environment configuration",detail:"'production', 'preview' and 'development' are the only valid environment values for RBAC Configuration",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_REQUIRE_PROJECTS={type:"https://zup.fail/rbacconfiguration-required-projects",title:"RBAC Configuration must provide which project access to configure",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS={type:"https://zup.fail/rbacconfiguration-no-projects",title:"Cannot find the specified projects on this account",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED={type:"https://zup.fail/rbacconfiguration-invalid-project",title:"One or more of the projects provided is not part of the account or does not exist",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG={type:"https://zup.fail/rbacconfiguration-invalid-openfga-config",title:"The provided configuration caused an unexpected error. Please contact support.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DELETE_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-delete-misconfiguration",title:"The provided configuration was not correctly created and cannot be deleted. Please contact support.",status:N.HttpStatusCode.BAD_REQUEST}});var Oae=h(wi=>{"use strict";var wlt=wi&&wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Tlt=wi&&wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Nlt=wi&&wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&wlt(t,e,r);return Tlt(t,e),t};Object.defineProperty(wi,"__esModule",{value:!0});wi.ApiNotFoundError=wi.ApiError=wi.Problems=void 0;var vae=Nlt(Sae());wi.Problems=vae;var I1=class extends Error{static{s(this,"ApiError")}type;status;detail;instance;constructor(t){if(super(t.title),!t.type.startsWith("https://zup.fail/"))throw new Error(`Invalid 'type' specified on ApiError, must be a URI starting with 'https://zup.fail/'. Type was set to ${t.type}`);this.name="ApiProblemError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.instance=t.instance}};wi.ApiError=I1;var XF=class extends I1{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...vae.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};wi.ApiNotFoundError=XF});var Pae=h(Iu=>{"use strict";var Alt=Iu&&Iu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Rlt=Iu&&Iu.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Alt(t,e,r)};Object.defineProperty(Iu,"__esModule",{value:!0});Iu.HttpStatusCode=void 0;Rlt(Oae(),Iu);var Clt=JF();Object.defineProperty(Iu,"HttpStatusCode",{enumerable:!0,get:function(){return Clt.HttpStatusCode}})});var wae=h((aqt,Iae)=>{"use strict";function $lt(e){return e>=55296&&e<=56319}s($lt,"isHighSurrogate");function Dlt(e){return e>=56320&&e<=57343}s(Dlt,"isLowSurrogate");Iae.exports=s(function(t,r,n){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,a,u,c=0;c<i;c+=1){if(a=r.charCodeAt(c),u=r[c],$lt(a)&&Dlt(r.charCodeAt(c+1))&&(c+=1,u+=r[c]),o+=t(u),o===n)return r.slice(0,c+1);if(o>n)return r.slice(0,c-u.length+1)}return r},"truncate")});var Nae=h((cqt,Tae)=>{"use strict";var Llt=wae(),jlt=Buffer.byteLength.bind(Buffer);Tae.exports=Llt.bind(null,jlt)});var QF=h(Jm=>{"use strict";var Mlt=Jm&&Jm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jm,"__esModule",{value:!0});Jm.sanitize=void 0;var Ult=Mlt(Nae()),xlt=/[/?<>\\:*|"]/g,qlt=/[\x00-\x1f\x80-\x9f]/g,Flt=/^\.+$/,klt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Blt=/[. ]+$/;function Glt(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(xlt,t).replace(qlt,t).replace(Flt,t).replace(klt,t).replace(Blt,t);return(0,Ult.default)(r,255)}s(Glt,"sanitize");Jm.sanitize=Glt});var $ae=h(Xm=>{"use strict";var Cae=Xm&&Xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xm,"__esModule",{value:!0});Xm.createProjectDirs=void 0;var Aae=Cae(require("fs/promises")),Vlt=Cae(require("path")),KE=kt(),Rae=rc(),zlt=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[KE.USER_MODULES_DIR_NAME,KE.USER_CONFIG_DIR_NAME,KE.USER_TEST_DIR_NAME,KE.USER_SCHEMAS_DIR_NAME,KE.USER_DOCS_DIR_NAME,".vscode"];try{await Aae.default.mkdir(e);for(let n of r)await Aae.default.mkdir(Vlt.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new Rae.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new Rae.PluginResult},"createProjectDirs");Xm.createProjectDirs=zlt});var Mae=h(Qm=>{"use strict";var jae=Qm&&Qm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qm,"__esModule",{value:!0});Qm.generateFromTemplate=void 0;var Hlt=require("fs"),Dae=jae(require("fs/promises")),Lae=jae(require("path"));async function Klt(e){let t=Lae.default.resolve(__dirname,"..","templates",e);if((0,Hlt.existsSync)(t))return await Dae.default.readFile(t,"utf-8");{let r=Lae.default.resolve(__dirname,"templates",e);return await Dae.default.readFile(r,"utf-8")}}s(Klt,"generateFromTemplate");Qm.generateFromTemplate=Klt});var Ti=h(Zm=>{"use strict";var w1=Zm&&Zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zm,"__esModule",{value:!0});Zm.generateFileFromTemplate=void 0;var Wlt=w1(gn()),Ylt=w1(require("fs/promises")),Jlt=w1(require("path")),Xlt=w1(_n()),Qlt=Mae(),Zlt=s(function(e,t){return async({sourceDirectory:r,logger:n})=>Xlt.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=Jlt.default.join(r,e);return await Wlt.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):eft(i,t,n)})},"generateFileFromTemplate");Zm.generateFileFromTemplate=Zlt;async function eft(e,t,r){let n=await(0,Qlt.generateFromTemplate)(t);try{await Ylt.default.writeFile(e,n,"utf-8"),r.debug(`File written to ${e}`)}catch(i){r.error(i);let o={message:`Error creating file at ${e}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[o]}}return{warnings:[],errors:[]}}s(eft,"writeTemplate")});var xae=h(e_=>{"use strict";var tft=e_&&e_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e_,"__esModule",{value:!0});e_.generateDefaultDocsMarkdown=void 0;var rft=tft(require("path")),Uae=kt(),nft=Ti();e_.generateDefaultDocsMarkdown=(0,nft.generateFileFromTemplate)(rft.default.join(Uae.USER_DOCS_DIR_NAME,Uae.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Fae=h(t_=>{"use strict";var ift=t_&&t_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t_,"__esModule",{value:!0});t_.generateDefaultDocsSidebar=void 0;var sft=ift(require("path")),qae=kt(),oft=Ti();t_.generateDefaultDocsSidebar=(0,oft.generateFileFromTemplate)(sft.default.join(qae.USER_DOCS_DIR_NAME,qae.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var Bae=h(r_=>{"use strict";var aft=r_&&r_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r_,"__esModule",{value:!0});r_.generateDefaultDocsTheme=void 0;var uft=aft(require("path")),kae=kt(),cft=Ti();r_.generateDefaultDocsTheme=(0,cft.generateFileFromTemplate)(uft.default.join(kae.USER_DOCS_DIR_NAME,kae.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Vae=h(n_=>{"use strict";var lft=n_&&n_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n_,"__esModule",{value:!0});n_.generateDefaultModule=void 0;var fft=lft(require("path")),Gae=kt(),dft=Ti();n_.generateDefaultModule=(0,dft.generateFileFromTemplate)(fft.default.join(Gae.USER_MODULES_DIR_NAME,Gae.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var Hae=h(i_=>{"use strict";var pft=i_&&i_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i_,"__esModule",{value:!0});i_.generateDevPortalConfigJson=void 0;var hft=pft(require("path")),zae=kt(),mft=Ti();i_.generateDevPortalConfigJson=(0,mft.generateFileFromTemplate)(hft.default.join(zae.USER_CONFIG_DIR_NAME,zae.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Kae=h(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});T1.generateEnvironment=void 0;var _ft=Ti();T1.generateEnvironment=(0,_ft.generateFileFromTemplate)(".env","env.template")});var Wae=h(N1=>{"use strict";Object.defineProperty(N1,"__esModule",{value:!0});N1.generateESLint=void 0;var gft=Ti();N1.generateESLint=(0,gft.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Yae=h(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});A1.generateGitignore=void 0;var yft=Ti();A1.generateGitignore=(0,yft.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var Jae=h(s_=>{"use strict";var Eft=s_&&s_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s_,"__esModule",{value:!0});s_.generateLaunchJson=void 0;var bft=Eft(require("path")),Sft=Ti();s_.generateLaunchJson=(0,Sft.generateFileFromTemplate)(bft.default.join(".vscode","launch.json"),"launch.template.jsonc")});var Qae=h(o_=>{"use strict";var vft=o_&&o_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o_,"__esModule",{value:!0});o_.generateRouteOasConfig=void 0;var Oft=vft(require("path")),Xae=kt(),Pft=Ti();o_.generateRouteOasConfig=(0,Pft.generateFileFromTemplate)(Oft.default.join(Xae.USER_CONFIG_DIR_NAME,Xae.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var tue=h(qs=>{"use strict";var ZF=qs&&qs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0});qs.updateProjectPackageJson=qs.getProjectPackageJson=qs.getPackageOverrides=qs.generateDefaultPackageJson=void 0;var Zae=ZF(require("fs/promises")),ek=ZF(require("path")),Ift=ZF(Xs());async function wft(e,t=Ift.default.USE_MONOREPO_PACKAGES){let r={name:e,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(t){let n=eue();r.overrides=n,r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"],r.devDependencies&&"@zuplo/core"in r.devDependencies&&(r.devDependencies["@zuplo/core"]=n["@zuplo/core"]),"@zuplo/core"in r.dependencies&&(r.dependencies["@zuplo/core"]=n["@zuplo/core"])}return r}s(wft,"generateDefaultPackageJson");qs.generateDefaultPackageJson=wft;function eue(){let e=ek.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${e}/core`,"@zuplo/runtime":`file:${e}/runtime`,"@zuplo/debug":`file:${e}/debug`,"@zuplo/errors":`file:${e}/errors`}}s(eue,"getPackageOverrides");qs.getPackageOverrides=eue;async function Tft(e){let t=ek.default.join(e,"package.json"),r=await Zae.default.readFile(t,"utf-8");return JSON.parse(r)}s(Tft,"getProjectPackageJson");qs.getProjectPackageJson=Tft;async function Nft(e,t){let r=ek.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await Zae.default.writeFile(r,n,"utf-8")}s(Nft,"updateProjectPackageJson");qs.updateProjectPackageJson=Nft});var iue=h(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.generatePackageJson=void 0;var rue=tue(),nue=rc(),Aft=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,rue.generateDefaultPackageJson)(t);try{await(0,rue.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new nue.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new nue.PluginResult},"generatePackageJson");R1.generatePackageJson=Aft});var oue=h(a_=>{"use strict";var Rft=a_&&a_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a_,"__esModule",{value:!0});a_.generatePoliciesConfig=void 0;var Cft=Rft(require("path")),sue=kt(),$ft=Ti();a_.generatePoliciesConfig=(0,$ft.generateFileFromTemplate)(Cft.default.join(sue.USER_CONFIG_DIR_NAME,sue.POLICIES_CONFIG_FILE),"policies.template.json")});var aue=h(u_=>{"use strict";var Dft=u_&&u_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u_,"__esModule",{value:!0});u_.generateSettingsJson=void 0;var Lft=Dft(require("path")),jft=Ti();u_.generateSettingsJson=(0,jft.generateFileFromTemplate)(Lft.default.join(".vscode","settings.json"),"settings.template.jsonc")});var uue=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.generateTSConfig=void 0;var Mft=Ti();C1.generateTSConfig=(0,Mft.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var lue=h(c_=>{"use strict";var Uft=c_&&c_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c_,"__esModule",{value:!0});c_.generateZuploJson=void 0;var xft=Yo(),qft=require("fs/promises"),Fft=Uft(require("path")),kft=kt(),cue=rc(),Bft=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:xft.DEFAULT_COMPATIBILITY_DATE},i=Fft.default.join(t,kft.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,qft.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new cue.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new cue.PluginResult},"generateZuploJson");c_.generateZuploJson=Bft});var hue=h(l_=>{"use strict";var pue=l_&&l_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l_,"__esModule",{value:!0});l_.create=void 0;var fue=Pae(),Gft=pue(gn()),Vft=require("fs/promises"),zft=pue(require("path")),Hft=rc(),due=QF(),Kft=$ae(),Wft=xae(),Yft=Fae(),Jft=Bae(),Xft=Vae(),Qft=Hae(),Zft=Kae(),edt=Wae(),tdt=Yae(),rdt=Jae(),ndt=Qae(),idt=iue(),sdt=oue(),odt=aue(),adt=uue(),udt=lue();async function cdt({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,due.sanitize)(e),o=(0,due.sanitize)(t),a=zft.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await Gft.default.dirExists(a))throw new fue.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:fue.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(Kft.createProjectDirs,ndt.generateRouteOasConfig,udt.generateZuploJson,Qft.generateDevPortalConfigJson,Xft.generateDefaultModule,Yft.generateDefaultDocsSidebar,Wft.generateDefaultDocsMarkdown,Jft.generateDefaultDocsTheme,sdt.generatePoliciesConfig),c.push(adt.generateTSConfig,tdt.generateGitignore,idt.generatePackageJson,Zft.generateEnvironment,edt.generateESLint,rdt.generateLaunchJson,odt.generateSettingsJson);let{errors:l,warnings:f}=await(0,Hft.runPlugins)(c,u);if(f.length>0&&f.forEach(_=>{n.warn(_)}),l.length>0){await(0,Vft.rm)(a,{recursive:!0,force:!0});let _=l[0];throw _ instanceof Error?_:new Error(_.message)}return{sourceDirectory:a,projectName:e}}s(cdt,"create");l_.create=cdt});var Eue=h((qqt,yue)=>{yue.exports=gue;gue.sync=fdt;var mue=require("fs");function ldt(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}s(ldt,"checkPathExt");function _ue(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:ldt(t,r)}s(_ue,"checkStat");function gue(e,t,r){mue.stat(e,function(n,i){r(n,n?!1:_ue(i,e,t))})}s(gue,"isexe");function fdt(e,t){return _ue(mue.statSync(e),e,t)}s(fdt,"sync")});var Pue=h((kqt,Oue)=>{Oue.exports=Sue;Sue.sync=ddt;var bue=require("fs");function Sue(e,t,r){bue.stat(e,function(n,i){r(n,n?!1:vue(i,t))})}s(Sue,"isexe");function ddt(e,t){return vue(bue.statSync(e),t)}s(ddt,"sync");function vue(e,t){return e.isFile()&&pdt(e,t)}s(vue,"checkStat");function pdt(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),f=u|c,d=r&l||r&c&&i===a||r&u&&n===o||r&f&&o===0;return d}s(pdt,"checkMode")});var wue=h((Vqt,Iue)=>{var Gqt=require("fs"),$1;process.platform==="win32"||global.TESTING_WINDOWS?$1=Eue():$1=Pue();Iue.exports=tk;tk.sync=hdt;function tk(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){tk(e,t||{},function(o,a){o?i(o):n(a)})})}$1(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(tk,"isexe");function hdt(e,t){try{return $1.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(hdt,"sync")});var Due=h((Hqt,$ue)=>{var f_=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Tue=require("path"),mdt=f_?";":":",Nue=wue(),Aue=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Rue=s((e,t)=>{let r=t.colon||mdt,n=e.match(/\//)||f_&&e.match(/\\/)?[""]:[...f_?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=f_?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=f_?i.split(r):[""];return f_&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),Cue=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Rue(e,t),a=[],u=s(l=>new Promise((f,d)=>{if(l===n.length)return t.all&&a.length?f(a):d(Aue(e));let _=n[l],m=/^".*"$/.test(_)?_.slice(1,-1):_,g=Tue.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(c(y,l,0))}),"step"),c=s((l,f,d)=>new Promise((_,m)=>{if(d===i.length)return _(u(f+1));let g=i[d];Nue(l+g,{pathExt:o},(y,b)=>{if(!y&&b)if(t.all)a.push(l+g);else return _(l+g);return _(c(l,f,d+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),_dt=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=Rue(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=Tue.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let _=f+n[d];try{if(Nue.sync(_,{pathExt:i}))if(t.all)o.push(_);else return _}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Aue(e)},"whichSync");$ue.exports=Cue;Cue.sync=_dt});var nk=h((Wqt,rk)=>{"use strict";var Lue=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");rk.exports=Lue;rk.exports.default=Lue});var xue=h((Jqt,Uue)=>{"use strict";var jue=require("path"),gdt=Due(),ydt=nk();function Mue(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let a;try{a=gdt.sync(e.command,{path:r[ydt({env:r})],pathExt:t?jue.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=jue.resolve(i?e.options.cwd:"",a)),a}s(Mue,"resolveCommandAttempt");function Edt(e){return Mue(e)||Mue(e,!0)}s(Edt,"resolveCommand");Uue.exports=Edt});var que=h((Qqt,sk)=>{"use strict";var ik=/([()\][%!^"`<>&|;, *?])/g;function bdt(e){return e=e.replace(ik,"^$1"),e}s(bdt,"escapeCommand");function Sdt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ik,"^$1"),t&&(e=e.replace(ik,"^$1")),e}s(Sdt,"escapeArgument");sk.exports.command=bdt;sk.exports.argument=Sdt});var kue=h((e2t,Fue)=>{"use strict";Fue.exports=/^#!(.*)/});var Gue=h((t2t,Bue)=>{"use strict";var vdt=kue();Bue.exports=(e="")=>{let t=e.match(vdt);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var zue=h((r2t,Vue)=>{"use strict";var ok=require("fs"),Odt=Gue();function Pdt(e){let r=Buffer.alloc(150),n;try{n=ok.openSync(e,"r"),ok.readSync(n,r,0,150,0),ok.closeSync(n)}catch{}return Odt(r.toString())}s(Pdt,"readShebang");Vue.exports=Pdt});var Yue=h((i2t,Wue)=>{"use strict";var Idt=require("path"),Hue=xue(),Kue=que(),wdt=zue(),Tdt=process.platform==="win32",Ndt=/\.(?:com|exe)$/i,Adt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Rdt(e){e.file=Hue(e);let t=e.file&&wdt(e.file);return t?(e.args.unshift(e.file),e.command=t,Hue(e)):e.file}s(Rdt,"detectShebang");function Cdt(e){if(!Tdt)return e;let t=Rdt(e),r=!Ndt.test(t);if(e.options.forceShell||r){let n=Adt.test(t);e.command=Idt.normalize(e.command),e.command=Kue.command(e.command),e.args=e.args.map(o=>Kue.argument(o,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(Cdt,"parseNonShell");function $dt(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Cdt(n)}s($dt,"parse");Wue.exports=$dt});var Que=h((o2t,Xue)=>{"use strict";var ak=process.platform==="win32";function uk(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(uk,"notFoundError");function Ddt(e,t){if(!ak)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=Jue(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(Ddt,"hookChildProcess");function Jue(e,t){return ak&&e===1&&!t.file?uk(t.original,"spawn"):null}s(Jue,"verifyENOENT");function Ldt(e,t){return ak&&e===1&&!t.file?uk(t.original,"spawnSync"):null}s(Ldt,"verifyENOENTSync");Xue.exports={hookChildProcess:Ddt,verifyENOENT:Jue,verifyENOENTSync:Ldt,notFoundError:uk}});var tce=h((u2t,d_)=>{"use strict";var Zue=require("child_process"),ck=Yue(),lk=Que();function ece(e,t,r){let n=ck(e,t,r),i=Zue.spawn(n.command,n.args,n.options);return lk.hookChildProcess(i,n),i}s(ece,"spawn");function jdt(e,t,r){let n=ck(e,t,r),i=Zue.spawnSync(n.command,n.args,n.options);return i.error=i.error||lk.verifyENOENTSync(i.status,n),i}s(jdt,"spawnSync");d_.exports=ece;d_.exports.spawn=ece;d_.exports.sync=jdt;d_.exports._parse=ck;d_.exports._enoent=lk});var nce=h((l2t,rce)=>{"use strict";rce.exports=e=>{let t=typeof e=="string"?`
|
|
302
|
+
`},nodePaths:aae,entryPoints:[a],...c,sourcemap:"linked",legalComments:"linked",treeShaking:!0,bundle:!0,...u,external:[],logLevel:"silent",conditions:Zc.BUILD_CONDITIONS,plugins:[(0,Kut.environmentPlugin)({sourceDirectory:n}),(0,zut.blockRemoteModulePlugin)({logger:i}),(0,Jut.openApiRoutesPlugin)({sourceDirectory:n,outputDirectory:r}),(0,Xut.rawRoutePlugin)({sourceDirectory:n,logger:i}),(0,Zut.schemaValidationPlugin)({sourceDirectory:n,logger:i,isOpenApiBased:!0}),(0,Qut.runtimeConfigPlugin)(),(0,Hut.devPortalConfigPlugin)({sourceDirectory:n}),(0,Wut.jsonSchemaPlugin)({sourceDirectory:n,outputDirectory:r}),(0,Yut.nodejsCompatPlugin)({nodeCompatEnabled:o?.esmWorker===!0,sourceDirectory:n})]}}s(tct,"getBaseESBuildConfig");Zc.default=tct});var E1=h(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatBuildResult=Ms.BUILD_TASK_PLUGIN_NAME=Ms.ESBUILD_PLUGIN_NAME=void 0;Ms.ESBUILD_PLUGIN_NAME="run-esbuild";Ms.BUILD_TASK_PLUGIN_NAME="build-task";var rct=s((e,t)=>{let r=t;if(t.includes(e)){let n=new RegExp(`.*(${e})`,"g");r=t.replace(n,"")}return r.match(/^(\/)?(\.\.(\/)?)+/)&&(r=r.replace(/^(\/)?(\.\.(\/)?)+/,"/")),r},"removePrefixFromString"),nct=s((e,t)=>{let r=t;if(r.includes(e)){let n=new RegExp(`[a-zA-Z0-9-_.\\/]+(${e})`,"g");r=r.replace(n,"")}return r},"cleanFilePathsInMessage"),y1=s((e,t,r)=>{if(!e||e.length<=0)return e;let n=e.filter(i=>i.message!=='Could not resolve "@zuplo/runtime"');return n&&n.length>0&&n.forEach(i=>{i.location&&i.location.file&&(i.location.file=rct(t,i.location.file)),i.location&&i.location.lineText&&i.location.lineText.includes("@zuplo/core/index.minified.js")&&(i.location.lineText=i.location.lineText.substring(0,200)+"...<Truncated>"),i.message=nct(t,i.message),i.notes&&i.notes.length>0&&delete i.notes,i.text&&delete i.text,i.pluginName===""&&(i.pluginName=r)}),n},"cleanDataOnBuildIssue");function ict(e,t,r){try{e.buildTaskResult&&(e.buildTaskResult.errors&&(e.buildTaskResult.errors=y1(e.buildTaskResult.errors,t,Ms.BUILD_TASK_PLUGIN_NAME)),e.buildTaskResult.warnings&&(e.buildTaskResult.warnings=y1(e.buildTaskResult.warnings,t,Ms.BUILD_TASK_PLUGIN_NAME))),e.compilerResult&&(e.compilerResult.errors&&(e.compilerResult.errors=y1(e.compilerResult.errors,t,Ms.ESBUILD_PLUGIN_NAME)),e.compilerResult.warnings&&(e.compilerResult.warnings=y1(e.compilerResult.warnings,t,Ms.ESBUILD_PLUGIN_NAME)))}catch(n){r.error("Error while formatting buildResult. Err: ",n)}return e}s(ict,"formatBuildResult");Ms.formatBuildResult=ict});var lae=h(Us=>{"use strict";var sct=Us&&Us.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),oct=Us&&Us.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),act=Us&&Us.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&sct(t,e,r);return oct(t,e),t},cae=Us&&Us.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getRunEsBuildPlugin=void 0;var uct=Gf(),uae=Yo(),cct=act(require("esbuild")),lct=cae(_n()),fct=AP(),dct=cae(VF()),zF=E1(),pct=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,generateSourceMaps:a,buildId:u,logger:c,config:l}){return lct.default.timeFn("Running esbuild",async()=>{c.info(`Running build_id: ${u}`);let f=await(0,dct.default)({systemDirectory:r,outputDirectory:n,generateSourceMaps:a,sourceDirectory:i,dev:o,logger:c,flags:l.flags}),d,_=new Date;try{if(!await(0,uct.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");d=await cct.build(f)}catch(g){if(c.error(g),g.errors||g.warnings)d=g;else if(g.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))d={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:zF.ESBUILD_PLUGIN_NAME,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw g}let m=new Date;if(e(new fct.CompilerResult(d,{endBuildTime:m,startBuildTime:_,buildId:u??""})),d.errors.length>0){d.errors.length>1&&(d.errors.length=1);let g=d.errors[0];c.debug(g)}return{warnings:[...d.warnings.map(g=>({message:g.text,pluginName:zF.ESBUILD_PLUGIN_NAME,severity:uae.WARNING_SEVERITY}))],errors:[...d.errors.map(g=>({message:g.text,pluginName:zF.ESBUILD_PLUGIN_NAME,severity:uae.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Us.getRunEsBuildPlugin=pct});var KF=h(Ym=>{"use strict";var dae=Ym&&Ym.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ym,"__esModule",{value:!0});Ym.build=void 0;var Wm=Yo(),hct=require("crypto"),mct=require("fs"),zE=dae(require("path")),fae=kt(),_ct=rc(),gct=dae(_n()),yct=Fz(),Ect=Bz(),bct=Gz(),Sct=Vz(),vct=Yz(),Oct=Jz(),Pct=eH(),Ict=l9(),wct=d9(),Tct=lae(),HF=E1(),b1;try{let e=(0,mct.readFileSync)(zE.default.resolve(__dirname,"../../package.json"),"utf-8");b1=JSON.parse(e).version}catch{b1="0.0.0"}async function Nct({sourceDirectory:e,deploymentName:t=zE.default.basename(e),dev:r,entitlements:n,environmentType:i,generateSourceMaps:o=!1,logger:a,noCompile:u=!1,postBuildTasks:c,projectId:l,publicZuploEnvironmentVariables:f={}}){let d=(0,hct.randomUUID)(),_=a.child({buildId:d});return gct.default.timeFn(`Run build with build_id: ${d}`,async()=>{let m=await(0,yct.getZuploConfig)(e),g=zE.default.join(e,fae.BUILD_OUTPUT_DIR),y;if("errors"in m)y={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:b1,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:Wm.FAILURE_STATUS,buildId:d,warnings:[],errors:m.errors}};else{let E={dev:r,generateSourceMaps:o,deploymentName:t,sourceDirectory:e,outputDirectory:g,systemDirectory:zE.default.join(e,fae.GENERATED_SOURCE_DIR_NAME),buildId:d,logger:_,config:m.config,publicZuploEnvironmentVariables:f,projectId:l,entitlements:n,environmentType:i},v=[];v.push(Ect.cleanOutput),v.push(bct.createSystemDir),v.push(Sct.checkForDeprecations),v.push(vct.generateBuildData),v.push(Pct.validateDevPortalJSON),v.push(Ict.validateOpenAPIFiles),v.push(Oct.generateWorker);let O,I=s(K=>{O=K},"compileCallback");u||v.push((0,Tct.getRunEsBuildPlugin)(I)),v.push(wct.verifyWorkerOutput),c&&v.push(...c);let w=await(0,_ct.runPlugins)(v,E),j=w.errors.length>0?Wm.FAILURE_STATUS:w.warnings.length>0?Wm.WARNING_STATUS:Wm.GOOD_STATUS;y={status:j==="Failed"||O===void 0||O.status==="Failed"?"Failed":j==="Warnings"||O.status==="Warnings"?"Warnings":"Good",compatibilityDate:m.config.compatibilityDate,runtimeVersion:b1,outputPath:g,compilerResult:O,buildTaskResult:{buildTime:"",buildTimeMs:0,status:j,buildId:d,warnings:w.warnings,errors:w.errors},flags:m.config.flags}}if(y.buildTaskResult.warnings.length>0){y.buildTaskResult.warnings.forEach(v=>{_.warn(v)});let E=y.buildTaskResult.warnings.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==HF.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.warnings=E),y.buildTaskResult.status=Wm.WARNING_STATUS}if(y.buildTaskResult.errors.length>0){y.buildTaskResult.errors.forEach(v=>{_.error(v)});let E=y.buildTaskResult.errors.filter(v=>v.pluginName!=="runEsbuild"&&v.pluginName!==HF.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.errors=E),y.buildTaskResult.status=Wm.FAILURE_STATUS}if(_.debug(`Build ${y.compilerResult?.buildId??d} completed ${u?"on watch mode":"with compiler status "+y.compilerResult?.status} and build task status ${y.buildTaskResult.status}`),y.compilerResult){let{metafile:E,...v}=y.compilerResult;_.debug(`Compiler results for build ${y.compilerResult?.buildId??d}`,v)}_.debug(`Build task results for build ${y.buildTaskResult?.buildId??d}`,y.buildTaskResult);let b=zE.default.basename(e);return(0,HF.formatBuildResult)(y,b,_)})}s(Nct,"build");Ym.build=Nct});var v1=h(xs=>{"use strict";var Act=xs&&xs.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Rct=xs&&xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cct=xs&&xs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Act(t,e,r);return Rct(t,e),t},S1=xs&&xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.BuildWatcher=void 0;var pae=Yo(),$ct=S1(require("chokidar")),Dct=Cct(require("esbuild")),hae=require("crypto"),Lct=S1(require("events")),HE=S1(require("path")),mae=kt(),jct=KF(),_ae=AP(),Mct=S1(VF()),gae=E1(),WF=class extends Lct.default{static{s(this,"WatchEmitter")}},YF=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new WF;envFilesWatcher;outputDirectory;sourceDirectory;dev;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,generateSourceMaps:n,logger:i,publicZuploEnvironmentVariables:o={}}){this.sourceDirectory=t,this.dev=r,this.outputDirectory=HE.default.join(t,mae.BUILD_OUTPUT_DIR),this.generateSourceMaps=n??!1,this.logger=i,this.publicZuploEnvironmentVariables=o,this.projectName=HE.default.basename(t),this.envFilesWatcher=$ct.default.watch([HE.default.join(t,".env"),HE.default.join(t,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",async()=>{this.emitter.emit("reload",null,null)})}onReload=t=>{this.emitter.on("reload",t)};async start(){let{sourceDirectory:t}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let r=await(0,jct.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,Mct.default)({systemDirectory:HE.default.join(t,mae.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,sourceDirectory:t,dev:this.dev,generateSourceMaps:this.generateSourceMaps,logger:this.logger,flags:r.flags}),i=this;n.plugins?.push({name:"on-end",setup(o){o.onEnd(a=>{i.logger.debug("Watcher (build) reloaded");let u;if(a)if(u=new _ae.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:pae.FAILURE_STATUS,buildId:(0,hae.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,gae.formatBuildResult)(c,i.projectName,i.logger),i.logger.error(c.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${u.buildId}`);i.emitter.emit("reload",r,null,u)})}}),this.esbuildContext=await Dct.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let a={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:pae.FAILURE_STATUS,buildId:(0,hae.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new _ae.CompilerResult(o),(0,gae.formatBuildResult)(a,this.projectName,this.logger),this.logger.error(a.compilerResult.errors,"Build errors")}}catch(o){throw await this.close(),o}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(t){this.logger.error(t)}}};xs.BuildWatcher=YF});var JF=h(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});O1.HttpStatusCode=void 0;var yae;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(yae||(O1.HttpStatusCode=yae={}))});var Eae=h(P1=>{"use strict";Object.defineProperty(P1,"__esModule",{value:!0});P1.getSourceControlProviderLabel=void 0;function Uct(e){let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="BitBucket";break;default:t=e;break}return t}s(Uct,"getSourceControlProviderLabel");P1.getSourceControlProviderLabel=Uct});var Sae=h(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_NO_ACCESS=S.INVALID_SOURCE_REPO_URL=S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=S.PROJECT_MUST_HAVE_ONE_MEMBER=S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=S.PROJECT_MEMBER_ALREADY_EXISTS=S.PROJECT_MEMBER_NOT_FOUND=S.INVALID_TEMPLATE_REPOSITORY=S.INCORRECT_PROJECT_TEMPLATE=S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=S.PROJECT_NOT_FOUND=S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=S.PROJECT_SHARING_DISABLED_ON_ACCOUNT=S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=S.ACCOUNT_MEMBER_INVITE_INVALID=S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_INFO_MISSING=S.ACCOUNT_MEMBER_ALREADY_EXISTS=S.ACCOUNT_UPDATE_INFO_MISSING=S.ACCOUNT_INFO_MISSING=S.ACCOUNT_DOES_NOT_EXISTS=S.INVALID_ACCOUNT_LABEL_ENDING=S.INVALID_ACCOUNT_NAME_ENDING=S.ACCOUNT_NAME_ALREADY_IN_USE=S.INVALID_ACCOUNT_LABEL=S.INVALID_ACCOUNT_NAME=S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=S.ACCOUNT_NAME_USES_RESERVED_KEYWORD=S.ACCOUNT_ALREADY_EXISTS=S.ACCOUNT_NOT_FOUND=S.USER_IS_NOT_SERVICE_ACCOUNT=S.USER_REMOVE_NOT_MEMBER_ACCOUNT=S.USER_HAS_NO_ACCESS_TO_ACCOUNT=S.USER_DETAILS_CANNOT_BE_FOUND=S.USER_ALREADY_EXISTS=S.CLIENT_NOT_FOUND=S.FORBIDDEN=S.UNAUTHORIZED=S.METHOD_NOT_ALLOWED=S.NOT_FOUND=S.CONFLICT=S.BAD_REQUEST=S.INTERNAL_SERVER_ERROR=void 0;S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=S.GITHUB_INTEGRATION_ALREADY_EXISTS=S.FEATURE_FLAGS_NOT_FOUND=S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=S.PROJECT_ALREADY_HAS_REPO=S.PROJECT_INVALID_NAME=S.FAILED_TO_REVOKE_GH_TOKEN=S.USER_ACCOUNT_NOT_FS_MIGRATED=S.USER_NO_ACCESS_GITLAB_REPO=S.USER_NO_ACCESS_BITBUCKET_REPO=S.GITHUB_APP_CONFIGURATION_NOT_FOUND=S.GITHUB_APP_NO_USER_ACCESS_=S.GITHUB_APP_NO_NAMESPACE_ACCESS=S.GENERIC_GITHUB_BRANCH_INFO_ERROR=S.GITHUB_USER_NO_READ_ACCESS_REPO=S.USER_NO_PULL_ACCESS_GITHUB_REPO=S.USER_NO_ACCESS_GITHUB_REPO=S.PROJECT_SHARING_REQUIRES_GIT_REPO=S.PROJECT_INVALID_GIT_REPO=S.PROJECT_INVALID_GIT_CLONE=S.USER_IS_PROJECT_MEMBER=S.USER_HAS_NO_ACCESS_TO_PROJECT=S.RUNTIME_FLAG_KEY_NOT_VALID=S.RUNTIME_FLAG_NOT_FOUND=S.RUNTIME_FLAG_ALREADY_EXISTS=S.PROJECT_NO_MEMBERS=S.PROJECT_ALREADY_EXISTS=S.SERVICE_CONFIGURATION_FAILED_DECRYPTION=S.WORKING_COPY_SERVICE_NOT_CREATED=S.WORKING_COPY_SERVICE_NOT_DELETED=S.WORKING_COPY_SERVICE_NOT_FOUND=S.SERVICE_CONFIGURATION_NOT_FOUND=S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=S.DEPLOYMENT_INCORRECT_STATUS_PAUSE=S.DEPLOYMENT_NOT_WORKING_COPY=S.DEPLOYMENT_LOG_NOT_FOUND=S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=S.DEPLOYMENT_DELETE_ERROR=S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=void 0;S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS=S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=S.SOURCE_CONTROL_REPO_OPERATION_ERROR=S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=S.SOURCE_CONTROL_REPO_NOT_FOUND=S.SOURCE_CONTROL_AUTHENTICATION_FAILED=S.EXTERNAL_SERVICE_GENERIC_ERROR=S.API_USER_NO_ACCESS=S.EXTERNAL_USER_NOT_CONFIGURED=S.EXTERNAL_USER_NO_ACCESS=S.API_KEY_CANNOT_BE_CREATED=S.CONSUMER_CANNOT_BE_CREATED=S.CONSUMER_DOES_NOT_EXIST=S.CONSUMER_NO_ACCESS=S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=S.GITLAB_DUPLICATE_REPO=S.GITLAB_FAILED_DURING_REPO_CREATION=S.GITLAB_QUERY_USER_INFO_FAILED=S.BITBUCKET_FAILED_DURING_REPO_CREATION=S.BITBUCKET_WORKSPACE_MISCONFIGURATION=S.BITBUCKET_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=S.GITHUB_INTEGRATION_DUPLICATE_REPO=S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=S.GITHUB_INTEGRATION_BRANCH_BEHIND=S.GITHUB_INTEGRATION_NOT_FOUND=S.GITHUB_REPOSITORY_NOT_FOUND=void 0;S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS=S.RBACCONFIGURATION_DOES_NOT_EXISTS=S.RBAC_INVALID_EXPIRATION_DATE=S.ACCOUNT_RBAC_DISABLED=S.METERING_BUCKET_CREATION_FAILED=S.UNABLE_UPGRADE_PLAN=S.BUCKET_NOT_FOUND=S.BUCKET_API_KEY_SERVICE_CONFLICT=S.DIRECTORY_DELETE_FAILED=S.FILE_DELETE_FAILED=S.CANNOT_DELETE_SOLE_OPEN_API_FILE=S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=S.CANNOT_DELETE_ESSENTIAL_FILE=S.FILE_WRITE_FAILED=S.FILE_RENAME_FAILED=S.FILE_RENAME_FILE_ALREADY_EXISTS=S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=S.FILE_RENAME_PATHS_MATCH=S.DIRECTORY_CREATION_FAILED=S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=S.DIRECTORY_DOES_NOT_EXIST=S.DIRECTORY_ALREADY_EXISTS=S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=S.FAILED_DOWNLOAD_FROM_STORAGE=S.CANNOT_FIND_SRC_DIRECTORY=S.CANNOT_READ_PACKAGE_JSON=S.PACKAGE_JSON_NOT_FOUND=S.RUNTIME_VERSION_INCORRECT_FORMAT=S.MIGRATIONS_ONLY_ON_WORKING_COPY=S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=S.NO_GLOBAL_SYMBOLS=S.NO_ZUPLO_PREFIXED_VARIABLES=S.NON_EMPTY_TARGETS_REQUIRED=S.CONFLICTING_TYPES=S.OVERLAPPING_TARGETS=S.INVALID_BRANCH_NAME=S.TARGET_BRANCH_ONLY_FOR_PREVIEW=S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=S.DEPLOYMENT_NAME_MISSING=S.NON_EXISTENT_ENVIRONMENT_VARIABLE=S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=S.DUPLICATE_ENVIRONMENT_VARIABLE=S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=void 0;S.RBACCONFIGURATION_DELETE_MISCONFIGURATION=S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG=S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED=S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS=S.RBACCONFIGURATION_REQUIRE_PROJECTS=S.RBACCONFIGURATION_INVALID_ENVIRONMENTS=void 0;var N=JF(),bae=Eae(),xct="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:N.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:N.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:N.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:N.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:N.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:N.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:N.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:N.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:N.HttpStatusCode.UNAUTHORIZED};S.USER_REMOVE_NOT_MEMBER_ACCOUNT={type:"https://zup.fail/removed-user-not-account-member",title:"The user being removed is not a member of the account",status:N.HttpStatusCode.BAD_REQUEST};S.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:N.HttpStatusCode.CONFLICT};S.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD={type:"https://zup.fail/account-use-reserved-keyword",title:"The account name can not start with a reserved keyword",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-name-length-limit",title:"The account name exceeds the 200 character limit",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-label-length-limit",title:"The account label exceeds the 200 character limit",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME={type:"https://zup.fail/invalid-account-name",title:"The account name can only contain lower-cased characters, numbers, dashes and underscores",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL={type:"https://zup.fail/invalid-account-label",title:"The account label can only contain alpha-numeric characters, spaces, dashes and underscores",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_ALREADY_IN_USE={type:"https://zup.fail/account-name-in-use",title:"The account name is already taken. Please try again using a different name.",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME_ENDING={type:"https://zup.fail/invalid-account-name-ending",title:"The account name can not end with a dash or underscore character",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL_ENDING={type:"https://zup.fail/invalid-account-label-ending",title:"The account label can not end with a dash or underscore character",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND={type:"https://zup.fail/account-member-invite-failed-send",title:"We were not able to send the account member invite. Please try again or contact support.",status:N.HttpStatusCode.BAD_REQUEST};S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:N.HttpStatusCode.BAD_REQUEST};S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE={type:"https://zup.fail/existing-pending-account-member-invites",title:"The user has a pending invitation to this account.",status:N.HttpStatusCode.BAD_REQUEST};S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED={type:"https://zup.fail/account-members-limit-reached",title:"This account has reached the limit of users allowed by its current billing plan.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:N.HttpStatusCode.FORBIDDEN};S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:N.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:N.HttpStatusCode.NOT_FOUND};S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS={type:"https://zup.fail/project-cannot-be-deleted-protected-deployments-exists",title:"Project cannot be deleted because it has protected deployments",detail:"Project has protected deployments. Make sure to remove the use of custom domains before trying to delete the project.",status:N.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:N.HttpStatusCode.BAD_REQUEST};var qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:N.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=qct;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:N.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:N.HttpStatusCode.BAD_REQUEST};S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS={type:"https://zup.fail/cannt-delete-your-own-project-member",title:"Can not delete your own Project Member record",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:N.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_SOURCE_REPO_URL={type:"https://zup.fail/invalid-source-repo-url",title:"Project is not connected to source control, a sourceRepoUrl property must be specified and valid",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH={type:"https://zup.fail/deployment-branch-does-not-exist",title:"A deployment record cannot be found for the provided branch.",detail:"You can only update a project's default branch to one that has been deployed.",status:N.HttpStatusCode.FORBIDDEN};S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST={type:"https://zup.fail/default-deployment-does-not-exist",title:"A default deployment record cannot be found for the project.",detail:"You can only update a project's default branch to one that has been deployed.",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED={type:"https://zup.fail/deployment-is-protected-cannot-be-deleted",title:"Deployment is protected and cannot be deleted",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid account",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid project name",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid user sub",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY={type:"https://zup.fail/deployment-cannot-be-deleted",title:"Deployment cannot be deleted since is a working copy",status:N.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:N.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:N.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:N.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:N.HttpStatusCode.BAD_REQUEST};S.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:N.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:N.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:N.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:N.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:N.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:N.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_REPO={type:"https://zup.fail/project-invalid-git-repo",title:"The current source control repository is already in use by a Zuplo project",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_REQUIRES_GIT_REPO={type:"https://zup.fail/project-sharing-requires-git-repo",title:"The current project is not connected to a source control repository.",status:N.HttpStatusCode.BAD_REQUEST};var Fct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=Fct;var kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have pull access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=kct;var Bct=s(({repositoryUrl:e})=>({type:"https://zup.fail/no-read-access-github-repo",title:"You do not have read access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=Bct;S.GENERIC_GITHUB_BRANCH_INFO_ERROR={type:"https://zup.fail/gh-branch-info-error",title:"There was an error getting branch information for the GitHub repository associated to the project.",status:N.HttpStatusCode.BAD_REQUEST};S.GITHUB_APP_NO_NAMESPACE_ACCESS={type:"https://zup.fail/no-namespace-access-github-app",title:"The Zuplo GitHub app does not have access to the repositories under the namespace provided. Make sure to configure the GitHub Zuplo App on the repository.",status:N.HttpStatusCode.FORBIDDEN};var Gct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:"The Zuplo GitHub app does not have access to the repository. Make sure to configure the GitHub Zuplo App on the repository.",detail:`The Zuplo GitHub app has not been granted access to the repository '${e}'. Go to '${xct}' to add the repository.`,status:N.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=Gct;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:N.HttpStatusCode.NOT_FOUND};var Vct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-bitbucket-repo",title:"You do not have access to the Bitbucket repository associated to the project. Ask your Bitbucket admin for access and try again.",detail:`User does not have access to the Bitbucket repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=Vct;var zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-gitlab-repo",title:"You do not have access to the GitLab repository associated to the project. Ask your GitLab admin for access and try again.",detail:`User does not have access to the GitLab repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:N.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=zct;S.USER_ACCOUNT_NOT_FS_MIGRATED={type:"https://zup.fail/user-account-not-fs-migrated",title:"User account is in a plan that does not allow project sharing. Please contact your account admin.",status:N.HttpStatusCode.FORBIDDEN};S.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:N.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_HAS_REPO={type:"https://zup.fail/project-already-has-repo",title:"The current project has been previously linked to a source control repository",status:N.HttpStatusCode.BAD_REQUEST};S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED={type:"https://zup.fail/max-allowed-projects-limit-reached",title:"Your account has reached the maximum number of projects allowed.",status:N.HttpStatusCode.BAD_REQUEST};S.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:N.HttpStatusCode.BAD_REQUEST};var Hct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:N.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=Hct;var Kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:N.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=Kct;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:N.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};S.GITHUB_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/github-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:N.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:N.HttpStatusCode.FORBIDDEN};S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED={type:"https://zup.fail/github-integration-query-user-info-failed",title:"Failed while requesting basic user info from GitHub",status:N.HttpStatusCode.FORBIDDEN};var Wct=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${e}' already exists on GitHub org '${t}'.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=Wct;var Yct=s(({repositoryName:e,details:t})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:t,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=Yct;var Jct=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-empty-repo",title:"The repository is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=Jct;var Xct=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-git-repo",title:"We can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=Xct;var Qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-invalid-repo",title:"We can only connect to an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.",details:`Repository '${e}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=Qct;S.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:N.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:N.HttpStatusCode.FORBIDDEN};var Zct=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:N.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=Zct;S.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:N.HttpStatusCode.FORBIDDEN};var elt=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=elt;var tlt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${e}' already exists in GitLab team '${t}'.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=tlt;var rlt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-create-repo-perm",title:"The user's GitLab group access level does not allow for repository creation.",details:"The user's GitLab group access level does not allow for repository creation.",instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=rlt;var nlt=s(({namespaceLabel:e})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${e}'.`,details:`The user's GitLab access level does not allow the use of namespace '${e}'.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=nlt;var ilt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=ilt;S.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:N.HttpStatusCode.UNAUTHORIZED};S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist or cannot be accessed.",status:N.HttpStatusCode.NOT_FOUND};S.CONSUMER_CANNOT_BE_CREATED={type:"https://zup.fail/consumer-not-created",title:"Failed to create consumer",status:N.HttpStatusCode.BAD_GATEWAY};S.API_KEY_CANNOT_BE_CREATED={type:"https://zup.fail/api-key-not-created",title:"Failed to create api key",status:N.HttpStatusCode.BAD_GATEWAY};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:N.HttpStatusCode.UNAUTHORIZED};S.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:N.HttpStatusCode.FORBIDDEN};S.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:N.HttpStatusCode.FORBIDDEN};S.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};var slt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,bae.getSourceControlProviderLabel)(e)}`,status:N.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=slt;var olt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-repo-not-found",title:"We cannot connect to the repository associated to the project, verify your source control access configuration and try again.",detail:`Could not connect to ${(0,bae.getSourceControlProviderLabel)(e)} repository`,status:N.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=olt;S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE={type:"https://zup.fail/source-control-empty-commit",title:"Commit operation failed because you provided an empty message. Please try again by providing a commit message.",status:N.HttpStatusCode.BAD_REQUEST};var alt=s(({repoURL:e,operation:t})=>({type:`https://zup.fail/source-control-repo-${t}-error`,title:`Failed on ${t} operation to repository '${e}'. Verify you have read & write access to the repository and try again.`,detail:"Verify your source control configuration and make sure you have been granted read & write access to the repository",status:N.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=alt;S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE={type:"https://zup.fail/source-control-write-access-issue",title:"You do not have write access to the repository, verify your source control access configuration and try again.",detail:"Verify your source control configuration and make sure you have been granted access to the repository",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:N.HttpStatusCode.NOT_FOUND};S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND={type:"https://zup.fail/source-control-credentials-not-found",title:"Source control credentials not found for this user. Verify your user's source control connection and try again.",status:N.HttpStatusCode.NOT_FOUND};S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-refresh-source-control-credentials",title:"Failed to refresh Source Control credentials. Verify your user's source control connection and try again.",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED={type:"https://zup.fail/new-gh-config-required",title:"Current Source Control credentials are using the previous Zuplo GitHup App. Re-authenticate using the latest Zuplo GitHup App via Profile UI and try again.",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS={type:"https://zup.fail/gh-app-revoked-access",title:"Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.",status:N.HttpStatusCode.UNAUTHORIZED};S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-revoke-source-control-credentials",title:"Failed to revoke Source Control access token for the user",status:N.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING={type:"https://zup.fail/source-control-configuration-info-missing",title:"Source Control Configuration information is insufficient for this operation.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING={type:"https://zup.fail/source-control-configuration-bb-workspace-missing",title:"Source Control Configuration for Bitbucket must include a workspace configuration (additionalMetadata).",status:N.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION={type:"https://zup.fail/preexisiting-source-control-configuration-on-account",title:"This account already has a Source Control Configuration for this provider.",detail:"This account has a pre-existing Source Control Configuration for this provider. Delete or update the existing configuration.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/source-control-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS={type:"https://zup.fail/source-control-integration-branch-behind",title:"The branch exists in the remote repository. Please try again with a different branch name.",status:N.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:N.HttpStatusCode.FORBIDDEN};S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR={type:"https://zup.fail/third-party-app-auth0-clients-endpoint-error",title:"Error Creating an Auth0 Client through tenant api",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST={type:"https://zup.fail/third-party-app-auth0-config-does-not-exist",title:"Auth0 Configuration does not exist for account and environment",status:N.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR={type:"https://zup.fail/third-party-app-auth0-client-not-found-error",title:"Third Party App Not Found",status:N.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR={type:"https://zup.fail/third-party-app-auth-scope-config-error",title:"API Scope configuration at Auth0 end Error",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:N.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND={type:"https://zup.fail/third-party-app-connection-not-found",title:"Cannot find connection with the given name",status:N.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION={type:"https://zup.fail/third-party-app-cannot-link-tpa-to-connection",title:"Cannot link a connection to a third party app",status:N.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:N.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:N.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE={type:"https://zup.fail/environment-variables-cannot-be-retrieved-invalid-env-type",title:"Env vars will not be retrieved since the deployment is from non valid environment type",status:N.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:N.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:N.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:N.HttpStatusCode.BAD_REQUEST};S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY={type:"https://zup.fail/personal-override-only-for-working-copy",title:"A personal override can only be used for a working-copy environment variable",status:N.HttpStatusCode.BAD_REQUEST};S.TARGET_BRANCH_ONLY_FOR_PREVIEW={type:"https://zup.fail/target-branch-only-for-preview",title:"A target branch can only be used for preview environment variables",status:N.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:N.HttpStatusCode.BAD_REQUEST};S.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:N.HttpStatusCode.BAD_REQUEST};S.CONFLICTING_TYPES={type:"https://zup.fail/conflicting-types",title:"The type of this environment variable conflicts with an existing environment variable with the same name",status:N.HttpStatusCode.BAD_REQUEST};S.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:N.HttpStatusCode.BAD_REQUEST};S.NO_ZUPLO_PREFIXED_VARIABLES={type:"https://zup.fail/no-zuplo-prefixed-variables",title:"Environment variables should not start with the reserved prefix of ZUPLO or __ZUPLO",status:N.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE={type:"https://zup.fail/deployer-non-valid-deployment-environment-type",title:"Deployment cannot be different than preview or production",status:N.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2={type:"https://zup.fail/deployer-cannot-deploy-using-env-vars-v2",title:"Deployer was not able to deploy zup using environment variables v2",status:N.HttpStatusCode.FORBIDDEN};S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:N.HttpStatusCode.NOT_FOUND};var ult=s(({operation:e,path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${e} file ${t} for a read-only environment. Read-only environments cannot be edited.`,status:N.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=ult;var clt=s(()=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify files on read-only environment",detail:"Cannot save files on a read-only environment. Read-only environments cannot be edited.",status:N.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=clt;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:N.HttpStatusCode.BAD_REQUEST};S.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:N.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:N.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:N.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:N.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:N.HttpStatusCode.BAD_REQUEST};var llt=s(({path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${e} for a read-only environment. Read-only environments cannot be edited.`,status:N.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=llt;var flt=s(({path:e})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${e} is not allowed.`,instance:e,status:N.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=flt;var dlt=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:N.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=dlt;var plt=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:N.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=plt;var hlt=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:N.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=hlt;var mlt=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=mlt;var _lt=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:N.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${e} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");S.FILE_RENAME_PATHS_MATCH=_lt;var glt=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:N.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=glt;var ylt=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:N.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${e}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");S.FILE_RENAME_FILE_ALREADY_EXISTS=ylt;var Elt=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=Elt;var blt=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=blt;var Slt=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:N.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=Slt;var vlt=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:N.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=vlt;var Olt=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:N.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");S.CANNOT_DELETE_SOLE_OPEN_API_FILE=Olt;var Plt=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=Plt;var Ilt=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=Ilt;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:N.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:N.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:N.HttpStatusCode.BAD_REQUEST};S.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:N.HttpStatusCode.INTERNAL_SERVER_ERROR};S.ACCOUNT_RBAC_DISABLED={type:"https://zup.fail/account_rbac_disabled",title:"Account does not have RBAC enabled. Please contact support to get this feature enabled.",status:N.HttpStatusCode.FORBIDDEN};S.RBAC_INVALID_EXPIRATION_DATE={type:"https://zup.fail/rbac_invalid_expiration_date",title:"Invalid expiresOn date provided",detail:"The expiresOn date provided must be greater than the current date",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DOES_NOT_EXISTS={type:"https://zup.fail/rbacconfiguration-does-not-exists",title:"RBAC configuration record can not be found",detail:"The RBAC configuration does not exist or you don't have access to it.",status:N.HttpStatusCode.NOT_FOUND};S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-required-environments",title:"You must provide at least one environment value.",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-invalid-environments",title:"The environment configuration provided is invalid.",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_REQUIRE_PROJECTS={type:"https://zup.fail/rbacconfiguration-required-projects",title:"You must provide at least one project to configure.",detail:"Please provide at least one project to configure access for.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS={type:"https://zup.fail/rbacconfiguration-no-projects",title:"Cannot find the specified projects on this account",detail:"The account does not have any projects to configure. Please create at least one project before configuring RBAC access.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED={type:"https://zup.fail/rbacconfiguration-invalid-project",title:"You must provide valid projects to configure",detail:"One or more of the projects provided is not part of the account or does not exist. Make sure all the projects are valid and try again.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG={type:"https://zup.fail/rbacconfiguration-invalid-openfga-config",title:"Unexpected error while creating the configuration",detail:"The provided configuration caused an unexpected error. Please contact support.",status:N.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DELETE_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-delete-misconfiguration",title:"Failed to delete the configuration",detail:"The provided configuration was not correctly created and cannot be deleted. Please contact support.",status:N.HttpStatusCode.BAD_REQUEST}});var Oae=h(wi=>{"use strict";var wlt=wi&&wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Tlt=wi&&wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Nlt=wi&&wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&wlt(t,e,r);return Tlt(t,e),t};Object.defineProperty(wi,"__esModule",{value:!0});wi.ApiNotFoundError=wi.ApiError=wi.Problems=void 0;var vae=Nlt(Sae());wi.Problems=vae;var I1=class extends Error{static{s(this,"ApiError")}type;status;detail;instance;constructor(t){if(super(t.title),!t.type.startsWith("https://zup.fail/"))throw new Error(`Invalid 'type' specified on ApiError, must be a URI starting with 'https://zup.fail/'. Type was set to ${t.type}`);this.name="ApiProblemError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.instance=t.instance}};wi.ApiError=I1;var XF=class extends I1{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...vae.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};wi.ApiNotFoundError=XF});var Pae=h(Iu=>{"use strict";var Alt=Iu&&Iu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Rlt=Iu&&Iu.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Alt(t,e,r)};Object.defineProperty(Iu,"__esModule",{value:!0});Iu.HttpStatusCode=void 0;Rlt(Oae(),Iu);var Clt=JF();Object.defineProperty(Iu,"HttpStatusCode",{enumerable:!0,get:function(){return Clt.HttpStatusCode}})});var wae=h((aqt,Iae)=>{"use strict";function $lt(e){return e>=55296&&e<=56319}s($lt,"isHighSurrogate");function Dlt(e){return e>=56320&&e<=57343}s(Dlt,"isLowSurrogate");Iae.exports=s(function(t,r,n){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,a,u,c=0;c<i;c+=1){if(a=r.charCodeAt(c),u=r[c],$lt(a)&&Dlt(r.charCodeAt(c+1))&&(c+=1,u+=r[c]),o+=t(u),o===n)return r.slice(0,c+1);if(o>n)return r.slice(0,c-u.length+1)}return r},"truncate")});var Nae=h((cqt,Tae)=>{"use strict";var Llt=wae(),jlt=Buffer.byteLength.bind(Buffer);Tae.exports=Llt.bind(null,jlt)});var QF=h(Jm=>{"use strict";var Mlt=Jm&&Jm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jm,"__esModule",{value:!0});Jm.sanitize=void 0;var Ult=Mlt(Nae()),xlt=/[/?<>\\:*|"]/g,qlt=/[\x00-\x1f\x80-\x9f]/g,Flt=/^\.+$/,klt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Blt=/[. ]+$/;function Glt(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(xlt,t).replace(qlt,t).replace(Flt,t).replace(klt,t).replace(Blt,t);return(0,Ult.default)(r,255)}s(Glt,"sanitize");Jm.sanitize=Glt});var $ae=h(Xm=>{"use strict";var Cae=Xm&&Xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xm,"__esModule",{value:!0});Xm.createProjectDirs=void 0;var Aae=Cae(require("fs/promises")),Vlt=Cae(require("path")),KE=kt(),Rae=rc(),zlt=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[KE.USER_MODULES_DIR_NAME,KE.USER_CONFIG_DIR_NAME,KE.USER_TEST_DIR_NAME,KE.USER_SCHEMAS_DIR_NAME,KE.USER_DOCS_DIR_NAME,".vscode"];try{await Aae.default.mkdir(e);for(let n of r)await Aae.default.mkdir(Vlt.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new Rae.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new Rae.PluginResult},"createProjectDirs");Xm.createProjectDirs=zlt});var Mae=h(Qm=>{"use strict";var jae=Qm&&Qm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qm,"__esModule",{value:!0});Qm.generateFromTemplate=void 0;var Hlt=require("fs"),Dae=jae(require("fs/promises")),Lae=jae(require("path"));async function Klt(e){let t=Lae.default.resolve(__dirname,"..","templates",e);if((0,Hlt.existsSync)(t))return await Dae.default.readFile(t,"utf-8");{let r=Lae.default.resolve(__dirname,"templates",e);return await Dae.default.readFile(r,"utf-8")}}s(Klt,"generateFromTemplate");Qm.generateFromTemplate=Klt});var Ti=h(Zm=>{"use strict";var w1=Zm&&Zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zm,"__esModule",{value:!0});Zm.generateFileFromTemplate=void 0;var Wlt=w1(gn()),Ylt=w1(require("fs/promises")),Jlt=w1(require("path")),Xlt=w1(_n()),Qlt=Mae(),Zlt=s(function(e,t){return async({sourceDirectory:r,logger:n})=>Xlt.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=Jlt.default.join(r,e);return await Wlt.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):eft(i,t,n)})},"generateFileFromTemplate");Zm.generateFileFromTemplate=Zlt;async function eft(e,t,r){let n=await(0,Qlt.generateFromTemplate)(t);try{await Ylt.default.writeFile(e,n,"utf-8"),r.debug(`File written to ${e}`)}catch(i){r.error(i);let o={message:`Error creating file at ${e}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[o]}}return{warnings:[],errors:[]}}s(eft,"writeTemplate")});var xae=h(e_=>{"use strict";var tft=e_&&e_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e_,"__esModule",{value:!0});e_.generateDefaultDocsMarkdown=void 0;var rft=tft(require("path")),Uae=kt(),nft=Ti();e_.generateDefaultDocsMarkdown=(0,nft.generateFileFromTemplate)(rft.default.join(Uae.USER_DOCS_DIR_NAME,Uae.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Fae=h(t_=>{"use strict";var ift=t_&&t_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t_,"__esModule",{value:!0});t_.generateDefaultDocsSidebar=void 0;var sft=ift(require("path")),qae=kt(),oft=Ti();t_.generateDefaultDocsSidebar=(0,oft.generateFileFromTemplate)(sft.default.join(qae.USER_DOCS_DIR_NAME,qae.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var Bae=h(r_=>{"use strict";var aft=r_&&r_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r_,"__esModule",{value:!0});r_.generateDefaultDocsTheme=void 0;var uft=aft(require("path")),kae=kt(),cft=Ti();r_.generateDefaultDocsTheme=(0,cft.generateFileFromTemplate)(uft.default.join(kae.USER_DOCS_DIR_NAME,kae.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Vae=h(n_=>{"use strict";var lft=n_&&n_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n_,"__esModule",{value:!0});n_.generateDefaultModule=void 0;var fft=lft(require("path")),Gae=kt(),dft=Ti();n_.generateDefaultModule=(0,dft.generateFileFromTemplate)(fft.default.join(Gae.USER_MODULES_DIR_NAME,Gae.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var Hae=h(i_=>{"use strict";var pft=i_&&i_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i_,"__esModule",{value:!0});i_.generateDevPortalConfigJson=void 0;var hft=pft(require("path")),zae=kt(),mft=Ti();i_.generateDevPortalConfigJson=(0,mft.generateFileFromTemplate)(hft.default.join(zae.USER_CONFIG_DIR_NAME,zae.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Kae=h(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});T1.generateEnvironment=void 0;var _ft=Ti();T1.generateEnvironment=(0,_ft.generateFileFromTemplate)(".env","env.template")});var Wae=h(N1=>{"use strict";Object.defineProperty(N1,"__esModule",{value:!0});N1.generateESLint=void 0;var gft=Ti();N1.generateESLint=(0,gft.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Yae=h(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});A1.generateGitignore=void 0;var yft=Ti();A1.generateGitignore=(0,yft.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var Jae=h(s_=>{"use strict";var Eft=s_&&s_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s_,"__esModule",{value:!0});s_.generateLaunchJson=void 0;var bft=Eft(require("path")),Sft=Ti();s_.generateLaunchJson=(0,Sft.generateFileFromTemplate)(bft.default.join(".vscode","launch.json"),"launch.template.jsonc")});var Qae=h(o_=>{"use strict";var vft=o_&&o_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o_,"__esModule",{value:!0});o_.generateRouteOasConfig=void 0;var Oft=vft(require("path")),Xae=kt(),Pft=Ti();o_.generateRouteOasConfig=(0,Pft.generateFileFromTemplate)(Oft.default.join(Xae.USER_CONFIG_DIR_NAME,Xae.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var tue=h(qs=>{"use strict";var ZF=qs&&qs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0});qs.updateProjectPackageJson=qs.getProjectPackageJson=qs.getPackageOverrides=qs.generateDefaultPackageJson=void 0;var Zae=ZF(require("fs/promises")),ek=ZF(require("path")),Ift=ZF(Xs());async function wft(e,t=Ift.default.USE_MONOREPO_PACKAGES){let r={name:e,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(t){let n=eue();r.overrides=n,r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"],r.devDependencies&&"@zuplo/core"in r.devDependencies&&(r.devDependencies["@zuplo/core"]=n["@zuplo/core"]),"@zuplo/core"in r.dependencies&&(r.dependencies["@zuplo/core"]=n["@zuplo/core"])}return r}s(wft,"generateDefaultPackageJson");qs.generateDefaultPackageJson=wft;function eue(){let e=ek.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${e}/core`,"@zuplo/runtime":`file:${e}/runtime`,"@zuplo/debug":`file:${e}/debug`,"@zuplo/errors":`file:${e}/errors`}}s(eue,"getPackageOverrides");qs.getPackageOverrides=eue;async function Tft(e){let t=ek.default.join(e,"package.json"),r=await Zae.default.readFile(t,"utf-8");return JSON.parse(r)}s(Tft,"getProjectPackageJson");qs.getProjectPackageJson=Tft;async function Nft(e,t){let r=ek.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await Zae.default.writeFile(r,n,"utf-8")}s(Nft,"updateProjectPackageJson");qs.updateProjectPackageJson=Nft});var iue=h(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.generatePackageJson=void 0;var rue=tue(),nue=rc(),Aft=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,rue.generateDefaultPackageJson)(t);try{await(0,rue.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new nue.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new nue.PluginResult},"generatePackageJson");R1.generatePackageJson=Aft});var oue=h(a_=>{"use strict";var Rft=a_&&a_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a_,"__esModule",{value:!0});a_.generatePoliciesConfig=void 0;var Cft=Rft(require("path")),sue=kt(),$ft=Ti();a_.generatePoliciesConfig=(0,$ft.generateFileFromTemplate)(Cft.default.join(sue.USER_CONFIG_DIR_NAME,sue.POLICIES_CONFIG_FILE),"policies.template.json")});var aue=h(u_=>{"use strict";var Dft=u_&&u_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u_,"__esModule",{value:!0});u_.generateSettingsJson=void 0;var Lft=Dft(require("path")),jft=Ti();u_.generateSettingsJson=(0,jft.generateFileFromTemplate)(Lft.default.join(".vscode","settings.json"),"settings.template.jsonc")});var uue=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.generateTSConfig=void 0;var Mft=Ti();C1.generateTSConfig=(0,Mft.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var lue=h(c_=>{"use strict";var Uft=c_&&c_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c_,"__esModule",{value:!0});c_.generateZuploJson=void 0;var xft=Yo(),qft=require("fs/promises"),Fft=Uft(require("path")),kft=kt(),cue=rc(),Bft=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:xft.DEFAULT_COMPATIBILITY_DATE},i=Fft.default.join(t,kft.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,qft.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new cue.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new cue.PluginResult},"generateZuploJson");c_.generateZuploJson=Bft});var hue=h(l_=>{"use strict";var pue=l_&&l_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l_,"__esModule",{value:!0});l_.create=void 0;var fue=Pae(),Gft=pue(gn()),Vft=require("fs/promises"),zft=pue(require("path")),Hft=rc(),due=QF(),Kft=$ae(),Wft=xae(),Yft=Fae(),Jft=Bae(),Xft=Vae(),Qft=Hae(),Zft=Kae(),edt=Wae(),tdt=Yae(),rdt=Jae(),ndt=Qae(),idt=iue(),sdt=oue(),odt=aue(),adt=uue(),udt=lue();async function cdt({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,due.sanitize)(e),o=(0,due.sanitize)(t),a=zft.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await Gft.default.dirExists(a))throw new fue.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:fue.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(Kft.createProjectDirs,ndt.generateRouteOasConfig,udt.generateZuploJson,Qft.generateDevPortalConfigJson,Xft.generateDefaultModule,Yft.generateDefaultDocsSidebar,Wft.generateDefaultDocsMarkdown,Jft.generateDefaultDocsTheme,sdt.generatePoliciesConfig),c.push(adt.generateTSConfig,tdt.generateGitignore,idt.generatePackageJson,Zft.generateEnvironment,edt.generateESLint,rdt.generateLaunchJson,odt.generateSettingsJson);let{errors:l,warnings:f}=await(0,Hft.runPlugins)(c,u);if(f.length>0&&f.forEach(_=>{n.warn(_)}),l.length>0){await(0,Vft.rm)(a,{recursive:!0,force:!0});let _=l[0];throw _ instanceof Error?_:new Error(_.message)}return{sourceDirectory:a,projectName:e}}s(cdt,"create");l_.create=cdt});var Eue=h((qqt,yue)=>{yue.exports=gue;gue.sync=fdt;var mue=require("fs");function ldt(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}s(ldt,"checkPathExt");function _ue(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:ldt(t,r)}s(_ue,"checkStat");function gue(e,t,r){mue.stat(e,function(n,i){r(n,n?!1:_ue(i,e,t))})}s(gue,"isexe");function fdt(e,t){return _ue(mue.statSync(e),e,t)}s(fdt,"sync")});var Pue=h((kqt,Oue)=>{Oue.exports=Sue;Sue.sync=ddt;var bue=require("fs");function Sue(e,t,r){bue.stat(e,function(n,i){r(n,n?!1:vue(i,t))})}s(Sue,"isexe");function ddt(e,t){return vue(bue.statSync(e),t)}s(ddt,"sync");function vue(e,t){return e.isFile()&&pdt(e,t)}s(vue,"checkStat");function pdt(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),f=u|c,d=r&l||r&c&&i===a||r&u&&n===o||r&f&&o===0;return d}s(pdt,"checkMode")});var wue=h((Vqt,Iue)=>{var Gqt=require("fs"),$1;process.platform==="win32"||global.TESTING_WINDOWS?$1=Eue():$1=Pue();Iue.exports=tk;tk.sync=hdt;function tk(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){tk(e,t||{},function(o,a){o?i(o):n(a)})})}$1(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(tk,"isexe");function hdt(e,t){try{return $1.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(hdt,"sync")});var Due=h((Hqt,$ue)=>{var f_=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Tue=require("path"),mdt=f_?";":":",Nue=wue(),Aue=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Rue=s((e,t)=>{let r=t.colon||mdt,n=e.match(/\//)||f_&&e.match(/\\/)?[""]:[...f_?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=f_?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=f_?i.split(r):[""];return f_&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),Cue=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Rue(e,t),a=[],u=s(l=>new Promise((f,d)=>{if(l===n.length)return t.all&&a.length?f(a):d(Aue(e));let _=n[l],m=/^".*"$/.test(_)?_.slice(1,-1):_,g=Tue.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(c(y,l,0))}),"step"),c=s((l,f,d)=>new Promise((_,m)=>{if(d===i.length)return _(u(f+1));let g=i[d];Nue(l+g,{pathExt:o},(y,b)=>{if(!y&&b)if(t.all)a.push(l+g);else return _(l+g);return _(c(l,f,d+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),_dt=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=Rue(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=Tue.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let _=f+n[d];try{if(Nue.sync(_,{pathExt:i}))if(t.all)o.push(_);else return _}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw Aue(e)},"whichSync");$ue.exports=Cue;Cue.sync=_dt});var nk=h((Wqt,rk)=>{"use strict";var Lue=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");rk.exports=Lue;rk.exports.default=Lue});var xue=h((Jqt,Uue)=>{"use strict";var jue=require("path"),gdt=Due(),ydt=nk();function Mue(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let a;try{a=gdt.sync(e.command,{path:r[ydt({env:r})],pathExt:t?jue.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=jue.resolve(i?e.options.cwd:"",a)),a}s(Mue,"resolveCommandAttempt");function Edt(e){return Mue(e)||Mue(e,!0)}s(Edt,"resolveCommand");Uue.exports=Edt});var que=h((Qqt,sk)=>{"use strict";var ik=/([()\][%!^"`<>&|;, *?])/g;function bdt(e){return e=e.replace(ik,"^$1"),e}s(bdt,"escapeCommand");function Sdt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ik,"^$1"),t&&(e=e.replace(ik,"^$1")),e}s(Sdt,"escapeArgument");sk.exports.command=bdt;sk.exports.argument=Sdt});var kue=h((e2t,Fue)=>{"use strict";Fue.exports=/^#!(.*)/});var Gue=h((t2t,Bue)=>{"use strict";var vdt=kue();Bue.exports=(e="")=>{let t=e.match(vdt);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var zue=h((r2t,Vue)=>{"use strict";var ok=require("fs"),Odt=Gue();function Pdt(e){let r=Buffer.alloc(150),n;try{n=ok.openSync(e,"r"),ok.readSync(n,r,0,150,0),ok.closeSync(n)}catch{}return Odt(r.toString())}s(Pdt,"readShebang");Vue.exports=Pdt});var Yue=h((i2t,Wue)=>{"use strict";var Idt=require("path"),Hue=xue(),Kue=que(),wdt=zue(),Tdt=process.platform==="win32",Ndt=/\.(?:com|exe)$/i,Adt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Rdt(e){e.file=Hue(e);let t=e.file&&wdt(e.file);return t?(e.args.unshift(e.file),e.command=t,Hue(e)):e.file}s(Rdt,"detectShebang");function Cdt(e){if(!Tdt)return e;let t=Rdt(e),r=!Ndt.test(t);if(e.options.forceShell||r){let n=Adt.test(t);e.command=Idt.normalize(e.command),e.command=Kue.command(e.command),e.args=e.args.map(o=>Kue.argument(o,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(Cdt,"parseNonShell");function $dt(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Cdt(n)}s($dt,"parse");Wue.exports=$dt});var Que=h((o2t,Xue)=>{"use strict";var ak=process.platform==="win32";function uk(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(uk,"notFoundError");function Ddt(e,t){if(!ak)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=Jue(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(Ddt,"hookChildProcess");function Jue(e,t){return ak&&e===1&&!t.file?uk(t.original,"spawn"):null}s(Jue,"verifyENOENT");function Ldt(e,t){return ak&&e===1&&!t.file?uk(t.original,"spawnSync"):null}s(Ldt,"verifyENOENTSync");Xue.exports={hookChildProcess:Ddt,verifyENOENT:Jue,verifyENOENTSync:Ldt,notFoundError:uk}});var tce=h((u2t,d_)=>{"use strict";var Zue=require("child_process"),ck=Yue(),lk=Que();function ece(e,t,r){let n=ck(e,t,r),i=Zue.spawn(n.command,n.args,n.options);return lk.hookChildProcess(i,n),i}s(ece,"spawn");function jdt(e,t,r){let n=ck(e,t,r),i=Zue.spawnSync(n.command,n.args,n.options);return i.error=i.error||lk.verifyENOENTSync(i.status,n),i}s(jdt,"spawnSync");d_.exports=ece;d_.exports.spawn=ece;d_.exports.sync=jdt;d_.exports._parse=ck;d_.exports._enoent=lk});var nce=h((l2t,rce)=>{"use strict";rce.exports=e=>{let t=typeof e=="string"?`
|
|
303
303
|
`:`
|
|
304
304
|
`.charCodeAt(),r=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e}});var oce=h((f2t,YE)=>{"use strict";var WE=require("path"),ice=nk(),sce=s(e=>{e={cwd:process.cwd(),path:process.env[ice()],execPath:process.execPath,...e};let t,r=WE.resolve(e.cwd),n=[];for(;t!==r;)n.push(WE.join(r,"node_modules/.bin")),t=r,r=WE.resolve(r,"..");let i=WE.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(WE.delimiter)},"npmRunPath");YE.exports=sce;YE.exports.default=sce;YE.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=ice({env:t});return e.path=t[r],t[r]=YE.exports(e),t}});var uce=h((p2t,fk)=>{"use strict";var ace=s((e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},"mimicFn");fk.exports=ace;fk.exports.default=ace});var lce=h((m2t,L1)=>{"use strict";var Mdt=uce(),D1=new WeakMap,cce=s((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,i=e.displayName||e.name||"<anonymous>",o=s(function(...a){if(D1.set(o,++n),n===1)r=e.apply(this,a),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r},"onetime");return Mdt(o,e),D1.set(o,n),o},"onetime");L1.exports=cce;L1.exports.default=cce;L1.exports.callCount=e=>{if(!D1.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return D1.get(e)}});var fce=h(j1=>{"use strict";Object.defineProperty(j1,"__esModule",{value:!0});j1.SIGNALS=void 0;var Udt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];j1.SIGNALS=Udt});var dk=h(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.SIGRTMAX=p_.getRealtimeSignals=void 0;var xdt=s(function(){let e=pce-dce+1;return Array.from({length:e},qdt)},"getRealtimeSignals");p_.getRealtimeSignals=xdt;var qdt=s(function(e,t){return{name:`SIGRT${t+1}`,number:dce+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),dce=34,pce=64;p_.SIGRTMAX=pce});var hce=h(M1=>{"use strict";Object.defineProperty(M1,"__esModule",{value:!0});M1.getSignals=void 0;var Fdt=require("os"),kdt=fce(),Bdt=dk(),Gdt=s(function(){let e=(0,Bdt.getRealtimeSignals)();return[...kdt.SIGNALS,...e].map(Vdt)},"getSignals");M1.getSignals=Gdt;var Vdt=s(function({name:e,number:t,description:r,action:n,forced:i=!1,standard:o}){let{signals:{[e]:a}}=Fdt.constants,u=a!==void 0;return{name:e,number:u?a:t,description:r,supported:u,action:n,forced:i,standard:o}},"normalizeSignal")});var _ce=h(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});h_.signalsByNumber=h_.signalsByName=void 0;var zdt=require("os"),mce=hce(),Hdt=dk(),Kdt=s(function(){return(0,mce.getSignals)().reduce(Wdt,{})},"getSignalsByName"),Wdt=s(function(e,{name:t,number:r,description:n,supported:i,action:o,forced:a,standard:u}){return{...e,[t]:{name:t,number:r,description:n,supported:i,action:o,forced:a,standard:u}}},"getSignalByName"),Ydt=Kdt();h_.signalsByName=Ydt;var Jdt=s(function(){let e=(0,mce.getSignals)(),t=Hdt.SIGRTMAX+1,r=Array.from({length:t},(n,i)=>Xdt(i,e));return Object.assign({},...r)},"getSignalsByNumber"),Xdt=s(function(e,t){let r=Qdt(e,t);if(r===void 0)return{};let{name:n,description:i,supported:o,action:a,forced:u,standard:c}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:a,forced:u,standard:c}}},"getSignalByNumber"),Qdt=s(function(e,t){let r=t.find(({name:n})=>zdt.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},"findSignalByNumber"),Zdt=Jdt();h_.signalsByNumber=Zdt});var yce=h((P2t,gce)=>{"use strict";var{signalsByName:ept}=_ce(),tpt=s(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:o,isCanceled:a})=>e?`timed out after ${t} milliseconds`:a?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed","getErrorPrefix"),rpt=s(({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:a,escapedCommand:u,timedOut:c,isCanceled:l,killed:f,parsed:{options:{timeout:d}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let _=i===void 0?void 0:ept[i].description,m=n&&n.code,y=`Command ${tpt({timedOut:c,timeout:d,errorCode:m,signal:i,signalDescription:_,exitCode:o,isCanceled:l})}: ${a}`,b=Object.prototype.toString.call(n)==="[object Error]",E=b?`${y}
|
|
305
305
|
${n.message}`:y,v=[E,t,e].filter(Boolean).join(`
|