@zuplo/core 5.1849.0 → 5.1852.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 +2 -2
- package/package.json +1 -1
package/index.minified.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
"use strict";var ovr=Object.create;var YD=Object.defineProperty;var uvr=Object.getOwnPropertyDescriptor;var lvr=Object.getOwnPropertyNames;var cvr=Object.getPrototypeOf;var dvr=Object.prototype.hasOwnProperty;var a=(e,t)=>YD(e,"name",{value:t,configurable:true});var Ii=(e,t)=>()=>(e&&(t=e(e=0)),t);var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var XD=(e,t)=>{for(var r in t)YD(e,r,{get:t[r],enumerable:true})};var kGe=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of lvr(t))if(!dvr.call(e,i)&&i!==r)YD(e,i,{get:()=>t[i],enumerable:!(n=uvr(t,i))||n.enumerable})}return e};var Si=(e,t,r)=>(r=e!=null?ovr(cvr(e)):{},kGe(t||!e||!e.__esModule?YD(r,"default",{value:e,enumerable:true}):r,e));var Ct=e=>kGe(YD({},"__esModule",{value:true}),e);var DGe=y((uls,pvr)=>{pvr.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var FGe=y((lls,M$)=>{var fvr=require("fs");var LGe=require("path");var mvr=require("os");var hvr=DGe();var gvr=hvr.version;var yvr=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function _vr(e){const t={};let r=e.toString();r=r.replace(/\r\n?/mg,"\n");let n;while((n=yvr.exec(r))!=null){const i=n[1];let s=n[2]||"";s=s.trim();const o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2");if(o==='"'){s=s.replace(/\\n/g,"\n");s=s.replace(/\\r/g,"\r")}t[i]=s}return t}a(_vr,"parse");function Fce(e){console.log(`[dotenv@${gvr}][DEBUG] ${e}`)}a(Fce,"_log");function vvr(e){return e[0]==="~"?LGe.join(mvr.homedir(),e.slice(1)):e}a(vvr,"_resolveHome");function Evr(e){let t=LGe.resolve(process.cwd(),".env");let r="utf8";const n=Boolean(e&&e.debug);const i=Boolean(e&&e.override);if(e){if(e.path!=null){t=vvr(e.path)}if(e.encoding!=null){r=e.encoding}}try{const s=B$.parse(fvr.readFileSync(t,{encoding:r}));Object.keys(s).forEach(function(o){if(!Object.prototype.hasOwnProperty.call(process.env,o)){process.env[o]=s[o]}else{if(i===true){process.env[o]=s[o]}if(n){if(i===true){Fce(`"${o}" is already defined in \`process.env\` and WAS overwritten`)}else{Fce(`"${o}" is already defined in \`process.env\` and was NOT overwritten`)}}}});return{parsed:s}}catch(s){if(n){Fce(`Failed to load ${t} ${s.message}`)}return{error:s}}}a(Evr,"config");var B$={config:Evr,parse:_vr};M$.exports.config=B$.config;M$.exports.parse=B$.parse;M$.exports=B$});var Jd=y(X2=>{"use strict";Object.defineProperty(X2,"__esModule",{value:true});X2.EnvironmentalVariableRequiredError=X2.getRequiredEnvVar=void 0;var Bce=class{static{a(this,"Environment")}get LOG_LEVEL(){return process.env.LOG_LEVEL??"info"}get LOG_FORMAT(){return process.env.LOG_FORMAT??"pretty"}get NODE_ENV(){return process.env.NODE_ENV}get USE_LOCAL_API_SERVER(){return process.env.USE_LOCAL_API_SERVER==="true"}get USE_MONOREPO_PACKAGES(){return process.env.USE_MONOREPO_PACKAGES==="true"}get GCP_STORAGE_BUNDLE_BUCKET_NAME(){return process.env.GCP_STORAGE_BUNDLE_BUCKET_NAME}get GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME(){return process.env.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}get GCP_STORAGE_ARCHIVE_BUCKET_NAME(){return process.env.GCP_STORAGE_ARCHIVE_BUCKET_NAME}get GCP_STORAGE_SOURCE_CODE_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}get GCP_STORAGE_SOURCES_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCES_BUCKET_NAME}get ZUPLO_AUTH_API_JWT(){return process.env.ZUPLO_AUTH_API_JWT}get GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS(){return process.env.GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS}get RUNTIME_DENO_VERSION(){return process.env.RUNTIME_DENO_VERSION??"1.53.0"}get AUTH_API_URL(){return Pm("AUTH_API_URL","http://localhost:5201")}get MANAGEMENT_API_URL(){return Pm("MANAGEMENT_API_URL","http://localhost:3100")}get TENANT_API_URL(){return Pm("TENANT_API_URL","http://localhost:5100")}get CONTENT_API_URL(){return Pm("CONTENT_API_URL","http://localhost:5400")}get DEPLOYER_API_URL(){return Pm("DEPLOYER_API_URL","http://localhost:5300")}get DEV_API_URL(){return Pm("DEV_API_URL","http://localhost:5200")}get API_KEY_SERVICE_URL(){return Pm("API_KEY_SERVICE_URL","https://apikey.zuplo.com")}get API_KEY_MANAGEMENT_SERVICE_URL(){return Pm("API_KEY_MANAGEMENT_SERVICE_URL","https://api-key-management-service-rreeuhlsca-ue.a.run.app")}get METERING_SERVICE_URL(){return Pm("METERING_SERVICE_URL","https://meters.zuplo.com")}get FETCH_PROXY_URL(){return process.env.FETCH_PROXY_URL||"https://proxy-main-04e55cb.zuplo.app"}get FETCH_PROXY_API_KEY(){return process.env.FETCH_PROXY_API_KEY||"zpk_123"}get LOG_EVENT_API_URL(){return process.env.LOG_EVENT_API_URL}get LAUNCH_DARKLY_SERVER_KEY(){return process.env.LAUNCH_DARKLY_SERVER_KEY}get REMOTE_LOGGING_SHARED_SECRET(){return process.env.REMOTE_LOGGING_SHARED_SECRET??"the-logging-shared-secret"}get TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT(){return process.env.TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT??"10.142.0.64:5000"}get DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME(){return process.env.DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME??"zpl-developer-api"}get __ZUPLO_AUTH_API_JWT(){return process.env.__ZUPLO_AUTH_API_JWT??void 0}get BUILD_ASSETS_BUCKET_NAME(){return process.env.BUILD_ASSETS_BUCKET_NAME}get BUILD_ASSETS_S3_ENDPOINT(){return process.env.BUILD_ASSETS_S3_ENDPOINT}get BUILD_ASSETS_ACCESS_KEY_ID(){return process.env.BUILD_ASSETS_ACCESS_KEY_ID}get BUILD_ASSETS_SECRET_ACCESS_KEY(){return process.env.BUILD_ASSETS_SECRET_ACCESS_KEY}get DEV_PORTAL_ENCRYPTION_SECRET(){if(!process.env.DEV_PORTAL_ENCRYPTION_SECRET){throw new JD(`DEV_PORTAL_ENCRYPTION_SECRET`)}return process.env.DEV_PORTAL_ENCRYPTION_SECRET}isProduction(){return this.NODE_ENV==="production"}get OPENFGA_SERVICE_URL(){return Pm("OPENFGA_SERVICE_URL","https://openfga-eq7z4lly2a-ue.a.run.app")}get OPENFGA_STORE_ID(){return process.env.OPENFGA_STORE_ID??""}get OPENFGA_MODEL_ID(){return process.env.OPENFGA_MODEL_ID??""}};function Pm(e,t){const r=process.env[e];if(r===void 0&&(t===void 0||process.env.NODE_ENV==="production")){throw new JD(e)}return r??t}a(Pm,"getRequiredEnvVar");X2.getRequiredEnvVar=Pm;var JD=class extends Error{static{a(this,"EnvironmentalVariableRequiredError")}constructor(t){super(`The environmental variable '${t}' is required.'`)}};X2.EnvironmentalVariableRequiredError=JD;var bvr=new Bce;X2.default=bvr});var Mce=y(q$=>{"use strict";Object.defineProperty(q$,"__esModule",{value:true});q$.HttpStatusCode=void 0;var BGe;(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"})(BGe||(q$.HttpStatusCode=BGe={}))});var MGe=y(U$=>{"use strict";Object.defineProperty(U$,"__esModule",{value:true});U$.getSourceControlProviderLabel=void 0;function Svr(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}a(Svr,"getSourceControlProviderLabel");U$.getSourceControlProviderLabel=Svr});var UGe=y(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:true});z.DEPLOYMENT_INVALID_MULTI_PART=z.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=z.DEPLOYMENT_FILE_DOES_NOT_EXISTS=z.DEPLOYMENT_NOT_FOUND=z.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=z.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=z.DEPLOYMENT_NO_ACCESS=z.INVALID_SOURCE_REPO_URL=z.INVALID_EMAIL_FORMAT=z.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=z.PROJECT_MUST_HAVE_ONE_MEMBER=z.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=z.PROJECT_MEMBER_ALREADY_EXISTS=z.PROJECT_MEMBER_NOT_FOUND=z.INVALID_TEMPLATE_REPOSITORY=z.INCORRECT_PROJECT_TEMPLATE=z.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=z.PROJECT_NOT_FOUND=z.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=z.PROJECT_SHARING_DISABLED_ON_ACCOUNT=z.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=z.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=z.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=z.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=z.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=z.ACCOUNT_MEMBER_INVITE_INVALID=z.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=z.ACCOUNT_MEMBER_DOES_NOT_EXIST=z.ACCOUNT_MEMBER_INFO_MISSING=z.ACCOUNT_MEMBER_ALREADY_EXISTS=z.ACCOUNT_UPDATE_INFO_MISSING=z.ACCOUNT_INFO_MISSING=z.ACCOUNT_DOES_NOT_EXISTS=z.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=z.ACCOUNT_NAME_USES_RESERVED_KEYWORD=z.ACCOUNT_ALREADY_EXISTS=z.ACCOUNT_NOT_FOUND=z.USER_IS_NOT_SERVICE_ACCOUNT=z.USER_REMOVE_NOT_MEMBER_ACCOUNT=z.USER_HAS_NO_ACCESS_TO_ACCOUNT=z.USER_DETAILS_CANNOT_BE_FOUND=z.USER_ALREADY_EXISTS=z.CLIENT_NOT_FOUND=z.FORBIDDEN=z.UNAUTHORIZED=z.METHOD_NOT_ALLOWED=z.NOT_FOUND=z.CONFLICT=z.BAD_REQUEST=z.INTERNAL_SERVER_ERROR=void 0;z.GITHUB_INTEGRATION_DUPLICATE_REPO=z.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=z.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=z.GITHUB_INTEGRATION_BRANCH_BEHIND=z.GITHUB_INTEGRATION_NOT_FOUND=z.GITHUB_REPOSITORY_NOT_FOUND=z.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=z.GITHUB_INTEGRATION_ALREADY_EXISTS=z.FEATURE_FLAGS_NOT_FOUND=z.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=z.PROJECT_ALREADY_HAS_REPO=z.PROJECT_INVALID_NAME=z.FAILED_TO_REVOKE_GH_TOKEN=z.USER_ACCOUNT_NOT_FS_MIGRATED=z.USER_NO_ACCESS_GITLAB_REPO=z.USER_NO_ACCESS_BITBUCKET_REPO=z.GITHUB_APP_CONFIGURATION_NOT_FOUND=z.GITHUB_APP_NO_USER_ACCESS_=z.GITHUB_APP_NO_NAMESPACE_ACCESS=z.GENERIC_GITHUB_BRANCH_INFO_ERROR=z.GITHUB_USER_NO_READ_ACCESS_REPO=z.USER_NO_PULL_ACCESS_GITHUB_REPO=z.USER_NO_ACCESS_GITHUB_REPO=z.PROJECT_SHARING_REQUIRES_GIT_REPO=z.PROJECT_INVALID_GIT_REPO=z.PROJECT_INVALID_GIT_CLONE=z.USER_IS_PROJECT_MEMBER=z.USER_HAS_NO_ACCESS_TO_PROJECT=z.RUNTIME_FLAG_KEY_NOT_VALID=z.RUNTIME_FLAG_NOT_FOUND=z.RUNTIME_FLAG_ALREADY_EXISTS=z.PROJECT_NO_MEMBERS=z.PROJECT_ALREADY_EXISTS=z.SERVICE_CONFIGURATION_FAILED_DECRYPTION=z.WORKING_COPY_SERVICE_NOT_CREATED=z.WORKING_COPY_SERVICE_NOT_DELETED=z.WORKING_COPY_SERVICE_NOT_FOUND=z.SERVICE_CONFIGURATION_NOT_FOUND=z.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=z.DEPLOYMENT_INCORRECT_STATUS_PAUSE=z.DEPLOYMENT_NOT_WORKING_COPY=z.DEPLOYMENT_LOG_NOT_FOUND=z.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=z.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=z.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=z.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=z.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=z.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=z.DEPLOYMENT_DELETE_ERROR=z.DEPLOYMENT_CANNOT_DELETE_INSTANCE=void 0;z.TARGET_BRANCH_ONLY_FOR_PREVIEW=z.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=z.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=z.DEPLOYMENT_NAME_MISSING=z.NON_EXISTENT_ENVIRONMENT_VARIABLE=z.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=z.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=z.DUPLICATE_ENVIRONMENT_VARIABLE=z.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=z.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=z.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=z.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=z.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=z.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=z.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=z.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=z.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=z.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=z.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=z.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=z.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=z.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=z.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=z.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=z.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=z.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=z.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=z.SOURCE_CONTROL_REPO_OPERATION_ERROR=z.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=z.SOURCE_CONTROL_REPO_NOT_FOUND=z.SOURCE_CONTROL_AUTHENTICATION_FAILED=z.EXTERNAL_SERVICE_GENERIC_ERROR=z.API_USER_NO_ACCESS=z.EXTERNAL_USER_NOT_CONFIGURED=z.EXTERNAL_USER_NO_ACCESS=z.CONSUMER_DOES_NOT_EXIST=z.CONSUMER_NO_ACCESS=z.GITLAB_ACCESS_LEVEL_CHECK_FAIL=z.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=z.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=z.GITLAB_DUPLICATE_REPO=z.GITLAB_FAILED_DURING_REPO_CREATION=z.GITLAB_QUERY_USER_INFO_FAILED=z.BITBUCKET_FAILED_DURING_REPO_CREATION=z.BITBUCKET_WORKSPACE_MISCONFIGURATION=z.BITBUCKET_QUERY_USER_INFO_FAILED=z.GITHUB_INTEGRATION_INVALID_REPO=z.GIT_CREATE_PROJECT_WITH_INVALID_REPO=z.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=z.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=void 0;z.UNABLE_UPGRADE_PLAN=z.BUCKET_API_KEY_SERVICE_CONFLICT=z.DIRECTORY_DELETE_FAILED=z.FILE_DELETE_FAILED=z.CANNOT_DELETE_SOLE_OPEN_API_FILE=z.CANNOT_DELETE_ESSENTIAL_DIRECTORY=z.CANNOT_DELETE_ESSENTIAL_FILE=z.FILE_WRITE_FAILED=z.FILE_RENAME_FAILED=z.FILE_RENAME_FILE_ALREADY_EXISTS=z.FILE_RENAME_CANNOT_CHANGE_EXTENSION=z.FILE_RENAME_PATHS_MATCH=z.DIRECTORY_CREATION_FAILED=z.DIRECTORY_OR_FILE_DOES_NOT_EXIST=z.DIRECTORY_DOES_NOT_EXIST=z.DIRECTORY_ALREADY_EXISTS=z.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=z.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=z.FAILED_DOWNLOAD_FROM_STORAGE=z.CANNOT_FIND_SRC_DIRECTORY=z.CANNOT_READ_PACKAGE_JSON=z.PACKAGE_JSON_NOT_FOUND=z.RUNTIME_VERSION_INCORRECT_FORMAT=z.MIGRATIONS_ONLY_ON_WORKING_COPY=z.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=z.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=z.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=z.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=z.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=z.NO_GLOBAL_SYMBOLS=z.NO_ZUPLO_PREFIXED_VARIABLES=z.NON_EMPTY_TARGETS_REQUIRED=z.CONFLICTING_TYPES=z.OVERLAPPING_TARGETS=z.INVALID_BRANCH_NAME=void 0;var Me=Mce();var qGe=MGe();var Avr="https://github.com/apps/zuplo/installations/new";z.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:Me.HttpStatusCode.BAD_REQUEST};z.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:Me.HttpStatusCode.CONFLICT};z.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:Me.HttpStatusCode.NOT_FOUND};z.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:Me.HttpStatusCode.METHOD_NOT_ALLOWED};z.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:Me.HttpStatusCode.UNAUTHORIZED};z.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:Me.HttpStatusCode.FORBIDDEN};z.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:Me.HttpStatusCode.NOT_FOUND};z.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:Me.HttpStatusCode.CONFLICT};z.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:Me.HttpStatusCode.NOT_FOUND};z.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:Me.HttpStatusCode.UNAUTHORIZED};z.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:Me.HttpStatusCode.BAD_REQUEST};z.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:Me.HttpStatusCode.CONFLICT};z.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:Me.HttpStatusCode.FORBIDDEN};z.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:Me.HttpStatusCode.NOT_FOUND};z.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:Me.HttpStatusCode.NOT_FOUND};z.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",status:Me.HttpStatusCode.FORBIDDEN};z.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:Me.HttpStatusCode.BAD_REQUEST};var Cvr=a(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:Me.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");z.INVALID_TEMPLATE_REPOSITORY=Cvr;z.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:Me.HttpStatusCode.NOT_FOUND};z.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:Me.HttpStatusCode.BAD_REQUEST};z.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:Me.HttpStatusCode.BAD_REQUEST};z.INVALID_EMAIL_FORMAT={type:"https://zup.fail/invalid-email-format",title:"The email address provided is in an invalid email format",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};z.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.FORBIDDEN};z.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:`Deployment is not working copy.`,status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:Me.HttpStatusCode.BAD_REQUEST};z.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:Me.HttpStatusCode.NOT_FOUND};z.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:Me.HttpStatusCode.NOT_FOUND};z.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:Me.HttpStatusCode.BAD_REQUEST};z.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:Me.HttpStatusCode.BAD_REQUEST};z.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:Me.HttpStatusCode.NOT_FOUND};z.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:Me.HttpStatusCode.BAD_REQUEST};z.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:Me.HttpStatusCode.NOT_FOUND};z.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:Me.HttpStatusCode.BAD_REQUEST};z.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:Me.HttpStatusCode.FORBIDDEN};z.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};var wvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");z.USER_NO_ACCESS_GITHUB_REPO=wvr;var Tvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");z.USER_NO_PULL_ACCESS_GITHUB_REPO=Tvr;var xvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");z.GITHUB_USER_NO_READ_ACCESS_REPO=xvr;z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.FORBIDDEN};var Rvr=a(({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 '${Avr}' to add the repository.`,status:Me.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");z.GITHUB_APP_NO_USER_ACCESS_=Rvr;z.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:Me.HttpStatusCode.NOT_FOUND};var Ovr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");z.USER_NO_ACCESS_BITBUCKET_REPO=Ovr;var Pvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");z.USER_NO_ACCESS_GITLAB_REPO=Pvr;z.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:Me.HttpStatusCode.FORBIDDEN};z.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:Me.HttpStatusCode.BAD_REQUEST};var Nvr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:Me.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");z.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=Nvr;var Ivr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:Me.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");z.GITHUB_REPOSITORY_NOT_FOUND=Ivr;z.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:Me.HttpStatusCode.NOT_FOUND,detail:`The project does not have a GitHub integration configured.`};z.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:Me.HttpStatusCode.BAD_REQUEST};z.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};var kvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");z.GITHUB_INTEGRATION_DUPLICATE_REPO=kvr;var Dvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");z.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=Dvr;var Lvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");z.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=Lvr;var Fvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");z.GIT_CREATE_PROJECT_WITH_INVALID_REPO=Fvr;var Bvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");z.GITHUB_INTEGRATION_INVALID_REPO=Bvr;z.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:Me.HttpStatusCode.FORBIDDEN};z.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:Me.HttpStatusCode.FORBIDDEN};var Mvr=a(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:Me.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");z.BITBUCKET_FAILED_DURING_REPO_CREATION=Mvr;z.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:Me.HttpStatusCode.FORBIDDEN};var qvr=a(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");z.GITLAB_FAILED_DURING_REPO_CREATION=qvr;var Uvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");z.GITLAB_DUPLICATE_REPO=Uvr;var $vr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");z.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=$vr;var jvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");z.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=jvr;var Gvr=a(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");z.GITLAB_ACCESS_LEVEL_CHECK_FAIL=Gvr;z.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:Me.HttpStatusCode.UNAUTHORIZED};z.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:Me.HttpStatusCode.NOT_FOUND};z.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:Me.HttpStatusCode.UNAUTHORIZED};z.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:Me.HttpStatusCode.FORBIDDEN};z.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:Me.HttpStatusCode.FORBIDDEN};z.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};var Hvr=a(({sourceControlProvider:e})=>{const t=(0,qGe.getSourceControlProviderLabel)(e);return{type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${t}`,status:Me.HttpStatusCode.UNAUTHORIZED}},"SOURCE_CONTROL_AUTHENTICATION_FAILED");z.SOURCE_CONTROL_AUTHENTICATION_FAILED=Hvr;var Vvr=a(({sourceControlProvider:e})=>{const t=(0,qGe.getSourceControlProviderLabel)(e);return{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 ${t} repository`,status:Me.HttpStatusCode.NOT_FOUND}},"SOURCE_CONTROL_REPO_NOT_FOUND");z.SOURCE_CONTROL_REPO_NOT_FOUND=Vvr;z.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:Me.HttpStatusCode.BAD_REQUEST};var zvr=a(({repoURL:e,operation:t})=>{return{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:Me.HttpStatusCode.FORBIDDEN}},"SOURCE_CONTROL_REPO_OPERATION_ERROR");z.SOURCE_CONTROL_REPO_OPERATION_ERROR=zvr;z.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:Me.HttpStatusCode.FORBIDDEN};z.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.UNAUTHORIZED};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:Me.HttpStatusCode.FAILED_DEPENDENCY};z.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:Me.HttpStatusCode.FAILED_DEPENDENCY};z.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:Me.HttpStatusCode.FAILED_DEPENDENCY};z.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:Me.HttpStatusCode.BAD_REQUEST};z.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:Me.HttpStatusCode.BAD_REQUEST};z.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:Me.HttpStatusCode.BAD_REQUEST};z.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.FORBIDDEN};z.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:Me.HttpStatusCode.NOT_FOUND};var Kvr=a(({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:Me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");z.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=Kvr;var Wvr=a(()=>({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:Me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");z.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=Wvr;z.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:`Migrations can only run on working copies.`,status:Me.HttpStatusCode.BAD_REQUEST};z.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:`Runtime version is in an incorrect format.`,status:Me.HttpStatusCode.BAD_REQUEST};z.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:`No package.json file found.`,status:Me.HttpStatusCode.NOT_FOUND};z.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:`Cannot read package.json file.`,status:Me.HttpStatusCode.BAD_REQUEST};z.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:`Cannot find source directory.`,status:Me.HttpStatusCode.BAD_REQUEST};z.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:`Failed to download content from storage.`,status:Me.HttpStatusCode.BAD_REQUEST};var Yvr=a(({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:Me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");z.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=Yvr;var Xvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");z.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=Xvr;var Jvr=a(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");z.DIRECTORY_ALREADY_EXISTS=Jvr;var Qvr=a(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:Me.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");z.DIRECTORY_DOES_NOT_EXIST=Qvr;var Zvr=a(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:Me.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");z.DIRECTORY_OR_FILE_DOES_NOT_EXIST=Zvr;var eEr=a(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");z.DIRECTORY_CREATION_FAILED=eEr;var tEr=a(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:Me.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");z.FILE_RENAME_PATHS_MATCH=tEr;var rEr=a(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");z.FILE_RENAME_CANNOT_CHANGE_EXTENSION=rEr;var nEr=a(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:Me.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");z.FILE_RENAME_FILE_ALREADY_EXISTS=nEr;var iEr=a(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");z.FILE_RENAME_FAILED=iEr;var sEr=a(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");z.FILE_WRITE_FAILED=sEr;var aEr=a(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");z.CANNOT_DELETE_ESSENTIAL_FILE=aEr;var oEr=a(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");z.CANNOT_DELETE_ESSENTIAL_DIRECTORY=oEr;var uEr=a(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Your project must have at least 1 OpenAPI file.`}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");z.CANNOT_DELETE_SOLE_OPEN_API_FILE=uEr;var lEr=a(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");z.FILE_DELETE_FAILED=lEr;var cEr=a(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");z.DIRECTORY_DELETE_FAILED=cEr;z.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:Me.HttpStatusCode.CONFLICT};z.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:Me.HttpStatusCode.BAD_REQUEST}});var jGe=y(Gc=>{"use strict";var dEr=Gc&&Gc.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var pEr=Gc&&Gc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var fEr=Gc&&Gc.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))dEr(t,e,r)}pEr(t,e);return t};Object.defineProperty(Gc,"__esModule",{value:true});Gc.ApiNotFoundError=Gc.ApiError=Gc.Problems=void 0;var $Ge=fEr(UGe());Gc.Problems=$Ge;var $$=class extends Error{static{a(this,"ApiError")}type;status;detail;instance;constructor(t){super(t.title);if(!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}};Gc.ApiError=$$;var qce=class extends $${static{a(this,"ApiNotFoundError")}constructor(t={}){super({...t,...$Ge.NOT_FOUND});this.name="ApiNotFoundProblemError"}};Gc.ApiNotFoundError=qce});var Hc=y(T1=>{"use strict";var mEr=T1&&T1.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var hEr=T1&&T1.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))mEr(t,e,r)};Object.defineProperty(T1,"__esModule",{value:true});T1.HttpStatusCode=void 0;hEr(jGe(),T1);var gEr=Mce();Object.defineProperty(T1,"HttpStatusCode",{enumerable:true,get:function(){return gEr.HttpStatusCode}})});var $ce=y(j$=>{"use strict";Object.defineProperty(j$,"__esModule",{value:true});j$.CommonAuth=void 0;var I_=Hc();var yEr=["google-oauth2|106231436550039770264","google-oauth2|113609898431445637338","google-oauth2|115413213714061429608","google-oauth2|105283806895031006146","google-oauth2|116604562105669742663"];var Uce=class e{static{a(this,"CommonAuth")}static DEPLOYER_USER_SUB="deployer-app@zuplo";isZuploAdmin(t){return yEr.includes(t)}isDeployerServiceAccount(t){return e.DEPLOYER_USER_SUB===t}static isAuthorizedSub(t,r){if(typeof r==="string"){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}if(r instanceof Buffer){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}try{const n=t.includes(r.sub);if(!n){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}}catch(n){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}}};j$.CommonAuth=Uce});var jce=y(G$=>{"use strict";Object.defineProperty(G$,"__esModule",{value:true});G$.FeatureFlags=void 0;G$.FeatureFlags=Object.freeze({remoteModules:(e,t)=>({flagName:"REMOTE_MODULES",defaultValue:false,accountName:e,projectName:t}),disableIntegratedDevPortalBuild:(e,t)=>({flagName:"DISABLE_INTEGRATED_DEV_PORTAL_BUILD",defaultValue:false,accountName:e,projectName:t}),FS_ACCOUNT_NAME_PATH:"FS_ACCOUNT_NAME_PATH"})});var HGe=y(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:true});k_.hasBlockedNotifications=k_.getBuildFlagsForDeployment=k_.getDefaultFlags=void 0;var GGe=jce();var _Er=["chocolate_bold_silverfish"];function vEr(e){const t={remoteModules:!!e?.remoteModules,disableIntegratedDevPortalBuild:!!e?.disableIntegratedDevPortalBuild};return t}a(vEr,"getDefaultFlags");k_.getDefaultFlags=vEr;async function EEr(e,{accountName:t,projectName:r}){const n=await e.getFlagValue(GGe.FeatureFlags.remoteModules(t,r));const i=await e.getFlagValue(GGe.FeatureFlags.disableIntegratedDevPortalBuild(t,r));return{remoteModules:n,disableIntegratedDevPortalBuild:i}}a(EEr,"getBuildFlagsForDeployment");k_.getBuildFlagsForDeployment=EEr;function bEr(e){return _Er.includes(e)}a(bEr,"hasBlockedNotifications");k_.hasBlockedNotifications=bEr});var VGe=y(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:true});Vc.BuildIssueError=Vc.WARNING_SEVERITY=Vc.ERROR_SEVERITY=Vc.FAILURE_STATUS=Vc.WARNING_STATUS=Vc.GOOD_STATUS=void 0;Vc.GOOD_STATUS="Good";Vc.WARNING_STATUS="Warnings";Vc.FAILURE_STATUS="Failed";Vc.ERROR_SEVERITY="error";Vc.WARNING_SEVERITY="warning";var Gce=class extends Error{static{a(this,"BuildIssueError")}issue;constructor(t){super(t.message);this.issue=t}};Vc.BuildIssueError=Gce});var zGe=y(H$=>{"use strict";Object.defineProperty(H$,"__esModule",{value:true});H$.COMPATIBILITY_FLAG_MAPPINGS=void 0;H$.COMPATIBILITY_FLAG_MAPPINGS=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:true,doNotRunHooksOnSystemRoutes:true}})});var KGe=y((Ols,SEr)=>{SEr.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/zuplo.config.json",title:"Zuplo Config",description:"",type:"object",required:[],additionalProperties:false,properties:{version:{description:"The version of the configuration",type:"number",enum:[1]},project:{type:"string"},compatibilityDate:{description:"The compatibility date on which to run the gateway",type:"string",title:"Compatibility Date",default:"2023-03-14",enum:["2023-03-14","2024-01-15"]}}}});var WGe=y(V$=>{"use strict";Object.defineProperty(V$,"__esModule",{value:true});V$.VALID_COMPATIBILITY_DATES=void 0;V$.VALID_COMPATIBILITY_DATES=Object.freeze(["2023-03-14","2024-01-15"])});var YGe=y(D_=>{"use strict";var AEr=D_&&D_.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(D_,"__esModule",{value:true});D_.DEFAULT_COMPATIBILITY_DATE=D_.VALID_COMPATIBILITY_DATES=void 0;var CEr=AEr(KGe());var wEr=WGe();Object.defineProperty(D_,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return wEr.VALID_COMPATIBILITY_DATES}});D_.DEFAULT_COMPATIBILITY_DATE=CEr.default.properties.compatibilityDate.default});var XGe=y(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:true});L_.decrypt=L_.encrypt=L_.signString=void 0;var _T=require("crypto");function TEr(e,t){return(0,_T.createHmac)("sha256",t).update(e).digest("hex")}a(TEr,"signString");L_.signString=TEr;var Hce={AUTH_TAG_BYTE_LEN:16,IV_BYTE_LEN:12};var xEr=a(()=>(0,_T.randomBytes)(Hce.IV_BYTE_LEN),"getIV");function REr(e,t){if(e===null){return null}const r=(0,_T.createHash)("sha256").update(String(t)).digest("base64").substring(0,32);const n=xEr();const i=(0,_T.createCipheriv)("aes-256-gcm",r,n,{authTagLength:Hce.AUTH_TAG_BYTE_LEN});let s=i.update(e);s=Buffer.concat([s,i.final()]);return Buffer.concat([n,s,i.getAuthTag()]).toString("hex")}a(REr,"encrypt");L_.encrypt=REr;function OEr(e,t){if(!e){return null}const r=Buffer.from(t);const n=(0,_T.createHash)("sha256").update(String(r)).digest("base64").substring(0,32);const i=Buffer.from(e,"hex");const s=i.slice(-16);const o=i.slice(0,12);const u=i.slice(12,-16);const l=(0,_T.createDecipheriv)("aes-256-gcm",n,o,{authTagLength:Hce.AUTH_TAG_BYTE_LEN});l.setAuthTag(s);const c=l.update(u);return Buffer.concat([c,l.final()]).toString("utf-8")}a(OEr,"decrypt");L_.decrypt=OEr});var JGe=y(z$=>{"use strict";Object.defineProperty(z$,"__esModule",{value:true});z$.getCurrentUtcDateTime=void 0;function PEr(){const e={year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:true,timeZone:"UTC"};const t=new Date().toLocaleString("en-US",e);return t}a(PEr,"getCurrentUtcDateTime");z$.getCurrentUtcDateTime=PEr});var Vce=y(K$=>{"use strict";Object.defineProperty(K$,"__esModule",{value:true});K$.DeploymentLogState=void 0;var QGe;(function(e){e["ERROR"]="ERROR";e["IN_PROGRESS"]="IN_PROGRESS";e["SUCCESS"]="SUCCESS"})(QGe||(K$.DeploymentLogState=QGe={}))});var zce=y(ZGe=>{"use strict";Object.defineProperty(ZGe,"__esModule",{value:true})});var tHe=y(eHe=>{"use strict";Object.defineProperty(eHe,"__esModule",{value:true})});var rHe=y(W$=>{"use strict";Object.defineProperty(W$,"__esModule",{value:true});W$.MARKDOWN_FRONTMATTER_KEYS=void 0;W$.MARKDOWN_FRONTMATTER_KEYS=["sidebar_label"]});var iHe=y(nHe=>{"use strict";Object.defineProperty(nHe,"__esModule",{value:true})});var sHe=y(Jh=>{"use strict";var NEr=Jh&&Jh.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var Y$=Jh&&Jh.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))NEr(t,e,r)};Object.defineProperty(Jh,"__esModule",{value:true});Y$(zce(),Jh);Y$(tHe(),Jh);Y$(rHe(),Jh);Y$(iHe(),Jh)});var X$=y(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:true});Qh.getLoggerContext=Qh.requestIdGenerator=Qh.REQUEST_ID_HEADER=Qh.LEGACY_REQUEST_ID_HEADER=void 0;var IEr=require("crypto");Qh.LEGACY_REQUEST_ID_HEADER="zuplo-request-id";Qh.REQUEST_ID_HEADER="zp-rid";var kEr=a(e=>{const t=e.headers["zuplo-request-id"];const r=e.headers["X-GitHub-Delivery"];if(t){const n=t;return`${n}`}else if(r){return`${r}`}return(0,IEr.randomUUID)()},"requestIdGenerator");Qh.requestIdGenerator=kEr;function DEr(e){const t=e.raw.url??"";const r={};try{const n=e.headers["zuplo-user"]??e.user?.sub;if(n){r.userSub=`${n}`}const i=t.match(/(deployments)\/([a-zA-Z-0-9]*)/);if(i&&i!==null&&i.length>=2){r.deployment=i[2]}const s=t.match(/(accounts)\/([a-zA-Z-0-9]*)/);if(s&&s!==null&&s.length>=2){r.account=s[2]}const o=t.match(/(projects)\/([a-zA-Z-0-9]*)/);if(o&&o!==null&&o.length>=2){r.project=o[2]}}catch(n){}return r}a(DEr,"getLoggerContext");Qh.getLoggerContext=DEr});var Kce=y(vT=>{"use strict";var LEr=vT&&vT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(vT,"__esModule",{value:true});vT.errorHandler=void 0;var Mp=Hc();var FEr=LEr(Jd());var aHe=X$();function BEr(e,t,r){let n=500;let i;if(e instanceof Mp.ApiError){n=e.status;i={type:e.type,title:e.message,status:e.status,detail:e.detail,instance:e.instance}}else if(typeof e==="object"&&"validation"in e&&"validationContext"in e){n=Mp.HttpStatusCode.BAD_REQUEST;i={...Mp.Problems.BAD_REQUEST,detail:`An error occurred when validating the ${e.validationContext}.`,errors:e.validation}}else if(typeof e==="object"&&"code"in e&&e.code==="FST_ERR_NOT_FOUND"){n=404;i=Mp.Problems.NOT_FOUND}else if(typeof e==="object"&&"code"in e&&typeof e.code==="string"&&["FST_ERR_CTP_INVALID_TYPE","FST_ERR_CTP_EMPTY_TYPE","FST_ERR_CTP_BODY_TOO_LARGE","FST_ERR_CTP_INVALID_MEDIA_TYPE","FST_ERR_CTP_INVALID_CONTENT_LENGTH","FST_ERR_CTP_EMPTY_JSON_BODY","FST_ERR_BAD_URL","FST_ERR_INVALID_URL"].includes(e.code)){n=Mp.HttpStatusCode.BAD_REQUEST;i={...Mp.Problems.BAD_REQUEST,detail:e.message}}else{let o;if(!r.statusCode||r.statusCode===200){if(typeof e==="object"&&"statusCode"in e&&typeof e.statusCode==="number"){o=e.statusCode}else if(typeof e==="object"&&"status"in e&&typeof e.status==="number"){o=e.status}n=o&&o>=400?o:500}else{n=r.statusCode}i=MEr(n);if(FEr.default.NODE_ENV!=="production"){if(typeof e==="object"&&"message"in e){i.detail=e.message}else if(typeof e==="string"){i.detail=e}}}i.trace={timestamp:new Date().toJSON(),requestId:t.headers[aHe.REQUEST_ID_HEADER]??t.headers[aHe.LEGACY_REQUEST_ID_HEADER]};if(n<500){r.log.warn({res:r,err:e},e&&e.message)}else{r.log.error({req:t,res:r,err:e},e&&e.message)}const s=JSON.stringify(i,null,2);return r.status(n).header("content-type","application/json").send(s)}a(BEr,"errorHandler");vT.errorHandler=BEr;function MEr(e){if(e===401){return Mp.Problems.UNAUTHORIZED}else if(e===403){return Mp.Problems.FORBIDDEN}else if(e===404){return Mp.Problems.NOT_FOUND}else if(e===405){return Mp.Problems.METHOD_NOT_ALLOWED}else if(e<500&&e>=400){return Mp.Problems.BAD_REQUEST}return Mp.Problems.INTERNAL_SERVER_ERROR}a(MEr,"getProblemFromStatus")});var uHe=y((zls,Wce)=>{"use strict";var qEr=/at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/;var UEr=/(\w*(\.\w*)*)\..*/;Wce.exports=a(function e(t){if(t.name.length>0)return t.name;const r=Error.stackTraceLimit;Error.stackTraceLimit=10;try{throw new Error("anonymous function")}catch(n){Error.stackTraceLimit=r;return oHe(n.stack)}},"getPluginName");function oHe(e){const t=e.match(qEr);return t?t[1].split(/[/\\]/).slice(-1)[0].match(UEr)[1]:"anonymous"}a(oHe,"extractPluginName");Wce.exports.extractPluginName=oHe});var cHe=y((Wls,lHe)=>{"use strict";lHe.exports=a(function e(t){if(t[0]==="@"){t=t.slice(1).replace("/","-")}const r=t.replace(/-(.)/g,function(n,i){return i.toUpperCase()});return r},"toCamelCase")});var J2=y((Xls,J$)=>{"use strict";var $Er=uHe();var jEr=cHe();var GEr=0;function Yce(e,t={}){let r=false;if(typeof e.default!=="undefined"){e=e.default}if(typeof e!=="function"){throw new TypeError(`fastify-plugin expects a function, instead got a '${typeof e}'`)}if(typeof t==="string"){t={fastify:t}}if(typeof t!=="object"||Array.isArray(t)||t===null){throw new TypeError("The options object should be an object")}if(t.fastify!==void 0&&typeof t.fastify!=="string"){throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof t.fastify}'`)}if(!t.name){r=true;t.name=$Er(e)+"-auto-"+GEr++}e[Symbol.for("skip-override")]=t.encapsulate!==true;e[Symbol.for("fastify.display-name")]=t.name;e[Symbol.for("plugin-meta")]=t;if(!e.default){e.default=e}const n=jEr(t.name);if(!r&&!e[n]){e[n]=e}return e}a(Yce,"plugin");J$.exports=Yce;J$.exports.default=Yce;J$.exports.fastifyPlugin=Yce});var pHe=y(ET=>{"use strict";var HEr=ET&&ET.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ET,"__esModule",{value:true});ET.apiKeyAuthPlugin=void 0;var Zh=Hc();var VEr=HEr(J2());var zEr="https://apikey.zuplo.com";var dHe=`Bearer `;ET.apiKeyAuthPlugin=(0,VEr.default)(async(e,t)=>{e.decorate("validateApiKey",async function(r){const{authorization:n}=r.headers;if(!n){throw new Zh.ApiError({...Zh.Problems.UNAUTHORIZED,detail:`No Authorization Header`})}if(!n.toLowerCase().startsWith(dHe)){throw new Zh.ApiError({...Zh.Problems.UNAUTHORIZED,detail:`Invalid Authorization Scheme`})}const i=n.substring(dHe.length);if(!i||i===""){throw new Zh.ApiError({...Zh.Problems.UNAUTHORIZED,detail:`No key present`})}const s={key:i};const o=await fetch(`${zEr}/v1/$validate/${t.bucketName}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(o.status===401){throw new Zh.ApiError(Zh.Problems.UNAUTHORIZED)}const u=await o.json();if(t.allowedSubs){if(!t.allowedSubs.includes(u.name)){throw new Zh.ApiError(Zh.Problems.UNAUTHORIZED)}}r.user={sub:u.name,metadata:u.metadata}})},{name:"api-key-auth"})});var fHe=y(bT=>{"use strict";var KEr=bT&&bT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(bT,"__esModule",{value:true});bT.ensureZuploAdminPlugin=void 0;var Q$=Hc();var WEr=KEr(J2());var YEr=$ce();bT.ensureZuploAdminPlugin=(0,WEr.default)(async function(e){const t=new YEr.CommonAuth;e.decorate("ensureZuploAdmin",async function(r){if(!r.user){r.log.error(`Bad request, no user on request`);throw new Q$.ApiError(Q$.Problems.UNAUTHORIZED)}const n=r.user.sub;const i=n&&t.isZuploAdmin(n);if(!i){r.log.error(`User is not an admin`);throw new Q$.ApiError(Q$.Problems.FORBIDDEN)}})},{name:"ensure-zuplo-admin-plugin"})});var hHe=y(ST=>{"use strict";var XEr=ST&&ST.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ST,"__esModule",{value:true});ST.ensureZuploUserPlugin=void 0;var mHe=Hc();var JEr=XEr(J2());ST.ensureZuploUserPlugin=(0,JEr.default)(async e=>{e.decorate("ensureZuploUser",async function(t){const r=t.headers["zuplo-user"];if(!r||typeof r!=="string"){t.log.error("The 'zuplo-user' header is missing");throw new mHe.ApiError(mHe.Problems.UNAUTHORIZED)}t.user={sub:r}})},{name:"ensure-zuplo-user-plugin"})});var _He=y(AT=>{"use strict";var QEr=AT&&AT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(AT,"__esModule",{value:true});AT.featureFlagsPlugin=void 0;var ZEr=QEr(J2());var Xce;async function gHe(e,t){try{const r=await Xce?.variation(t.flagName,{kind:t.kind,key:t.key},t.defaultValue);if(r===void 0){return t.defaultValue}else{return r}}catch(r){e.log.warn(`Failed to query Launch Darkly flag ${t.flagName}`);e.log.error(r)}return t.defaultValue}a(gHe,"getFlagValue");function yHe(){this.log.error("Call to feature flag getFlagValue function on uninitialized flag plugin");return Promise.resolve(false)}a(yHe,"fallback");AT.featureFlagsPlugin=(0,ZEr.default)(async(e,t)=>{try{if(typeof t.key!=="string"||!t.key||!t.client){e.decorateRequest("getFlagValue",yHe);e.decorateRequest("getFlagValueByUser",yHe);return}Xce=t.client;e.log.info("Launch Darkly SDK successfully initialized!");e.decorate("flags",Xce);e.decorateRequest("getFlagValue",async function(r){let n;let i;if("projectName"in r){n="project";i=`${r.accountName}/${r.projectName}`}else{n="account";i=r.accountName}const s={flagName:r.flagName,kind:n,key:i,defaultValue:r.defaultValue};return gHe(this,s)});e.decorateRequest("getFlagValueByUser",async function(r,n,i){const s={flagName:r,kind:"user",key:n,defaultValue:i};return gHe(this,s)})}catch(r){e.log.warn("Launch Darkly failed to initialize");e.log.error(r)}},{name:"feature-flag-plugin"})});var Jce=y(CT=>{"use strict";var ebr=CT&&CT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(CT,"__esModule",{value:true});CT.getUserSubPlugin=void 0;var vHe=Hc();var tbr=ebr(J2());CT.getUserSubPlugin=(0,tbr.default)(async e=>{e.decorateRequest("getUserSub",function(){const t=this.user?.sub;if(!t){this.log.error("Could not determine the user sub");throw new vHe.ApiError(vHe.Problems.UNAUTHORIZED)}return t})},{name:"get-user-sub-plugin"})});var Qce=y(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:true});qp.getUserSubPlugin=qp.featureFlagsPlugin=qp.ensureZuploUserPlugin=qp.ensureZuploAdminPlugin=qp.apiKeyAuthPlugin=void 0;var rbr=pHe();Object.defineProperty(qp,"apiKeyAuthPlugin",{enumerable:true,get:function(){return rbr.apiKeyAuthPlugin}});var nbr=fHe();Object.defineProperty(qp,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return nbr.ensureZuploAdminPlugin}});var ibr=hHe();Object.defineProperty(qp,"ensureZuploUserPlugin",{enumerable:true,get:function(){return ibr.ensureZuploUserPlugin}});var sbr=_He();Object.defineProperty(qp,"featureFlagsPlugin",{enumerable:true,get:function(){return sbr.featureFlagsPlugin}});var abr=Jce();Object.defineProperty(qp,"getUserSubPlugin",{enumerable:true,get:function(){return abr.getUserSubPlugin}})});var ls=y(qu=>{"use strict";var Zce=Symbol.for("yaml.alias");var EHe=Symbol.for("yaml.document");var Z$=Symbol.for("yaml.map");var bHe=Symbol.for("yaml.pair");var ede=Symbol.for("yaml.scalar");var ej=Symbol.for("yaml.seq");var x1=Symbol.for("yaml.node.type");var obr=a(e=>!!e&&typeof e==="object"&&e[x1]===Zce,"isAlias");var ubr=a(e=>!!e&&typeof e==="object"&&e[x1]===EHe,"isDocument");var lbr=a(e=>!!e&&typeof e==="object"&&e[x1]===Z$,"isMap");var cbr=a(e=>!!e&&typeof e==="object"&&e[x1]===bHe,"isPair");var SHe=a(e=>!!e&&typeof e==="object"&&e[x1]===ede,"isScalar");var dbr=a(e=>!!e&&typeof e==="object"&&e[x1]===ej,"isSeq");function AHe(e){if(e&&typeof e==="object")switch(e[x1]){case Z$:case ej:return true}return false}a(AHe,"isCollection");function pbr(e){if(e&&typeof e==="object")switch(e[x1]){case Zce:case Z$:case ede:case ej:return true}return false}a(pbr,"isNode");var fbr=a(e=>(SHe(e)||AHe(e))&&!!e.anchor,"hasAnchor");qu.ALIAS=Zce;qu.DOC=EHe;qu.MAP=Z$;qu.NODE_TYPE=x1;qu.PAIR=bHe;qu.SCALAR=ede;qu.SEQ=ej;qu.hasAnchor=fbr;qu.isAlias=obr;qu.isCollection=AHe;qu.isDocument=ubr;qu.isMap=lbr;qu.isNode=pbr;qu.isPair=cbr;qu.isScalar=SHe;qu.isSeq=dbr});var QD=y(tde=>{"use strict";var Zo=ls();var zc=Symbol("break visit");var CHe=Symbol("skip children");var e0=Symbol("remove node");function tj(e,t){const r=wHe(t);if(Zo.isDocument(e)){const n=wT(null,e.contents,r,Object.freeze([e]));if(n===e0)e.contents=null}else wT(null,e,r,Object.freeze([]))}a(tj,"visit");tj.BREAK=zc;tj.SKIP=CHe;tj.REMOVE=e0;function wT(e,t,r,n){const i=THe(e,t,r,n);if(Zo.isNode(i)||Zo.isPair(i)){xHe(e,n,i);return wT(e,i,r,n)}if(typeof i!=="symbol"){if(Zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){const o=wT(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===zc)return zc;else if(o===e0){t.items.splice(s,1);s-=1}}}else if(Zo.isPair(t)){n=Object.freeze(n.concat(t));const s=wT("key",t.key,r,n);if(s===zc)return zc;else if(s===e0)t.key=null;const o=wT("value",t.value,r,n);if(o===zc)return zc;else if(o===e0)t.value=null}}return i}a(wT,"visit_");async function rj(e,t){const r=wHe(t);if(Zo.isDocument(e)){const n=await TT(null,e.contents,r,Object.freeze([e]));if(n===e0)e.contents=null}else await TT(null,e,r,Object.freeze([]))}a(rj,"visitAsync");rj.BREAK=zc;rj.SKIP=CHe;rj.REMOVE=e0;async function TT(e,t,r,n){const i=await THe(e,t,r,n);if(Zo.isNode(i)||Zo.isPair(i)){xHe(e,n,i);return TT(e,i,r,n)}if(typeof i!=="symbol"){if(Zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){const o=await TT(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===zc)return zc;else if(o===e0){t.items.splice(s,1);s-=1}}}else if(Zo.isPair(t)){n=Object.freeze(n.concat(t));const s=await TT("key",t.key,r,n);if(s===zc)return zc;else if(s===e0)t.key=null;const o=await TT("value",t.value,r,n);if(o===zc)return zc;else if(o===e0)t.value=null}}return i}a(TT,"visitAsync_");function wHe(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value)){return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e)}return e}a(wHe,"initVisitor");function THe(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(Zo.isMap(t))return r.Map?.(e,t,n);if(Zo.isSeq(t))return r.Seq?.(e,t,n);if(Zo.isPair(t))return r.Pair?.(e,t,n);if(Zo.isScalar(t))return r.Scalar?.(e,t,n);if(Zo.isAlias(t))return r.Alias?.(e,t,n);return void 0}a(THe,"callVisitor");function xHe(e,t,r){const n=t[t.length-1];if(Zo.isCollection(n)){n.items[e]=r}else if(Zo.isPair(n)){if(e==="key")n.key=r;else n.value=r}else if(Zo.isDocument(n)){n.contents=r}else{const i=Zo.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(xHe,"replaceNode");tde.visit=tj;tde.visitAsync=rj});var rde=y(OHe=>{"use strict";var RHe=ls();var mbr=QD();var hbr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};var gbr=a(e=>e.replace(/[!,[\]{}]/g,t=>hbr[t]),"escapeTagName");var ZD=class e{static{a(this,"Directives")}constructor(t,r){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},e.defaultYaml,t);this.tags=Object.assign({},e.defaultTags,r)}clone(){const t=new e(this.yaml,this.tags);t.docStart=this.docStart;return t}atDocument(){const t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){if(this.atNextDocument){this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},e.defaultTags);this.atNextDocument=false}const n=t.trim().split(/[ \t]+/);const i=n.shift();switch(i){case"%TAG":{if(n.length!==2){r(0,"%TAG directive should contain exactly two parts");if(n.length<2)return false}const[s,o]=n;this.tags[s]=o;return true}case"%YAML":{this.yaml.explicit=true;if(n.length!==1){r(0,"%YAML directive should contain exactly one part");return false}const[s]=n;if(s==="1.1"||s==="1.2"){this.yaml.version=s;return true}else{const o=/^\d+\.\d+$/.test(s);r(6,`Unsupported YAML version ${s}`,o);return false}}default:r(0,`Unknown directive ${i}`,true);return false}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!"){r(`Not a valid tag: ${t}`);return null}if(t[1]==="<"){const o=t.slice(2,-1);if(o==="!"||o==="!!"){r(`Verbatim tags aren't resolved, so ${t} is invalid.`);return null}if(t[t.length-1]!==">")r("Verbatim tags must end with a >");return o}const[,n,i]=t.match(/^(.*!)([^!]*)$/s);if(!i)r(`The ${t} tag has no suffix`);const s=this.tags[n];if(s){try{return s+decodeURIComponent(i)}catch(o){r(String(o));return null}}if(n==="!")return t;r(`Could not resolve tag: ${t}`);return null}tagString(t){for(const[r,n]of Object.entries(this.tags)){if(t.startsWith(n))return r+gbr(t.substring(n.length))}return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const n=Object.entries(this.tags);let i;if(t&&n.length>0&&RHe.isNode(t.contents)){const s={};mbr.visit(t.contents,(o,u)=>{if(RHe.isNode(u)&&u.tag)s[u.tag]=true});i=Object.keys(s)}else i=[];for(const[s,o]of n){if(s==="!!"&&o==="tag:yaml.org,2002:")continue;if(!t||i.some(u=>u.startsWith(o)))r.push(`%TAG ${s} ${o}`)}return r.join("\n")}};ZD.defaultYaml={explicit:false,version:"1.2"};ZD.defaultTags={"!!":"tag:yaml.org,2002:"};OHe.Directives=ZD});var nj=y(e6=>{"use strict";var PHe=ls();var ybr=QD();function _br(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const r=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(r)}return true}a(_br,"anchorIsValid");function NHe(e){const t=new Set;ybr.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}});return t}a(NHe,"anchorNames");function IHe(e,t){for(let r=1;true;++r){const n=`${e}${r}`;if(!t.has(n))return n}}a(IHe,"findNewAnchor");function vbr(e,t){const r=[];const n=new Map;let i=null;return{onAnchor:s=>{r.push(s);if(!i)i=NHe(e);const o=IHe(t,i);i.add(o);return o},setAnchors:()=>{for(const s of r){const o=n.get(s);if(typeof o==="object"&&o.anchor&&(PHe.isScalar(o.node)||PHe.isCollection(o.node))){o.node.anchor=o.anchor}else{const u=new Error("Failed to resolve repeated object (this should not happen)");u.source=s;throw u}}},sourceObjects:n}}a(vbr,"createNodeAnchors");e6.anchorIsValid=_br;e6.anchorNames=NHe;e6.createNodeAnchors=vbr;e6.findNewAnchor=IHe});var nde=y(kHe=>{"use strict";function t6(e,t,r,n){if(n&&typeof n==="object"){if(Array.isArray(n)){for(let i=0,s=n.length;i<s;++i){const o=n[i];const u=t6(e,n,String(i),o);if(u===void 0)delete n[i];else if(u!==o)n[i]=u}}else if(n instanceof Map){for(const i of Array.from(n.keys())){const s=n.get(i);const o=t6(e,n,i,s);if(o===void 0)n.delete(i);else if(o!==s)n.set(i,o)}}else if(n instanceof Set){for(const i of Array.from(n)){const s=t6(e,n,i,i);if(s===void 0)n.delete(i);else if(s!==i){n.delete(i);n.add(s)}}}else{for(const[i,s]of Object.entries(n)){const o=t6(e,n,i,s);if(o===void 0)delete n[i];else if(o!==s)n[i]=o}}}return e.call(t,r,n)}a(t6,"applyReviver");kHe.applyReviver=t6});var F_=y(LHe=>{"use strict";var Ebr=ls();function DHe(e,t,r){if(Array.isArray(e))return e.map((n,i)=>DHe(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!Ebr.hasAnchor(e))return e.toJSON(t,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n);r.onCreate=s=>{n.res=s;delete r.onCreate};const i=e.toJSON(t,r);if(r.onCreate)r.onCreate(i);return i}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}a(DHe,"toJS");LHe.toJS=DHe});var ij=y(BHe=>{"use strict";var bbr=nde();var FHe=ls();var Sbr=F_();var ide=class{static{a(this,"NodeBase")}constructor(t){Object.defineProperty(this,FHe.NODE_TYPE,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)t.range=this.range.slice();return t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!FHe.isDocument(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:true,mapAsMap:r===true,mapKeyWarned:false,maxAliasCount:typeof n==="number"?n:100};const u=Sbr.toJS(this,"",o);if(typeof i==="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof s==="function"?bbr.applyReviver(s,{"":u},"",u):u}};BHe.NodeBase=ide});var r6=y(qHe=>{"use strict";var Abr=nj();var MHe=QD();var sj=ls();var Cbr=ij();var wbr=F_();var sde=class extends Cbr.NodeBase{static{a(this,"Alias")}constructor(t){super(sj.ALIAS);this.source=t;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let r=void 0;MHe.visit(t,{Node:(n,i)=>{if(i===this)return MHe.visit.BREAK;if(i.anchor===this.source)r=i}});return r}toJSON(t,r){if(!r)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:s}=r;const o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let u=n.get(o);if(!u){wbr.toJS(o,null,r);u=n.get(o)}if(!u||u.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0){u.count+=1;if(u.aliasCount===0)u.aliasCount=aj(i,o,n);if(u.count*u.aliasCount>s){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return u.res}toString(t,r,n){const i=`*${this.source}`;if(t){Abr.anchorIsValid(this.source);if(t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function aj(e,t,r){if(sj.isAlias(t)){const n=t.resolve(e);const i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(sj.isCollection(t)){let n=0;for(const i of t.items){const s=aj(e,i,r);if(s>n)n=s}return n}else if(sj.isPair(t)){const n=aj(e,t.key,r);const i=aj(e,t.value,r);return Math.max(n,i)}return 1}a(aj,"getAliasCount");qHe.Alias=sde});var Ro=y(ade=>{"use strict";var Tbr=ls();var xbr=ij();var Rbr=F_();var Obr=a(e=>!e||typeof e!=="function"&&typeof e!=="object","isScalarValue");var B_=class extends xbr.NodeBase{static{a(this,"Scalar")}constructor(t){super(Tbr.SCALAR);this.value=t}toJSON(t,r){return r?.keep?this.value:Rbr.toJS(this.value,t,r)}toString(){return String(this.value)}};B_.BLOCK_FOLDED="BLOCK_FOLDED";B_.BLOCK_LITERAL="BLOCK_LITERAL";B_.PLAIN="PLAIN";B_.QUOTE_DOUBLE="QUOTE_DOUBLE";B_.QUOTE_SINGLE="QUOTE_SINGLE";ade.Scalar=B_;ade.isScalarValue=Obr});var n6=y($He=>{"use strict";var Pbr=r6();var Q2=ls();var UHe=Ro();var Nbr="tag:yaml.org,2002:";function Ibr(e,t,r){if(t){const n=r.filter(s=>s.tag===t);const i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return r.find(n=>n.identify?.(e)&&!n.format)}a(Ibr,"findTagObject");function kbr(e,t,r){if(Q2.isDocument(e))e=e.contents;if(Q2.isNode(e))return e;if(Q2.isPair(e)){const p=r.schema[Q2.MAP].createNode?.(r.schema,null,r);p.items.push(e);return p}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:u}=r;let l=void 0;if(n&&e&&typeof e==="object"){l=u.get(e);if(l){if(!l.anchor)l.anchor=i(e);return new Pbr.Alias(l.anchor)}else{l={anchor:null,node:null};u.set(e,l)}}if(t?.startsWith("!!"))t=Nbr+t.slice(2);let c=Ibr(e,t,o.tags);if(!c){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const p=new UHe.Scalar(e);if(l)l.node=p;return p}c=e instanceof Map?o[Q2.MAP]:Symbol.iterator in Object(e)?o[Q2.SEQ]:o[Q2.MAP]}if(s){s(c);delete r.onTagObj}const d=c?.createNode?c.createNode(r.schema,e,r):typeof c?.nodeClass?.from==="function"?c.nodeClass.from(r.schema,e,r):new UHe.Scalar(e);if(t)d.tag=t;else if(!c.default)d.tag=c.tag;if(l)l.node=d;return d}a(kbr,"createNode");$He.createNode=kbr});var i6=y(uj=>{"use strict";var Dbr=n6();var t0=ls();var Lbr=ij();function ode(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s==="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=n;n=o}else{n=new Map([[s,n]])}}return Dbr.createNode(n,void 0,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}a(ode,"collectionFromPath");var jHe=a(e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done,"isEmptyPath");var oj=class extends Lbr.NodeBase{static{a(this,"Collection")}constructor(t,r){super(t);Object.defineProperty(this,"schema",{value:r,configurable:true,enumerable:false,writable:true})}clone(t){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(t)r.schema=t;r.items=r.items.map(n=>t0.isNode(n)||t0.isPair(n)?n.clone(t):n);if(this.range)r.range=this.range.slice();return r}addIn(t,r){if(jHe(t))this.add(r);else{const[n,...i]=t;const s=this.get(n,true);if(t0.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,ode(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){const[r,...n]=t;if(n.length===0)return this.delete(r);const i=this.get(r,true);if(t0.isCollection(i))return i.deleteIn(n);else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){const[n,...i]=t;const s=this.get(n,true);if(i.length===0)return!r&&t0.isScalar(s)?s.value:s;else return t0.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!t0.isPair(r))return false;const n=r.value;return n==null||t&&t0.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){const[r,...n]=t;if(n.length===0)return this.has(r);const i=this.get(r,true);return t0.isCollection(i)?i.hasIn(n):false}setIn(t,r){const[n,...i]=t;if(i.length===0){this.set(n,r)}else{const s=this.get(n,true);if(t0.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,ode(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};oj.maxFlowStringSingleLineLength=60;uj.Collection=oj;uj.collectionFromPath=ode;uj.isEmptyPath=jHe});var s6=y(lj=>{"use strict";var Fbr=a(e=>e.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function ude(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}a(ude,"indentComment");var Bbr=a((e,t,r)=>e.endsWith("\n")?ude(r,t):r.includes("\n")?"\n"+ude(r,t):(e.endsWith(" ")?"":" ")+r,"lineComment");lj.indentComment=ude;lj.lineComment=Bbr;lj.stringifyComment=Fbr});var HHe=y(a6=>{"use strict";var Mbr="flow";var lde="block";var cj="quoted";function qbr(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:u}={}){if(!i||i<0)return e;const l=Math.max(1+s,1+i-t.length);if(e.length<=l)return e;const c=[];const d={};let p=i-t.length;if(typeof n==="number"){if(n>i-Math.max(2,s))c.push(0);else p=i-n}let f=void 0;let m=void 0;let h=false;let g=-1;let _=-1;let v=-1;if(r===lde){g=GHe(e,g);if(g!==-1)p=g+l}for(let E;E=e[g+=1];){if(r===cj&&E==="\\"){_=g;switch(e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}v=g}if(E==="\n"){if(r===lde)g=GHe(e,g);p=g+l;f=void 0}else{if(E===" "&&m&&m!==" "&&m!=="\n"&&m!==" "){const b=e[g+1];if(b&&b!==" "&&b!=="\n"&&b!==" ")f=g}if(g>=p){if(f){c.push(f);p=f+l;f=void 0}else if(r===cj){while(m===" "||m===" "){m=E;E=e[g+=1];h=true}const b=g>v+1?g-2:_-1;if(d[b])return e;c.push(b);d[b]=true;p=b+l;f=void 0}else{h=true}}}m=E}if(h&&u)u();if(c.length===0)return e;if(o)o();let S=e.slice(0,c[0]);for(let E=0;E<c.length;++E){const b=c[E];const A=c[E+1]||e.length;if(b===0)S=`
|
|
25
|
+
"use strict";var ovr=Object.create;var YD=Object.defineProperty;var uvr=Object.getOwnPropertyDescriptor;var lvr=Object.getOwnPropertyNames;var cvr=Object.getPrototypeOf;var dvr=Object.prototype.hasOwnProperty;var a=(e,t)=>YD(e,"name",{value:t,configurable:true});var Ii=(e,t)=>()=>(e&&(t=e(e=0)),t);var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var XD=(e,t)=>{for(var r in t)YD(e,r,{get:t[r],enumerable:true})};var kGe=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of lvr(t))if(!dvr.call(e,i)&&i!==r)YD(e,i,{get:()=>t[i],enumerable:!(n=uvr(t,i))||n.enumerable})}return e};var Si=(e,t,r)=>(r=e!=null?ovr(cvr(e)):{},kGe(t||!e||!e.__esModule?YD(r,"default",{value:e,enumerable:true}):r,e));var Ct=e=>kGe(YD({},"__esModule",{value:true}),e);var DGe=y((uls,pvr)=>{pvr.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var FGe=y((lls,M$)=>{var fvr=require("fs");var LGe=require("path");var mvr=require("os");var hvr=DGe();var gvr=hvr.version;var yvr=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function _vr(e){const t={};let r=e.toString();r=r.replace(/\r\n?/mg,"\n");let n;while((n=yvr.exec(r))!=null){const i=n[1];let s=n[2]||"";s=s.trim();const o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2");if(o==='"'){s=s.replace(/\\n/g,"\n");s=s.replace(/\\r/g,"\r")}t[i]=s}return t}a(_vr,"parse");function Fce(e){console.log(`[dotenv@${gvr}][DEBUG] ${e}`)}a(Fce,"_log");function vvr(e){return e[0]==="~"?LGe.join(mvr.homedir(),e.slice(1)):e}a(vvr,"_resolveHome");function Evr(e){let t=LGe.resolve(process.cwd(),".env");let r="utf8";const n=Boolean(e&&e.debug);const i=Boolean(e&&e.override);if(e){if(e.path!=null){t=vvr(e.path)}if(e.encoding!=null){r=e.encoding}}try{const s=B$.parse(fvr.readFileSync(t,{encoding:r}));Object.keys(s).forEach(function(o){if(!Object.prototype.hasOwnProperty.call(process.env,o)){process.env[o]=s[o]}else{if(i===true){process.env[o]=s[o]}if(n){if(i===true){Fce(`"${o}" is already defined in \`process.env\` and WAS overwritten`)}else{Fce(`"${o}" is already defined in \`process.env\` and was NOT overwritten`)}}}});return{parsed:s}}catch(s){if(n){Fce(`Failed to load ${t} ${s.message}`)}return{error:s}}}a(Evr,"config");var B$={config:Evr,parse:_vr};M$.exports.config=B$.config;M$.exports.parse=B$.parse;M$.exports=B$});var Jd=y(X2=>{"use strict";Object.defineProperty(X2,"__esModule",{value:true});X2.EnvironmentalVariableRequiredError=X2.getRequiredEnvVar=void 0;var Bce=class{static{a(this,"Environment")}get LOG_LEVEL(){return process.env.LOG_LEVEL??"info"}get LOG_FORMAT(){return process.env.LOG_FORMAT??"pretty"}get NODE_ENV(){return process.env.NODE_ENV}get USE_LOCAL_API_SERVER(){return process.env.USE_LOCAL_API_SERVER==="true"}get USE_MONOREPO_PACKAGES(){return process.env.USE_MONOREPO_PACKAGES==="true"}get GCP_STORAGE_BUNDLE_BUCKET_NAME(){return process.env.GCP_STORAGE_BUNDLE_BUCKET_NAME}get GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME(){return process.env.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}get GCP_STORAGE_ARCHIVE_BUCKET_NAME(){return process.env.GCP_STORAGE_ARCHIVE_BUCKET_NAME}get GCP_STORAGE_SOURCE_CODE_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}get GCP_STORAGE_SOURCES_BUCKET_NAME(){return process.env.GCP_STORAGE_SOURCES_BUCKET_NAME}get ZUPLO_AUTH_API_JWT(){return process.env.ZUPLO_AUTH_API_JWT}get GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS(){return process.env.GCP_SERVICE_ACCOUNT_KEY_USER_ZUPS}get RUNTIME_DENO_VERSION(){return process.env.RUNTIME_DENO_VERSION??"1.53.0"}get AUTH_API_URL(){return Pm("AUTH_API_URL","http://localhost:5201")}get MANAGEMENT_API_URL(){return Pm("MANAGEMENT_API_URL","http://localhost:3100")}get TENANT_API_URL(){return Pm("TENANT_API_URL","http://localhost:5100")}get CONTENT_API_URL(){return Pm("CONTENT_API_URL","http://localhost:5400")}get DEPLOYER_API_URL(){return Pm("DEPLOYER_API_URL","http://localhost:5300")}get DEV_API_URL(){return Pm("DEV_API_URL","http://localhost:5200")}get API_KEY_SERVICE_URL(){return Pm("API_KEY_SERVICE_URL","https://apikey.zuplo.com")}get API_KEY_MANAGEMENT_SERVICE_URL(){return Pm("API_KEY_MANAGEMENT_SERVICE_URL","https://api-key-management-service-rreeuhlsca-ue.a.run.app")}get METERING_SERVICE_URL(){return Pm("METERING_SERVICE_URL","https://meters.zuplo.com")}get FETCH_PROXY_URL(){return process.env.FETCH_PROXY_URL||"https://proxy-main-04e55cb.zuplo.app"}get FETCH_PROXY_API_KEY(){return process.env.FETCH_PROXY_API_KEY||"zpk_123"}get LOG_EVENT_API_URL(){return process.env.LOG_EVENT_API_URL}get LAUNCH_DARKLY_SERVER_KEY(){return process.env.LAUNCH_DARKLY_SERVER_KEY}get REMOTE_LOGGING_SHARED_SECRET(){return process.env.REMOTE_LOGGING_SHARED_SECRET??"the-logging-shared-secret"}get TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT(){return process.env.TENANT_API_CLOUDRUN_K8_SERVICE_IP_PORT??"10.142.0.64:5000"}get DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME(){return process.env.DEVELOPER_API_API_KEY_SERVICE_BUCKET_NAME??"zpl-developer-api"}get __ZUPLO_AUTH_API_JWT(){return process.env.__ZUPLO_AUTH_API_JWT??void 0}get BUILD_ASSETS_BUCKET_NAME(){return process.env.BUILD_ASSETS_BUCKET_NAME}get BUILD_ASSETS_S3_ENDPOINT(){return process.env.BUILD_ASSETS_S3_ENDPOINT}get BUILD_ASSETS_ACCESS_KEY_ID(){return process.env.BUILD_ASSETS_ACCESS_KEY_ID}get BUILD_ASSETS_SECRET_ACCESS_KEY(){return process.env.BUILD_ASSETS_SECRET_ACCESS_KEY}get DEV_PORTAL_ENCRYPTION_SECRET(){if(!process.env.DEV_PORTAL_ENCRYPTION_SECRET){throw new JD(`DEV_PORTAL_ENCRYPTION_SECRET`)}return process.env.DEV_PORTAL_ENCRYPTION_SECRET}isProduction(){return this.NODE_ENV==="production"}get OPENFGA_SERVICE_URL(){return Pm("OPENFGA_SERVICE_URL","https://openfga-eq7z4lly2a-ue.a.run.app")}get OPENFGA_STORE_ID(){return process.env.OPENFGA_STORE_ID??""}get OPENFGA_MODEL_ID(){return process.env.OPENFGA_MODEL_ID??""}};function Pm(e,t){const r=process.env[e];if(r===void 0&&(t===void 0||process.env.NODE_ENV==="production")){throw new JD(e)}return r??t}a(Pm,"getRequiredEnvVar");X2.getRequiredEnvVar=Pm;var JD=class extends Error{static{a(this,"EnvironmentalVariableRequiredError")}constructor(t){super(`The environmental variable '${t}' is required.'`)}};X2.EnvironmentalVariableRequiredError=JD;var bvr=new Bce;X2.default=bvr});var Mce=y(q$=>{"use strict";Object.defineProperty(q$,"__esModule",{value:true});q$.HttpStatusCode=void 0;var BGe;(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"})(BGe||(q$.HttpStatusCode=BGe={}))});var MGe=y(U$=>{"use strict";Object.defineProperty(U$,"__esModule",{value:true});U$.getSourceControlProviderLabel=void 0;function Svr(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}a(Svr,"getSourceControlProviderLabel");U$.getSourceControlProviderLabel=Svr});var UGe=y(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:true});z.DEPLOYMENT_INVALID_MULTI_PART=z.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=z.DEPLOYMENT_FILE_DOES_NOT_EXISTS=z.DEPLOYMENT_NOT_FOUND=z.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=z.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=z.DEPLOYMENT_NO_ACCESS=z.INVALID_SOURCE_REPO_URL=z.INVALID_EMAIL_FORMAT=z.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=z.PROJECT_MUST_HAVE_ONE_MEMBER=z.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=z.PROJECT_MEMBER_ALREADY_EXISTS=z.PROJECT_MEMBER_NOT_FOUND=z.INVALID_TEMPLATE_REPOSITORY=z.INCORRECT_PROJECT_TEMPLATE=z.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=z.PROJECT_NOT_FOUND=z.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=z.PROJECT_SHARING_DISABLED_ON_ACCOUNT=z.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=z.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=z.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=z.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=z.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=z.ACCOUNT_MEMBER_INVITE_INVALID=z.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=z.ACCOUNT_MEMBER_DOES_NOT_EXIST=z.ACCOUNT_MEMBER_INFO_MISSING=z.ACCOUNT_MEMBER_ALREADY_EXISTS=z.ACCOUNT_UPDATE_INFO_MISSING=z.ACCOUNT_INFO_MISSING=z.ACCOUNT_DOES_NOT_EXISTS=z.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=z.ACCOUNT_NAME_USES_RESERVED_KEYWORD=z.ACCOUNT_ALREADY_EXISTS=z.ACCOUNT_NOT_FOUND=z.USER_IS_NOT_SERVICE_ACCOUNT=z.USER_REMOVE_NOT_MEMBER_ACCOUNT=z.USER_HAS_NO_ACCESS_TO_ACCOUNT=z.USER_DETAILS_CANNOT_BE_FOUND=z.USER_ALREADY_EXISTS=z.CLIENT_NOT_FOUND=z.FORBIDDEN=z.UNAUTHORIZED=z.METHOD_NOT_ALLOWED=z.NOT_FOUND=z.CONFLICT=z.BAD_REQUEST=z.INTERNAL_SERVER_ERROR=void 0;z.GITHUB_INTEGRATION_DUPLICATE_REPO=z.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=z.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=z.GITHUB_INTEGRATION_BRANCH_BEHIND=z.GITHUB_INTEGRATION_NOT_FOUND=z.GITHUB_REPOSITORY_NOT_FOUND=z.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=z.GITHUB_INTEGRATION_ALREADY_EXISTS=z.FEATURE_FLAGS_NOT_FOUND=z.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=z.PROJECT_ALREADY_HAS_REPO=z.PROJECT_INVALID_NAME=z.FAILED_TO_REVOKE_GH_TOKEN=z.USER_ACCOUNT_NOT_FS_MIGRATED=z.USER_NO_ACCESS_GITLAB_REPO=z.USER_NO_ACCESS_BITBUCKET_REPO=z.GITHUB_APP_CONFIGURATION_NOT_FOUND=z.GITHUB_APP_NO_USER_ACCESS_=z.GITHUB_APP_NO_NAMESPACE_ACCESS=z.GENERIC_GITHUB_BRANCH_INFO_ERROR=z.GITHUB_USER_NO_READ_ACCESS_REPO=z.USER_NO_PULL_ACCESS_GITHUB_REPO=z.USER_NO_ACCESS_GITHUB_REPO=z.PROJECT_SHARING_REQUIRES_GIT_REPO=z.PROJECT_INVALID_GIT_REPO=z.PROJECT_INVALID_GIT_CLONE=z.USER_IS_PROJECT_MEMBER=z.USER_HAS_NO_ACCESS_TO_PROJECT=z.RUNTIME_FLAG_KEY_NOT_VALID=z.RUNTIME_FLAG_NOT_FOUND=z.RUNTIME_FLAG_ALREADY_EXISTS=z.PROJECT_NO_MEMBERS=z.PROJECT_ALREADY_EXISTS=z.SERVICE_CONFIGURATION_FAILED_DECRYPTION=z.WORKING_COPY_SERVICE_NOT_CREATED=z.WORKING_COPY_SERVICE_NOT_DELETED=z.WORKING_COPY_SERVICE_NOT_FOUND=z.SERVICE_CONFIGURATION_NOT_FOUND=z.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=z.DEPLOYMENT_INCORRECT_STATUS_PAUSE=z.DEPLOYMENT_NOT_WORKING_COPY=z.DEPLOYMENT_LOG_NOT_FOUND=z.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=z.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=z.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=z.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=z.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=z.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=z.DEPLOYMENT_DELETE_ERROR=z.DEPLOYMENT_CANNOT_DELETE_INSTANCE=void 0;z.TARGET_BRANCH_ONLY_FOR_PREVIEW=z.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=z.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=z.DEPLOYMENT_NAME_MISSING=z.NON_EXISTENT_ENVIRONMENT_VARIABLE=z.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=z.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=z.DUPLICATE_ENVIRONMENT_VARIABLE=z.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=z.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=z.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=z.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=z.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=z.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=z.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=z.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=z.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=z.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=z.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=z.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=z.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=z.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=z.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=z.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=z.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=z.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=z.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=z.SOURCE_CONTROL_REPO_OPERATION_ERROR=z.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=z.SOURCE_CONTROL_REPO_NOT_FOUND=z.SOURCE_CONTROL_AUTHENTICATION_FAILED=z.EXTERNAL_SERVICE_GENERIC_ERROR=z.API_USER_NO_ACCESS=z.EXTERNAL_USER_NOT_CONFIGURED=z.EXTERNAL_USER_NO_ACCESS=z.CONSUMER_DOES_NOT_EXIST=z.CONSUMER_NO_ACCESS=z.GITLAB_ACCESS_LEVEL_CHECK_FAIL=z.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=z.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=z.GITLAB_DUPLICATE_REPO=z.GITLAB_FAILED_DURING_REPO_CREATION=z.GITLAB_QUERY_USER_INFO_FAILED=z.BITBUCKET_FAILED_DURING_REPO_CREATION=z.BITBUCKET_WORKSPACE_MISCONFIGURATION=z.BITBUCKET_QUERY_USER_INFO_FAILED=z.GITHUB_INTEGRATION_INVALID_REPO=z.GIT_CREATE_PROJECT_WITH_INVALID_REPO=z.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=z.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=void 0;z.UNABLE_UPGRADE_PLAN=z.BUCKET_API_KEY_SERVICE_CONFLICT=z.DIRECTORY_DELETE_FAILED=z.FILE_DELETE_FAILED=z.CANNOT_DELETE_SOLE_OPEN_API_FILE=z.CANNOT_DELETE_ESSENTIAL_DIRECTORY=z.CANNOT_DELETE_ESSENTIAL_FILE=z.FILE_WRITE_FAILED=z.FILE_RENAME_FAILED=z.FILE_RENAME_FILE_ALREADY_EXISTS=z.FILE_RENAME_CANNOT_CHANGE_EXTENSION=z.FILE_RENAME_PATHS_MATCH=z.DIRECTORY_CREATION_FAILED=z.DIRECTORY_OR_FILE_DOES_NOT_EXIST=z.DIRECTORY_DOES_NOT_EXIST=z.DIRECTORY_ALREADY_EXISTS=z.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=z.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=z.FAILED_DOWNLOAD_FROM_STORAGE=z.CANNOT_FIND_SRC_DIRECTORY=z.CANNOT_READ_PACKAGE_JSON=z.PACKAGE_JSON_NOT_FOUND=z.RUNTIME_VERSION_INCORRECT_FORMAT=z.MIGRATIONS_ONLY_ON_WORKING_COPY=z.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=z.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=z.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=z.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=z.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=z.NO_GLOBAL_SYMBOLS=z.NO_ZUPLO_PREFIXED_VARIABLES=z.NON_EMPTY_TARGETS_REQUIRED=z.CONFLICTING_TYPES=z.OVERLAPPING_TARGETS=z.INVALID_BRANCH_NAME=void 0;var Me=Mce();var qGe=MGe();var Avr="https://github.com/apps/zuplo/installations/new";z.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:Me.HttpStatusCode.BAD_REQUEST};z.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:Me.HttpStatusCode.CONFLICT};z.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:Me.HttpStatusCode.NOT_FOUND};z.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:Me.HttpStatusCode.METHOD_NOT_ALLOWED};z.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:Me.HttpStatusCode.UNAUTHORIZED};z.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:Me.HttpStatusCode.FORBIDDEN};z.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:Me.HttpStatusCode.NOT_FOUND};z.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:Me.HttpStatusCode.CONFLICT};z.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:Me.HttpStatusCode.NOT_FOUND};z.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Not a member of the account",status:Me.HttpStatusCode.UNAUTHORIZED};z.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:Me.HttpStatusCode.BAD_REQUEST};z.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:Me.HttpStatusCode.CONFLICT};z.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"You are not a member of any accounts",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:Me.HttpStatusCode.BAD_REQUEST};z.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:Me.HttpStatusCode.NOT_FOUND};z.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:Me.HttpStatusCode.FORBIDDEN};z.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:Me.HttpStatusCode.NOT_FOUND};z.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:Me.HttpStatusCode.NOT_FOUND};z.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",status:Me.HttpStatusCode.FORBIDDEN};z.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:Me.HttpStatusCode.BAD_REQUEST};var Cvr=a(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:Me.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");z.INVALID_TEMPLATE_REPOSITORY=Cvr;z.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:Me.HttpStatusCode.NOT_FOUND};z.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:Me.HttpStatusCode.BAD_REQUEST};z.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:Me.HttpStatusCode.BAD_REQUEST};z.INVALID_EMAIL_FORMAT={type:"https://zup.fail/invalid-email-format",title:"The email address provided is in an invalid email format",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};z.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.FORBIDDEN};z.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:`Deployment is not working copy.`,status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:Me.HttpStatusCode.BAD_REQUEST};z.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:Me.HttpStatusCode.BAD_REQUEST};z.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:Me.HttpStatusCode.NOT_FOUND};z.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:Me.HttpStatusCode.NOT_FOUND};z.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:Me.HttpStatusCode.BAD_REQUEST};z.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:Me.HttpStatusCode.BAD_REQUEST};z.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:Me.HttpStatusCode.NOT_FOUND};z.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:Me.HttpStatusCode.BAD_REQUEST};z.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:Me.HttpStatusCode.NOT_FOUND};z.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:Me.HttpStatusCode.BAD_REQUEST};z.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Not a member of the project",status:Me.HttpStatusCode.FORBIDDEN};z.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:Me.HttpStatusCode.BAD_REQUEST};z.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};var wvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");z.USER_NO_ACCESS_GITHUB_REPO=wvr;var Tvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");z.USER_NO_PULL_ACCESS_GITHUB_REPO=Tvr;var xvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");z.GITHUB_USER_NO_READ_ACCESS_REPO=xvr;z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.FORBIDDEN};var Rvr=a(({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 '${Avr}' to add the repository.`,status:Me.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");z.GITHUB_APP_NO_USER_ACCESS_=Rvr;z.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:Me.HttpStatusCode.NOT_FOUND};var Ovr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");z.USER_NO_ACCESS_BITBUCKET_REPO=Ovr;var Pvr=a(({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:Me.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");z.USER_NO_ACCESS_GITLAB_REPO=Pvr;z.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:Me.HttpStatusCode.FORBIDDEN};z.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:Me.HttpStatusCode.BAD_REQUEST};var Nvr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:Me.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");z.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=Nvr;var Ivr=a(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:Me.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");z.GITHUB_REPOSITORY_NOT_FOUND=Ivr;z.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:Me.HttpStatusCode.NOT_FOUND,detail:`The project does not have a GitHub integration configured.`};z.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:Me.HttpStatusCode.BAD_REQUEST};z.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};var kvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");z.GITHUB_INTEGRATION_DUPLICATE_REPO=kvr;var Dvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");z.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=Dvr;var Lvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");z.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=Lvr;var Fvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");z.GIT_CREATE_PROJECT_WITH_INVALID_REPO=Fvr;var Bvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");z.GITHUB_INTEGRATION_INVALID_REPO=Bvr;z.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:Me.HttpStatusCode.FORBIDDEN};z.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:Me.HttpStatusCode.FORBIDDEN};var Mvr=a(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:Me.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");z.BITBUCKET_FAILED_DURING_REPO_CREATION=Mvr;z.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:Me.HttpStatusCode.FORBIDDEN};var qvr=a(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");z.GITLAB_FAILED_DURING_REPO_CREATION=qvr;var Uvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");z.GITLAB_DUPLICATE_REPO=Uvr;var $vr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");z.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=$vr;var jvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");z.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=jvr;var Gvr=a(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:Me.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");z.GITLAB_ACCESS_LEVEL_CHECK_FAIL=Gvr;z.CONSUMER_NO_ACCESS={type:"https://zup.fail/consumer-no-access",title:"User does not have access to this consumer.",status:Me.HttpStatusCode.UNAUTHORIZED};z.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist.",status:Me.HttpStatusCode.NOT_FOUND};z.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:Me.HttpStatusCode.UNAUTHORIZED};z.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:Me.HttpStatusCode.FORBIDDEN};z.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:Me.HttpStatusCode.FORBIDDEN};z.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};var Hvr=a(({sourceControlProvider:e})=>{const t=(0,qGe.getSourceControlProviderLabel)(e);return{type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${t}`,status:Me.HttpStatusCode.UNAUTHORIZED}},"SOURCE_CONTROL_AUTHENTICATION_FAILED");z.SOURCE_CONTROL_AUTHENTICATION_FAILED=Hvr;var Vvr=a(({sourceControlProvider:e})=>{const t=(0,qGe.getSourceControlProviderLabel)(e);return{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 ${t} repository`,status:Me.HttpStatusCode.NOT_FOUND}},"SOURCE_CONTROL_REPO_NOT_FOUND");z.SOURCE_CONTROL_REPO_NOT_FOUND=Vvr;z.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:Me.HttpStatusCode.BAD_REQUEST};var zvr=a(({repoURL:e,operation:t})=>{return{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:Me.HttpStatusCode.FORBIDDEN}},"SOURCE_CONTROL_REPO_OPERATION_ERROR");z.SOURCE_CONTROL_REPO_OPERATION_ERROR=zvr;z.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:Me.HttpStatusCode.FORBIDDEN};z.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.UNAUTHORIZED};z.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:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:Me.HttpStatusCode.FORBIDDEN};z.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:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.NOT_FOUND};z.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:Me.HttpStatusCode.INTERNAL_SERVER_ERROR};z.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:Me.HttpStatusCode.FAILED_DEPENDENCY};z.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:Me.HttpStatusCode.FAILED_DEPENDENCY};z.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:Me.HttpStatusCode.FAILED_DEPENDENCY};z.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:Me.HttpStatusCode.BAD_REQUEST};z.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:Me.HttpStatusCode.NOT_FOUND};z.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:Me.HttpStatusCode.BAD_REQUEST};z.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:Me.HttpStatusCode.BAD_REQUEST};z.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.BAD_REQUEST};z.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:Me.HttpStatusCode.FORBIDDEN};z.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:Me.HttpStatusCode.NOT_FOUND};var Kvr=a(({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:Me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");z.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=Kvr;var Wvr=a(()=>({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:Me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");z.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=Wvr;z.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:`Migrations can only run on working copies.`,status:Me.HttpStatusCode.BAD_REQUEST};z.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:`Runtime version is in an incorrect format.`,status:Me.HttpStatusCode.BAD_REQUEST};z.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:`No package.json file found.`,status:Me.HttpStatusCode.NOT_FOUND};z.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:`Cannot read package.json file.`,status:Me.HttpStatusCode.BAD_REQUEST};z.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:`Cannot find source directory.`,status:Me.HttpStatusCode.BAD_REQUEST};z.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:`Failed to download content from storage.`,status:Me.HttpStatusCode.BAD_REQUEST};var Yvr=a(({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:Me.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");z.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=Yvr;var Xvr=a(({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:Me.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");z.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=Xvr;var Jvr=a(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");z.DIRECTORY_ALREADY_EXISTS=Jvr;var Qvr=a(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:Me.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");z.DIRECTORY_DOES_NOT_EXIST=Qvr;var Zvr=a(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:Me.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");z.DIRECTORY_OR_FILE_DOES_NOT_EXIST=Zvr;var eEr=a(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");z.DIRECTORY_CREATION_FAILED=eEr;var tEr=a(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:Me.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");z.FILE_RENAME_PATHS_MATCH=tEr;var rEr=a(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");z.FILE_RENAME_CANNOT_CHANGE_EXTENSION=rEr;var nEr=a(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:Me.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");z.FILE_RENAME_FILE_ALREADY_EXISTS=nEr;var iEr=a(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");z.FILE_RENAME_FAILED=iEr;var sEr=a(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");z.FILE_WRITE_FAILED=sEr;var aEr=a(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");z.CANNOT_DELETE_ESSENTIAL_FILE=aEr;var oEr=a(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");z.CANNOT_DELETE_ESSENTIAL_DIRECTORY=oEr;var uEr=a(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:Me.HttpStatusCode.BAD_REQUEST,detail:`Your project must have at least 1 OpenAPI file.`}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");z.CANNOT_DELETE_SOLE_OPEN_API_FILE=uEr;var lEr=a(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");z.FILE_DELETE_FAILED=lEr;var cEr=a(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:Me.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");z.DIRECTORY_DELETE_FAILED=cEr;z.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:Me.HttpStatusCode.CONFLICT};z.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:Me.HttpStatusCode.BAD_REQUEST}});var jGe=y(Gc=>{"use strict";var dEr=Gc&&Gc.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var pEr=Gc&&Gc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var fEr=Gc&&Gc.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))dEr(t,e,r)}pEr(t,e);return t};Object.defineProperty(Gc,"__esModule",{value:true});Gc.ApiNotFoundError=Gc.ApiError=Gc.Problems=void 0;var $Ge=fEr(UGe());Gc.Problems=$Ge;var $$=class extends Error{static{a(this,"ApiError")}type;status;detail;instance;constructor(t){super(t.title);if(!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}};Gc.ApiError=$$;var qce=class extends $${static{a(this,"ApiNotFoundError")}constructor(t={}){super({...t,...$Ge.NOT_FOUND});this.name="ApiNotFoundProblemError"}};Gc.ApiNotFoundError=qce});var Hc=y(T1=>{"use strict";var mEr=T1&&T1.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var hEr=T1&&T1.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))mEr(t,e,r)};Object.defineProperty(T1,"__esModule",{value:true});T1.HttpStatusCode=void 0;hEr(jGe(),T1);var gEr=Mce();Object.defineProperty(T1,"HttpStatusCode",{enumerable:true,get:function(){return gEr.HttpStatusCode}})});var $ce=y(j$=>{"use strict";Object.defineProperty(j$,"__esModule",{value:true});j$.CommonAuth=void 0;var I_=Hc();var yEr=["google-oauth2|106231436550039770264","google-oauth2|113609898431445637338","google-oauth2|115413213714061429608","google-oauth2|105283806895031006146","google-oauth2|116604562105669742663"];var Uce=class e{static{a(this,"CommonAuth")}static DEPLOYER_USER_SUB="deployer-app@zuplo";isZuploAdmin(t){return yEr.includes(t)}isDeployerServiceAccount(t){return e.DEPLOYER_USER_SUB===t}static isAuthorizedSub(t,r){if(typeof r==="string"){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}if(r instanceof Buffer){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}try{const n=t.includes(r.sub);if(!n){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}}catch(n){throw new I_.ApiError(I_.Problems.API_USER_NO_ACCESS)}}};j$.CommonAuth=Uce});var jce=y(G$=>{"use strict";Object.defineProperty(G$,"__esModule",{value:true});G$.FeatureFlags=void 0;G$.FeatureFlags=Object.freeze({remoteModules:(e,t)=>({flagName:"REMOTE_MODULES",defaultValue:false,accountName:e,projectName:t}),disableIntegratedDevPortalBuild:(e,t)=>({flagName:"DISABLE_INTEGRATED_DEV_PORTAL_BUILD",defaultValue:false,accountName:e,projectName:t}),FS_ACCOUNT_NAME_PATH:"FS_ACCOUNT_NAME_PATH"})});var HGe=y(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:true});k_.hasBlockedNotifications=k_.getBuildFlagsForDeployment=k_.getDefaultFlags=void 0;var GGe=jce();var _Er=["chocolate_bold_silverfish"];function vEr(e){const t={remoteModules:!!e?.remoteModules,disableIntegratedDevPortalBuild:!!e?.disableIntegratedDevPortalBuild};return t}a(vEr,"getDefaultFlags");k_.getDefaultFlags=vEr;async function EEr(e,{accountName:t,projectName:r}){const n=await e.getFlagValue(GGe.FeatureFlags.remoteModules(t,r));const i=await e.getFlagValue(GGe.FeatureFlags.disableIntegratedDevPortalBuild(t,r));return{remoteModules:n,disableIntegratedDevPortalBuild:i}}a(EEr,"getBuildFlagsForDeployment");k_.getBuildFlagsForDeployment=EEr;function bEr(e){return _Er.includes(e)}a(bEr,"hasBlockedNotifications");k_.hasBlockedNotifications=bEr});var VGe=y(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:true});Vc.BuildIssueError=Vc.WARNING_SEVERITY=Vc.ERROR_SEVERITY=Vc.FAILURE_STATUS=Vc.WARNING_STATUS=Vc.GOOD_STATUS=void 0;Vc.GOOD_STATUS="Good";Vc.WARNING_STATUS="Warnings";Vc.FAILURE_STATUS="Failed";Vc.ERROR_SEVERITY="error";Vc.WARNING_SEVERITY="warning";var Gce=class extends Error{static{a(this,"BuildIssueError")}issue;constructor(t){super(t.message);this.issue=t}};Vc.BuildIssueError=Gce});var zGe=y(H$=>{"use strict";Object.defineProperty(H$,"__esModule",{value:true});H$.COMPATIBILITY_FLAG_MAPPINGS=void 0;H$.COMPATIBILITY_FLAG_MAPPINGS=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false,removeAllVendorHeadersExceptListed:false},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false,removeAllVendorHeadersExceptListed:false},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:true,doNotRunHooksOnSystemRoutes:true,removeAllVendorHeadersExceptListed:true}})});var KGe=y((Ols,SEr)=>{SEr.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/zuplo.config.json",title:"Zuplo Config",description:"",type:"object",required:[],additionalProperties:false,properties:{version:{description:"The version of the configuration",type:"number",enum:[1]},project:{type:"string"},compatibilityDate:{description:"The compatibility date on which to run the gateway",type:"string",title:"Compatibility Date",default:"2024-01-15",enum:["2023-03-14","2024-01-15"]}}}});var WGe=y(V$=>{"use strict";Object.defineProperty(V$,"__esModule",{value:true});V$.VALID_COMPATIBILITY_DATES=void 0;V$.VALID_COMPATIBILITY_DATES=Object.freeze(["2023-03-14","2024-01-15"])});var YGe=y(D_=>{"use strict";var AEr=D_&&D_.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(D_,"__esModule",{value:true});D_.DEFAULT_COMPATIBILITY_DATE=D_.VALID_COMPATIBILITY_DATES=void 0;var CEr=AEr(KGe());var wEr=WGe();Object.defineProperty(D_,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return wEr.VALID_COMPATIBILITY_DATES}});D_.DEFAULT_COMPATIBILITY_DATE=CEr.default.properties.compatibilityDate.default});var XGe=y(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:true});L_.decrypt=L_.encrypt=L_.signString=void 0;var _T=require("crypto");function TEr(e,t){return(0,_T.createHmac)("sha256",t).update(e).digest("hex")}a(TEr,"signString");L_.signString=TEr;var Hce={AUTH_TAG_BYTE_LEN:16,IV_BYTE_LEN:12};var xEr=a(()=>(0,_T.randomBytes)(Hce.IV_BYTE_LEN),"getIV");function REr(e,t){if(e===null){return null}const r=(0,_T.createHash)("sha256").update(String(t)).digest("base64").substring(0,32);const n=xEr();const i=(0,_T.createCipheriv)("aes-256-gcm",r,n,{authTagLength:Hce.AUTH_TAG_BYTE_LEN});let s=i.update(e);s=Buffer.concat([s,i.final()]);return Buffer.concat([n,s,i.getAuthTag()]).toString("hex")}a(REr,"encrypt");L_.encrypt=REr;function OEr(e,t){if(!e){return null}const r=Buffer.from(t);const n=(0,_T.createHash)("sha256").update(String(r)).digest("base64").substring(0,32);const i=Buffer.from(e,"hex");const s=i.slice(-16);const o=i.slice(0,12);const u=i.slice(12,-16);const l=(0,_T.createDecipheriv)("aes-256-gcm",n,o,{authTagLength:Hce.AUTH_TAG_BYTE_LEN});l.setAuthTag(s);const c=l.update(u);return Buffer.concat([c,l.final()]).toString("utf-8")}a(OEr,"decrypt");L_.decrypt=OEr});var JGe=y(z$=>{"use strict";Object.defineProperty(z$,"__esModule",{value:true});z$.getCurrentUtcDateTime=void 0;function PEr(){const e={year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:true,timeZone:"UTC"};const t=new Date().toLocaleString("en-US",e);return t}a(PEr,"getCurrentUtcDateTime");z$.getCurrentUtcDateTime=PEr});var Vce=y(K$=>{"use strict";Object.defineProperty(K$,"__esModule",{value:true});K$.DeploymentLogState=void 0;var QGe;(function(e){e["ERROR"]="ERROR";e["IN_PROGRESS"]="IN_PROGRESS";e["SUCCESS"]="SUCCESS"})(QGe||(K$.DeploymentLogState=QGe={}))});var zce=y(ZGe=>{"use strict";Object.defineProperty(ZGe,"__esModule",{value:true})});var tHe=y(eHe=>{"use strict";Object.defineProperty(eHe,"__esModule",{value:true})});var rHe=y(W$=>{"use strict";Object.defineProperty(W$,"__esModule",{value:true});W$.MARKDOWN_FRONTMATTER_KEYS=void 0;W$.MARKDOWN_FRONTMATTER_KEYS=["sidebar_label"]});var iHe=y(nHe=>{"use strict";Object.defineProperty(nHe,"__esModule",{value:true})});var sHe=y(Jh=>{"use strict";var NEr=Jh&&Jh.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var Y$=Jh&&Jh.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))NEr(t,e,r)};Object.defineProperty(Jh,"__esModule",{value:true});Y$(zce(),Jh);Y$(tHe(),Jh);Y$(rHe(),Jh);Y$(iHe(),Jh)});var X$=y(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:true});Qh.getLoggerContext=Qh.requestIdGenerator=Qh.REQUEST_ID_HEADER=Qh.LEGACY_REQUEST_ID_HEADER=void 0;var IEr=require("crypto");Qh.LEGACY_REQUEST_ID_HEADER="zuplo-request-id";Qh.REQUEST_ID_HEADER="zp-rid";var kEr=a(e=>{const t=e.headers["zuplo-request-id"];const r=e.headers["X-GitHub-Delivery"];if(t){const n=t;return`${n}`}else if(r){return`${r}`}return(0,IEr.randomUUID)()},"requestIdGenerator");Qh.requestIdGenerator=kEr;function DEr(e){const t=e.raw.url??"";const r={};try{const n=e.headers["zuplo-user"]??e.user?.sub;if(n){r.userSub=`${n}`}const i=t.match(/(deployments)\/([a-zA-Z-0-9]*)/);if(i&&i!==null&&i.length>=2){r.deployment=i[2]}const s=t.match(/(accounts)\/([a-zA-Z-0-9]*)/);if(s&&s!==null&&s.length>=2){r.account=s[2]}const o=t.match(/(projects)\/([a-zA-Z-0-9]*)/);if(o&&o!==null&&o.length>=2){r.project=o[2]}}catch(n){}return r}a(DEr,"getLoggerContext");Qh.getLoggerContext=DEr});var Kce=y(vT=>{"use strict";var LEr=vT&&vT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(vT,"__esModule",{value:true});vT.errorHandler=void 0;var Mp=Hc();var FEr=LEr(Jd());var aHe=X$();function BEr(e,t,r){let n=500;let i;if(e instanceof Mp.ApiError){n=e.status;i={type:e.type,title:e.message,status:e.status,detail:e.detail,instance:e.instance}}else if(typeof e==="object"&&"validation"in e&&"validationContext"in e){n=Mp.HttpStatusCode.BAD_REQUEST;i={...Mp.Problems.BAD_REQUEST,detail:`An error occurred when validating the ${e.validationContext}.`,errors:e.validation}}else if(typeof e==="object"&&"code"in e&&e.code==="FST_ERR_NOT_FOUND"){n=404;i=Mp.Problems.NOT_FOUND}else if(typeof e==="object"&&"code"in e&&typeof e.code==="string"&&["FST_ERR_CTP_INVALID_TYPE","FST_ERR_CTP_EMPTY_TYPE","FST_ERR_CTP_BODY_TOO_LARGE","FST_ERR_CTP_INVALID_MEDIA_TYPE","FST_ERR_CTP_INVALID_CONTENT_LENGTH","FST_ERR_CTP_EMPTY_JSON_BODY","FST_ERR_BAD_URL","FST_ERR_INVALID_URL"].includes(e.code)){n=Mp.HttpStatusCode.BAD_REQUEST;i={...Mp.Problems.BAD_REQUEST,detail:e.message}}else{let o;if(!r.statusCode||r.statusCode===200){if(typeof e==="object"&&"statusCode"in e&&typeof e.statusCode==="number"){o=e.statusCode}else if(typeof e==="object"&&"status"in e&&typeof e.status==="number"){o=e.status}n=o&&o>=400?o:500}else{n=r.statusCode}i=MEr(n);if(FEr.default.NODE_ENV!=="production"){if(typeof e==="object"&&"message"in e){i.detail=e.message}else if(typeof e==="string"){i.detail=e}}}i.trace={timestamp:new Date().toJSON(),requestId:t.headers[aHe.REQUEST_ID_HEADER]??t.headers[aHe.LEGACY_REQUEST_ID_HEADER]};if(n<500){r.log.warn({res:r,err:e},e&&e.message)}else{r.log.error({req:t,res:r,err:e},e&&e.message)}const s=JSON.stringify(i,null,2);return r.status(n).header("content-type","application/json").send(s)}a(BEr,"errorHandler");vT.errorHandler=BEr;function MEr(e){if(e===401){return Mp.Problems.UNAUTHORIZED}else if(e===403){return Mp.Problems.FORBIDDEN}else if(e===404){return Mp.Problems.NOT_FOUND}else if(e===405){return Mp.Problems.METHOD_NOT_ALLOWED}else if(e<500&&e>=400){return Mp.Problems.BAD_REQUEST}return Mp.Problems.INTERNAL_SERVER_ERROR}a(MEr,"getProblemFromStatus")});var uHe=y((zls,Wce)=>{"use strict";var qEr=/at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/;var UEr=/(\w*(\.\w*)*)\..*/;Wce.exports=a(function e(t){if(t.name.length>0)return t.name;const r=Error.stackTraceLimit;Error.stackTraceLimit=10;try{throw new Error("anonymous function")}catch(n){Error.stackTraceLimit=r;return oHe(n.stack)}},"getPluginName");function oHe(e){const t=e.match(qEr);return t?t[1].split(/[/\\]/).slice(-1)[0].match(UEr)[1]:"anonymous"}a(oHe,"extractPluginName");Wce.exports.extractPluginName=oHe});var cHe=y((Wls,lHe)=>{"use strict";lHe.exports=a(function e(t){if(t[0]==="@"){t=t.slice(1).replace("/","-")}const r=t.replace(/-(.)/g,function(n,i){return i.toUpperCase()});return r},"toCamelCase")});var J2=y((Xls,J$)=>{"use strict";var $Er=uHe();var jEr=cHe();var GEr=0;function Yce(e,t={}){let r=false;if(typeof e.default!=="undefined"){e=e.default}if(typeof e!=="function"){throw new TypeError(`fastify-plugin expects a function, instead got a '${typeof e}'`)}if(typeof t==="string"){t={fastify:t}}if(typeof t!=="object"||Array.isArray(t)||t===null){throw new TypeError("The options object should be an object")}if(t.fastify!==void 0&&typeof t.fastify!=="string"){throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof t.fastify}'`)}if(!t.name){r=true;t.name=$Er(e)+"-auto-"+GEr++}e[Symbol.for("skip-override")]=t.encapsulate!==true;e[Symbol.for("fastify.display-name")]=t.name;e[Symbol.for("plugin-meta")]=t;if(!e.default){e.default=e}const n=jEr(t.name);if(!r&&!e[n]){e[n]=e}return e}a(Yce,"plugin");J$.exports=Yce;J$.exports.default=Yce;J$.exports.fastifyPlugin=Yce});var pHe=y(ET=>{"use strict";var HEr=ET&&ET.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ET,"__esModule",{value:true});ET.apiKeyAuthPlugin=void 0;var Zh=Hc();var VEr=HEr(J2());var zEr="https://apikey.zuplo.com";var dHe=`Bearer `;ET.apiKeyAuthPlugin=(0,VEr.default)(async(e,t)=>{e.decorate("validateApiKey",async function(r){const{authorization:n}=r.headers;if(!n){throw new Zh.ApiError({...Zh.Problems.UNAUTHORIZED,detail:`No Authorization Header`})}if(!n.toLowerCase().startsWith(dHe)){throw new Zh.ApiError({...Zh.Problems.UNAUTHORIZED,detail:`Invalid Authorization Scheme`})}const i=n.substring(dHe.length);if(!i||i===""){throw new Zh.ApiError({...Zh.Problems.UNAUTHORIZED,detail:`No key present`})}const s={key:i};const o=await fetch(`${zEr}/v1/$validate/${t.bucketName}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)});if(o.status===401){throw new Zh.ApiError(Zh.Problems.UNAUTHORIZED)}const u=await o.json();if(t.allowedSubs){if(!t.allowedSubs.includes(u.name)){throw new Zh.ApiError(Zh.Problems.UNAUTHORIZED)}}r.user={sub:u.name,metadata:u.metadata}})},{name:"api-key-auth"})});var fHe=y(bT=>{"use strict";var KEr=bT&&bT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(bT,"__esModule",{value:true});bT.ensureZuploAdminPlugin=void 0;var Q$=Hc();var WEr=KEr(J2());var YEr=$ce();bT.ensureZuploAdminPlugin=(0,WEr.default)(async function(e){const t=new YEr.CommonAuth;e.decorate("ensureZuploAdmin",async function(r){if(!r.user){r.log.error(`Bad request, no user on request`);throw new Q$.ApiError(Q$.Problems.UNAUTHORIZED)}const n=r.user.sub;const i=n&&t.isZuploAdmin(n);if(!i){r.log.error(`User is not an admin`);throw new Q$.ApiError(Q$.Problems.FORBIDDEN)}})},{name:"ensure-zuplo-admin-plugin"})});var hHe=y(ST=>{"use strict";var XEr=ST&&ST.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ST,"__esModule",{value:true});ST.ensureZuploUserPlugin=void 0;var mHe=Hc();var JEr=XEr(J2());ST.ensureZuploUserPlugin=(0,JEr.default)(async e=>{e.decorate("ensureZuploUser",async function(t){const r=t.headers["zuplo-user"];if(!r||typeof r!=="string"){t.log.error("The 'zuplo-user' header is missing");throw new mHe.ApiError(mHe.Problems.UNAUTHORIZED)}t.user={sub:r}})},{name:"ensure-zuplo-user-plugin"})});var _He=y(AT=>{"use strict";var QEr=AT&&AT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(AT,"__esModule",{value:true});AT.featureFlagsPlugin=void 0;var ZEr=QEr(J2());var Xce;async function gHe(e,t){try{const r=await Xce?.variation(t.flagName,{kind:t.kind,key:t.key},t.defaultValue);if(r===void 0){return t.defaultValue}else{return r}}catch(r){e.log.warn(`Failed to query Launch Darkly flag ${t.flagName}`);e.log.error(r)}return t.defaultValue}a(gHe,"getFlagValue");function yHe(){this.log.error("Call to feature flag getFlagValue function on uninitialized flag plugin");return Promise.resolve(false)}a(yHe,"fallback");AT.featureFlagsPlugin=(0,ZEr.default)(async(e,t)=>{try{if(typeof t.key!=="string"||!t.key||!t.client){e.decorateRequest("getFlagValue",yHe);e.decorateRequest("getFlagValueByUser",yHe);return}Xce=t.client;e.log.info("Launch Darkly SDK successfully initialized!");e.decorate("flags",Xce);e.decorateRequest("getFlagValue",async function(r){let n;let i;if("projectName"in r){n="project";i=`${r.accountName}/${r.projectName}`}else{n="account";i=r.accountName}const s={flagName:r.flagName,kind:n,key:i,defaultValue:r.defaultValue};return gHe(this,s)});e.decorateRequest("getFlagValueByUser",async function(r,n,i){const s={flagName:r,kind:"user",key:n,defaultValue:i};return gHe(this,s)})}catch(r){e.log.warn("Launch Darkly failed to initialize");e.log.error(r)}},{name:"feature-flag-plugin"})});var Jce=y(CT=>{"use strict";var ebr=CT&&CT.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(CT,"__esModule",{value:true});CT.getUserSubPlugin=void 0;var vHe=Hc();var tbr=ebr(J2());CT.getUserSubPlugin=(0,tbr.default)(async e=>{e.decorateRequest("getUserSub",function(){const t=this.user?.sub;if(!t){this.log.error("Could not determine the user sub");throw new vHe.ApiError(vHe.Problems.UNAUTHORIZED)}return t})},{name:"get-user-sub-plugin"})});var Qce=y(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:true});qp.getUserSubPlugin=qp.featureFlagsPlugin=qp.ensureZuploUserPlugin=qp.ensureZuploAdminPlugin=qp.apiKeyAuthPlugin=void 0;var rbr=pHe();Object.defineProperty(qp,"apiKeyAuthPlugin",{enumerable:true,get:function(){return rbr.apiKeyAuthPlugin}});var nbr=fHe();Object.defineProperty(qp,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return nbr.ensureZuploAdminPlugin}});var ibr=hHe();Object.defineProperty(qp,"ensureZuploUserPlugin",{enumerable:true,get:function(){return ibr.ensureZuploUserPlugin}});var sbr=_He();Object.defineProperty(qp,"featureFlagsPlugin",{enumerable:true,get:function(){return sbr.featureFlagsPlugin}});var abr=Jce();Object.defineProperty(qp,"getUserSubPlugin",{enumerable:true,get:function(){return abr.getUserSubPlugin}})});var ls=y(qu=>{"use strict";var Zce=Symbol.for("yaml.alias");var EHe=Symbol.for("yaml.document");var Z$=Symbol.for("yaml.map");var bHe=Symbol.for("yaml.pair");var ede=Symbol.for("yaml.scalar");var ej=Symbol.for("yaml.seq");var x1=Symbol.for("yaml.node.type");var obr=a(e=>!!e&&typeof e==="object"&&e[x1]===Zce,"isAlias");var ubr=a(e=>!!e&&typeof e==="object"&&e[x1]===EHe,"isDocument");var lbr=a(e=>!!e&&typeof e==="object"&&e[x1]===Z$,"isMap");var cbr=a(e=>!!e&&typeof e==="object"&&e[x1]===bHe,"isPair");var SHe=a(e=>!!e&&typeof e==="object"&&e[x1]===ede,"isScalar");var dbr=a(e=>!!e&&typeof e==="object"&&e[x1]===ej,"isSeq");function AHe(e){if(e&&typeof e==="object")switch(e[x1]){case Z$:case ej:return true}return false}a(AHe,"isCollection");function pbr(e){if(e&&typeof e==="object")switch(e[x1]){case Zce:case Z$:case ede:case ej:return true}return false}a(pbr,"isNode");var fbr=a(e=>(SHe(e)||AHe(e))&&!!e.anchor,"hasAnchor");qu.ALIAS=Zce;qu.DOC=EHe;qu.MAP=Z$;qu.NODE_TYPE=x1;qu.PAIR=bHe;qu.SCALAR=ede;qu.SEQ=ej;qu.hasAnchor=fbr;qu.isAlias=obr;qu.isCollection=AHe;qu.isDocument=ubr;qu.isMap=lbr;qu.isNode=pbr;qu.isPair=cbr;qu.isScalar=SHe;qu.isSeq=dbr});var QD=y(tde=>{"use strict";var Zo=ls();var zc=Symbol("break visit");var CHe=Symbol("skip children");var e0=Symbol("remove node");function tj(e,t){const r=wHe(t);if(Zo.isDocument(e)){const n=wT(null,e.contents,r,Object.freeze([e]));if(n===e0)e.contents=null}else wT(null,e,r,Object.freeze([]))}a(tj,"visit");tj.BREAK=zc;tj.SKIP=CHe;tj.REMOVE=e0;function wT(e,t,r,n){const i=THe(e,t,r,n);if(Zo.isNode(i)||Zo.isPair(i)){xHe(e,n,i);return wT(e,i,r,n)}if(typeof i!=="symbol"){if(Zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){const o=wT(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===zc)return zc;else if(o===e0){t.items.splice(s,1);s-=1}}}else if(Zo.isPair(t)){n=Object.freeze(n.concat(t));const s=wT("key",t.key,r,n);if(s===zc)return zc;else if(s===e0)t.key=null;const o=wT("value",t.value,r,n);if(o===zc)return zc;else if(o===e0)t.value=null}}return i}a(wT,"visit_");async function rj(e,t){const r=wHe(t);if(Zo.isDocument(e)){const n=await TT(null,e.contents,r,Object.freeze([e]));if(n===e0)e.contents=null}else await TT(null,e,r,Object.freeze([]))}a(rj,"visitAsync");rj.BREAK=zc;rj.SKIP=CHe;rj.REMOVE=e0;async function TT(e,t,r,n){const i=await THe(e,t,r,n);if(Zo.isNode(i)||Zo.isPair(i)){xHe(e,n,i);return TT(e,i,r,n)}if(typeof i!=="symbol"){if(Zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let s=0;s<t.items.length;++s){const o=await TT(s,t.items[s],r,n);if(typeof o==="number")s=o-1;else if(o===zc)return zc;else if(o===e0){t.items.splice(s,1);s-=1}}}else if(Zo.isPair(t)){n=Object.freeze(n.concat(t));const s=await TT("key",t.key,r,n);if(s===zc)return zc;else if(s===e0)t.key=null;const o=await TT("value",t.value,r,n);if(o===zc)return zc;else if(o===e0)t.value=null}}return i}a(TT,"visitAsync_");function wHe(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value)){return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e)}return e}a(wHe,"initVisitor");function THe(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(Zo.isMap(t))return r.Map?.(e,t,n);if(Zo.isSeq(t))return r.Seq?.(e,t,n);if(Zo.isPair(t))return r.Pair?.(e,t,n);if(Zo.isScalar(t))return r.Scalar?.(e,t,n);if(Zo.isAlias(t))return r.Alias?.(e,t,n);return void 0}a(THe,"callVisitor");function xHe(e,t,r){const n=t[t.length-1];if(Zo.isCollection(n)){n.items[e]=r}else if(Zo.isPair(n)){if(e==="key")n.key=r;else n.value=r}else if(Zo.isDocument(n)){n.contents=r}else{const i=Zo.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(xHe,"replaceNode");tde.visit=tj;tde.visitAsync=rj});var rde=y(OHe=>{"use strict";var RHe=ls();var mbr=QD();var hbr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};var gbr=a(e=>e.replace(/[!,[\]{}]/g,t=>hbr[t]),"escapeTagName");var ZD=class e{static{a(this,"Directives")}constructor(t,r){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},e.defaultYaml,t);this.tags=Object.assign({},e.defaultTags,r)}clone(){const t=new e(this.yaml,this.tags);t.docStart=this.docStart;return t}atDocument(){const t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){if(this.atNextDocument){this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},e.defaultTags);this.atNextDocument=false}const n=t.trim().split(/[ \t]+/);const i=n.shift();switch(i){case"%TAG":{if(n.length!==2){r(0,"%TAG directive should contain exactly two parts");if(n.length<2)return false}const[s,o]=n;this.tags[s]=o;return true}case"%YAML":{this.yaml.explicit=true;if(n.length!==1){r(0,"%YAML directive should contain exactly one part");return false}const[s]=n;if(s==="1.1"||s==="1.2"){this.yaml.version=s;return true}else{const o=/^\d+\.\d+$/.test(s);r(6,`Unsupported YAML version ${s}`,o);return false}}default:r(0,`Unknown directive ${i}`,true);return false}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!"){r(`Not a valid tag: ${t}`);return null}if(t[1]==="<"){const o=t.slice(2,-1);if(o==="!"||o==="!!"){r(`Verbatim tags aren't resolved, so ${t} is invalid.`);return null}if(t[t.length-1]!==">")r("Verbatim tags must end with a >");return o}const[,n,i]=t.match(/^(.*!)([^!]*)$/s);if(!i)r(`The ${t} tag has no suffix`);const s=this.tags[n];if(s){try{return s+decodeURIComponent(i)}catch(o){r(String(o));return null}}if(n==="!")return t;r(`Could not resolve tag: ${t}`);return null}tagString(t){for(const[r,n]of Object.entries(this.tags)){if(t.startsWith(n))return r+gbr(t.substring(n.length))}return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const n=Object.entries(this.tags);let i;if(t&&n.length>0&&RHe.isNode(t.contents)){const s={};mbr.visit(t.contents,(o,u)=>{if(RHe.isNode(u)&&u.tag)s[u.tag]=true});i=Object.keys(s)}else i=[];for(const[s,o]of n){if(s==="!!"&&o==="tag:yaml.org,2002:")continue;if(!t||i.some(u=>u.startsWith(o)))r.push(`%TAG ${s} ${o}`)}return r.join("\n")}};ZD.defaultYaml={explicit:false,version:"1.2"};ZD.defaultTags={"!!":"tag:yaml.org,2002:"};OHe.Directives=ZD});var nj=y(e6=>{"use strict";var PHe=ls();var ybr=QD();function _br(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const r=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(r)}return true}a(_br,"anchorIsValid");function NHe(e){const t=new Set;ybr.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}});return t}a(NHe,"anchorNames");function IHe(e,t){for(let r=1;true;++r){const n=`${e}${r}`;if(!t.has(n))return n}}a(IHe,"findNewAnchor");function vbr(e,t){const r=[];const n=new Map;let i=null;return{onAnchor:s=>{r.push(s);if(!i)i=NHe(e);const o=IHe(t,i);i.add(o);return o},setAnchors:()=>{for(const s of r){const o=n.get(s);if(typeof o==="object"&&o.anchor&&(PHe.isScalar(o.node)||PHe.isCollection(o.node))){o.node.anchor=o.anchor}else{const u=new Error("Failed to resolve repeated object (this should not happen)");u.source=s;throw u}}},sourceObjects:n}}a(vbr,"createNodeAnchors");e6.anchorIsValid=_br;e6.anchorNames=NHe;e6.createNodeAnchors=vbr;e6.findNewAnchor=IHe});var nde=y(kHe=>{"use strict";function t6(e,t,r,n){if(n&&typeof n==="object"){if(Array.isArray(n)){for(let i=0,s=n.length;i<s;++i){const o=n[i];const u=t6(e,n,String(i),o);if(u===void 0)delete n[i];else if(u!==o)n[i]=u}}else if(n instanceof Map){for(const i of Array.from(n.keys())){const s=n.get(i);const o=t6(e,n,i,s);if(o===void 0)n.delete(i);else if(o!==s)n.set(i,o)}}else if(n instanceof Set){for(const i of Array.from(n)){const s=t6(e,n,i,i);if(s===void 0)n.delete(i);else if(s!==i){n.delete(i);n.add(s)}}}else{for(const[i,s]of Object.entries(n)){const o=t6(e,n,i,s);if(o===void 0)delete n[i];else if(o!==s)n[i]=o}}}return e.call(t,r,n)}a(t6,"applyReviver");kHe.applyReviver=t6});var F_=y(LHe=>{"use strict";var Ebr=ls();function DHe(e,t,r){if(Array.isArray(e))return e.map((n,i)=>DHe(n,String(i),r));if(e&&typeof e.toJSON==="function"){if(!r||!Ebr.hasAnchor(e))return e.toJSON(t,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n);r.onCreate=s=>{n.res=s;delete r.onCreate};const i=e.toJSON(t,r);if(r.onCreate)r.onCreate(i);return i}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}a(DHe,"toJS");LHe.toJS=DHe});var ij=y(BHe=>{"use strict";var bbr=nde();var FHe=ls();var Sbr=F_();var ide=class{static{a(this,"NodeBase")}constructor(t){Object.defineProperty(this,FHe.NODE_TYPE,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)t.range=this.range.slice();return t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!FHe.isDocument(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:true,mapAsMap:r===true,mapKeyWarned:false,maxAliasCount:typeof n==="number"?n:100};const u=Sbr.toJS(this,"",o);if(typeof i==="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof s==="function"?bbr.applyReviver(s,{"":u},"",u):u}};BHe.NodeBase=ide});var r6=y(qHe=>{"use strict";var Abr=nj();var MHe=QD();var sj=ls();var Cbr=ij();var wbr=F_();var sde=class extends Cbr.NodeBase{static{a(this,"Alias")}constructor(t){super(sj.ALIAS);this.source=t;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let r=void 0;MHe.visit(t,{Node:(n,i)=>{if(i===this)return MHe.visit.BREAK;if(i.anchor===this.source)r=i}});return r}toJSON(t,r){if(!r)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:s}=r;const o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let u=n.get(o);if(!u){wbr.toJS(o,null,r);u=n.get(o)}if(!u||u.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0){u.count+=1;if(u.aliasCount===0)u.aliasCount=aj(i,o,n);if(u.count*u.aliasCount>s){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return u.res}toString(t,r,n){const i=`*${this.source}`;if(t){Abr.anchorIsValid(this.source);if(t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}};function aj(e,t,r){if(sj.isAlias(t)){const n=t.resolve(e);const i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(sj.isCollection(t)){let n=0;for(const i of t.items){const s=aj(e,i,r);if(s>n)n=s}return n}else if(sj.isPair(t)){const n=aj(e,t.key,r);const i=aj(e,t.value,r);return Math.max(n,i)}return 1}a(aj,"getAliasCount");qHe.Alias=sde});var Ro=y(ade=>{"use strict";var Tbr=ls();var xbr=ij();var Rbr=F_();var Obr=a(e=>!e||typeof e!=="function"&&typeof e!=="object","isScalarValue");var B_=class extends xbr.NodeBase{static{a(this,"Scalar")}constructor(t){super(Tbr.SCALAR);this.value=t}toJSON(t,r){return r?.keep?this.value:Rbr.toJS(this.value,t,r)}toString(){return String(this.value)}};B_.BLOCK_FOLDED="BLOCK_FOLDED";B_.BLOCK_LITERAL="BLOCK_LITERAL";B_.PLAIN="PLAIN";B_.QUOTE_DOUBLE="QUOTE_DOUBLE";B_.QUOTE_SINGLE="QUOTE_SINGLE";ade.Scalar=B_;ade.isScalarValue=Obr});var n6=y($He=>{"use strict";var Pbr=r6();var Q2=ls();var UHe=Ro();var Nbr="tag:yaml.org,2002:";function Ibr(e,t,r){if(t){const n=r.filter(s=>s.tag===t);const i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return r.find(n=>n.identify?.(e)&&!n.format)}a(Ibr,"findTagObject");function kbr(e,t,r){if(Q2.isDocument(e))e=e.contents;if(Q2.isNode(e))return e;if(Q2.isPair(e)){const p=r.schema[Q2.MAP].createNode?.(r.schema,null,r);p.items.push(e);return p}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:u}=r;let l=void 0;if(n&&e&&typeof e==="object"){l=u.get(e);if(l){if(!l.anchor)l.anchor=i(e);return new Pbr.Alias(l.anchor)}else{l={anchor:null,node:null};u.set(e,l)}}if(t?.startsWith("!!"))t=Nbr+t.slice(2);let c=Ibr(e,t,o.tags);if(!c){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const p=new UHe.Scalar(e);if(l)l.node=p;return p}c=e instanceof Map?o[Q2.MAP]:Symbol.iterator in Object(e)?o[Q2.SEQ]:o[Q2.MAP]}if(s){s(c);delete r.onTagObj}const d=c?.createNode?c.createNode(r.schema,e,r):typeof c?.nodeClass?.from==="function"?c.nodeClass.from(r.schema,e,r):new UHe.Scalar(e);if(t)d.tag=t;else if(!c.default)d.tag=c.tag;if(l)l.node=d;return d}a(kbr,"createNode");$He.createNode=kbr});var i6=y(uj=>{"use strict";var Dbr=n6();var t0=ls();var Lbr=ij();function ode(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s==="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=n;n=o}else{n=new Map([[s,n]])}}return Dbr.createNode(n,void 0,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}a(ode,"collectionFromPath");var jHe=a(e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done,"isEmptyPath");var oj=class extends Lbr.NodeBase{static{a(this,"Collection")}constructor(t,r){super(t);Object.defineProperty(this,"schema",{value:r,configurable:true,enumerable:false,writable:true})}clone(t){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(t)r.schema=t;r.items=r.items.map(n=>t0.isNode(n)||t0.isPair(n)?n.clone(t):n);if(this.range)r.range=this.range.slice();return r}addIn(t,r){if(jHe(t))this.add(r);else{const[n,...i]=t;const s=this.get(n,true);if(t0.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,ode(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){const[r,...n]=t;if(n.length===0)return this.delete(r);const i=this.get(r,true);if(t0.isCollection(i))return i.deleteIn(n);else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){const[n,...i]=t;const s=this.get(n,true);if(i.length===0)return!r&&t0.isScalar(s)?s.value:s;else return t0.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!t0.isPair(r))return false;const n=r.value;return n==null||t&&t0.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){const[r,...n]=t;if(n.length===0)return this.has(r);const i=this.get(r,true);return t0.isCollection(i)?i.hasIn(n):false}setIn(t,r){const[n,...i]=t;if(i.length===0){this.set(n,r)}else{const s=this.get(n,true);if(t0.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,ode(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};oj.maxFlowStringSingleLineLength=60;uj.Collection=oj;uj.collectionFromPath=ode;uj.isEmptyPath=jHe});var s6=y(lj=>{"use strict";var Fbr=a(e=>e.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function ude(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}a(ude,"indentComment");var Bbr=a((e,t,r)=>e.endsWith("\n")?ude(r,t):r.includes("\n")?"\n"+ude(r,t):(e.endsWith(" ")?"":" ")+r,"lineComment");lj.indentComment=ude;lj.lineComment=Bbr;lj.stringifyComment=Fbr});var HHe=y(a6=>{"use strict";var Mbr="flow";var lde="block";var cj="quoted";function qbr(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:u}={}){if(!i||i<0)return e;const l=Math.max(1+s,1+i-t.length);if(e.length<=l)return e;const c=[];const d={};let p=i-t.length;if(typeof n==="number"){if(n>i-Math.max(2,s))c.push(0);else p=i-n}let f=void 0;let m=void 0;let h=false;let g=-1;let _=-1;let v=-1;if(r===lde){g=GHe(e,g);if(g!==-1)p=g+l}for(let E;E=e[g+=1];){if(r===cj&&E==="\\"){_=g;switch(e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}v=g}if(E==="\n"){if(r===lde)g=GHe(e,g);p=g+l;f=void 0}else{if(E===" "&&m&&m!==" "&&m!=="\n"&&m!==" "){const b=e[g+1];if(b&&b!==" "&&b!=="\n"&&b!==" ")f=g}if(g>=p){if(f){c.push(f);p=f+l;f=void 0}else if(r===cj){while(m===" "||m===" "){m=E;E=e[g+=1];h=true}const b=g>v+1?g-2:_-1;if(d[b])return e;c.push(b);d[b]=true;p=b+l;f=void 0}else{h=true}}}m=E}if(h&&u)u();if(c.length===0)return e;if(o)o();let S=e.slice(0,c[0]);for(let E=0;E<c.length;++E){const b=c[E];const A=c[E+1]||e.length;if(b===0)S=`
|
|
26
26
|
${t}${e.slice(0,A)}`;else{if(r===cj&&d[b])S+=`${e[b]}\\`;S+=`
|
|
27
27
|
${t}${e.slice(b+1,A)}`}}return S}a(qbr,"foldFlowLines");function GHe(e,t){let r=e[t+1];while(r===" "||r===" "){do{r=e[t+=1]}while(r&&r!=="\n");r=e[t+1]}return t}a(GHe,"consumeMoreIndentedLines");a6.FOLD_BLOCK=lde;a6.FOLD_FLOW=Mbr;a6.FOLD_QUOTED=cj;a6.foldFlowLines=qbr});var u6=y(VHe=>{"use strict";var r0=Ro();var M_=HHe();var pj=a((e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),"getFoldOptions");var fj=a(e=>/^(%|---|\.\.\.)/m.test(e),"containsDocumentMarker");function Ubr(e,t,r){if(!t||t<0)return false;const n=t-r;const i=e.length;if(i<=n)return false;for(let s=0,o=0;s<i;++s){if(e[s]==="\n"){if(s-o>n)return true;o=s+1;if(i-o<=n)return false}}return true}a(Ubr,"lineLengthOverLimit");function o6(e,t){const r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;const{implicitKey:n}=t;const i=t.options.doubleQuotedMinMultiLineLength;const s=t.indent||(fj(e)?" ":"");let o="";let u=0;for(let l=0,c=r[l];c;c=r[++l]){if(c===" "&&r[l+1]==="\\"&&r[l+2]==="n"){o+=r.slice(u,l)+"\\ ";l+=1;u=l;c="\\"}if(c==="\\")switch(r[l+1]){case"u":{o+=r.slice(u,l);const d=r.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:if(d.substr(0,2)==="00")o+="\\x"+d.substr(2);else o+=r.substr(l,6)}l+=5;u=l+1}break;case"n":if(n||r[l+2]==='"'||r.length<i){l+=1}else{o+=r.slice(u,l)+"\n\n";while(r[l+2]==="\\"&&r[l+3]==="n"&&r[l+4]!=='"'){o+="\n";l+=2}o+=s;if(r[l+2]===" ")o+="\\";l+=1;u=l+1}break;default:l+=1}}o=u?o+r.slice(u):r;return n?o:M_.foldFlowLines(o,s,M_.FOLD_QUOTED,pj(t,false))}a(o6,"doubleQuotedString");function cde(e,t){if(t.options.singleQuote===false||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return o6(e,t);const r=t.indent||(fj(e)?" ":"");const n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
28
28
|
${r}`)+"'";return t.implicitKey?n:M_.foldFlowLines(n,r,M_.FOLD_FLOW,pj(t,false))}a(cde,"singleQuotedString");function xT(e,t){const{singleQuote:r}=t.options;let n;if(r===false)n=o6;else{const i=e.includes('"');const s=e.includes("'");if(i&&!s)n=cde;else if(s&&!i)n=o6;else n=r?cde:o6}return n(e,t)}a(xT,"quotedString");var dde;try{dde=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{dde=/\n+(?!\n|$)/g}function dj({comment:e,type:t,value:r},n,i,s){const{blockQuote:o,commentString:u,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(r)||/^\s*$/.test(r)){return xT(r,n)}const c=n.indent||(n.forceBlockIndent||fj(r)?" ":"");const d=o==="literal"?true:o==="folded"||t===r0.Scalar.BLOCK_FOLDED?false:t===r0.Scalar.BLOCK_LITERAL?true:!Ubr(r,l,c.length);if(!r)return d?"|\n":">\n";let p;let f;for(f=r.length;f>0;--f){const C=r[f-1];if(C!=="\n"&&C!==" "&&C!==" ")break}let m=r.substring(f);const h=m.indexOf("\n");if(h===-1){p="-"}else if(r===m||h!==m.length-1){p="+";if(s)s()}else{p=""}if(m){r=r.slice(0,-m.length);if(m[m.length-1]==="\n")m=m.slice(0,-1);m=m.replace(dde,`$&${c}`)}let g=false;let _;let v=-1;for(_=0;_<r.length;++_){const C=r[_];if(C===" ")g=true;else if(C==="\n")v=_;else break}let S=r.substring(0,v<_?v+1:_);if(S){r=r.substring(S.length);S=S.replace(/\n+/g,`$&${c}`)}const E=c?"2":"1";let b=(d?"|":">")+(g?E:"")+p;if(e){b+=" "+u(e.replace(/ ?[\r\n]+/g," "));if(i)i()}if(d){r=r.replace(/\n+/g,`$&${c}`);return`${b}
|
|
@@ -407,7 +407,7 @@ ${p}
|
|
|
407
407
|
${f}`;const h=`${o}/${e.region}/${n}/${LSn}`;const g=`${LCt}
|
|
408
408
|
${s}
|
|
409
409
|
${h}
|
|
410
|
-
`+await e.crypto.sha256DigestHex(m);const _=await FSn(e.crypto,e.securityCredentials.secretAccessKey,o,e.region,n);const v=await yF(e.crypto,_,g);const S=`${LCt} Credential=${e.securityCredentials.accessKeyId}/${h}, SignedHeaders=${p}, Signature=${(0,FCt.fromArrayBufferToHex)(v)}`;return{amzDate:u.date?void 0:s,authorizationHeader:S,canonicalQuerystring:e.canonicalQuerystring}}a(BSn,"generateAuthenticationHeaderMap")});var txe=y(XX=>{"use strict";Object.defineProperty(XX,"__esModule",{value:true});XX.AwsClient=void 0;var MSn=BCt();var qSn=BE();var _F=class extends qSn.BaseExternalAccountClient{static{a(this,"AwsClient")}constructor(t,r){super(t,r);this.environmentId=t.credential_source.environment_id;this.regionUrl=t.credential_source.region_url;this.securityCredentialsUrl=t.credential_source.url;this.regionalCredVerificationUrl=t.credential_source.regional_cred_verification_url;this.imdsV2SessionTokenUrl=t.credential_source.imdsv2_session_token_url;this.awsRequestSigner=null;this.region="";this.validateEnvironmentId()}validateEnvironmentId(){var t;const r=(t=this.environmentId)===null||t===void 0?void 0:t.match(/^(aws)(\d+)$/);if(!r||!this.regionalCredVerificationUrl){throw new Error('No valid AWS "credential_source" provided')}else if(parseInt(r[2],10)!==1){throw new Error(`aws version "${r[2]}" is not supported in the current build.`)}}async retrieveSubjectToken(){if(!this.awsRequestSigner){const i={};if(this.shouldUseMetadataServer()&&this.imdsV2SessionTokenUrl){i["x-aws-ec2-metadata-token"]=await this.getImdsV2SessionToken()}this.region=await this.getAwsRegion(i);this.awsRequestSigner=new MSn.AwsRequestSigner(async()=>{if(this.securityCredentialsFromEnv){return this.securityCredentialsFromEnv}const s=await this.getAwsRoleName(i);const o=await this.getAwsSecurityCredentials(s,i);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}},this.region)}const t=await this.awsRequestSigner.getRequestOptions({url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"});const r=[];const n=Object.assign({"x-goog-cloud-target-resource":this.audience},t.headers);for(const i in n){r.push({key:i,value:n[i]})}return encodeURIComponent(JSON.stringify({url:t.url,method:t.method,headers:r}))}async getImdsV2SessionToken(){const t={url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};const r=await this.transporter.request(t);return r.data}async getAwsRegion(t){if(this.regionFromEnv){return this.regionFromEnv}if(!this.regionUrl){throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"')}const r={url:this.regionUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data.substr(0,n.data.length-1)}async getAwsRoleName(t){if(!this.securityCredentialsUrl){throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"')}const r={url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data}async getAwsSecurityCredentials(t,r){const n=await this.transporter.request({url:`${this.securityCredentialsUrl}/${t}`,responseType:"json",headers:r});return n.data}shouldUseMetadataServer(){return!this.regionFromEnv||!this.securityCredentialsFromEnv}get regionFromEnv(){return process.env["AWS_REGION"]||process.env["AWS_DEFAULT_REGION"]||null}get securityCredentialsFromEnv(){if(process.env["AWS_ACCESS_KEY_ID"]&&process.env["AWS_SECRET_ACCESS_KEY"]){return{accessKeyId:process.env["AWS_ACCESS_KEY_ID"],secretAccessKey:process.env["AWS_SECRET_ACCESS_KEY"],token:process.env["AWS_SESSION_TOKEN"]}}return null}};XX.AwsClient=_F;_F.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";_F.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var axe=y(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:true});Lo.InvalidSubjectTokenError=Lo.InvalidMessageFieldError=Lo.InvalidCodeFieldError=Lo.InvalidTokenTypeFieldError=Lo.InvalidExpirationTimeFieldError=Lo.InvalidSuccessFieldError=Lo.InvalidVersionFieldError=Lo.ExecutableResponseError=Lo.ExecutableResponse=void 0;var JX="urn:ietf:params:oauth:token-type:saml2";var rxe="urn:ietf:params:oauth:token-type:id_token";var nxe="urn:ietf:params:oauth:token-type:jwt";var ixe=class{static{a(this,"ExecutableResponse")}constructor(t){if(!t.version){throw new QX("Executable response must contain a 'version' field.")}if(t.success===void 0){throw new ZX("Executable response must contain a 'success' field.")}this.version=t.version;this.success=t.success;if(this.success){this.expirationTime=t.expiration_time;this.tokenType=t.token_type;if(this.tokenType!==JX&&this.tokenType!==rxe&&this.tokenType!==nxe){throw new eJ(`Executable response must contain a 'token_type' field when successful and it must be one of ${rxe}, ${nxe}, or ${JX}.`)}if(this.tokenType===JX){if(!t.saml_response){throw new vF(`Executable response must contain a 'saml_response' field when token_type=${JX}.`)}this.subjectToken=t.saml_response}else{if(!t.id_token){throw new vF(`Executable response must contain a 'id_token' field when token_type=${rxe} or ${nxe}.`)}this.subjectToken=t.id_token}}else{if(!t.code){throw new tJ("Executable response must contain a 'code' field when unsuccessful.")}if(!t.message){throw new rJ("Executable response must contain a 'message' field when unsuccessful.")}this.errorCode=t.code;this.errorMessage=t.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};Lo.ExecutableResponse=ixe;var tg=class extends Error{static{a(this,"ExecutableResponseError")}constructor(t){super(t);Object.setPrototypeOf(this,new.target.prototype)}};Lo.ExecutableResponseError=tg;var QX=class extends tg{static{a(this,"InvalidVersionFieldError")}};Lo.InvalidVersionFieldError=QX;var ZX=class extends tg{static{a(this,"InvalidSuccessFieldError")}};Lo.InvalidSuccessFieldError=ZX;var sxe=class extends tg{static{a(this,"InvalidExpirationTimeFieldError")}};Lo.InvalidExpirationTimeFieldError=sxe;var eJ=class extends tg{static{a(this,"InvalidTokenTypeFieldError")}};Lo.InvalidTokenTypeFieldError=eJ;var tJ=class extends tg{static{a(this,"InvalidCodeFieldError")}};Lo.InvalidCodeFieldError=tJ;var rJ=class extends tg{static{a(this,"InvalidMessageFieldError")}};Lo.InvalidMessageFieldError=rJ;var vF=class extends tg{static{a(this,"InvalidSubjectTokenError")}};Lo.InvalidSubjectTokenError=vF});var MCt=y(nJ=>{"use strict";Object.defineProperty(nJ,"__esModule",{value:true});nJ.PluggableAuthHandler=void 0;var USn=iJ();var QA=axe();var $Sn=require("child_process");var oxe=require("fs");var uxe=class e{static{a(this,"PluggableAuthHandler")}constructor(t){if(!t.command){throw new Error("No command provided.")}this.commandComponents=e.parseCommand(t.command);this.timeoutMillis=t.timeoutMillis;if(!this.timeoutMillis){throw new Error("No timeoutMillis provided.")}this.outputFile=t.outputFile}retrieveResponseFromExecutable(t){return new Promise((r,n)=>{const i=$Sn.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(t)}});let s="";i.stdout.on("data",u=>{s+=u});i.stderr.on("data",u=>{s+=u});const o=setTimeout(()=>{i.removeAllListeners();i.kill();return n(new Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);i.on("close",u=>{clearTimeout(o);if(u===0){try{const l=JSON.parse(s);const c=new QA.ExecutableResponse(l);return r(c)}catch(l){if(l instanceof QA.ExecutableResponseError){return n(l)}return n(new QA.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}}else{return n(new USn.ExecutableError(s,u.toString()))}})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0){return void 0}let t;try{t=await oxe.promises.realpath(this.outputFile)}catch(n){return void 0}if(!(await oxe.promises.lstat(t)).isFile()){return void 0}const r=await oxe.promises.readFile(t,{encoding:"utf8"});if(r===""){return void 0}try{const n=JSON.parse(r);const i=new QA.ExecutableResponse(n);if(i.isValid()){return new QA.ExecutableResponse(n)}return void 0}catch(n){if(n instanceof QA.ExecutableResponseError){throw n}throw new QA.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(t){const r=t.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r){throw new Error(`Provided command: "${t}" could not be parsed.`)}for(let n=0;n<r.length;n++){if(r[n][0]==='"'&&r[n].slice(-1)==='"'){r[n]=r[n].slice(1,-1)}}return r}};nJ.PluggableAuthHandler=uxe});var iJ=y(VO=>{"use strict";Object.defineProperty(VO,"__esModule",{value:true});VO.PluggableAuthClient=VO.ExecutableError=void 0;var jSn=BE();var GSn=axe();var HSn=MCt();var sJ=class extends Error{static{a(this,"ExecutableError")}constructor(t,r){super(`The executable failed with exit code: ${r} and error message: ${t}.`);this.code=r;Object.setPrototypeOf(this,new.target.prototype)}};VO.ExecutableError=sJ;var VSn=30*1e3;var qCt=5*1e3;var UCt=120*1e3;var zSn="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES";var $Ct=1;var lxe=class extends jSn.BaseExternalAccountClient{static{a(this,"PluggableAuthClient")}constructor(t,r){super(t,r);if(!t.credential_source.executable){throw new Error('No valid Pluggable Auth "credential_source" provided.')}this.command=t.credential_source.executable.command;if(!this.command){throw new Error('No valid Pluggable Auth "credential_source" provided.')}if(t.credential_source.executable.timeout_millis===void 0){this.timeoutMillis=VSn}else{this.timeoutMillis=t.credential_source.executable.timeout_millis;if(this.timeoutMillis<qCt||this.timeoutMillis>UCt){throw new Error(`Timeout must be between ${qCt} and ${UCt} milliseconds.`)}}this.outputFile=t.credential_source.executable.output_file;this.handler=new HSn.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile})}async retrieveSubjectToken(){if(process.env[zSn]!=="1"){throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.")}let t=void 0;if(this.outputFile){t=await this.handler.retrieveCachedResponse()}if(!t){const r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience);r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType);r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0");if(this.outputFile){r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile)}const n=this.getServiceAccountEmail();if(n){r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n)}t=await this.handler.retrieveResponseFromExecutable(r)}if(t.version>$Ct){throw new Error(`Version of executable is not currently supported, maximum supported version is ${$Ct}.`)}if(!t.success){throw new sJ(t.errorMessage,t.errorCode)}if(this.outputFile){if(!t.expirationTime){throw new GSn.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.")}}if(t.isExpired()){throw new Error("Executable response is expired.")}return t.subjectToken}};VO.PluggableAuthClient=lxe});var dxe=y(aJ=>{"use strict";Object.defineProperty(aJ,"__esModule",{value:true});aJ.ExternalAccountClient=void 0;var KSn=BE();var WSn=ZTe();var YSn=txe();var XSn=iJ();var cxe=class{static{a(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(t,r){var n,i;if(t&&t.type===KSn.EXTERNAL_ACCOUNT_TYPE){if((n=t.credential_source)===null||n===void 0?void 0:n.environment_id){return new YSn.AwsClient(t,r)}else if((i=t.credential_source)===null||i===void 0?void 0:i.executable){return new XSn.PluggableAuthClient(t,r)}else{return new WSn.IdentityPoolClient(t,r)}}else{return null}}};aJ.ExternalAccountClient=cxe});var GCt=y(zO=>{"use strict";Object.defineProperty(zO,"__esModule",{value:true});zO.ExternalAccountAuthorizedUserClient=zO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var JSn=wO();var jCt=jTe();var QSn=Ey();var ZSn=require("stream");var eAn=BE();zO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var pxe=class extends jCt.OAuthClientAuthHandler{static{a(this,"ExternalAccountAuthorizedUserHandler")}constructor(t,r,n){super(n);this.url=t;this.transporter=r}async refreshToken(t,r){const n=new URLSearchParams({grant_type:"refresh_token",refresh_token:t});const i={"Content-Type":"application/x-www-form-urlencoded",...r};const s={url:this.url,method:"POST",headers:i,data:n.toString(),responseType:"json"};this.applyClientAuthenticationOptions(s);try{const o=await this.transporter.request(s);const u=o.data;u.res=o;return u}catch(o){if(o instanceof QSn.GaxiosError&&o.response){throw(0,jCt.getErrorFromOAuthErrorResponse)(o.response.data,o)}throw o}}};var fxe=class extends JSn.AuthClient{static{a(this,"ExternalAccountAuthorizedUserClient")}constructor(t,r){super();this.refreshToken=t.refresh_token;const n={confidentialClientType:"basic",clientId:t.client_id,clientSecret:t.client_secret};this.externalAccountAuthorizedUserHandler=new pxe(t.token_url,this.transporter,n);this.cachedAccessToken=null;this.quotaProjectId=t.quota_project_id;if(typeof(r===null||r===void 0?void 0:r.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=eAn.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=r.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(r===null||r===void 0?void 0:r.forceRefreshOnFailure)}async getAccessToken(){if(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof ZSn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){const t=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);this.cachedAccessToken={access_token:t.access_token,expiry_date:new Date().getTime()+t.expires_in*1e3,res:t.res};if(t.refresh_token!==void 0){this.refreshToken=t.refresh_token}return this.cachedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};zO.ExternalAccountAuthorizedUserClient=fxe});var zCt=y(WO=>{"use strict";Object.defineProperty(WO,"__esModule",{value:true});WO.GoogleAuth=WO.CLOUD_SDK_CLIENT_ID=void 0;var tAn=require("child_process");var EF=require("fs");var mxe=ZY();var rAn=require("os");var hxe=require("path");var nAn=AO();var iAn=eF();var sAn=Cwe();var aAn=Twe();var oAn=xwe();var KO=FTe();var gxe=MTe();var oJ=UTe();var uAn=dxe();var bF=BE();var HCt=GCt();WO.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";var VCt={NO_PROJECT_ID_FOUND:"Unable to detect a Project Id in the current environment. \nTo learn more about authentication and Google APIs, visit: \nhttps://cloud.google.com/docs/authentication/getting-started"};var uJ=class{static{a(this,"GoogleAuth")}get isGCE(){return this.checkIsGCE}constructor(t){this.checkIsGCE=void 0;this.jsonContent=null;this.cachedCredential=null;t=t||{};this._cachedProjectId=t.projectId||null;this.cachedCredential=t.authClient||null;this.keyFilename=t.keyFilename||t.keyFile;this.scopes=t.scopes;this.jsonContent=t.credentials||null;this.clientOptions=t.clientOptions}setGapicJWTValues(t){t.defaultServicePath=this.defaultServicePath;t.useJWTAccessWithScope=this.useJWTAccessWithScope;t.defaultScopes=this.defaultScopes}getProjectId(t){if(t){this.getProjectIdAsync().then(r=>t(null,r),t)}else{return this.getProjectIdAsync()}}async getProjectIdOptional(){try{return await this.getProjectId()}catch(t){if(t instanceof Error&&t.message===VCt.NO_PROJECT_ID_FOUND){return null}else{throw t}}}async findAndCacheProjectId(){let t=null;t||(t=await this.getProductionProjectId());t||(t=await this.getFileProjectId());t||(t=await this.getDefaultServiceProjectId());t||(t=await this.getGCEProjectId());t||(t=await this.getExternalAccountClientProjectId());if(t){this._cachedProjectId=t;return t}else{throw new Error(VCt.NO_PROJECT_ID_FOUND)}}async getProjectIdAsync(){if(this._cachedProjectId){return this._cachedProjectId}if(!this._findProjectIdPromise){this._findProjectIdPromise=this.findAndCacheProjectId()}return this._findProjectIdPromise}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(t={},r){let n;if(typeof t==="function"){r=t}else{n=t}if(r){this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r)}else{return this.getApplicationDefaultAsync(n)}}async getApplicationDefaultAsync(t={}){if(this.cachedCredential){return await this.prepareAndCacheADC(this.cachedCredential)}const r=process.env["GOOGLE_CLOUD_QUOTA_PROJECT"];let n;n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(t);if(n){if(n instanceof KO.JWT){n.scopes=this.scopes}else if(n instanceof bF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}n=await this._tryGetApplicationCredentialsFromWellKnownFile(t);if(n){if(n instanceof KO.JWT){n.scopes=this.scopes}else if(n instanceof bF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}let i;try{i=await this._checkIsGCE()}catch(s){if(s instanceof Error){s.message=`Unexpected error determining execution environment: ${s.message}`}throw s}if(!i){throw new Error("Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.")}t.scopes=this.getAnyScopes();return await this.prepareAndCacheADC(new sAn.Compute(t),r)}async prepareAndCacheADC(t,r){const n=await this.getProjectIdOptional();if(r){t.quotaProjectId=r}this.cachedCredential=t;return{credential:t,projectId:n}}async _checkIsGCE(){if(this.checkIsGCE===void 0){this.checkIsGCE=await mxe.isAvailable()}return this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(t){const r=process.env["GOOGLE_APPLICATION_CREDENTIALS"]||process.env["google_application_credentials"];if(!r||r.length===0){return null}try{return this._getApplicationCredentialsFromFilePath(r,t)}catch(n){if(n instanceof Error){n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`}throw n}}async _tryGetApplicationCredentialsFromWellKnownFile(t){let r=null;if(this._isWindows()){r=process.env["APPDATA"]}else{const i=process.env["HOME"];if(i){r=hxe.join(i,".config")}}if(r){r=hxe.join(r,"gcloud","application_default_credentials.json");if(!EF.existsSync(r)){r=null}}if(!r){return null}const n=await this._getApplicationCredentialsFromFilePath(r,t);return n}async _getApplicationCredentialsFromFilePath(t,r={}){if(!t||t.length===0){throw new Error("The file path is invalid.")}try{t=EF.realpathSync(t);if(!EF.lstatSync(t).isFile()){throw new Error}}catch(i){if(i instanceof Error){i.message=`The file at ${t} does not exist, or it is not a file. ${i.message}`}throw i}const n=EF.createReadStream(t);return this.fromStream(n,r)}fromImpersonatedJSON(t){var r,n,i,s;if(!t){throw new Error("Must pass in a JSON object containing an impersonated refresh token")}if(t.type!==oJ.IMPERSONATED_ACCOUNT_TYPE){throw new Error(`The incoming JSON object does not have the "${oJ.IMPERSONATED_ACCOUNT_TYPE}" type`)}if(!t.source_credentials){throw new Error("The incoming JSON object does not contain a source_credentials field")}if(!t.service_account_impersonation_url){throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field")}const o=new gxe.UserRefreshClient(t.source_credentials.client_id,t.source_credentials.client_secret,t.source_credentials.refresh_token);const u=(n=(r=/(?<target>[^/]+):generateAccessToken$/.exec(t.service_account_impersonation_url))===null||r===void 0?void 0:r.groups)===null||n===void 0?void 0:n.target;if(!u){throw new RangeError(`Cannot extract target principal from ${t.service_account_impersonation_url}`)}const l=(i=this.getAnyScopes())!==null&&i!==void 0?i:[];const c=new oJ.Impersonated({delegates:(s=t.delegates)!==null&&s!==void 0?s:[],sourceClient:o,targetPrincipal:u,targetScopes:Array.isArray(l)?l:[l]});return c}fromJSON(t,r={}){let n;r=r||{};if(t.type===gxe.USER_REFRESH_ACCOUNT_TYPE){n=new gxe.UserRefreshClient(r);n.fromJSON(t)}else if(t.type===oJ.IMPERSONATED_ACCOUNT_TYPE){n=this.fromImpersonatedJSON(t)}else if(t.type===bF.EXTERNAL_ACCOUNT_TYPE){n=uAn.ExternalAccountClient.fromJSON(t,r);n.scopes=this.getAnyScopes()}else if(t.type===HCt.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE){n=new HCt.ExternalAccountAuthorizedUserClient(t,r)}else{r.scopes=this.scopes;n=new KO.JWT(r);this.setGapicJWTValues(n);n.fromJSON(t)}return n}_cacheClientFromJSON(t,r){const n=this.fromJSON(t,r);this.jsonContent=t;this.cachedCredential=n;return n}fromStream(t,r={},n){let i={};if(typeof r==="function"){n=r}else{i=r}if(n){this.fromStreamAsync(t,i).then(s=>n(null,s),n)}else{return this.fromStreamAsync(t,i)}}fromStreamAsync(t,r){return new Promise((n,i)=>{if(!t){throw new Error("Must pass in a stream containing the Google auth settings.")}let s="";t.setEncoding("utf8").on("error",i).on("data",o=>s+=o).on("end",()=>{try{try{const o=JSON.parse(s);const u=this._cacheClientFromJSON(o,r);return n(u)}catch(o){if(!this.keyFilename)throw o;const u=new KO.JWT({...this.clientOptions,keyFile:this.keyFilename});this.cachedCredential=u;this.setGapicJWTValues(u);return n(u)}}catch(o){return i(o)}})})}fromAPIKey(t,r){r=r||{};const n=new KO.JWT(r);n.fromAPIKey(t);return n}_isWindows(){const t=rAn.platform();if(t&&t.length>=3){if(t.substring(0,3).toLowerCase()==="win"){return true}}return false}async getDefaultServiceProjectId(){return new Promise(t=>{(0,tAn.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n){try{const i=JSON.parse(n).configuration.properties.core.project;t(i);return}catch(i){}}t(null)})})}getProductionProjectId(){return process.env["GCLOUD_PROJECT"]||process.env["GOOGLE_CLOUD_PROJECT"]||process.env["gcloud_project"]||process.env["google_cloud_project"]}async getFileProjectId(){if(this.cachedCredential){return this.cachedCredential.projectId}if(this.keyFilename){const r=await this.getClient();if(r&&r.projectId){return r.projectId}}const t=await this._tryGetApplicationCredentialsFromEnvironmentVariable();if(t){return t.projectId}else{return null}}async getExternalAccountClientProjectId(){if(!this.jsonContent||this.jsonContent.type!==bF.EXTERNAL_ACCOUNT_TYPE){return null}const t=await this.getClient();return await t.getProjectId()}async getGCEProjectId(){try{const t=await mxe.project("project-id");return t}catch(t){return null}}getCredentials(t){if(t){this.getCredentialsAsync().then(r=>t(null,r),t)}else{return this.getCredentialsAsync()}}async getCredentialsAsync(){const t=await this.getClient();if(t instanceof bF.BaseExternalAccountClient){const i=t.getServiceAccountEmail();if(i){return{client_email:i}}}if(this.jsonContent){const i={client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key};return i}const r=await this._checkIsGCE();if(!r){throw new Error("Unknown error.")}const n=await mxe.instance({property:"service-accounts/",params:{recursive:"true"}});if(!n||!n.default||!n.default.email){throw new Error("Failure from metadata server.")}return{client_email:n.default.email}}async getClient(){if(!this.cachedCredential){if(this.jsonContent){this._cacheClientFromJSON(this.jsonContent,this.clientOptions)}else if(this.keyFilename){const t=hxe.resolve(this.keyFilename);const r=EF.createReadStream(t);await this.fromStreamAsync(r,this.clientOptions)}else{await this.getApplicationDefaultAsync(this.clientOptions)}}return this.cachedCredential}async getIdTokenClient(t){const r=await this.getClient();if(!("fetchIdToken"in r)){throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.")}return new aAn.IdTokenClient({targetAudience:t,idTokenProvider:r})}async getAccessToken(){const t=await this.getClient();return(await t.getAccessToken()).token}async getRequestHeaders(t){const r=await this.getClient();return r.getRequestHeaders(t)}async authorizeRequest(t){t=t||{};const r=t.url||t.uri;const n=await this.getClient();const i=await n.getRequestHeaders(r);t.headers=Object.assign(t.headers||{},i);return t}async request(t){const r=await this.getClient();return r.request(t)}getEnv(){return(0,oAn.getEnv)()}async sign(t){const r=await this.getClient();const n=(0,nAn.createCrypto)();if(r instanceof KO.JWT&&r.key){const s=await n.sign(r.key,t);return s}const i=await this.getCredentials();if(!i.client_email){throw new Error("Cannot sign data without `client_email`.")}return this.signBlob(n,i.client_email,t)}async signBlob(t,r,n){const i=`https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${r}:signBlob`;const s=await this.request({method:"POST",url:i,data:{payload:t.encodeBase64StringUtf8(n)}});return s.data.signedBlob}};WO.GoogleAuth=uJ;uJ.DefaultTransporter=iAn.DefaultTransporter});var KCt=y(lJ=>{"use strict";Object.defineProperty(lJ,"__esModule",{value:true});lJ.IAMAuth=void 0;var yxe=class{static{a(this,"IAMAuth")}constructor(t,r){this.selector=t;this.token=r;this.selector=t;this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};lJ.IAMAuth=yxe});var WCt=y(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:true});ph.DownscopedClient=ph.EXPIRATION_TIME_OFFSET=ph.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var lAn=require("stream");var cAn=wO();var dAn=HTe();var pAn="urn:ietf:params:oauth:grant-type:token-exchange";var fAn="urn:ietf:params:oauth:token-type:access_token";var mAn="urn:ietf:params:oauth:token-type:access_token";var hAn="https://sts.googleapis.com/v1/token";ph.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;ph.EXPIRATION_TIME_OFFSET=5*60*1e3;var _xe=class extends cAn.AuthClient{static{a(this,"DownscopedClient")}constructor(t,r,n,i){super();this.authClient=t;this.credentialAccessBoundary=r;if(r.accessBoundary.accessBoundaryRules.length===0){throw new Error("At least one access boundary rule needs to be defined.")}else if(r.accessBoundary.accessBoundaryRules.length>ph.MAX_ACCESS_BOUNDARY_RULES_COUNT){throw new Error(`The provided access boundary has more than ${ph.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`)}for(const s of r.accessBoundary.accessBoundaryRules){if(s.availablePermissions.length===0){throw new Error("At least one permission should be defined in access boundary rules.")}}this.stsCredential=new dAn.StsCredentials(hAn);this.cachedDownscopedAccessToken=null;if(typeof(n===null||n===void 0?void 0:n.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=ph.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(n===null||n===void 0?void 0:n.forceRefreshOnFailure);this.quotaProjectId=i}setCredentials(t){if(!t.expiry_date){throw new Error("The access token expiry_date field is missing in the provided credentials.")}super.setCredentials(t);this.cachedDownscopedAccessToken=t}async getAccessToken(){if(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof lAn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){var t;const r=(await this.authClient.getAccessToken()).token;const n={grantType:pAn,requestedTokenType:fAn,subjectToken:r,subjectTokenType:mAn};const i=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary);const s=((t=this.authClient.credentials)===null||t===void 0?void 0:t.expiry_date)||null;const o=i.expires_in?new Date().getTime()+i.expires_in*1e3:s;this.cachedDownscopedAccessToken={access_token:i.access_token,expiry_date:o,res:i.res};this.credentials={};Object.assign(this.credentials,this.cachedDownscopedAccessToken);delete this.credentials.res;this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null});return this.cachedDownscopedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};ph.DownscopedClient=_xe});var vxe=y(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:true});mn.GoogleAuth=mn.auth=mn.DefaultTransporter=mn.PluggableAuthClient=mn.DownscopedClient=mn.BaseExternalAccountClient=mn.ExternalAccountClient=mn.IdentityPoolClient=mn.AwsClient=mn.UserRefreshClient=mn.LoginTicket=mn.OAuth2Client=mn.CodeChallengeMethod=mn.Impersonated=mn.JWT=mn.JWTAccess=mn.IdTokenClient=mn.IAMAuth=mn.GCPEnv=mn.Compute=mn.AuthClient=void 0;var YCt=zCt();Object.defineProperty(mn,"GoogleAuth",{enumerable:true,get:function(){return YCt.GoogleAuth}});var gAn=wO();Object.defineProperty(mn,"AuthClient",{enumerable:true,get:function(){return gAn.AuthClient}});var yAn=Cwe();Object.defineProperty(mn,"Compute",{enumerable:true,get:function(){return yAn.Compute}});var _An=xwe();Object.defineProperty(mn,"GCPEnv",{enumerable:true,get:function(){return _An.GCPEnv}});var vAn=KCt();Object.defineProperty(mn,"IAMAuth",{enumerable:true,get:function(){return vAn.IAMAuth}});var EAn=Twe();Object.defineProperty(mn,"IdTokenClient",{enumerable:true,get:function(){return EAn.IdTokenClient}});var bAn=DTe();Object.defineProperty(mn,"JWTAccess",{enumerable:true,get:function(){return bAn.JWTAccess}});var SAn=FTe();Object.defineProperty(mn,"JWT",{enumerable:true,get:function(){return SAn.JWT}});var AAn=UTe();Object.defineProperty(mn,"Impersonated",{enumerable:true,get:function(){return AAn.Impersonated}});var XCt=jA();Object.defineProperty(mn,"CodeChallengeMethod",{enumerable:true,get:function(){return XCt.CodeChallengeMethod}});Object.defineProperty(mn,"OAuth2Client",{enumerable:true,get:function(){return XCt.OAuth2Client}});var CAn=bwe();Object.defineProperty(mn,"LoginTicket",{enumerable:true,get:function(){return CAn.LoginTicket}});var wAn=MTe();Object.defineProperty(mn,"UserRefreshClient",{enumerable:true,get:function(){return wAn.UserRefreshClient}});var TAn=txe();Object.defineProperty(mn,"AwsClient",{enumerable:true,get:function(){return TAn.AwsClient}});var xAn=ZTe();Object.defineProperty(mn,"IdentityPoolClient",{enumerable:true,get:function(){return xAn.IdentityPoolClient}});var RAn=dxe();Object.defineProperty(mn,"ExternalAccountClient",{enumerable:true,get:function(){return RAn.ExternalAccountClient}});var OAn=BE();Object.defineProperty(mn,"BaseExternalAccountClient",{enumerable:true,get:function(){return OAn.BaseExternalAccountClient}});var PAn=WCt();Object.defineProperty(mn,"DownscopedClient",{enumerable:true,get:function(){return PAn.DownscopedClient}});var NAn=iJ();Object.defineProperty(mn,"PluggableAuthClient",{enumerable:true,get:function(){return NAn.PluggableAuthClient}});var IAn=eF();Object.defineProperty(mn,"DefaultTransporter",{enumerable:true,get:function(){return IAn.DefaultTransporter}});var kAn=new YCt.GoogleAuth;mn.auth=kAn});var XO=y(YO=>{"use strict";var DAn=YO&&YO.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(YO,"__esModule",{value:true});YO.getServiceAccountIdToken=void 0;var LAn=vxe();var FAn=DAn(Fm());var BAn=new LAn.GoogleAuth;var JCt=new FAn.default({max:50,maxAge:1e3*60*50});async function MAn(e){let t=JCt.get(e);if(!t){const r=await BAn.getIdTokenClient(e);t=await r.idTokenProvider.fetchIdToken(e);JCt.set(e,t)}return t}a(MAn,"getServiceAccountIdToken");YO.getServiceAccountIdToken=MAn});var rwt=y(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:true});kf.mergeHeaders=kf.createFinalURL=kf.defaultBodySerializer=kf.defaultQuerySerializer=kf.createClient=void 0;var JO=Hc();var qAn=XO();var UAn=/\/*$/;async function $An(e){const{baseUrl:t,fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:i,zuploExtensions:s,...o}=e;const u=s?.fastifyRequest.log;const l=s?.fastifyRequest.id;const c=s?.options?.userSub??s?.fastifyRequest.getUserSub();const d=new Headers({"zuplo-user":c,"zp-rid":l,...o.headers??{}});const p=await(0,qAn.getServiceAccountIdToken)(t);d.set("Authorization",`Bearer ${p}`);async function f(m,h){const{headers:g,body:_,params:v={},parseAs:S="json",querySerializer:E=n??QCt,bodySerializer:b=i??ZCt,...A}=h||{};const C=ewt(m,{baseUrl:t,params:v,querySerializer:E});if(A.method){if(["GET","DELETE","HEAD","OPTIONS","TRACE"].includes(A.method.toUpperCase()??"")){d.delete("Content-Type")}else{d.set("Content-Type","application/json")}}else{d.delete("Content-Type")}const T=twt(d,g,v.header);const O={redirect:"follow",...o,...A,headers:T};if(_)O.body=b(_);if(O.body instanceof FormData)T.delete("Content-Type");const P=await r(C,O);if(P.status===404){const R=await P.json();if(R&&R.hasOwnProperty("type")&&R.hasOwnProperty("title")&&R.hasOwnProperty("status")){throw new JO.ApiError(R)}throw new JO.ApiError(JO.Problems.NOT_FOUND)}if(P.status===204||P.headers.get("Content-Length")==="0"){return P.ok?{data:{},response:P}:{error:{},response:P}}if(P.ok){let R=P.body;if(S!=="stream"){const I=P.clone();R=typeof I[S]==="function"?await I[S]():await I.text()}return{data:R,response:P}}else{u.debug(`Error on internal api: path: ${C}, status: ${P.status}, headers: ${JSON.stringify(P.headers)}, body: ${await P.clone().text()}`);let R={};try{R=await P.clone().json();if(R.type&&R.status&&R.title){throw new JO.ApiError(R)}}catch(I){}throw new JO.ApiError(JO.Problems.INTERNAL_SERVER_ERROR)}}a(f,"coreFetch");return{async GET(m,h){return f(m,{...h,method:"GET"})},async PUT(m,h){return f(m,{...h,method:"PUT"})},async POST(m,h){return f(m,{...h,method:"POST"})},async DELETE(m,h){return f(m,{...h,method:"DELETE"})},async OPTIONS(m,h){return f(m,{...h,method:"OPTIONS"})},async HEAD(m,h){return f(m,{...h,method:"HEAD"})},async PATCH(m,h){return f(m,{...h,method:"PATCH"})},async TRACE(m,h){return f(m,{...h,method:"TRACE"})}}}a($An,"createClient");kf.createClient=$An;function QCt(e){const t=new URLSearchParams;if(e&&typeof e==="object"){for(const[r,n]of Object.entries(e)){if(n===void 0||n===null)continue;t.set(r,n)}}return t.toString()}a(QCt,"defaultQuerySerializer");kf.defaultQuerySerializer=QCt;function ZCt(e){return JSON.stringify(e)}a(ZCt,"defaultBodySerializer");kf.defaultBodySerializer=ZCt;function ewt(e,t){let r=`${t.baseUrl?t.baseUrl.replace(UAn,""):""}${e}`;if(t.params.path){for(const[n,i]of Object.entries(t.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(i)))}if(t.params.query){const n=t.querySerializer(t.params.query);if(n)r+=`?${n}`}return r}a(ewt,"createFinalURL");kf.createFinalURL=ewt;function twt(...e){const t=new Headers;for(const r of e){if(!r||typeof r!=="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n){if(s!==void 0&&s!==null){t.set(i,s)}}}return t}a(twt,"mergeHeaders");kf.mergeHeaders=twt});var nwt=y(ME=>{"use strict";var jAn=ME&&ME.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ME,"__esModule",{value:true});ME.ApiKeyService=ME.createApiKeyServiceClient=void 0;var QO=Hc();var GAn=vxe();var cJ=jAn(Jd());var HAn=rwt();async function VAn(e){return(0,HAn.createClient)({baseUrl:cJ.default.API_KEY_MANAGEMENT_SERVICE_URL,zuploExtensions:{fastifyRequest:e}})}a(VAn,"createApiKeyServiceClient");ME.createApiKeyServiceClient=VAn;var Exe=class{static{a(this,"ApiKeyService")}logger;requestId;constructor(t){this.logger=t.log;this.requestId=t.id}async fetchGCP(t,r={}){this.logger.info(`Fetching with GCP JWT ${r.method} ${t} from Api Key Service API.`);const n=new GAn.GoogleAuth;const i=await n.getIdTokenClient(cJ.default.API_KEY_MANAGEMENT_SERVICE_URL);this.logger.info(`Payload to send: ${JSON.stringify({url:`${cJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:"GET",body:r.body,headers:{...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}}})}`);const s=await i.getRequestHeaders();const o=await i.request({url:`${cJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:r.method||"GET",body:r.body,headers:{...s,...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}},validateStatus:u=>u>=200&&u<500});if(o.status===404){const u=await o.data;if(u&&u.hasOwnProperty("type")&&u.hasOwnProperty("title")&&u.hasOwnProperty("status")){throw new QO.ApiError(u)}throw new QO.ApiError(QO.Problems.NOT_FOUND)}if(o.status>=300){this.logger.debug(`Error on api-key-service: path: ${t}, status: ${o.status}, headers: ${JSON.stringify(o.headers)}, body: ${JSON.stringify(o.data)}`);const u=o.data;if(u.type&&u.status&&u.title){throw new QO.ApiError(u)}this.logger.error(`Error not handled on api-key-service: path: ${t}, status: ${o.status}`);throw new QO.ApiError(QO.Problems.INTERNAL_SERVER_ERROR)}if(o.status===204){return{}}return o.data}};ME.ApiKeyService=Exe});var swt=y(ZO=>{"use strict";var zAn=ZO&&ZO.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ZO,"__esModule",{value:true});ZO.AuthApiService=void 0;var ZA=Hc();var iwt=zAn(Jd());var KAn=XO();var bxe=class{static{a(this,"AuthApiService")}logger;requestId;baseUrl;constructor(t){this.logger=t.log;this.requestId=t.id;if(!iwt.default.AUTH_API_URL){throw new Error("AUTH_API_URL is not set")}this.baseUrl=iwt.default.AUTH_API_URL}async getClientJWT(t,r){let n;try{n=await this.fetch(`/v1/clients/${t}`,{method:"GET"})}catch(s){if(s.status===ZA.Problems.NOT_FOUND.status){n=await this.fetch(`/v1/clients`,{method:"POST",body:JSON.stringify({client_id:t})})}else{throw s}}const i=await this.fetch(`/v1/oauth/token`,{method:"POST",body:JSON.stringify({client_id:t,client_secret:n.client_secret,grant_type:"client_credentials",custom_claims:r})});return i.access_token}async fetch(t,r){this.logger.info(`Fetching internally ${t} from Auth API V2.`);const n=new Headers({"content-type":"application/json","zp-rid":this.requestId,authorization:""});if(process.env.K_SERVICE){const s=await(0,KAn.getServiceAccountIdToken)(this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===ZA.HttpStatusCode.NOT_FOUND){throw new ZA.ApiError(ZA.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on auth-api: path: ${t}, status: ${i.status}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new ZA.ApiError(s)}this.logger.error(`Error not handled on auth-api: path: ${t}, status: ${i.status}`);throw new ZA.ApiError(ZA.Problems.INTERNAL_SERVER_ERROR)}return i.clone().json()}};ZO.AuthApiService=bxe});var SF=y(dJ=>{"use strict";Object.defineProperty(dJ,"__esModule",{value:true});dJ.ApiServiceClient=void 0;var eP=Hc();var WAn=XO();var Sxe=class{static{a(this,"ApiServiceClient")}userSub;logger;requestId;baseUrl;cache;targetAudience;constructor(t,r,n){this.userSub=n.userSub;this.logger=n.logger;this.requestId=n.requestId;this.baseUrl=t;this.cache=r;this.targetAudience=n.targetAudience}async cachedFetch(t,r,n){if(!this.userSub||!n){throw new Error("userSub and cacheKey parameters are required to use cachedFetch")}const i=`${this.userSub}@${n}`;if(this.cache.has(i)){return this.cache.get(i)}const s=await this.fetchInternally(t,r);this.cache.set(i,s);return s}async fetchInternally(t,r){this.logger.info(`Fetching internally ${r.method} ${this.baseUrl}${t}`);const n=new Headers({...r.headers,"zuplo-user":this.userSub,"content-type":"application/json","zp-rid":this.requestId});if(process.env.K_SERVICE){const s=await(0,WAn.getServiceAccountIdToken)(this.targetAudience??this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===404){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.json();if(s&&s.hasOwnProperty("type")&&s.hasOwnProperty("title")&&s.hasOwnProperty("status")){throw new eP.ApiError(s)}throw new eP.ApiError(eP.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new eP.ApiError(s)}this.logger.error(`Error not handled on internal api: path: ${t}, status: ${i.status}`);throw new eP.ApiError(eP.Problems.INTERNAL_SERVER_ERROR)}if(i.status===204){return{}}return i.clone().json()}};dJ.ApiServiceClient=Sxe});var lwt=y(rg=>{"use strict";var owt=rg&&rg.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(rg,"__esModule",{value:true});rg.ContentApiService=rg.getContentApiStorageTarballPath=rg.contentApiTarballFileName=void 0;var YAn=owt(Fm());var awt=owt(Jd());var XAn=SF();var JAn=new YAn.default({max:500,maxAge:1e3*60*50});function uwt(e,t){return`${e}--${t}.tar.gz`}a(uwt,"contentApiTarballFileName");rg.contentApiTarballFileName=uwt;function QAn(e,t){const r=uwt(e,t);return`${e}/builds/${r}`}a(QAn,"getContentApiStorageTarballPath");rg.getContentApiStorageTarballPath=QAn;var Axe=class extends XAn.ApiServiceClient{static{a(this,"ContentApiService")}constructor(t){if(!awt.default.CONTENT_API_URL){throw new Error("CONTENT_API_URL is not set")}super(awt.default.CONTENT_API_URL,JAn,t)}};rg.ContentApiService=Axe});var pwt=y(tP=>{"use strict";var dwt=tP&&tP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(tP,"__esModule",{value:true});tP.DevApiService=void 0;var ZAn=dwt(Fm());var cwt=dwt(Jd());var eCn=SF();var tCn=new ZAn.default({max:500,maxAge:1e3*60*50});var Cxe=class extends eCn.ApiServiceClient{static{a(this,"DevApiService")}constructor(t,r){if(!cwt.default.DEV_API_URL){throw new Error("DEV_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(cwt.default.DEV_API_URL,tCn,{userSub:n,logger:t.log,requestId:t.id})}};tP.DevApiService=Cxe});var hwt=y((jDs,mwt)=>{var fwt=require("stream").Stream;var rCn=require("util");mwt.exports=fh;function fh(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}a(fh,"DelayedStream");rCn.inherits(fh,fwt);fh.create=function(e,t){var r=new this;t=t||{};for(var n in t){r[n]=t[n]}r.source=e;var i=e.emit;e.emit=function(){r._handleEmit(arguments);return i.apply(e,arguments)};e.on("error",function(){});if(r.pauseStream){e.pause()}return r};Object.defineProperty(fh.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});fh.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fh.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};fh.prototype.pause=function(){this.source.pause()};fh.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this));this._bufferedEvents=[]};fh.prototype.pipe=function(){var e=fwt.prototype.pipe.apply(this,arguments);this.resume();return e};fh.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}if(e[0]==="data"){this.dataSize+=e[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(e)};fh.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}});var vwt=y((HDs,_wt)=>{var nCn=require("util");var ywt=require("stream").Stream;var gwt=hwt();_wt.exports=ao;function ao(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}a(ao,"CombinedStream");nCn.inherits(ao,ywt);ao.create=function(e){var t=new this;e=e||{};for(var r in e){t[r]=e[r]}return t};ao.isStreamLike=function(e){return typeof e!=="function"&&typeof e!=="string"&&typeof e!=="boolean"&&typeof e!=="number"&&!Buffer.isBuffer(e)};ao.prototype.append=function(e){var t=ao.isStreamLike(e);if(t){if(!(e instanceof gwt)){var r=gwt.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this));e=r}this._handleErrors(e);if(this.pauseStreams){e.pause()}}this._streams.push(e);return this};ao.prototype.pipe=function(e,t){ywt.prototype.pipe.call(this,e,t);this.resume();return e};ao.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};ao.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e=="undefined"){this.end();return}if(typeof e!=="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ao.isStreamLike(r);if(n){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};ao.prototype._pipeNext=function(e){this._currentStream=e;var t=ao.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this));e.pipe(this,{end:false});return}var r=e;this.write(r);this._getNext()};ao.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ao.prototype.write=function(e){this.emit("data",e)};ao.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};ao.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};ao.prototype.end=function(){this._reset();this.emit("end")};ao.prototype.destroy=function(){this._reset();this.emit("close")};ao.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};ao.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))};ao.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){if(!t.dataSize){return}e.dataSize+=t.dataSize});if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};ao.prototype._emitError=function(e){this._reset();this.emit("error",e)}});var bwt=y((zDs,Ewt)=>{Ewt.exports=iCn;function iCn(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t){t(e)}else{setTimeout(e,0)}}a(iCn,"defer")});var wxe=y((WDs,Awt)=>{var Swt=bwt();Awt.exports=sCn;function sCn(e){var t=false;Swt(function(){t=true});return a(function r(n,i){if(t){e(n,i)}else{Swt(a(function s(){e(n,i)},"nextTick_callback"))}},"async_callback")}a(sCn,"async")});var Txe=y((XDs,Cwt)=>{Cwt.exports=aCn;function aCn(e){Object.keys(e.jobs).forEach(oCn.bind(e));e.jobs={}}a(aCn,"abort");function oCn(e){if(typeof this.jobs[e]=="function"){this.jobs[e]()}}a(oCn,"clean")});var xxe=y((QDs,Twt)=>{var wwt=wxe();var uCn=Txe();Twt.exports=lCn;function lCn(e,t,r,n){var i=r["keyedList"]?r["keyedList"][r.index]:r.index;r.jobs[i]=cCn(t,i,e[i],function(s,o){if(!(i in r.jobs)){return}delete r.jobs[i];if(s){uCn(r)}else{r.results[i]=o}n(s,r.results)})}a(lCn,"iterate");function cCn(e,t,r,n){var i;if(e.length==2){i=e(r,wwt(n))}else{i=e(r,t,wwt(n))}return i}a(cCn,"runJob")});var Rxe=y((e6s,xwt)=>{xwt.exports=dCn;function dCn(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};if(t){n.keyedList.sort(r?t:function(i,s){return t(e[i],e[s])})}return n}a(dCn,"state")});var Oxe=y((r6s,Rwt)=>{var pCn=Txe();var fCn=wxe();Rwt.exports=mCn;function mCn(e){if(!Object.keys(this.jobs).length){return}this.index=this.size;pCn(this);fCn(e)(null,this.results)}a(mCn,"terminator")});var Pwt=y((i6s,Owt)=>{var hCn=xxe();var gCn=Rxe();var yCn=Oxe();Owt.exports=_Cn;function _Cn(e,t,r){var n=gCn(e);while(n.index<(n["keyedList"]||e).length){hCn(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}});n.index++}return yCn.bind(n,r)}a(_Cn,"parallel")});var Pxe=y((a6s,pJ)=>{var Nwt=xxe();var vCn=Rxe();var ECn=Oxe();pJ.exports=bCn;pJ.exports.ascending=Iwt;pJ.exports.descending=SCn;function bCn(e,t,r,n){var i=vCn(e,r);Nwt(e,t,i,a(function s(o,u){if(o){n(o,u);return}i.index++;if(i.index<(i["keyedList"]||e).length){Nwt(e,t,i,s);return}n(null,i.results)},"iteratorHandler"));return ECn.bind(i,n)}a(bCn,"serialOrdered");function Iwt(e,t){return e<t?-1:e>t?1:0}a(Iwt,"ascending");function SCn(e,t){return-1*Iwt(e,t)}a(SCn,"descending")});var Dwt=y((u6s,kwt)=>{var ACn=Pxe();kwt.exports=CCn;function CCn(e,t,r){return ACn(e,t,null,r)}a(CCn,"serial")});var Fwt=y((c6s,Lwt)=>{Lwt.exports={parallel:Pwt(),serial:Dwt(),serialOrdered:Pxe()}});var Mwt=y((d6s,Bwt)=>{Bwt.exports=function(e,t){Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]});return e}});var $wt=y((p6s,Uwt)=>{var Dxe=vwt();var qwt=require("util");var Nxe=require("path");var wCn=require("http");var TCn=require("https");var xCn=require("url").parse;var RCn=require("fs");var OCn=require("stream").Stream;var Ixe=fSe();var PCn=Fwt();var kxe=Mwt();Uwt.exports=es;qwt.inherits(es,Dxe);function es(e){if(!(this instanceof es)){return new es(e)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];Dxe.call(this);e=e||{};for(var t in e){this[t]=e[t]}}a(es,"FormData");es.LINE_BREAK="\r\n";es.DEFAULT_CONTENT_TYPE="application/octet-stream";es.prototype.append=function(e,t,r){r=r||{};if(typeof r=="string"){r={filename:r}}var n=Dxe.prototype.append.bind(this);if(typeof t=="number"){t=""+t}if(qwt.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r);var s=this._multiPartFooter();n(i);n(t);n(s);this._trackLength(i,t,r)};es.prototype._trackLength=function(e,t,r){var n=0;if(r.knownLength!=null){n+=+r.knownLength}else if(Buffer.isBuffer(t)){n=t.length}else if(typeof t==="string"){n=Buffer.byteLength(t)}this._valueLength+=n;this._overheadLength+=Buffer.byteLength(e)+es.LINE_BREAK.length;if(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof OCn)){return}if(!r.knownLength){this._valuesToMeasure.push(t)}};es.prototype._lengthRetriever=function(e,t){if(e.hasOwnProperty("fd")){if(e.end!=void 0&&e.end!=Infinity&&e.start!=void 0){t(null,e.end+1-(e.start?e.start:0))}else{RCn.stat(e.path,function(r,n){var i;if(r){t(r);return}i=n.size-(e.start?e.start:0);t(null,i)})}}else if(e.hasOwnProperty("httpVersion")){t(null,+e.headers["content-length"])}else if(e.hasOwnProperty("httpModule")){e.on("response",function(r){e.pause();t(null,+r.headers["content-length"])});e.resume()}else{t("Unknown stream")}};es.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string"){return r.header}var n=this._getContentDisposition(t,r);var i=this._getContentType(t,r);var s="";var o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};if(typeof r.header=="object"){kxe(o,r.header)}var u;for(var l in o){if(!o.hasOwnProperty(l))continue;u=o[l];if(u==null){continue}if(!Array.isArray(u)){u=[u]}if(u.length){s+=l+": "+u.join("; ")+es.LINE_BREAK}}return"--"+this.getBoundary()+es.LINE_BREAK+s+es.LINE_BREAK};es.prototype._getContentDisposition=function(e,t){var r,n;if(typeof t.filepath==="string"){r=Nxe.normalize(t.filepath).replace(/\\/g,"/")}else if(t.filename||e.name||e.path){r=Nxe.basename(t.filename||e.name||e.path)}else if(e.readable&&e.hasOwnProperty("httpVersion")){r=Nxe.basename(e.client._httpMessage.path||"")}if(r){n='filename="'+r+'"'}return n};es.prototype._getContentType=function(e,t){var r=t.contentType;if(!r&&e.name){r=Ixe.lookup(e.name)}if(!r&&e.path){r=Ixe.lookup(e.path)}if(!r&&e.readable&&e.hasOwnProperty("httpVersion")){r=e.headers["content-type"]}if(!r&&(t.filepath||t.filename)){r=Ixe.lookup(t.filepath||t.filename)}if(!r&&typeof e=="object"){r=es.DEFAULT_CONTENT_TYPE}return r};es.prototype._multiPartFooter=function(){return function(e){var t=es.LINE_BREAK;var r=this._streams.length===0;if(r){t+=this._lastBoundary()}e(t)}.bind(this)};es.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+es.LINE_BREAK};es.prototype.getHeaders=function(e){var t;var r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e){if(e.hasOwnProperty(t)){r[t.toLowerCase()]=e[t]}}return r};es.prototype.setBoundary=function(e){this._boundary=e};es.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};es.prototype.getBuffer=function(){var e=new Buffer.alloc(0);var t=this.getBoundary();for(var r=0,n=this._streams.length;r<n;r++){if(typeof this._streams[r]!=="function"){if(Buffer.isBuffer(this._streams[r])){e=Buffer.concat([e,this._streams[r]])}else{e=Buffer.concat([e,Buffer.from(this._streams[r])])}if(typeof this._streams[r]!=="string"||this._streams[r].substring(2,t.length+2)!==t){e=Buffer.concat([e,Buffer.from(es.LINE_BREAK)])}}}return Buffer.concat([e,Buffer.from(this._lastBoundary())])};es.prototype._generateBoundary=function(){var e="--------------------------";for(var t=0;t<24;t++){e+=Math.floor(Math.random()*10).toString(16)}this._boundary=e};es.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;if(this._streams.length){e+=this._lastBoundary().length}if(!this.hasKnownLength()){this._error(new Error("Cannot calculate proper length in synchronous way."))}return e};es.prototype.hasKnownLength=function(){var e=true;if(this._valuesToMeasure.length){e=false}return e};es.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length){t+=this._lastBoundary().length}if(!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}PCn.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i});e(null,t)})};es.prototype.submit=function(e,t){var r,n,i={method:"post"};if(typeof e=="string"){e=xCn(e);n=kxe({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)}else{n=kxe(e,i);if(!n.port){n.port=n.protocol=="https:"?443:80}}n.headers=this.getHeaders(e.headers);if(n.protocol=="https:"){r=TCn.request(n)}else{r=wCn.request(n)}this.getLength(function(s,o){if(s&&s!=="Unknown stream"){this._error(s);return}if(o){r.setHeader("Content-Length",o)}this.pipe(r);if(t){var u;var l=a(function(c,d){r.removeListener("error",l);r.removeListener("response",u);return t.call(this,c,d)},"callback");u=l.bind(this,null);r.on("error",l);r.on("response",u)}}.bind(this));return r};es.prototype._error=function(e){if(!this.error){this.error=e;this.pause();this.emit("error",e)}};es.prototype.toString=function(){return"[object FormData]"}});var Gwt=y(jwt=>{"use strict";var NCn=require("url").parse;var ICn={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var kCn=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function DCn(e){var t=typeof e==="string"?NCn(e):e||{};var r=t.protocol;var n=t.host;var i=t.port;if(typeof n!=="string"||!n||typeof r!=="string"){return""}r=r.split(":",1)[0];n=n.replace(/:\d*$/,"");i=parseInt(i)||ICn[r]||0;if(!LCn(n,i)){return""}var s=rP("npm_config_"+r+"_proxy")||rP(r+"_proxy")||rP("npm_config_proxy")||rP("all_proxy");if(s&&s.indexOf("://")===-1){s=r+"://"+s}return s}a(DCn,"getProxyForUrl");function LCn(e,t){var r=(rP("npm_config_no_proxy")||rP("no_proxy")).toLowerCase();if(!r){return true}if(r==="*"){return false}return r.split(/[,\s]/).every(function(n){if(!n){return true}var i=n.match(/^(.+):(\d+)$/);var s=i?i[1]:n;var o=i?parseInt(i[2]):0;if(o&&o!==t){return true}if(!/^[.*]/.test(s)){return e!==s}if(s.charAt(0)==="*"){s=s.slice(1)}return!kCn.call(e,s)})}a(LCn,"shouldProxy");function rP(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}a(rP,"getEnv");jwt.getProxyForUrl=DCn});var Vwt=y((g6s,Hwt)=>{var AF;Hwt.exports=function(){if(!AF){try{AF=Zd()("follow-redirects")}catch(e){}if(typeof AF!=="function"){AF=a(function(){},"debug")}}AF.apply(null,arguments)}});var Xwt=y((_6s,zxe)=>{var TF=require("url");var CF=TF.URL;var FCn=require("http");var BCn=require("https");var qxe=require("stream").Writable;var Uxe=require("assert");var zwt=Vwt();var $xe=false;try{Uxe(new CF)}catch(e){$xe=e.code==="ERR_INVALID_URL"}var MCn=["auth","host","hostname","href","path","pathname","port","protocol","query","search"];var jxe=["abort","aborted","connect","error","socket","timeout"];var Gxe=Object.create(null);jxe.forEach(function(e){Gxe[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Fxe=xF("ERR_INVALID_URL","Invalid URL",TypeError);var Bxe=xF("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var qCn=xF("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Bxe);var UCn=xF("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var $Cn=xF("ERR_STREAM_WRITE_AFTER_END","write after end");var jCn=qxe.prototype.destroy||Wwt;function hd(e,t){qxe.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof Bxe?i:new Bxe({cause:i}))}};this._performRequest()}a(hd,"RedirectableRequest");hd.prototype=Object.create(qxe.prototype);hd.prototype.abort=function(){Vxe(this._currentRequest);this._currentRequest.abort();this.emit("abort")};hd.prototype.destroy=function(e){Vxe(this._currentRequest,e);jCn.call(this,e);return this};hd.prototype.write=function(e,t,r){if(this._ending){throw new $Cn}if(!eC(e)&&!VCn(e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(wF(t)){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new UCn);this.abort()}};hd.prototype.end=function(e,t,r){if(wF(e)){r=e;e=t=null}else if(wF(t)){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var i=this._currentRequest;this.write(e,t,function(){n._ended=true;i.end(null,null,r)});this._ending=true}};hd.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};hd.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};hd.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e);o.removeListener("timeout",o.destroy);o.addListener("timeout",o.destroy)}a(n,"destroyOnTimeout");function i(o){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout(function(){r.emit("timeout");s()},e);n(o)}a(i,"startTimer");function s(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",s);r.removeListener("error",s);r.removeListener("response",s);r.removeListener("close",s);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",i)}}a(s,"clearTimer");if(t){this.on("timeout",t)}if(this.socket){i(this.socket)}else{this._currentRequest.once("socket",i)}this.on("socket",n);this.on("abort",s);this.on("error",s);this.on("response",s);this.on("close",s);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){hd.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(hd.prototype,e,{get:function(){return this._currentRequest[e]}})});hd.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};hd.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){throw new TypeError("Unsupported protocol "+e)}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of jxe){n.on(i,Gxe[i])}this._currentUrl=/^\//.test(this._options.path)?TF.format(this._options):this._options.path;if(this._isRedirect){var s=0;var o=this;var u=this._requestBodyBuffers;a(function l(c){if(n===o._currentRequest){if(c){o.emit("error",c)}else if(s<u.length){var d=u[s++];if(!n.finished){n.write(d.data,d.encoding,l)}}else if(o._ended){n.end()}}},"writeNext")()}};hd.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}Vxe(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){throw new qCn}var n;var i=this._options.beforeRedirect;if(i){n=Object.assign({Host:e.req.getHeader("host")},this._options.headers)}var s=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];Lxe(/^content-/i,this._options.headers)}var o=Lxe(/^host$/i,this._options.headers);var u=Hxe(this._currentUrl);var l=o||u.host;var c=/^\w+:/.test(r)?this._currentUrl:TF.format(Object.assign(u,{host:l}));var d=GCn(r,c);zwt("redirecting to",d.href);this._isRedirect=true;Mxe(d,this._options);if(d.protocol!==u.protocol&&d.protocol!=="https:"||d.host!==l&&!HCn(d.host,l)){Lxe(/^(?:authorization|cookie)$/i,this._options.headers)}if(wF(i)){var p={headers:e.headers,statusCode:t};var f={url:c,method:s,headers:n};i(this._options,p,f);this._sanitizeOptions(this._options)}this._performRequest()};function Kwt(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach(function(n){var i=n+":";var s=r[i]=e[n];var o=t[n]=Object.create(s);function u(c,d,p){if(zCn(c)){c=Mxe(c)}else if(eC(c)){c=Mxe(Hxe(c))}else{p=d;d=Ywt(c);c={protocol:i}}if(wF(d)){p=d;d=null}d=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,d);d.nativeProtocols=r;if(!eC(d.host)&&!eC(d.hostname)){d.hostname="::1"}Uxe.equal(d.protocol,i,"protocol mismatch");zwt("options",d);return new hd(d,p)}a(u,"request");function l(c,d,p){var f=o.request(c,d,p);f.end();return f}a(l,"get");Object.defineProperties(o,{request:{value:u,configurable:true,enumerable:true,writable:true},get:{value:l,configurable:true,enumerable:true,writable:true}})});return t}a(Kwt,"wrap");function Wwt(){}a(Wwt,"noop");function Hxe(e){var t;if($xe){t=new CF(e)}else{t=Ywt(TF.parse(e));if(!eC(t.protocol)){throw new Fxe({input:e})}}return t}a(Hxe,"parseUrl");function GCn(e,t){return $xe?new CF(e,t):Hxe(TF.resolve(t,e))}a(GCn,"resolveUrl");function Ywt(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname)){throw new Fxe({input:e.href||e})}if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host)){throw new Fxe({input:e.href||e})}return e}a(Ywt,"validateUrl");function Mxe(e,t){var r=t||{};for(var n of MCn){r[n]=e[n]}if(r.hostname.startsWith("[")){r.hostname=r.hostname.slice(1,-1)}if(r.port!==""){r.port=Number(r.port)}r.path=r.search?r.pathname+r.search:r.pathname;return r}a(Mxe,"spreadUrlObject");function Lxe(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?void 0:String(r).trim()}a(Lxe,"removeMatchingHeaders");function xF(e,t,r){function n(i){Error.captureStackTrace(this,this.constructor);Object.assign(this,i||{});this.code=e;this.message=this.cause?t+": "+this.cause.message:t}a(n,"CustomError");n.prototype=new(r||Error);Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:false},name:{value:"Error ["+e+"]",enumerable:false}});return n}a(xF,"createErrorType");function Vxe(e,t){for(var r of jxe){e.removeListener(r,Gxe[r])}e.on("error",Wwt);e.destroy(t)}a(Vxe,"destroyRequest");function HCn(e,t){Uxe(eC(e)&&eC(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}a(HCn,"isSubdomain");function eC(e){return typeof e==="string"||e instanceof String}a(eC,"isString");function wF(e){return typeof e==="function"}a(wF,"isFunction");function VCn(e){return typeof e==="object"&&"length"in e}a(VCn,"isBuffer");function zCn(e){return CF&&e instanceof CF}a(zCn,"isURL");zxe.exports=Kwt({http:FCn,https:BCn});zxe.exports.wrap=Kwt});var SJ=y((E6s,qTt)=>{"use strict";var KCn=$wt();var WCn=require("url");var YCn=Gwt();var XCn=require("http");var JCn=require("https");var mTt=require("util");var QCn=Xwt();var ZCn=require("zlib");var hTt=require("stream");var ewn=require("events");function Ty(e){return e&&typeof e==="object"&&"default"in e?e:{"default":e}}a(Ty,"_interopDefaultLegacy");var gTt=Ty(KCn);var twn=Ty(WCn);var rwn=Ty(XCn);var nwn=Ty(JCn);var iwn=Ty(mTt);var swn=Ty(QCn);var jE=Ty(ZCn);var UE=Ty(hTt);var awn=Ty(ewn);function yTt(e,t){return a(function r(){return e.apply(t,arguments)},"wrap")}a(yTt,"bind");var{toString:own}=Object.prototype;var{getPrototypeOf:oRe}=Object;var _J=(e=>t=>{const r=own.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));var ng=a(e=>{e=e.toLowerCase();return t=>_J(t)===e},"kindOfTest");var vJ=a(e=>t=>typeof t===e,"typeOfTest");var{isArray:aP}=Array;var PF=vJ("undefined");function uwn(e){return e!==null&&!PF(e)&&e.constructor!==null&&!PF(e.constructor)&&Lf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}a(uwn,"isBuffer");var _Tt=ng("ArrayBuffer");function lwn(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&_Tt(e.buffer)}return t}a(lwn,"isArrayBufferView");var cwn=vJ("string");var Lf=vJ("function");var vTt=vJ("number");var EJ=a(e=>e!==null&&typeof e==="object","isObject");var dwn=a(e=>e===true||e===false,"isBoolean");var mJ=a(e=>{if(_J(e)!=="object"){return false}const t=oRe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},"isPlainObject");var pwn=ng("Date");var fwn=ng("File");var mwn=ng("Blob");var hwn=ng("FileList");var gwn=a(e=>EJ(e)&&Lf(e.pipe),"isStream");var ywn=a(e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||Lf(e.append)&&((t=_J(e))==="formdata"||t==="object"&&Lf(e.toString)&&e.toString()==="[object FormData]"))},"isFormData");var _wn=ng("URLSearchParams");var vwn=a(e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function IF(e,t,{allOwnKeys:r=false}={}){if(e===null||typeof e==="undefined"){return}let n;let i;if(typeof e!=="object"){e=[e]}if(aP(e)){for(n=0,i=e.length;n<i;n++){t.call(null,e[n],n,e)}}else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e);const o=s.length;let u;for(n=0;n<o;n++){u=s[n];t.call(null,e[u],u,e)}}}a(IF,"forEach");function ETt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length;let i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}a(ETt,"findKey");var bTt=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();var STt=a(e=>!PF(e)&&e!==bTt,"isContextDefined");function Jxe(){const{caseless:e}=STt(this)&&this||{};const t={};const r=a((n,i)=>{const s=e&&ETt(t,i)||i;if(mJ(t[s])&&mJ(n)){t[s]=Jxe(t[s],n)}else if(mJ(n)){t[s]=Jxe({},n)}else if(aP(n)){t[s]=n.slice()}else{t[s]=n}},"assignValue");for(let n=0,i=arguments.length;n<i;n++){arguments[n]&&IF(arguments[n],r)}return t}a(Jxe,"merge");var Ewn=a((e,t,r,{allOwnKeys:n}={})=>{IF(t,(i,s)=>{if(r&&Lf(i)){e[s]=yTt(i,r)}else{e[s]=i}},{allOwnKeys:n});return e},"extend");var bwn=a(e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e},"stripBOM");var Swn=a((e,t,r,n)=>{e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)},"inherits");var Awn=a((e,t,r,n)=>{let i;let s;let o;const u={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);s=i.length;while(s-- >0){o=i[s];if((!n||n(o,e,t))&&!u[o]){t[o]=e[o];u[o]=true}}e=r!==false&&oRe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},"toFlatObject");var Cwn=a((e,t,r)=>{e=String(e);if(r===void 0||r>e.length){r=e.length}r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},"endsWith");var wwn=a(e=>{if(!e)return null;if(aP(e))return e;let t=e.length;if(!vTt(t))return null;const r=new Array(t);while(t-- >0){r[t]=e[t]}return r},"toArray");var Twn=(e=>{return t=>{return e&&t instanceof e}})(typeof Uint8Array!=="undefined"&&oRe(Uint8Array));var xwn=a((e,t)=>{const r=e&&e[Symbol.iterator];const n=r.call(e);let i;while((i=n.next())&&!i.done){const s=i.value;t.call(e,s[0],s[1])}},"forEachEntry");var Rwn=a((e,t)=>{let r;const n=[];while((r=e.exec(t))!==null){n.push(r)}return n},"matchAll");var Own=ng("HTMLFormElement");var Pwn=a(e=>{return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function t(r,n,i){return n.toUpperCase()+i},"replacer"))},"toCamelCase");var Jwt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype);var Nwn=ng("RegExp");var ATt=a((e,t)=>{const r=Object.getOwnPropertyDescriptors(e);const n={};IF(r,(i,s)=>{let o;if((o=t(i,s,e))!==false){n[s]=o||i}});Object.defineProperties(e,n)},"reduceDescriptors");var Iwn=a(e=>{ATt(e,(t,r)=>{if(Lf(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=e[r];if(!Lf(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})},"freezeMethods");var kwn=a((e,t)=>{const r={};const n=a(i=>{i.forEach(s=>{r[s]=true})},"define");aP(e)?n(e):n(String(e).split(t));return r},"toObjectSet");var Dwn=a(()=>{},"noop");var Lwn=a((e,t)=>{e=+e;return Number.isFinite(e)?e:t},"toFiniteNumber");var Kxe="abcdefghijklmnopqrstuvwxyz";var Qwt="0123456789";var CTt={DIGIT:Qwt,ALPHA:Kxe,ALPHA_DIGIT:Kxe+Kxe.toUpperCase()+Qwt};var Fwn=a((e=16,t=CTt.ALPHA_DIGIT)=>{let r="";const{length:n}=t;while(e--){r+=t[Math.random()*n|0]}return r},"generateString");function Bwn(e){return!!(e&&Lf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}a(Bwn,"isSpecCompliantForm");var Mwn=a(e=>{const t=new Array(10);const r=a((n,i)=>{if(EJ(n)){if(t.indexOf(n)>=0){return}if(!("toJSON"in n)){t[i]=n;const s=aP(n)?[]:{};IF(n,(o,u)=>{const l=r(o,i+1);!PF(l)&&(s[u]=l)});t[i]=void 0;return s}}return n},"visit");return r(e,0)},"toJSONObject");var qwn=ng("AsyncFunction");var Uwn=a(e=>e&&(EJ(e)||Lf(e))&&Lf(e.then)&&Lf(e.catch),"isThenable");var Je={isArray:aP,isArrayBuffer:_Tt,isBuffer:uwn,isFormData:ywn,isArrayBufferView:lwn,isString:cwn,isNumber:vTt,isBoolean:dwn,isObject:EJ,isPlainObject:mJ,isUndefined:PF,isDate:pwn,isFile:fwn,isBlob:mwn,isRegExp:Nwn,isFunction:Lf,isStream:gwn,isURLSearchParams:_wn,isTypedArray:Twn,isFileList:hwn,forEach:IF,merge:Jxe,extend:Ewn,trim:vwn,stripBOM:bwn,inherits:Swn,toFlatObject:Awn,kindOf:_J,kindOfTest:ng,endsWith:Cwn,toArray:wwn,forEachEntry:xwn,matchAll:Rwn,isHTMLForm:Own,hasOwnProperty:Jwt,hasOwnProp:Jwt,reduceDescriptors:ATt,freezeMethods:Iwn,toObjectSet:kwn,toCamelCase:Pwn,noop:Dwn,toFiniteNumber:Lwn,findKey:ETt,global:bTt,isContextDefined:STt,ALPHABET:CTt,generateString:Fwn,isSpecCompliantForm:Bwn,toJSONObject:Mwn,isAsyncFn:qwn,isThenable:Uwn};function yr(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}a(yr,"AxiosError");Je.inherits(yr,Error,{toJSON:a(function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Je.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var wTt=yr.prototype;var TTt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{TTt[e]={value:e}});Object.defineProperties(yr,TTt);Object.defineProperty(wTt,"isAxiosError",{value:true});yr.from=(e,t,r,n,i,s)=>{const o=Object.create(wTt);Je.toFlatObject(e,o,a(function u(l){return l!==Error.prototype},"filter"),u=>{return u!=="isAxiosError"});yr.call(o,e.message,t,r,n,i);o.cause=e;o.name=e.name;s&&Object.assign(o,s);return o};function Qxe(e){return Je.isPlainObject(e)||Je.isArray(e)}a(Qxe,"isVisitable");function xTt(e){return Je.endsWith(e,"[]")?e.slice(0,-2):e}a(xTt,"removeBrackets");function Zwt(e,t,r){if(!e)return t;return e.concat(t).map(a(function n(i,s){i=xTt(i);return!r&&s?"["+i+"]":i},"each")).join(r?".":"")}a(Zwt,"renderKey");function $wn(e){return Je.isArray(e)&&!e.some(Qxe)}a($wn,"isFlatArray");var jwn=Je.toFlatObject(Je,{},null,a(function e(t){return/^is[A-Z]/.test(t)},"filter"));function bJ(e,t,r){if(!Je.isObject(e)){throw new TypeError("target must be an object")}t=t||new(gTt["default"]||FormData);r=Je.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,a(function h(g,_){return!Je.isUndefined(_[g])},"defined"));const n=r.metaTokens;const i=r.visitor||d;const s=r.dots;const o=r.indexes;const u=r.Blob||typeof Blob!=="undefined"&&Blob;const l=u&&Je.isSpecCompliantForm(t);if(!Je.isFunction(i)){throw new TypeError("visitor must be a function")}function c(h){if(h===null)return"";if(Je.isDate(h)){return h.toISOString()}if(!l&&Je.isBlob(h)){throw new yr("Blob is not supported. Use a Buffer instead.")}if(Je.isArrayBuffer(h)||Je.isTypedArray(h)){return l&&typeof Blob==="function"?new Blob([h]):Buffer.from(h)}return h}a(c,"convertValue");function d(h,g,_){let v=h;if(h&&!_&&typeof h==="object"){if(Je.endsWith(g,"{}")){g=n?g:g.slice(0,-2);h=JSON.stringify(h)}else if(Je.isArray(h)&&$wn(h)||(Je.isFileList(h)||Je.endsWith(g,"[]"))&&(v=Je.toArray(h))){g=xTt(g);v.forEach(a(function S(E,b){!(Je.isUndefined(E)||E===null)&&t.append(o===true?Zwt([g],b,s):o===null?g:g+"[]",c(E))},"each"));return false}}if(Qxe(h)){return true}t.append(Zwt(_,g,s),c(h));return false}a(d,"defaultVisitor");const p=[];const f=Object.assign(jwn,{defaultVisitor:d,convertValue:c,isVisitable:Qxe});function m(h,g){if(Je.isUndefined(h))return;if(p.indexOf(h)!==-1){throw Error("Circular reference detected in "+g.join("."))}p.push(h);Je.forEach(h,a(function _(v,S){const E=!(Je.isUndefined(v)||v===null)&&i.call(t,v,Je.isString(S)?S.trim():S,g,f);if(E===true){m(v,g?g.concat(S):[S])}},"each"));p.pop()}a(m,"build");if(!Je.isObject(e)){throw new TypeError("data must be an object")}m(e);return t}a(bJ,"toFormData");function eTt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,a(function r(n){return t[n]},"replacer"))}a(eTt,"encode$1");function RTt(e,t){this._pairs=[];e&&bJ(e,this,t)}a(RTt,"AxiosURLSearchParams");var OTt=RTt.prototype;OTt.append=a(function e(t,r){this._pairs.push([t,r])},"append");OTt.toString=a(function e(t){const r=t?function(n){return t.call(this,n,eTt)}:eTt;return this._pairs.map(a(function n(i){return r(i[0])+"="+r(i[1])},"each"),"").join("&")},"toString");function Gwn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}a(Gwn,"encode");function uRe(e,t,r){if(!t){return e}const n=r&&r.encode||Gwn;const i=r&&r.serialize;let s;if(i){s=i(t,r)}else{s=Je.isURLSearchParams(t)?t.toString():new RTt(t,r).toString(n)}if(s){const o=e.indexOf("#");if(o!==-1){e=e.slice(0,o)}e+=(e.indexOf("?")===-1?"?":"&")+s}return e}a(uRe,"buildURL");var Zxe=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){Je.forEach(this.handlers,a(function r(n){if(n!==null){t(n)}},"forEachHandler"))}};var tTt=Zxe;var lRe={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var Hwn=twn["default"].URLSearchParams;var Vwn={isNode:true,classes:{URLSearchParams:Hwn,FormData:gTt["default"],Blob:typeof Blob!=="undefined"&&Blob||null},protocols:["http","https","file","data"]};var PTt=typeof window!=="undefined"&&typeof document!=="undefined";var zwn=(e=>{return PTt&&["ReactNative","NativeScript","NS"].indexOf(e)<0})(typeof navigator!=="undefined"&&navigator.product);var Kwn=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();var Wwn=Object.freeze({__proto__:null,hasBrowserEnv:PTt,hasStandardBrowserWebWorkerEnv:Kwn,hasStandardBrowserEnv:zwn});var Df={...Wwn,...Vwn};function Ywn(e,t){return bJ(e,new Df.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){if(Df.isNode&&Je.isBuffer(r)){this.append(n,r.toString("base64"));return false}return s.defaultVisitor.apply(this,arguments)}},t))}a(Ywn,"toURLEncodedForm");function Xwn(e){return Je.matchAll(/\w+|\[(\w*)]/g,e).map(t=>{return t[0]==="[]"?"":t[1]||t[0]})}a(Xwn,"parsePropPath");function Jwn(e){const t={};const r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++){s=r[n];t[s]=e[s]}return t}a(Jwn,"arrayToObject");function NTt(e){function t(r,n,i,s){let o=r[s++];const u=Number.isFinite(+o);const l=s>=r.length;o=!o&&Je.isArray(i)?i.length:o;if(l){if(Je.hasOwnProp(i,o)){i[o]=[i[o],n]}else{i[o]=n}return!u}if(!i[o]||!Je.isObject(i[o])){i[o]=[]}const c=t(r,n,i[o],s);if(c&&Je.isArray(i[o])){i[o]=Jwn(i[o])}return!u}a(t,"buildPath");if(Je.isFormData(e)&&Je.isFunction(e.entries)){const r={};Je.forEachEntry(e,(n,i)=>{t(Xwn(n),i,r,0)});return r}return null}a(NTt,"formDataToJSON");function Qwn(e,t,r){if(Je.isString(e)){try{(t||JSON.parse)(e);return Je.trim(e)}catch(n){if(n.name!=="SyntaxError"){throw n}}}return(r||JSON.stringify)(e)}a(Qwn,"stringifySafely");var cRe={transitional:lRe,adapter:["xhr","http"],transformRequest:[a(function e(t,r){const n=r.getContentType()||"";const i=n.indexOf("application/json")>-1;const s=Je.isObject(t);if(s&&Je.isHTMLForm(t)){t=new FormData(t)}const o=Je.isFormData(t);if(o){if(!i){return t}return i?JSON.stringify(NTt(t)):t}if(Je.isArrayBuffer(t)||Je.isBuffer(t)||Je.isStream(t)||Je.isFile(t)||Je.isBlob(t)){return t}if(Je.isArrayBufferView(t)){return t.buffer}if(Je.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Ywn(t,this.formSerializer).toString()}if((u=Je.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return bJ(u?{"files[]":t}:t,l&&new l,this.formSerializer)}}if(s||i){r.setContentType("application/json",false);return Qwn(t)}return t},"transformRequest")],transformResponse:[a(function e(t){const r=this.transitional||cRe.transitional;const n=r&&r.forcedJSONParsing;const i=this.responseType==="json";if(t&&Je.isString(t)&&(n&&!this.responseType||i)){const s=r&&r.silentJSONParsing;const o=!s&&i;try{return JSON.parse(t)}catch(u){if(o){if(u.name==="SyntaxError"){throw yr.from(u,yr.ERR_BAD_RESPONSE,this,null,this.response)}throw u}}}return t},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Df.classes.FormData,Blob:Df.classes.Blob},validateStatus:a(function e(t){return t>=200&&t<300},"validateStatus"),headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],e=>{cRe.headers[e]={}});var dRe=cRe;var Zwn=Je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var eTn=a(e=>{const t={};let r;let n;let i;e&&e.split("\n").forEach(a(function s(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&Zwn[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}},"parser"));return t},"parseHeaders");var rTt=Symbol("internals");function RF(e){return e&&String(e).trim().toLowerCase()}a(RF,"normalizeHeader");function hJ(e){if(e===false||e==null){return e}return Je.isArray(e)?e.map(hJ):String(e)}a(hJ,"normalizeValue");function tTn(e){const t=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}a(tTn,"parseTokens");var rTn=a(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),"isValidHeaderName");function Wxe(e,t,r,n,i){if(Je.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Je.isString(t))return;if(Je.isString(n)){return t.indexOf(n)!==-1}if(Je.isRegExp(n)){return n.test(t)}}a(Wxe,"matchHeaderValue");function nTn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>{return r.toUpperCase()+n})}a(nTn,"formatHeader");function iTn(e,t){const r=Je.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:true})})}a(iTn,"buildAccessors");var nP=class{static{a(this,"AxiosHeaders")}constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(u,l,c){const d=RF(l);if(!d){throw new Error("header name must be a non-empty string")}const p=Je.findKey(i,d);if(!p||i[p]===void 0||c===true||c===void 0&&i[p]!==false){i[p||l]=hJ(u)}}a(s,"setHeader");const o=a((u,l)=>Je.forEach(u,(c,d)=>s(c,d,l)),"setHeaders");if(Je.isPlainObject(t)||t instanceof this.constructor){o(t,r)}else if(Je.isString(t)&&(t=t.trim())&&!rTn(t)){o(eTn(t),r)}else{t!=null&&s(r,t,n)}return this}get(t,r){t=RF(t);if(t){const n=Je.findKey(this,t);if(n){const i=this[n];if(!r){return i}if(r===true){return tTn(i)}if(Je.isFunction(r)){return r.call(this,i,n)}if(Je.isRegExp(r)){return r.exec(i)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){t=RF(t);if(t){const n=Je.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Wxe(this,this[n],n,r)))}return false}delete(t,r){const n=this;let i=false;function s(o){o=RF(o);if(o){const u=Je.findKey(n,o);if(u&&(!r||Wxe(n,n[u],u,r))){delete n[u];i=true}}}a(s,"deleteHeader");if(Je.isArray(t)){t.forEach(s)}else{s(t)}return i}clear(t){const r=Object.keys(this);let n=r.length;let i=false;while(n--){const s=r[n];if(!t||Wxe(this,this[s],s,t,true)){delete this[s];i=true}}return i}normalize(t){const r=this;const n={};Je.forEach(this,(i,s)=>{const o=Je.findKey(n,s);if(o){r[o]=hJ(i);delete r[s];return}const u=t?nTn(s):String(s).trim();if(u!==s){delete r[s]}r[u]=hJ(i);n[u]=true});return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);Je.forEach(this,(n,i)=>{n!=null&&n!==false&&(r[i]=t&&Je.isArray(n)?n.join(", "):n)});return r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);r.forEach(i=>n.set(i));return n}static accessor(t){const r=this[rTt]=this[rTt]={accessors:{}};const n=r.accessors;const i=this.prototype;function s(o){const u=RF(o);if(!n[u]){iTn(i,o);n[u]=true}}a(s,"defineAccessor");Je.isArray(t)?t.forEach(s):s(t);return this}};nP.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Je.reduceDescriptors(nP.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Je.freezeMethods(nP);var Ff=nP;function Yxe(e,t){const r=this||dRe;const n=t||r;const i=Ff.from(n.headers);let s=n.data;Je.forEach(e,a(function o(u){s=u.call(r,s,i.normalize(),t?t.status:void 0)},"transform"));i.normalize();return s}a(Yxe,"transformData");function ITt(e){return!!(e&&e.__CANCEL__)}a(ITt,"isCancel");function tC(e,t,r){yr.call(this,e==null?"canceled":e,yr.ERR_CANCELED,t,r);this.name="CanceledError"}a(tC,"CanceledError");Je.inherits(tC,yr,{__CANCEL__:true});function OF(e,t,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new yr("Request failed with status code "+r.status,[yr.ERR_BAD_REQUEST,yr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}a(OF,"settle");function sTn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}a(sTn,"isAbsoluteURL");function aTn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}a(aTn,"combineURLs");function pRe(e,t){if(e&&!sTn(t)){return aTn(e,t)}return t}a(pRe,"buildFullPath");var yJ="1.6.2";function kTt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}a(kTt,"parseProtocol");var oTn=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function uTn(e,t,r){const n=r&&r.Blob||Df.classes.Blob;const i=kTt(e);if(t===void 0&&n){t=true}if(i==="data"){e=i.length?e.slice(i.length+1):e;const s=oTn.exec(e);if(!s){throw new yr("Invalid URL",yr.ERR_INVALID_URL)}const o=s[1];const u=s[2];const l=s[3];const c=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(t){if(!n){throw new yr("Blob is not supported",yr.ERR_NOT_SUPPORT)}return new n([c],{type:o})}return c}throw new yr("Unsupported protocol "+i,yr.ERR_NOT_SUPPORT)}a(uTn,"fromDataURI");function lTn(e,t){let r=0;const n=1e3/t;let i=null;return a(function s(o,u){const l=Date.now();if(o||l-r>n){if(i){clearTimeout(i);i=null}r=l;return e.apply(null,u)}if(!i){i=setTimeout(()=>{i=null;r=Date.now();return e.apply(null,u)},n-(l-r))}},"throttled")}a(lTn,"throttle");function DTt(e,t){e=e||10;const r=new Array(e);const n=new Array(e);let i=0;let s=0;let o;t=t!==void 0?t:1e3;return a(function u(l){const c=Date.now();const d=n[s];if(!o){o=c}r[i]=l;n[i]=c;let p=s;let f=0;while(p!==i){f+=r[p++];p=p%e}i=(i+1)%e;if(i===s){s=(s+1)%e}if(c-o<t){return}const m=d&&c-d;return m?Math.round(f*1e3/m):void 0},"push")}a(DTt,"speedometer");var fJ=Symbol("internals");var eRe=class extends UE["default"].Transform{static{a(this,"AxiosTransformStream")}constructor(t){t=Je.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,l)=>{return!Je.isUndefined(l[u])});super({readableHighWaterMark:t.chunkSize});const r=this;const n=this[fJ]={length:t.length,timeWindow:t.timeWindow,ticksRate:t.ticksRate,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:false,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};const i=DTt(n.ticksRate*t.samplesCount,n.timeWindow);this.on("newListener",u=>{if(u==="progress"){if(!n.isCaptured){n.isCaptured=true}}});let s=0;n.updateProgress=lTn(a(function u(){const l=n.length;const c=n.bytesSeen;const d=c-s;if(!d||r.destroyed)return;const p=i(d);s=c;process.nextTick(()=>{r.emit("progress",{"loaded":c,"total":l,"progress":l?c/l:void 0,"bytes":d,"rate":p?p:void 0,"estimated":p&&l&&c<=l?(l-c)/p:void 0})})},"throttledHandler"),n.ticksRate);const o=a(()=>{n.updateProgress(true)},"onFinish");this.once("end",o);this.once("error",o)}_read(t){const r=this[fJ];if(r.onReadCallback){r.onReadCallback()}return super._read(t)}_transform(t,r,n){const i=this;const s=this[fJ];const o=s.maxRate;const u=this.readableHighWaterMark;const l=s.timeWindow;const c=1e3/l;const d=o/c;const p=s.minChunkSize!==false?Math.max(s.minChunkSize,d*.01):0;function f(h,g){const _=Buffer.byteLength(h);s.bytesSeen+=_;s.bytes+=_;if(s.isCaptured){s.updateProgress()}if(i.push(h)){process.nextTick(g)}else{s.onReadCallback=()=>{s.onReadCallback=null;process.nextTick(g)}}}a(f,"pushChunk");const m=a((h,g)=>{const _=Buffer.byteLength(h);let v=null;let S=u;let E;let b=0;if(o){const A=Date.now();if(!s.ts||(b=A-s.ts)>=l){s.ts=A;E=d-s.bytes;s.bytes=E<0?-E:0;b=0}E=d-s.bytes}if(o){if(E<=0){return setTimeout(()=>{g(null,h)},l-b)}if(E<S){S=E}}if(S&&_>S&&_-S>p){v=h.subarray(S);h=h.subarray(0,S)}f(h,v?()=>{process.nextTick(g,null,v)}:g)},"transformChunk");m(t,a(function h(g,_){if(g){return n(g)}if(_){m(_,h)}else{n(null)}},"transformNextChunk"))}setLength(t){this[fJ].length=+t;return this}};var nTt=eRe;var{asyncIterator:iTt}=Symbol;var cTn=a(async function*(e){if(e.stream){yield*e.stream()}else if(e.arrayBuffer){yield await e.arrayBuffer()}else if(e[iTt]){yield*e[iTt]()}else{yield e}},"readBlob");var LTt=cTn;var dTn=Je.ALPHABET.ALPHA_DIGIT+"-_";var NF=new mTt.TextEncoder;var $E="\r\n";var pTn=NF.encode($E);var fTn=2;var tRe=class{static{a(this,"FormDataPart")}constructor(t,r){const{escapeName:n}=this.constructor;const i=Je.isString(r);let s=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${$E}`;if(i){r=NF.encode(String(r).replace(/\r?\n|\r\n?/g,$E))}else{s+=`Content-Type: ${r.type||"application/octet-stream"}${$E}`}this.headers=NF.encode(s+$E);this.contentLength=i?r.byteLength:r.size;this.size=this.headers.byteLength+this.contentLength+fTn;this.name=t;this.value=r}async*encode(){yield this.headers;const{value:t}=this;if(Je.isTypedArray(t)){yield t}else{yield*LTt(t)}yield pTn}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}};var mTn=a((e,t,r)=>{const{tag:n="form-data-boundary",size:i=25,boundary:s=n+"-"+Je.generateString(i,dTn)}=r||{};if(!Je.isFormData(e)){throw TypeError("FormData instance required")}if(s.length<1||s.length>70){throw Error("boundary must be 10-70 characters long")}const o=NF.encode("--"+s+$E);const u=NF.encode("--"+s+"--"+$E+$E);let l=u.byteLength;const c=Array.from(e.entries()).map(([p,f])=>{const m=new tRe(p,f);l+=m.size;return m});l+=o.byteLength*c.length;l=Je.toFiniteNumber(l);const d={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(l)){d["Content-Length"]=l}t&&t(d);return hTt.Readable.from(async function*(){for(const p of c){yield o;yield*p.encode()}yield u}())},"formDataToStream");var hTn=mTn;var rRe=class extends UE["default"].Transform{static{a(this,"ZlibHeaderTransformStream")}__transform(t,r,n){this.push(t);n()}_transform(t,r,n){if(t.length!==0){this._transform=this.__transform;if(t[0]!==120){const i=Buffer.alloc(2);i[0]=120;i[1]=156;this.push(i,r)}}this.__transform(t,r,n)}};var gTn=rRe;var yTn=a((e,t)=>{return Je.isAsyncFn(e)?function(...r){const n=r.pop();e.apply(this,r).then(i=>{try{t?n(null,...t(i)):n(null,i)}catch(s){n(s)}},n)}:e},"callbackify");var _Tn=yTn;var sTt={flush:jE["default"].constants.Z_SYNC_FLUSH,finishFlush:jE["default"].constants.Z_SYNC_FLUSH};var vTn={flush:jE["default"].constants.BROTLI_OPERATION_FLUSH,finishFlush:jE["default"].constants.BROTLI_OPERATION_FLUSH};var aTt=Je.isFunction(jE["default"].createBrotliDecompress);var{http:ETn,https:bTn}=swn["default"];var STn=/https:?/;var oTt=Df.protocols.map(e=>{return e+":"});function ATn(e){if(e.beforeRedirects.proxy){e.beforeRedirects.proxy(e)}if(e.beforeRedirects.config){e.beforeRedirects.config(e)}}a(ATn,"dispatchBeforeRedirect");function FTt(e,t,r){let n=t;if(!n&&n!==false){const i=YCn.getProxyForUrl(r);if(i){n=new URL(i)}}if(n){if(n.username){n.auth=(n.username||"")+":"+(n.password||"")}if(n.auth){if(n.auth.username||n.auth.password){n.auth=(n.auth.username||"")+":"+(n.auth.password||"")}const s=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");const i=n.hostname||n.host;e.hostname=i;e.host=i;e.port=n.port;e.path=r;if(n.protocol){e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`}}e.beforeRedirects.proxy=a(function i(s){FTt(s,t,s.href)},"beforeRedirect")}a(FTt,"setProxy");var CTn=typeof process!=="undefined"&&Je.kindOf(process)==="process";var wTn=a(e=>{return new Promise((t,r)=>{let n;let i;const s=a((l,c)=>{if(i)return;i=true;n&&n(l,c)},"done");const o=a(l=>{s(l);t(l)},"_resolve");const u=a(l=>{s(l,true);r(l)},"_reject");e(o,u,l=>n=l).catch(u)})},"wrapAsync");var TTn=a(({address:e,family:t})=>{if(!Je.isString(e)){throw TypeError("address must be a string")}return{address:e,family:t||(e.indexOf(".")<0?6:4)}},"resolveFamily");var uTt=a((e,t)=>TTn(Je.isObject(e)?e:{address:e,family:t}),"buildAddressEntry");var xTn=CTn&&a(function e(t){return wTn(a(async function r(n,i,s){let{data:o,lookup:u,family:l}=t;const{responseType:c,responseEncoding:d}=t;const p=t.method.toUpperCase();let f;let m=false;let h;if(u){const he=_Tn(u,Fe=>Je.isArray(Fe)?Fe:[Fe]);u=a((Fe,Oe,M)=>{he(Fe,Oe,(Q,fe,B)=>{const ye=Je.isArray(fe)?fe.map(De=>uTt(De)):[uTt(fe,B)];Oe.all?M(Q,ye):M(Q,ye[0].address,ye[0].family)})},"lookup")}const g=new awn["default"];const _=a(()=>{if(t.cancelToken){t.cancelToken.unsubscribe(v)}if(t.signal){t.signal.removeEventListener("abort",v)}g.removeAllListeners()},"onFinished");s((he,Fe)=>{f=true;if(Fe){m=true;_()}});function v(he){g.emit("abort",!he||he.type?new tC(null,t,h):he)}a(v,"abort");g.once("abort",i);if(t.cancelToken||t.signal){t.cancelToken&&t.cancelToken.subscribe(v);if(t.signal){t.signal.aborted?v():t.signal.addEventListener("abort",v)}}const S=pRe(t.baseURL,t.url);const E=new URL(S,"http://localhost");const b=E.protocol||oTt[0];if(b==="data:"){let he;if(p!=="GET"){return OF(n,i,{status:405,statusText:"method not allowed",headers:{},config:t})}try{he=uTn(t.url,c==="blob",{Blob:t.env&&t.env.Blob})}catch(Fe){throw yr.from(Fe,yr.ERR_BAD_REQUEST,t)}if(c==="text"){he=he.toString(d);if(!d||d==="utf8"){he=Je.stripBOM(he)}}else if(c==="stream"){he=UE["default"].Readable.from(he)}return OF(n,i,{data:he,status:200,statusText:"OK",headers:new Ff,config:t})}if(oTt.indexOf(b)===-1){return i(new yr("Unsupported protocol "+b,yr.ERR_BAD_REQUEST,t))}const A=Ff.from(t.headers).normalize();A.set("User-Agent","axios/"+yJ,false);const C=t.onDownloadProgress;const T=t.onUploadProgress;const O=t.maxRate;let P=void 0;let R=void 0;if(Je.isSpecCompliantForm(o)){const he=A.getContentType(/boundary=([-_\w\d]{10,70})/i);o=hTn(o,Fe=>{A.set(Fe)},{tag:`axios-${yJ}-boundary`,boundary:he&&he[1]||void 0})}else if(Je.isFormData(o)&&Je.isFunction(o.getHeaders)){A.set(o.getHeaders());if(!A.hasContentLength()){try{const he=await iwn["default"].promisify(o.getLength).call(o);Number.isFinite(he)&&he>=0&&A.setContentLength(he)}catch(he){}}}else if(Je.isBlob(o)){o.size&&A.setContentType(o.type||"application/octet-stream");A.setContentLength(o.size||0);o=UE["default"].Readable.from(LTt(o))}else if(o&&!Je.isStream(o)){if(Buffer.isBuffer(o));else if(Je.isArrayBuffer(o)){o=Buffer.from(new Uint8Array(o))}else if(Je.isString(o)){o=Buffer.from(o,"utf-8")}else{return i(new yr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",yr.ERR_BAD_REQUEST,t))}A.setContentLength(o.length,false);if(t.maxBodyLength>-1&&o.length>t.maxBodyLength){return i(new yr("Request body larger than maxBodyLength limit",yr.ERR_BAD_REQUEST,t))}}const I=Je.toFiniteNumber(A.getContentLength());if(Je.isArray(O)){P=O[0];R=O[1]}else{P=R=O}if(o&&(T||P)){if(!Je.isStream(o)){o=UE["default"].Readable.from(o,{objectMode:false})}o=UE["default"].pipeline([o,new nTt({length:I,maxRate:Je.toFiniteNumber(P)})],Je.noop);T&&o.on("progress",he=>{T(Object.assign(he,{upload:true}))})}let D=void 0;if(t.auth){const he=t.auth.username||"";const Fe=t.auth.password||"";D=he+":"+Fe}if(!D&&E.username){const he=E.username;const Fe=E.password;D=he+":"+Fe}D&&A.delete("authorization");let U;try{U=uRe(E.pathname+E.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(he){const Fe=new Error(he.message);Fe.config=t;Fe.url=t.url;Fe.exists=true;return i(Fe)}A.set("Accept-Encoding","gzip, compress, deflate"+(aTt?", br":""),false);const te={path:U,method:p,headers:A.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:D,protocol:b,family:l,beforeRedirect:ATn,beforeRedirects:{}};!Je.isUndefined(u)&&(te.lookup=u);if(t.socketPath){te.socketPath=t.socketPath}else{te.hostname=E.hostname;te.port=E.port;FTt(te,t.proxy,b+"//"+E.hostname+(E.port?":"+E.port:"")+te.path)}let ve;const me=STn.test(te.protocol);te.agent=me?t.httpsAgent:t.httpAgent;if(t.transport){ve=t.transport}else if(t.maxRedirects===0){ve=me?nwn["default"]:rwn["default"]}else{if(t.maxRedirects){te.maxRedirects=t.maxRedirects}if(t.beforeRedirect){te.beforeRedirects.config=t.beforeRedirect}ve=me?bTn:ETn}if(t.maxBodyLength>-1){te.maxBodyLength=t.maxBodyLength}else{te.maxBodyLength=Infinity}if(t.insecureHTTPParser){te.insecureHTTPParser=t.insecureHTTPParser}h=ve.request(te,a(function he(Fe){if(h.destroyed)return;const Oe=[Fe];const M=+Fe.headers["content-length"];if(C){const De=new nTt({length:Je.toFiniteNumber(M),maxRate:Je.toFiniteNumber(R)});C&&De.on("progress",$e=>{C(Object.assign($e,{download:true}))});Oe.push(De)}let Q=Fe;const fe=Fe.req||h;if(t.decompress!==false&&Fe.headers["content-encoding"]){if(p==="HEAD"||Fe.statusCode===204){delete Fe.headers["content-encoding"]}switch((Fe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Oe.push(jE["default"].createUnzip(sTt));delete Fe.headers["content-encoding"];break;case"deflate":Oe.push(new gTn);Oe.push(jE["default"].createUnzip(sTt));delete Fe.headers["content-encoding"];break;case"br":if(aTt){Oe.push(jE["default"].createBrotliDecompress(vTn));delete Fe.headers["content-encoding"]}}}Q=Oe.length>1?UE["default"].pipeline(Oe,Je.noop):Oe[0];const B=UE["default"].finished(Q,()=>{B();_()});const ye={status:Fe.statusCode,statusText:Fe.statusMessage,headers:new Ff(Fe.headers),config:t,request:fe};if(c==="stream"){ye.data=Q;OF(n,i,ye)}else{const De=[];let $e=0;Q.on("data",a(function gt(ut){De.push(ut);$e+=ut.length;if(t.maxContentLength>-1&&$e>t.maxContentLength){m=true;Q.destroy();i(new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe))}},"handleStreamData"));Q.on("aborted",a(function gt(){if(m){return}const ut=new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe);Q.destroy(ut);i(ut)},"handlerStreamAborted"));Q.on("error",a(function gt(ut){if(h.destroyed)return;i(yr.from(ut,null,t,fe))},"handleStreamError"));Q.on("end",a(function gt(){try{let ut=De.length===1?De[0]:Buffer.concat(De);if(c!=="arraybuffer"){ut=ut.toString(d);if(!d||d==="utf8"){ut=Je.stripBOM(ut)}}ye.data=ut}catch(ut){return i(yr.from(ut,null,t,ye.request,ye))}OF(n,i,ye)},"handleStreamEnd"))}g.once("abort",De=>{if(!Q.destroyed){Q.emit("error",De);Q.destroy()}})},"handleResponse"));g.once("abort",he=>{i(he);h.destroy(he)});h.on("error",a(function he(Fe){i(yr.from(Fe,null,t,h))},"handleRequestError"));h.on("socket",a(function he(Fe){Fe.setKeepAlive(true,1e3*60)},"handleRequestSocket"));if(t.timeout){const he=parseInt(t.timeout,10);if(Number.isNaN(he)){i(new yr("error trying to parse `config.timeout` to int",yr.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(he,a(function Fe(){if(f)return;let Oe=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||lRe;if(t.timeoutErrorMessage){Oe=t.timeoutErrorMessage}i(new yr(Oe,M.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,t,h));v()},"handleRequestTimeout"))}if(Je.isStream(o)){let he=false;let Fe=false;o.on("end",()=>{he=true});o.once("error",Oe=>{Fe=true;h.destroy(Oe)});o.on("close",()=>{if(!he&&!Fe){v(new tC("Request stream has been aborted",t,h))}});o.pipe(h)}else{h.end(o)}},"dispatchHttpRequest"))},"httpAdapter");var RTn=Df.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];Je.isNumber(r)&&o.push("expires="+new Date(r).toGMTString());Je.isString(n)&&o.push("path="+n);Je.isString(i)&&o.push("domain="+i);s===true&&o.push("secure");document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var OTn=Df.hasStandardBrowserEnv?a(function e(){const t=/(msie|trident)/i.test(navigator.userAgent);const r=document.createElement("a");let n;function i(s){let o=s;if(t){r.setAttribute("href",o);o=r.href}r.setAttribute("href",o);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}a(i,"resolveURL");n=i(window.location.href);return a(function s(o){const u=Je.isString(o)?i(o):o;return u.protocol===n.protocol&&u.host===n.host},"isURLSameOrigin")},"standardBrowserEnv")():a(function e(){return a(function t(){return true},"isURLSameOrigin")},"nonStandardBrowserEnv")();function lTt(e,t){let r=0;const n=DTt(50,250);return i=>{const s=i.loaded;const o=i.lengthComputable?i.total:void 0;const u=s-r;const l=n(u);const c=s<=o;r=s;const d={loaded:s,total:o,progress:o?s/o:void 0,bytes:u,rate:l?l:void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};d[t?"download":"upload"]=true;e(d)}}a(lTt,"progressEventReducer");var PTn=typeof XMLHttpRequest!=="undefined";var NTn=PTn&&function(e){return new Promise(a(function t(r,n){let i=e.data;const s=Ff.from(e.headers).normalize();let{responseType:o,withXSRFToken:u}=e;let l;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(l)}if(e.signal){e.signal.removeEventListener("abort",l)}}a(c,"done");let d;if(Je.isFormData(i)){if(Df.hasStandardBrowserEnv||Df.hasStandardBrowserWebWorkerEnv){s.setContentType(false)}else if((d=s.getContentType())!==false){const[g,..._]=d?d.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",..._].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const g=e.auth.username||"";const _=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+_))}const f=pRe(e.baseURL,e.url);p.open(e.method.toUpperCase(),uRe(f,e.params,e.paramsSerializer),true);p.timeout=e.timeout;function m(){if(!p){return}const g=Ff.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());const _=!o||o==="text"||o==="json"?p.responseText:p.response;const v={data:_,status:p.status,statusText:p.statusText,headers:g,config:e,request:p};OF(a(function S(E){r(E);c()},"_resolve"),a(function S(E){n(E);c()},"_reject"),v);p=null}a(m,"onloadend");if("onloadend"in p){p.onloadend=m}else{p.onreadystatechange=a(function g(){if(!p||p.readyState!==4){return}if(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)){return}setTimeout(m)},"handleLoad")}p.onabort=a(function g(){if(!p){return}n(new yr("Request aborted",yr.ECONNABORTED,e,p));p=null},"handleAbort");p.onerror=a(function g(){n(new yr("Network Error",yr.ERR_NETWORK,e,p));p=null},"handleError");p.ontimeout=a(function g(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||lRe;if(e.timeoutErrorMessage){_=e.timeoutErrorMessage}n(new yr(_,v.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,e,p));p=null},"handleTimeout");if(Df.hasStandardBrowserEnv){u&&Je.isFunction(u)&&(u=u(e));if(u||u!==false&&OTn(f)){const g=e.xsrfHeaderName&&e.xsrfCookieName&&RTn.read(e.xsrfCookieName);if(g){s.set(e.xsrfHeaderName,g)}}}i===void 0&&s.setContentType(null);if("setRequestHeader"in p){Je.forEach(s.toJSON(),a(function g(_,v){p.setRequestHeader(v,_)},"setRequestHeader"))}if(!Je.isUndefined(e.withCredentials)){p.withCredentials=!!e.withCredentials}if(o&&o!=="json"){p.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){p.addEventListener("progress",lTt(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&p.upload){p.upload.addEventListener("progress",lTt(e.onUploadProgress))}if(e.cancelToken||e.signal){l=a(g=>{if(!p){return}n(!g||g.type?new tC(null,e,p):g);p.abort();p=null},"onCanceled");e.cancelToken&&e.cancelToken.subscribe(l);if(e.signal){e.signal.aborted?l():e.signal.addEventListener("abort",l)}}const h=kTt(f);if(h&&Df.protocols.indexOf(h)===-1){n(new yr("Unsupported protocol "+h+":",yr.ERR_BAD_REQUEST,e));return}p.send(i||null)},"dispatchXhrRequest"))};var nRe={http:xTn,xhr:NTn};Je.forEach(nRe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});var cTt=a(e=>`- ${e}`,"renderReason");var ITn=a(e=>Je.isFunction(e)||e===null||e===false,"isResolvedHandle");var BTt={getAdapter:e=>{e=Je.isArray(e)?e:[e];const{length:t}=e;let r;let n;const i={};for(let s=0;s<t;s++){r=e[s];let o;n=r;if(!ITn(r)){n=nRe[(o=String(r)).toLowerCase()];if(n===void 0){throw new yr(`Unknown adapter '${o}'`)}}if(n){break}i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===false?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?"since :\n"+s.map(cTt).join("\n"):" "+cTt(s[0]):"as no adapter specified";throw new yr(`There is no suitable adapter to dispatch the request `+o,"ERR_NOT_SUPPORT")}return n},adapters:nRe};function Xxe(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new tC(null,e)}}a(Xxe,"throwIfCancellationRequested");function dTt(e){Xxe(e);e.headers=Ff.from(e.headers);e.data=Yxe.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=BTt.getAdapter(e.adapter||dRe.adapter);return t(e).then(a(function r(n){Xxe(e);n.data=Yxe.call(e,e.transformResponse,n);n.headers=Ff.from(n.headers);return n},"onAdapterResolution"),a(function r(n){if(!ITt(n)){Xxe(e);if(n&&n.response){n.response.data=Yxe.call(e,e.transformResponse,n.response);n.response.headers=Ff.from(n.response.headers)}}return Promise.reject(n)},"onAdapterRejection"))}a(dTt,"dispatchRequest");var pTt=a(e=>e instanceof Ff?e.toJSON():e,"headersToObject");function iP(e,t){t=t||{};const r={};function n(c,d,p){if(Je.isPlainObject(c)&&Je.isPlainObject(d)){return Je.merge.call({caseless:p},c,d)}else if(Je.isPlainObject(d)){return Je.merge({},d)}else if(Je.isArray(d)){return d.slice()}return d}a(n,"getMergedValue");function i(c,d,p){if(!Je.isUndefined(d)){return n(c,d,p)}else if(!Je.isUndefined(c)){return n(void 0,c,p)}}a(i,"mergeDeepProperties");function s(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}}a(s,"valueFromConfig2");function o(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}else if(!Je.isUndefined(c)){return n(void 0,c)}}a(o,"defaultToConfig2");function u(c,d,p){if(p in t){return n(c,d)}else if(p in e){return n(void 0,c)}}a(u,"mergeDirectKeys");const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(c,d)=>i(pTt(c),pTt(d),true)};Je.forEach(Object.keys(Object.assign({},e,t)),a(function c(d){const p=l[d]||i;const f=p(e[d],t[d],d);Je.isUndefined(f)&&p!==u||(r[d]=f)},"computeConfigValue"));return r}a(iP,"mergeConfig");var fRe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fRe[e]=a(function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e},"validator")});var fTt={};fRe.transitional=a(function e(t,r,n){function i(s,o){return"[Axios v"+yJ+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}a(i,"formatMessage");return(s,o,u)=>{if(t===false){throw new yr(i(o," has been removed"+(r?" in "+r:"")),yr.ERR_DEPRECATED)}if(r&&!fTt[o]){fTt[o]=true;console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(s,o,u):true}},"transitional");function kTn(e,t,r){if(typeof e!=="object"){throw new yr("options must be an object",yr.ERR_BAD_OPTION_VALUE)}const n=Object.keys(e);let i=n.length;while(i-- >0){const s=n[i];const o=t[s];if(o){const u=e[s];const l=u===void 0||o(u,s,e);if(l!==true){throw new yr("option "+s+" must be "+l,yr.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new yr("Unknown option "+s,yr.ERR_BAD_OPTION)}}}a(kTn,"assertOptions");var iRe={assertOptions:kTn,validators:fRe};var qE=iRe.validators;var sP=class{static{a(this,"Axios")}constructor(t){this.defaults=t;this.interceptors={request:new tTt,response:new tTt}}request(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=iP(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;if(n!==void 0){iRe.assertOptions(n,{silentJSONParsing:qE.transitional(qE.boolean),forcedJSONParsing:qE.transitional(qE.boolean),clarifyTimeoutError:qE.transitional(qE.boolean)},false)}if(i!=null){if(Je.isFunction(i)){r.paramsSerializer={serialize:i}}else{iRe.assertOptions(i,{encode:qE.function,serialize:qE.function},true)}}r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Je.merge(s.common,s[r.method]);s&&Je.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]});r.headers=Ff.concat(o,s);const u=[];let l=true;this.interceptors.request.forEach(a(function h(g){if(typeof g.runWhen==="function"&&g.runWhen(r)===false){return}l=l&&g.synchronous;u.unshift(g.fulfilled,g.rejected)},"unshiftRequestInterceptors"));const c=[];this.interceptors.response.forEach(a(function h(g){c.push(g.fulfilled,g.rejected)},"pushResponseInterceptors"));let d;let p=0;let f;if(!l){const h=[dTt.bind(this),void 0];h.unshift.apply(h,u);h.push.apply(h,c);f=h.length;d=Promise.resolve(r);while(p<f){d=d.then(h[p++],h[p++])}return d}f=u.length;let m=r;p=0;while(p<f){const h=u[p++];const g=u[p++];try{m=h(m)}catch(_){g.call(this,_);break}}try{d=dTt.call(this,m)}catch(h){return Promise.reject(h)}p=0;f=c.length;while(p<f){d=d.then(c[p++],c[p++])}return d}getUri(t){t=iP(this.defaults,t);const r=pRe(t.baseURL,t.url);return uRe(r,t.params,t.paramsSerializer)}};Je.forEach(["delete","get","head","options"],a(function e(t){sP.prototype[t]=function(r,n){return this.request(iP(n||{},{method:t,url:r,data:(n||{}).data}))}},"forEachMethodNoData"));Je.forEach(["post","put","patch"],a(function e(t){function r(n){return a(function i(s,o,u){return this.request(iP(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))},"httpMethod")}a(r,"generateHTTPMethod");sP.prototype[t]=r();sP.prototype[t+"Form"]=r(true)},"forEachMethodWithData"));var gJ=sP;var sRe=class e{static{a(this,"CancelToken")}constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let r;this.promise=new Promise(a(function i(s){r=s},"promiseExecutor"));const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;while(s-- >0){n._listeners[s](i)}n._listeners=null});this.promise.then=i=>{let s;const o=new Promise(u=>{n.subscribe(u);s=u}).then(i);o.cancel=a(function u(){n.unsubscribe(s)},"reject");return o};t(a(function i(s,o,u){if(n.reason){return}n.reason=new tC(s,o,u);r(n.reason)},"cancel"))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}}static source(){let t;const r=new e(a(function n(i){t=i},"executor"));return{token:r,cancel:t}}};var DTn=sRe;function LTn(e){return a(function t(r){return e.apply(null,r)},"wrap")}a(LTn,"spread");function FTn(e){return Je.isObject(e)&&e.isAxiosError===true}a(FTn,"isAxiosError");var aRe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aRe).forEach(([e,t])=>{aRe[t]=e});var BTn=aRe;function MTt(e){const t=new gJ(e);const r=yTt(gJ.prototype.request,t);Je.extend(r,gJ.prototype,t,{allOwnKeys:true});Je.extend(r,t,null,{allOwnKeys:true});r.create=a(function n(i){return MTt(iP(e,i))},"create");return r}a(MTt,"createInstance");var Fo=MTt(dRe);Fo.Axios=gJ;Fo.CanceledError=tC;Fo.CancelToken=DTn;Fo.isCancel=ITt;Fo.VERSION=yJ;Fo.toFormData=bJ;Fo.AxiosError=yr;Fo.Cancel=Fo.CanceledError;Fo.all=a(function e(t){return Promise.all(t)},"all");Fo.spread=LTn;Fo.isAxiosError=FTn;Fo.mergeConfig=iP;Fo.AxiosHeaders=Ff;Fo.formToJSON=e=>NTt(Je.isHTMLForm(e)?new FormData(e):e);Fo.getAdapter=BTt.getAdapter;Fo.HttpStatusCode=BTn;Fo.default=Fo;qTt.exports=Fo});var CJ=y(AJ=>{"use strict";Object.defineProperty(AJ,"__esModule",{value:true});AJ.CredentialsMethod=void 0;var UTt;(function(e){e["None"]="none";e["ApiToken"]="api_token";e["ClientCredentials"]="client_credentials"})(UTt||(AJ.CredentialsMethod=UTt={}))});var nC=y(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:true});Bo.FgaRequiredParamError=Bo.FgaValidationError=Bo.FgaApiAuthenticationError=Bo.FgaApiInternalError=Bo.FgaApiRateLimitExceededError=Bo.FgaApiNotFoundError=Bo.FgaApiValidationError=Bo.FgaApiError=Bo.FgaError=void 0;var oP=class extends Error{static{a(this,"FgaError")}constructor(t,r){super(r||typeof t==="string"?t:`FGA Error${(t===null||t===void 0?void 0:t.message)?`: ${t.message}`:""}`);this.name="FgaError";if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Bo.FgaError=oP;function TJ(e){let t=(e||"").split("/");if(t.length<4){t=[]}const r=t[2]||"";const n=t[3]||"";return{storeId:r,endpointCategory:n}}a(TJ,"getRequestMetadataFromPath");var $Tt="fga-request-id";function ERe(e){return e.response?Object.fromEntries(Object.entries(e.response.headers).map(([t,r])=>[t.toLowerCase(),r])):{}}a(ERe,"getResponseHeaders");var rC=class extends oP{static{a(this,"FgaApiError")}constructor(t,r){var n,i,s,o,u,l,c,d,p,f;super(r?r:t);this.name="FgaApiError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestData=(s=t.config)===null||s===void 0?void 0:s.data;this.requestURL=(o=t.config)===null||o===void 0?void 0:o.url;this.method=(u=t.config)===null||u===void 0?void 0:u.method;const{storeId:m,endpointCategory:h}=TJ((l=t.request)===null||l===void 0?void 0:l.path);this.storeId=m;this.endpointCategory=h;this.apiErrorMessage=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message;this.responseData=(p=t.response)===null||p===void 0?void 0:p.data;this.responseHeader=(f=t.response)===null||f===void 0?void 0:f.headers;const g=ERe(t);this.requestId=g[$Tt];if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Bo.FgaApiError=rC;var mRe=class extends rC{static{a(this,"FgaApiValidationError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiValidationError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:p}=TJ((s=t.request)===null||s===void 0?void 0:s.path);this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Validation Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Bo.FgaApiValidationError=mRe;var hRe=class extends rC{static{a(this,"FgaApiNotFoundError")}constructor(t,r){var n,i,s,o,u,l,c;super(t);this.name="FgaApiNotFoundError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;this.message=r?r:((o=(s=t.response)===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.message)?`FGA API NotFound Error: ${(u=t.config)===null||u===void 0?void 0:u.method} : Error ${(c=(l=t.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message}`:t.message}};Bo.FgaApiNotFoundError=hRe;var gRe=class extends rC{static{a(this,"FgaApiRateLimitExceededError")}constructor(t,r){var n,i,s;super(t);this.name="FgaApiRateLimitExceededError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:o}=TJ((s=t.request)===null||s===void 0?void 0:s.path);const u=ERe(t);this.message=r?r:`FGA API Rate Limit Error for ${this.method} ${o}`}};Bo.FgaApiRateLimitExceededError=gRe;var yRe=class extends rC{static{a(this,"FgaApiInternalError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiInternalError";const{endpointCategory:p}=TJ((n=t.request)===null||n===void 0?void 0:n.path);this.apiErrorCode=(s=(i=t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.code;this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Internal Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Bo.FgaApiInternalError=yRe;var _Re=class extends oP{static{a(this,"FgaApiAuthenticationError")}constructor(t){var r,n,i,s,o,u,l,c,d,p;super(`FGA Authentication Error.${((r=t.response)===null||r===void 0?void 0:r.statusText)?` ${t.response.statusText}`:""}`);this.name="FgaApiAuthenticationError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestURL=(s=t.config)===null||s===void 0?void 0:s.url;this.method=(o=t.config)===null||o===void 0?void 0:o.method;this.responseData=(u=t.response)===null||u===void 0?void 0:u.data;this.responseHeader=(l=t.response)===null||l===void 0?void 0:l.headers;this.apiErrorCode=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.code;const f=ERe(t);this.requestId=f[$Tt];let m;try{m=JSON.parse(((p=t.config)===null||p===void 0?void 0:p.data)||"{}")}catch(h){}this.clientId=m===null||m===void 0?void 0:m.client_id;this.audience=m===null||m===void 0?void 0:m.audience;this.grantType=m===null||m===void 0?void 0:m.grant_type;if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Bo.FgaApiAuthenticationError=_Re;var wJ=class extends oP{static{a(this,"FgaValidationError")}constructor(t,r){super(r);this.field=t;this.name="FgaValidationError"}};Bo.FgaValidationError=wJ;var vRe=class extends wJ{static{a(this,"FgaRequiredParamError")}constructor(t,r,n){super(r,n);this.functionName=t;this.name="FgaRequiredParamError"}};Bo.FgaRequiredParamError=vRe});var kF=y(GE=>{"use strict";Object.defineProperty(GE,"__esModule",{value:true});GE.isWellFormedUlidString=GE.isWellFormedUriString=GE.assertParamExists=void 0;var MTn=nC();var qTn=a(function(e,t,r){if(r===null||r===void 0){throw new MTn.FgaRequiredParamError(e,t,`Required parameter ${t} was null or undefined when calling ${e}.`)}},"assertParamExists");GE.assertParamExists=qTn;var UTn=a(e=>{try{const t=new URL(e);return(t.toString()===e||t.toString()===`${e}/`)&&(t.protocol==="https:"||t.protocol==="http:")}catch(t){return false}},"isWellFormedUriString");GE.isWellFormedUriString=UTn;var $Tn=a(e=>{var t;const r=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;return!!(typeof e==="string"&&((t=e.match(r))===null||t===void 0?void 0:t.length))},"isWellFormedUlidString");GE.isWellFormedUlidString=$Tn});var SRe=y(uP=>{"use strict";Object.defineProperty(uP,"__esModule",{value:true});uP.Configuration=uP.GetDefaultRetryParams=void 0;var DF=CJ();var bRe=nC();var xJ=kF();var jTn=15;var GTn=100;var HTn="openfga-sdk js/0.3.0";function VTn(e=jTn,t=GTn){return{maxRetry:e,minWaitInMs:t}}a(VTn,"GetDefaultRetryParams");uP.GetDefaultRetryParams=VTn;var RJ=class{static{a(this,"Configuration")}constructor(t={}){this.apiScheme="https";this.getBasePath=()=>`${this.apiScheme}://${this.apiHost}`;this.apiScheme=t.apiScheme||this.apiScheme;this.apiHost=t.apiHost;this.storeId=t.storeId;const r=t.credentials;if(r){switch(r===null||r===void 0?void 0:r.method){case DF.CredentialsMethod.ApiToken:this.credentials={method:r.method,config:{token:r.config.token,headerName:"Authorization",headerValuePrefix:"Bearer"}};break;case DF.CredentialsMethod.ClientCredentials:this.credentials={method:DF.CredentialsMethod.ClientCredentials,config:{clientId:r.config.clientId,clientSecret:r.config.clientSecret,apiAudience:r.config.apiAudience,apiTokenIssuer:r.config.apiTokenIssuer}};break;case DF.CredentialsMethod.None:default:this.credentials={method:DF.CredentialsMethod.None};break}}const n=t.baseOptions||{};n.headers=n.headers||{};if(typeof process==="object"&&process.title==="node"&&!n.headers["User-Agent"]){n.headers["User-Agent"]=HTn}this.baseOptions=n;this.retryParams=t.retryParams}isValid(){var t;(0,xJ.assertParamExists)("Configuration","apiScheme",this.apiScheme);(0,xJ.assertParamExists)("Configuration","apiHost",this.apiHost);if(!(0,xJ.isWellFormedUriString)(this.getBasePath())){throw new bRe.FgaValidationError(`Configuration.apiScheme (${this.apiScheme}) and Configuration.apiHost (${this.apiHost}) do not form a valid URI (${this.getBasePath()})`)}if(this.storeId&&!(0,xJ.isWellFormedUlidString)(this.storeId)){throw new bRe.FgaValidationError("storeId")}if(((t=this.retryParams)===null||t===void 0?void 0:t.maxRetry)&&this.retryParams.maxRetry>15){throw new bRe.FgaValidationError("Configuration.retryParams.maxRetry exceeds maximum allowed limit of 15")}return true}};uP.Configuration=RJ;RJ.sdkVersion="0.3.0"});var jTt=y(OJ=>{"use strict";Object.defineProperty(OJ,"__esModule",{value:true});OJ.assertNever=void 0;function zTn(e){throw new Error(`Assertion failed. Unacceptable value: '${e}'`)}a(zTn,"assertNever");OJ.assertNever=zTn});var GTt=y(PJ=>{"use strict";Object.defineProperty(PJ,"__esModule",{value:true});PJ.chunkArray=void 0;function KTn(e,t){const r=[];const n=[...e];while(n.length>0){r.push(n.splice(0,t))}return r}a(KTn,"chunkArray");PJ.chunkArray=KTn});var VTt=y(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:true});lP.generateRandomIdWithNonUniqueFallback=lP.generateRandomId=void 0;var NJ=require("crypto");function HTt(){if(typeof NJ.randomUUID==="function"){return(0,NJ.randomUUID)()}if(typeof NJ.randomBytes==="function"){return(0,NJ.randomBytes)(20).toString("hex")}return}a(HTt,"generateRandomId");lP.generateRandomId=HTt;function WTn(){return HTt()||"00000000-0000-0000-0000-000000000000"}a(WTn,"generateRandomIdWithNonUniqueFallback");lP.generateRandomIdWithNonUniqueFallback=WTn});var zTt=y(IJ=>{"use strict";Object.defineProperty(IJ,"__esModule",{value:true});IJ.setHeaderIfNotSet=void 0;function YTn(e,t,r){if(!e[t]&&r){e[t]=r}}a(YTn,"setHeaderIfNotSet");IJ.setHeaderIfNotSet=YTn});var KTt=y(kJ=>{"use strict";Object.defineProperty(kJ,"__esModule",{value:true});kJ.setNotEnumerableProperty=void 0;function XTn(e,t,r){Object.defineProperty(e,t,{enumerable:false,writable:false,value:r})}a(XTn,"setNotEnumerableProperty");kJ.setNotEnumerableProperty=XTn});var ARe=y(mh=>{"use strict";var JTn=mh&&mh.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var LF=mh&&mh.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))JTn(t,e,r)};Object.defineProperty(mh,"__esModule",{value:true});LF(jTt(),mh);LF(GTt(),mh);LF(VTt(),mh);LF(zTt(),mh);LF(KTt(),mh)});var wRe=y(tu=>{"use strict";var CRe=tu&&tu.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(tu,"__esModule",{value:true});tu.createRequestFunction=tu.attemptHttpRequest=tu.toPathString=tu.serializeDataIfNeeded=tu.setSearchParams=tu.setBearerAuthToObject=tu.DUMMY_BASE_URL=void 0;var QTn=DJ();var iC=nC();var ZTn=ARe();tu.DUMMY_BASE_URL="https://example.com";var exn=a(function(e,t){return CRe(this,void 0,void 0,function*(){const r=yield t.getAccessTokenHeader();if(r&&!e[r.name]){e[r.name]=r.value}})},"setBearerAuthToObject");tu.setBearerAuthToObject=exn;var txn=a(function(e,...t){const r=new URLSearchParams(e.search);for(const n of t){for(const i in n){if(Array.isArray(n[i])){r.delete(i);for(const s of n[i]){r.append(i,s)}}else{r.set(i,n[i])}}}e.search=r.toString()},"setSearchParams");tu.setSearchParams=txn;var rxn=a(e=>{const t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(t.test(e)||e.toLowerCase()==="application/json-patch+json")},"isJsonMime");var nxn=a(function(e,t){const r=typeof e!=="string";const n=r?rxn(t.headers["Content-Type"]):r;return n?JSON.stringify(e!==void 0?e:{}):e||""},"serializeDataIfNeeded");tu.serializeDataIfNeeded=nxn;var ixn=a(function(e){return e.pathname+e.search+e.hash},"toPathString");tu.toPathString=ixn;function sxn(e){return e&&typeof e==="object"&&e.isAxiosError===true}a(sxn,"isAxiosError");function axn(e,t){const r=Math.ceil(Math.pow(2,e)*t);const n=Math.ceil(Math.pow(2,e+1)*t);return Math.floor(Math.random()*(n-r)+r)}a(axn,"randomTime");function WTt(e,t,r){var n;return CRe(this,void 0,void 0,function*(){let i=0;do{i++;try{return yield r(e)}catch(s){if(!sxn(s)){throw new iC.FgaError(s)}const o=(n=s===null||s===void 0?void 0:s.response)===null||n===void 0?void 0:n.status;if(o===400||o===422){throw new iC.FgaApiValidationError(s)}else if(o===401||o===403){throw new iC.FgaApiAuthenticationError(s)}else if(o===404){throw new iC.FgaApiNotFoundError(s)}else if(o===429||o>=500){if(i>=t.maxRetry){if(o===429){throw new iC.FgaApiRateLimitExceededError(s)}else{throw new iC.FgaApiInternalError(s)}}yield new Promise(u=>setTimeout(u,axn(i,t.minWaitInMs)))}else{throw new iC.FgaApiError(s)}}}while(i<t.maxRetry+1)})}a(WTt,"attemptHttpRequest");tu.attemptHttpRequest=WTt;var oxn=a(function(e,t,r,n){var i,s;r.isValid();const o=((i=e.options)===null||i===void 0?void 0:i.retryParams)?(s=e.options)===null||s===void 0?void 0:s.retryParams:r.retryParams;const u=o?o.maxRetry:0;const l=o?o.minWaitInMs:0;if(!n){n=QTn.Credentials.init(r)}return(c=t)=>CRe(this,void 0,void 0,function*(){yield(0,tu.setBearerAuthToObject)(e.options.headers,n);const d=Object.assign(Object.assign({},e.options),{url:r.getBasePath()+e.url});const p=yield WTt(d,{maxRetry:u,minWaitInMs:l},c);const f=typeof(p===null||p===void 0?void 0:p.data)==="undefined"?{}:p===null||p===void 0?void 0:p.data;const m=Object.assign({},f);(0,ZTn.setNotEnumerableProperty)(m,"$response",p);return m})},"createRequestFunction");tu.createRequestFunction=oxn});var XTt=y(cP=>{"use strict";var TRe=cP&&cP.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(cP,"__esModule",{value:true});cP.Credentials=void 0;var YTt=SJ();var HE=kF();var xRe=nC();var uxn=wRe();var Bf=CJ();var RRe=class e{static{a(this,"Credentials")}static init(t){return new e(t.credentials)}constructor(t,r=YTt.default){this.authConfig=t;this.axios=r;this.initConfig();this.isValid()}initConfig(){var t;switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Bf.CredentialsMethod.ApiToken:if(this.authConfig.config){if(!this.authConfig.config.headerName){this.authConfig.config.headerName="Authorization"}if(!this.authConfig.config.headerValuePrefix){this.authConfig.config.headerValuePrefix="Bearer"}}break;case Bf.CredentialsMethod.ClientCredentials:case Bf.CredentialsMethod.None:default:break}}isValid(){var t,r,n,i,s,o,u,l,c;const{authConfig:d}=this;switch(d===null||d===void 0?void 0:d.method){case Bf.CredentialsMethod.None:break;case Bf.CredentialsMethod.ApiToken:(0,HE.assertParamExists)("Credentials","config.token",(t=d.config)===null||t===void 0?void 0:t.token);(0,HE.assertParamExists)("Credentials","config.headerName",(r=d.config)===null||r===void 0?void 0:r.headerName);(0,HE.assertParamExists)("Credentials","config.headerName",(n=d.config)===null||n===void 0?void 0:n.headerName);break;case Bf.CredentialsMethod.ClientCredentials:(0,HE.assertParamExists)("Credentials","config.clientId",(i=d.config)===null||i===void 0?void 0:i.clientId);(0,HE.assertParamExists)("Credentials","config.clientSecret",(s=d.config)===null||s===void 0?void 0:s.clientSecret);(0,HE.assertParamExists)("Credentials","config.apiTokenIssuer",(o=d.config)===null||o===void 0?void 0:o.apiTokenIssuer);(0,HE.assertParamExists)("Credentials","config.apiAudience",(u=d.config)===null||u===void 0?void 0:u.apiAudience);if(!(0,HE.isWellFormedUriString)(`https://${(l=d.config)===null||l===void 0?void 0:l.apiTokenIssuer}`)){throw new xRe.FgaValidationError(`Configuration.apiTokenIssuer does not form a valid URI (https://${(c=d.config)===null||c===void 0?void 0:c.apiTokenIssuer})`)}break}}getAccessTokenHeader(){var t;return TRe(this,void 0,void 0,function*(){const r=yield this.getAccessTokenValue();switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Bf.CredentialsMethod.None:return;case Bf.CredentialsMethod.ApiToken:return{name:this.authConfig.config.headerName,value:`${this.authConfig.config.headerValuePrefix?`${this.authConfig.config.headerValuePrefix} `:""}${r}`};case Bf.CredentialsMethod.ClientCredentials:return{name:"Authorization",value:`Bearer ${r}`}}})}getAccessTokenValue(){var t;return TRe(this,void 0,void 0,function*(){switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Bf.CredentialsMethod.None:return;case Bf.CredentialsMethod.ApiToken:return this.authConfig.config.token;case Bf.CredentialsMethod.ClientCredentials:if(this.accessToken&&(!this.accessTokenExpiryDate||this.accessTokenExpiryDate>new Date)){return this.accessToken}return this.refreshAccessToken()}})}refreshAccessToken(){var t;return TRe(this,void 0,void 0,function*(){const r=(t=this.authConfig)===null||t===void 0?void 0:t.config;try{const n=yield(0,uxn.attemptHttpRequest)({url:`https://${r.apiTokenIssuer}/oauth/token`,method:"post",data:{client_id:r.clientId,client_secret:r.clientSecret,audience:r.apiAudience,grant_type:"client_credentials"}},{maxRetry:3,minWaitInMs:100},YTt.default);if(n){this.accessToken=n.data.access_token;this.accessTokenExpiryDate=new Date(Date.now()+n.data.expires_in*1e3)}return this.accessToken}catch(n){if(n instanceof xRe.FgaApiError){n.constructor=xRe.FgaApiAuthenticationError;n.name="FgaApiAuthenticationError";n.clientId=r.clientId;n.audience=r.apiAudience;n.grantType="client_credentials"}throw n}})}};cP.Credentials=RRe});var DJ=y(VE=>{"use strict";var lxn=VE&&VE.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var JTt=VE&&VE.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))lxn(t,e,r)};Object.defineProperty(VE,"__esModule",{value:true});JTt(XTt(),VE);JTt(CJ(),VE)});var PRe=y(LJ=>{"use strict";Object.defineProperty(LJ,"__esModule",{value:true});LJ.BaseAPI=void 0;var cxn=SJ();var dxn=require("http");var pxn=require("https");var QTt=SRe();var fxn=DJ();var mxn=1e4;var ORe=class{static{a(this,"BaseAPI")}constructor(t,r){var n;this.axios=r;if(t instanceof QTt.Configuration){this.configuration=t}else{this.configuration=new QTt.Configuration(t)}this.configuration.isValid();this.credentials=fxn.Credentials.init(this.configuration);if(!this.axios){const i=new dxn.Agent({keepAlive:true});const s=new pxn.Agent({keepAlive:true});this.axios=cxn.default.create({httpAgent:i,httpsAgent:s,timeout:mxn,headers:(n=this.configuration.baseOptions)===null||n===void 0?void 0:n.headers})}}get storeId(){return this.configuration.storeId}set storeId(t){this.configuration.storeId=t}};LJ.BaseAPI=ORe});var IRe=y(Ts=>{"use strict";var As=Ts&&Ts.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(Ts,"__esModule",{value:true});Ts.OpenFgaApi=Ts.OpenFgaApiFactory=Ts.OpenFgaApiFp=Ts.OpenFgaApiAxiosParamCreator=void 0;var Tc=SJ();var hxn=PRe();var sr=wRe();var za=kF();var gxn=a(function(e,t){return{check:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("check","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/check".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),createStore:(r,n={})=>As(this,void 0,void 0,function*(){const i="/stores";const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),deleteStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"DELETE"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),expand:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("expand","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/expand".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),getStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"GET"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),listObjects:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("listObjects","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/list-objects".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),listStores:(r,n,i={})=>As(this,void 0,void 0,function*(){const s="/stores";const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),read:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("read","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/read".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),readAssertions:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAssertions","authorizationModelId",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAuthorizationModel","id",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models/{id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModels:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),readChanges:(r,n,i,s={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const o="/stores/{store_id}/changes".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const u=new URL(o,sr.DUMMY_BASE_URL);let l;if(e){l=e.baseOptions}const c=Object.assign(Object.assign({method:"GET"},l),s);const d={};const p={};if(r!==void 0){p["type"]=r}if(n!==void 0){p["page_size"]=n}if(i!==void 0){p["continuation_token"]=i}(0,sr.setSearchParams)(u,p,s.query);c.headers=Object.assign(Object.assign({},d),s.headers);return{url:(0,sr.toPathString)(u),options:c}}),write:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("write","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/write".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),writeAssertions:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAssertions","authorizationModelId",r);(0,za.assertParamExists)("writeAssertions","body",n);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"PUT"},u),i);const c={};const d={};c["Content-Type"]="application/json";(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);l.data=(0,sr.serializeDataIfNeeded)(n,l);return{url:(0,sr.toPathString)(o),options:l}}),writeAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAuthorizationModel","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}})}},"OpenFgaApiAxiosParamCreator");Ts.OpenFgaApiAxiosParamCreator=gxn;var yxn=a(function(e,t){const r=(0,Ts.OpenFgaApiAxiosParamCreator)(e,t);return{check(n,i){return As(this,void 0,void 0,function*(){const s=yield r.check(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},createStore(n,i){return As(this,void 0,void 0,function*(){const s=yield r.createStore(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},deleteStore(n){return As(this,void 0,void 0,function*(){const i=yield r.deleteStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},expand(n,i){return As(this,void 0,void 0,function*(){const s=yield r.expand(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},getStore(n){return As(this,void 0,void 0,function*(){const i=yield r.getStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},listObjects(n,i){return As(this,void 0,void 0,function*(){const s=yield r.listObjects(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},listStores(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.listStores(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},read(n,i){return As(this,void 0,void 0,function*(){const s=yield r.read(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAssertions(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAssertions(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModels(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.readAuthorizationModels(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},readChanges(n,i,s,o){return As(this,void 0,void 0,function*(){const u=yield r.readChanges(n,i,s,o);return(0,sr.createRequestFunction)(u,Tc.default,e,t)})},write(n,i){return As(this,void 0,void 0,function*(){const s=yield r.write(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},writeAssertions(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.writeAssertions(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},writeAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.writeAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})}}},"OpenFgaApiFp");Ts.OpenFgaApiFp=yxn;var _xn=a(function(e,t,r){const n=(0,Ts.OpenFgaApiFp)(e,t);return{check(i,s){return n.check(i,s).then(o=>o(r))},createStore(i,s){return n.createStore(i,s).then(o=>o(r))},deleteStore(i){return n.deleteStore(i).then(s=>s(r))},expand(i,s){return n.expand(i,s).then(o=>o(r))},getStore(i){return n.getStore(i).then(s=>s(r))},listObjects(i,s){return n.listObjects(i,s).then(o=>o(r))},listStores(i,s,o){return n.listStores(i,s,o).then(u=>u(r))},read(i,s){return n.read(i,s).then(o=>o(r))},readAssertions(i,s){return n.readAssertions(i,s).then(o=>o(r))},readAuthorizationModel(i,s){return n.readAuthorizationModel(i,s).then(o=>o(r))},readAuthorizationModels(i,s,o){return n.readAuthorizationModels(i,s,o).then(u=>u(r))},readChanges(i,s,o,u){return n.readChanges(i,s,o,u).then(l=>l(r))},write(i,s){return n.write(i,s).then(o=>o(r))},writeAssertions(i,s,o){return n.writeAssertions(i,s,o).then(u=>u(r))},writeAuthorizationModel(i,s){return n.writeAuthorizationModel(i,s).then(o=>o(r))}}},"OpenFgaApiFactory");Ts.OpenFgaApiFactory=_xn;var NRe=class extends hxn.BaseAPI{static{a(this,"OpenFgaApi")}check(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).check(t,r).then(n=>n(this.axios))}createStore(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).createStore(t,r).then(n=>n(this.axios))}deleteStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).deleteStore(t).then(r=>r(this.axios))}expand(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).expand(t,r).then(n=>n(this.axios))}getStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).getStore(t).then(r=>r(this.axios))}listObjects(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listObjects(t,r).then(n=>n(this.axios))}listStores(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listStores(t,r,n).then(i=>i(this.axios))}read(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).read(t,r).then(n=>n(this.axios))}readAssertions(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAssertions(t,r).then(n=>n(this.axios))}readAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModel(t,r).then(n=>n(this.axios))}readAuthorizationModels(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModels(t,r,n).then(i=>i(this.axios))}readChanges(t,r,n,i){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readChanges(t,r,n,i).then(s=>s(this.axios))}write(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).write(t,r).then(n=>n(this.axios))}writeAssertions(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAssertions(t,r,n).then(i=>i(this.axios))}writeAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAuthorizationModel(t,r).then(n=>n(this.axios))}};Ts.OpenFgaApi=NRe});var ext=y((Y6s,ZTt)=>{async function*vxn(e,t,r){const n=new Set;async function i(){const[s,o]=await Promise.race(n);n.delete(s);return o}a(i,"consume");for(const s of t){const o=(async()=>await r(s,t))().then(u=>[o,u]);n.add(o);if(n.size>=e){yield await i()}}while(n.size){yield await i()}}a(vxn,"asyncPool");ZTt.exports=vxn});var txt=y(ig=>{"use strict";var Ka=ig&&ig.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};var kRe=ig&&ig.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(u,l){o=e[s](o),i(u,l,o.done,o.value)})}}a(n,"verb");function i(s,o,u,l){Promise.resolve(l).then(function(c){s({value:c,done:u})},o)}a(i,"settle")};Object.defineProperty(ig,"__esModule",{value:true});ig.OpenFgaClient=ig.ClientWriteStatus=void 0;var DRe=ext();var Exn=IRe();var bxn=PRe();var LRe=nC();var gd=ARe();var Sxn=kF();var FRe=10;var dP="X-OpenFGA-Client-Method";var BRe="X-OpenFGA-Client-Bulk-Request-Id";var pP;(function(e){e["SUCCESS"]="success";e["FAILURE"]="failure"})(pP||(ig.ClientWriteStatus=pP={}));var MRe=class extends bxn.BaseAPI{static{a(this,"OpenFgaClient")}constructor(t,r){super(t,r);this.axios=r;this.api=new Exn.OpenFgaApi(this.configuration,r);this.authorizationModelId=t.authorizationModelId;this.getAuthorizationModelId()}getAuthorizationModelId(t={}){const r=(t===null||t===void 0?void 0:t.authorizationModelId)||this.authorizationModelId;if(r&&!(0,Sxn.isWellFormedUlidString)(r)){throw new LRe.FgaValidationError("authorizationModelId")}return r}checkValidApiConnection(t={}){return Ka(this,void 0,void 0,function*(){if(this.getAuthorizationModelId(t)){yield this.readAuthorizationModel(t)}else{yield this.readLatestAuthorizationModel(t)}})}listStores(t={}){return Ka(this,void 0,void 0,function*(){return this.api.listStores(t.pageSize,t.continuationToken,t)})}createStore(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.createStore(t,r)})}getStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.getStore(t)})}deleteStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.deleteStore(t)})}readAuthorizationModels(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAuthorizationModels(t.pageSize,t.continuationToken,t)})}writeAuthorizationModel(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAuthorizationModel(t,r)})}readAuthorizationModel(t={}){return Ka(this,void 0,void 0,function*(){const r=this.getAuthorizationModelId(t);if(!r){throw new LRe.FgaRequiredParamError("ClientConfiguration","authorizationModelId")}return this.api.readAuthorizationModel(r,t)})}readLatestAuthorizationModel(t={}){var r;return Ka(this,void 0,void 0,function*(){const{headers:n={}}=t;(0,gd.setHeaderIfNotSet)(n,dP,"ReadLatestAuthorizationModel");const i=yield this.readAuthorizationModels(Object.assign(Object.assign({},t),{pageSize:1,headers:n}));const s=i;s.authorization_model=(r=i.authorization_models)===null||r===void 0?void 0:r[0];delete s.authorization_models;return s})}readChanges(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.readChanges(t.type,r.pageSize,r.continuationToken,r)})}read(t={},r={}){return Ka(this,void 0,void 0,function*(){const n={page_size:r.pageSize,continuation_token:r.continuationToken};if(t.user||t.object||t.relation){n.tuple_key=t}return this.api.read(n,r)})}write(t,r={}){return Ka(this,void 0,void 0,function*(){const{transaction:n={},headers:i={}}=r;const{maxPerChunk:s=1,maxParallelRequests:o=FRe}=n;const{writes:u,deletes:l}=t;const c=this.getAuthorizationModelId(r);if(!(n===null||n===void 0?void 0:n.disable)){const d={authorization_model_id:c};if(u===null||u===void 0?void 0:u.length){d.writes={tuple_keys:u}}if(l===null||l===void 0?void 0:l.length){d.deletes={tuple_keys:l}}yield this.api.write(d,r);return{writes:(u===null||u===void 0?void 0:u.map(p=>({tuple_key:p,status:pP.SUCCESS})))||[],deletes:(l===null||l===void 0?void 0:l.map(p=>({tuple_key:p,status:pP.SUCCESS})))||[]}}return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var d,p,f,m,h,g,_,v;(0,gd.setHeaderIfNotSet)(i,dP,"Write");(0,gd.setHeaderIfNotSet)(i,BRe,(0,gd.generateRandomIdWithNonUniqueFallback)());const S=[];if(u===null||u===void 0?void 0:u.length){try{for(var E=true,b=kRe(DRe(o,(0,gd.chunkArray)(u,s),R=>this.writeTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:R.map(D=>({tuple_key:D,status:pP.FAILURE,err:I})),deletes:[]})))),A;A=yield b.next(),d=A.done,!d;E=true){m=A.value;E=false;const R=m;S.push(R.writes)}}catch(R){p={error:R}}finally{try{if(!E&&!d&&(f=b.return))yield f.call(b)}finally{if(p)throw p.error}}}const C=[];if(l===null||l===void 0?void 0:l.length){try{for(var T=true,O=kRe(DRe(o,(0,gd.chunkArray)(l,s),R=>this.deleteTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:[],deletes:R.map(D=>({tuple_key:D,status:pP.FAILURE,err:I}))})))),P;P=yield O.next(),h=P.done,!h;T=true){v=P.value;T=false;const R=v;C.push(R.deletes)}}catch(R){g={error:R}}finally{try{if(!T&&!h&&(_=O.return))yield _.call(O)}finally{if(g)throw g.error}}}return{writes:S.flat(),deletes:C.flat()}}))(),this.checkValidApiConnection(r)]).then(d=>d[0])})}writeTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,gd.setHeaderIfNotSet)(n,dP,"WriteTuples");return this.write({writes:t},Object.assign(Object.assign({},r),{headers:n}))})}deleteTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,gd.setHeaderIfNotSet)(n,dP,"DeleteTuples");return this.write({deletes:t},Object.assign(Object.assign({},r),{headers:n}))})}check(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.check({tuple_key:{user:t.user,relation:t.relation,object:t.object},context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]},authorization_model_id:this.getAuthorizationModelId(r)},r)})}batchCheck(t,r={}){return Ka(this,void 0,void 0,function*(){return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var n,i,s,o;const{headers:u={},maxParallelRequests:l=FRe}=r;(0,gd.setHeaderIfNotSet)(u,dP,"BatchCheck");(0,gd.setHeaderIfNotSet)(u,BRe,(0,gd.generateRandomIdWithNonUniqueFallback)());const c=[];try{for(var d=true,p=kRe(DRe(l,t,m=>this.check(m,Object.assign(Object.assign({},r),{headers:u})).then(h=>{h._request=m;return h}).catch(h=>{return{allowed:void 0,error:h,_request:m}}))),f;f=yield p.next(),n=f.done,!n;d=true){o=f.value;d=false;const m=o;c.push(m)}}catch(m){i={error:m}}finally{try{if(!d&&!n&&(s=p.return))yield s.call(p)}finally{if(i)throw i.error}}return{responses:c}}))(),this.checkValidApiConnection(r)]).then(n=>n[0])})}expand(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.expand({authorization_model_id:this.getAuthorizationModelId(r),tuple_key:t},r)})}listObjects(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.listObjects({authorization_model_id:this.getAuthorizationModelId(r),user:t.user,relation:t.relation,type:t.type,context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]}},r)})}listRelations(t,r={}){return Ka(this,void 0,void 0,function*(){const{user:n,object:i,relations:s,contextualTuples:o,context:u}=t;const{headers:l={},maxParallelRequests:c=FRe}=r;(0,gd.setHeaderIfNotSet)(l,dP,"ListRelations");(0,gd.setHeaderIfNotSet)(l,BRe,(0,gd.generateRandomIdWithNonUniqueFallback)());if(!(s===null||s===void 0?void 0:s.length)){throw new LRe.FgaValidationError("relations","When calling listRelations, at least one relation must be passed in the relations field")}const d=yield this.batchCheck(s.map(f=>({user:n,relation:f,object:i,contextualTuples:o,context:u})),Object.assign(Object.assign({},r),{headers:l,maxParallelRequests:c}));const p=d.responses.find(f=>f.error);if(p){throw p.error}return{relations:d.responses.filter(f=>f.allowed).map(f=>f._request.relation)}})}readAssertions(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAssertions(this.getAuthorizationModelId(t),t)})}writeAssertions(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAssertions(this.getAuthorizationModelId(r),{assertions:t.map(n=>({tuple_key:{user:n.user,relation:n.relation,object:n.object},expectation:n.expectation}))},r)})}};ig.OpenFgaClient=MRe});var uxt=y(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:true});yd.TypeName=yd.TupleOperation=yd.NullValue=yd.NotFoundErrorCode=yd.InternalErrorCode=yd.ErrorCode=void 0;var rxt;(function(e){e["NoError"]="no_error";e["ValidationError"]="validation_error";e["AuthorizationModelNotFound"]="authorization_model_not_found";e["AuthorizationModelResolutionTooComplex"]="authorization_model_resolution_too_complex";e["InvalidWriteInput"]="invalid_write_input";e["CannotAllowDuplicateTuplesInOneRequest"]="cannot_allow_duplicate_tuples_in_one_request";e["CannotAllowDuplicateTypesInOneRequest"]="cannot_allow_duplicate_types_in_one_request";e["CannotAllowMultipleReferencesToOneRelation"]="cannot_allow_multiple_references_to_one_relation";e["InvalidContinuationToken"]="invalid_continuation_token";e["InvalidTupleSet"]="invalid_tuple_set";e["InvalidCheckInput"]="invalid_check_input";e["InvalidExpandInput"]="invalid_expand_input";e["UnsupportedUserSet"]="unsupported_user_set";e["InvalidObjectFormat"]="invalid_object_format";e["WriteFailedDueToInvalidInput"]="write_failed_due_to_invalid_input";e["AuthorizationModelAssertionsNotFound"]="authorization_model_assertions_not_found";e["LatestAuthorizationModelNotFound"]="latest_authorization_model_not_found";e["TypeNotFound"]="type_not_found";e["RelationNotFound"]="relation_not_found";e["EmptyRelationDefinition"]="empty_relation_definition";e["InvalidUser"]="invalid_user";e["InvalidTuple"]="invalid_tuple";e["UnknownRelation"]="unknown_relation";e["StoreIdInvalidLength"]="store_id_invalid_length";e["AssertionsTooManyItems"]="assertions_too_many_items";e["IdTooLong"]="id_too_long";e["AuthorizationModelIdTooLong"]="authorization_model_id_too_long";e["TupleKeyValueNotSpecified"]="tuple_key_value_not_specified";e["TupleKeysTooManyOrTooFewItems"]="tuple_keys_too_many_or_too_few_items";e["PageSizeInvalid"]="page_size_invalid";e["ParamMissingValue"]="param_missing_value";e["DifferenceBaseMissingValue"]="difference_base_missing_value";e["SubtractBaseMissingValue"]="subtract_base_missing_value";e["ObjectTooLong"]="object_too_long";e["RelationTooLong"]="relation_too_long";e["TypeDefinitionsTooFewItems"]="type_definitions_too_few_items";e["TypeInvalidLength"]="type_invalid_length";e["TypeInvalidPattern"]="type_invalid_pattern";e["RelationsTooFewItems"]="relations_too_few_items";e["RelationsTooLong"]="relations_too_long";e["RelationsInvalidPattern"]="relations_invalid_pattern";e["ObjectInvalidPattern"]="object_invalid_pattern";e["QueryStringTypeContinuationTokenMismatch"]="query_string_type_continuation_token_mismatch";e["ExceededEntityLimit"]="exceeded_entity_limit";e["InvalidContextualTuple"]="invalid_contextual_tuple";e["DuplicateContextualTuple"]="duplicate_contextual_tuple";e["InvalidAuthorizationModel"]="invalid_authorization_model";e["UnsupportedSchemaVersion"]="unsupported_schema_version"})(rxt||(yd.ErrorCode=rxt={}));var nxt;(function(e){e["NoInternalError"]="no_internal_error";e["InternalError"]="internal_error";e["Cancelled"]="cancelled";e["DeadlineExceeded"]="deadline_exceeded";e["AlreadyExists"]="already_exists";e["ResourceExhausted"]="resource_exhausted";e["FailedPrecondition"]="failed_precondition";e["Aborted"]="aborted";e["OutOfRange"]="out_of_range";e["Unavailable"]="unavailable";e["DataLoss"]="data_loss"})(nxt||(yd.InternalErrorCode=nxt={}));var ixt;(function(e){e["NoNotFoundError"]="no_not_found_error";e["UndefinedEndpoint"]="undefined_endpoint";e["StoreIdNotFound"]="store_id_not_found";e["Unimplemented"]="unimplemented"})(ixt||(yd.NotFoundErrorCode=ixt={}));var sxt;(function(e){e["NullValue"]="NULL_VALUE"})(sxt||(yd.NullValue=sxt={}));var axt;(function(e){e["Write"]="TUPLE_OPERATION_WRITE";e["Delete"]="TUPLE_OPERATION_DELETE"})(axt||(yd.TupleOperation=axt={}));var oxt;(function(e){e["Unspecified"]="TYPE_NAME_UNSPECIFIED";e["Any"]="TYPE_NAME_ANY";e["Bool"]="TYPE_NAME_BOOL";e["String"]="TYPE_NAME_STRING";e["Int"]="TYPE_NAME_INT";e["Uint"]="TYPE_NAME_UINT";e["Double"]="TYPE_NAME_DOUBLE";e["Duration"]="TYPE_NAME_DURATION";e["Timestamp"]="TYPE_NAME_TIMESTAMP";e["Map"]="TYPE_NAME_MAP";e["List"]="TYPE_NAME_LIST";e["Ipaddress"]="TYPE_NAME_IPADDRESS"})(oxt||(yd.TypeName=oxt={}))});var dxt=y(Cu=>{"use strict";var Axn=Cu&&Cu.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var FJ=Cu&&Cu.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))Axn(t,e,r)};Object.defineProperty(Cu,"__esModule",{value:true});Cu.CredentialsMethod=Cu.Credentials=Cu.GetDefaultRetryParams=Cu.Configuration=void 0;FJ(IRe(),Cu);FJ(txt(),Cu);FJ(uxt(),Cu);var lxt=SRe();Object.defineProperty(Cu,"Configuration",{enumerable:true,get:function(){return lxt.Configuration}});Object.defineProperty(Cu,"GetDefaultRetryParams",{enumerable:true,get:function(){return lxt.GetDefaultRetryParams}});var cxt=DJ();Object.defineProperty(Cu,"Credentials",{enumerable:true,get:function(){return cxt.Credentials}});Object.defineProperty(Cu,"CredentialsMethod",{enumerable:true,get:function(){return cxt.CredentialsMethod}});FJ(nC(),Cu)});var fxt=y(fP=>{"use strict";var Cxn=fP&&fP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(fP,"__esModule",{value:true});fP.OpenFGAService=void 0;var FF=Cxn(Jd());var pxt=dxt();var wxn=XO();var qRe=class{static{a(this,"OpenFGAService")}logger;openFGAClient;baseUrl;apiHost;storeId;modelId;userSub;constructor(t,r){if(!FF.default.OPENFGA_SERVICE_URL){throw new Error("OPENFGA_SERVICE_URL is not set")}this.userSub=r&&r.userSub?r.userSub:t.getUserSub();this.baseUrl=FF.default.OPENFGA_SERVICE_URL;this.apiHost=FF.default.OPENFGA_SERVICE_URL.replace(/^(https:\/\/)/,"");this.storeId=FF.default.OPENFGA_STORE_ID;this.modelId=FF.default.OPENFGA_MODEL_ID;this.logger=t.log}async getOpenFgaClient(){if(!this.openFGAClient){const t=await(0,wxn.getServiceAccountIdToken)(this.baseUrl);this.openFGAClient=new pxt.OpenFgaClient({apiScheme:"https",apiHost:this.apiHost,storeId:this.storeId,authorizationModelId:this.modelId,credentials:{method:pxt.CredentialsMethod.ApiToken,config:{token:t}}})}return this.openFGAClient}async createAccountMember(t){try{const r=await this.getOpenFgaClient();await r.write({writes:[{user:`user:${this.userSub}`,relation:"admin",object:`account:${t}`}]})}catch(r){this.logger.warn(`RBAC failed to create account membership. Error: ${r.message}`)}}async getAccountMemberships(){const t=await this.getOpenFgaClient();const r=await t.listObjects({user:`user:${this.userSub}`,relation:"member",type:"account"});if(r){return r.objects.map(n=>n.replace(/^(account:)/,""))}return[]}async isAccountMember(t){try{const r=await this.getOpenFgaClient();const{allowed:n}=await r.check({user:`user:${this.userSub}`,relation:"member",object:`account:${t}`});if(!n){return false}return n}catch(r){this.logger.warn(`RBAC failed to check account membership. Error: ${r.message}`);return false}}async isZuploAdmin(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-admin"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo admin. Error: ${t.message}`);return false}}async isDeployerServiceAccount(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-deployer"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo deployer. Error: ${t.message}`);return false}}async createProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({writes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to create account-project association. Error: ${n.message}`)}}async deleteProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({deletes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to delete account-project association. Error: ${n.message}`)}}};fP.OpenFGAService=qRe});var gxt=y(mP=>{"use strict";var hxt=mP&&mP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(mP,"__esModule",{value:true});mP.TenantService=void 0;var Txn=hxt(Fm());var mxt=hxt(Jd());var xxn=SF();var Rxn=new Txn.default({max:500,maxAge:1e3*60*50});var URe=class extends xxn.ApiServiceClient{static{a(this,"TenantService")}constructor(t,r){if(!mxt.default.TENANT_API_URL){throw new Error("TENANT_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(mxt.default.TENANT_API_URL,Rxn,{userSub:n,logger:t.log,requestId:t.id})}};mP.TenantService=URe});var _xt=y(hP=>{"use strict";var yxt=hP&&hP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(hP,"__esModule",{value:true});hP.MeteringService=void 0;var Oxn=yxt(Fm());var $Re=yxt(Jd());var Pxn=SF();var Nxn=new Oxn.default({max:500,maxAge:1e3*60*50});var jRe=class extends Pxn.ApiServiceClient{static{a(this,"MeteringService")}constructor(t,r){if(!$Re.default.METERING_SERVICE_URL){throw new Error("METERING_SERVICE_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super($Re.default.METERING_SERVICE_URL,Nxn,{userSub:n,logger:t.log,requestId:t.id,targetAudience:$Re.default.METERING_SERVICE_URL})}};hP.MeteringService=jRe});var vxt=y(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:true});sg.validateHostname=sg.kebabCase=sg.snakeCase=sg.sizeInBytes=void 0;function Ixn(e){return new TextEncoder().encode(JSON.stringify(e)).length}a(Ixn,"sizeInBytes");sg.sizeInBytes=Ixn;function kxn(e){if(!e||e===null){return""}return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(t=>t.toLowerCase()).join("_")}a(kxn,"snakeCase");sg.snakeCase=kxn;function Dxn(e){if(!e||e===null){return""}const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(t===null){return""}return t.map(r=>r.toLowerCase()).join("-")}a(Dxn,"kebabCase");sg.kebabCase=Dxn;function Lxn(e){try{const t=/^(?!https?:\/\/)([a-zA-Z0-9.-]*|(\*))*\.[a-zA-Z]+$/;if(e&&!t.test(e)){return false}return true}catch(t){}return false}a(Lxn,"validateHostname");sg.validateHostname=Lxn});var Sxt=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:true});_e.Type=_e.JsonType=_e.JavaScriptTypeBuilder=_e.JsonTypeBuilder=_e.TypeBuilder=_e.TypeBuilderError=_e.TransformEncodeBuilder=_e.TransformDecodeBuilder=_e.TemplateLiteralDslParser=_e.TemplateLiteralGenerator=_e.TemplateLiteralGeneratorError=_e.TemplateLiteralFinite=_e.TemplateLiteralFiniteError=_e.TemplateLiteralParser=_e.TemplateLiteralParserError=_e.TemplateLiteralResolver=_e.TemplateLiteralPattern=_e.TemplateLiteralPatternError=_e.UnionResolver=_e.KeyArrayResolver=_e.KeyArrayResolverError=_e.KeyResolver=_e.ObjectMap=_e.Intrinsic=_e.IndexedAccessor=_e.TypeClone=_e.TypeExtends=_e.TypeExtendsResult=_e.TypeExtendsError=_e.ExtendsUndefined=_e.TypeGuard=_e.TypeGuardUnknownTypeError=_e.ValueGuard=_e.FormatRegistry=_e.TypeBoxError=_e.TypeRegistry=_e.PatternStringExact=_e.PatternNumberExact=_e.PatternBooleanExact=_e.PatternString=_e.PatternNumber=_e.PatternBoolean=_e.Kind=_e.Hint=_e.Optional=_e.Readonly=_e.Transform=void 0;_e.Transform=Symbol.for("TypeBox.Transform");_e.Readonly=Symbol.for("TypeBox.Readonly");_e.Optional=Symbol.for("TypeBox.Optional");_e.Hint=Symbol.for("TypeBox.Hint");_e.Kind=Symbol.for("TypeBox.Kind");_e.PatternBoolean="(true|false)";_e.PatternNumber="(0|[1-9][0-9]*)";_e.PatternString="(.*)";_e.PatternBooleanExact=`^${_e.PatternBoolean}$`;_e.PatternNumberExact=`^${_e.PatternNumber}$`;_e.PatternStringExact=`^${_e.PatternString}$`;var GRe;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})(GRe||(_e.TypeRegistry=GRe={}));var hh=class extends Error{static{a(this,"TypeBoxError")}constructor(t){super(t)}};_e.TypeBoxError=hh;var Ext;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})(Ext||(_e.FormatRegistry=Ext={}));var Jt;(function(e){function t(c){return Array.isArray(c)}a(t,"IsArray");e.IsArray=t;function r(c){return typeof c==="bigint"}a(r,"IsBigInt");e.IsBigInt=r;function n(c){return typeof c==="boolean"}a(n,"IsBoolean");e.IsBoolean=n;function i(c){return c===null}a(i,"IsNull");e.IsNull=i;function s(c){return typeof c==="number"}a(s,"IsNumber");e.IsNumber=s;function o(c){return typeof c==="object"&&c!==null}a(o,"IsObject");e.IsObject=o;function u(c){return typeof c==="string"}a(u,"IsString");e.IsString=u;function l(c){return c===void 0}a(l,"IsUndefined");e.IsUndefined=l})(Jt||(_e.ValueGuard=Jt={}));var HRe=class extends hh{static{a(this,"TypeGuardUnknownTypeError")}};_e.TypeGuardUnknownTypeError=HRe;var Ee;(function(e){function t(L){try{new RegExp(L);return true}catch{return false}}a(t,"IsPattern");function r(L){if(!Jt.IsString(L))return false;for(let Se=0;Se<L.length;Se++){const Le=L.charCodeAt(Se);if(Le>=7&&Le<=13||Le===27||Le===127){return false}}return true}a(r,"IsControlCharacterFree");function n(L){return o(L)||se(L)}a(n,"IsAdditionalProperties");function i(L){return Jt.IsUndefined(L)||Jt.IsBigInt(L)}a(i,"IsOptionalBigInt");function s(L){return Jt.IsUndefined(L)||Jt.IsNumber(L)}a(s,"IsOptionalNumber");function o(L){return Jt.IsUndefined(L)||Jt.IsBoolean(L)}a(o,"IsOptionalBoolean");function u(L){return Jt.IsUndefined(L)||Jt.IsString(L)}a(u,"IsOptionalString");function l(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)&&t(L)}a(l,"IsOptionalPattern");function c(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)}a(c,"IsOptionalFormat");function d(L){return Jt.IsUndefined(L)||se(L)}a(d,"IsOptionalSchema");function p(L){return C(L,"Any")&&u(L.$id)}a(p,"TAny");e.TAny=p;function f(L){return C(L,"Array")&&L.type==="array"&&u(L.$id)&&se(L.items)&&s(L.minItems)&&s(L.maxItems)&&o(L.uniqueItems)&&d(L.contains)&&s(L.minContains)&&s(L.maxContains)}a(f,"TArray");e.TArray=f;function m(L){return C(L,"AsyncIterator")&&L.type==="AsyncIterator"&&u(L.$id)&&se(L.items)}a(m,"TAsyncIterator");e.TAsyncIterator=m;function h(L){return C(L,"BigInt")&&L.type==="bigint"&&u(L.$id)&&i(L.exclusiveMaximum)&&i(L.exclusiveMinimum)&&i(L.maximum)&&i(L.minimum)&&i(L.multipleOf)}a(h,"TBigInt");e.TBigInt=h;function g(L){return C(L,"Boolean")&&L.type==="boolean"&&u(L.$id)}a(g,"TBoolean");e.TBoolean=g;function _(L){return C(L,"Constructor")&&L.type==="constructor"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(_,"TConstructor");e.TConstructor=_;function v(L){return C(L,"Date")&&L.type==="Date"&&u(L.$id)&&s(L.exclusiveMaximumTimestamp)&&s(L.exclusiveMinimumTimestamp)&&s(L.maximumTimestamp)&&s(L.minimumTimestamp)&&s(L.multipleOfTimestamp)}a(v,"TDate");e.TDate=v;function S(L){return C(L,"Function")&&L.type==="function"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(S,"TFunction");e.TFunction=S;function E(L){return C(L,"Integer")&&L.type==="integer"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(E,"TInteger");e.TInteger=E;function b(L){return C(L,"Intersect")&&(Jt.IsString(L.type)&&L.type!=="object"?false:true)&&Jt.IsArray(L.allOf)&&L.allOf.every(Se=>se(Se)&&!De(Se))&&u(L.type)&&(o(L.unevaluatedProperties)||d(L.unevaluatedProperties))&&u(L.$id)}a(b,"TIntersect");e.TIntersect=b;function A(L){return C(L,"Iterator")&&L.type==="Iterator"&&u(L.$id)&&se(L.items)}a(A,"TIterator");e.TIterator=A;function C(L,Se){return T(L)&&L[_e.Kind]===Se}a(C,"TKindOf");e.TKindOf=C;function T(L){return Jt.IsObject(L)&&_e.Kind in L&&Jt.IsString(L[_e.Kind])}a(T,"TKind");e.TKind=T;function O(L){return I(L)&&Jt.IsString(L.const)}a(O,"TLiteralString");e.TLiteralString=O;function P(L){return I(L)&&Jt.IsNumber(L.const)}a(P,"TLiteralNumber");e.TLiteralNumber=P;function R(L){return I(L)&&Jt.IsBoolean(L.const)}a(R,"TLiteralBoolean");e.TLiteralBoolean=R;function I(L){return C(L,"Literal")&&u(L.$id)&&(Jt.IsBoolean(L.const)||Jt.IsNumber(L.const)||Jt.IsString(L.const))}a(I,"TLiteral");e.TLiteral=I;function D(L){return C(L,"Never")&&Jt.IsObject(L.not)&&Object.getOwnPropertyNames(L.not).length===0}a(D,"TNever");e.TNever=D;function U(L){return C(L,"Not")&&se(L.not)}a(U,"TNot");e.TNot=U;function te(L){return C(L,"Null")&&L.type==="null"&&u(L.$id)}a(te,"TNull");e.TNull=te;function ve(L){return C(L,"Number")&&L.type==="number"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(ve,"TNumber");e.TNumber=ve;function me(L){return C(L,"Object")&&L.type==="object"&&u(L.$id)&&Jt.IsObject(L.properties)&&n(L.additionalProperties)&&s(L.minProperties)&&s(L.maxProperties)&&Object.entries(L.properties).every(([Se,Le])=>r(Se)&&se(Le))}a(me,"TObject");e.TObject=me;function he(L){return C(L,"Promise")&&L.type==="Promise"&&u(L.$id)&&se(L.item)}a(he,"TPromise");e.TPromise=he;function Fe(L){return C(L,"Record")&&L.type==="object"&&u(L.$id)&&n(L.additionalProperties)&&Jt.IsObject(L.patternProperties)&&(Se=>{const Le=Object.getOwnPropertyNames(Se.patternProperties);return Le.length===1&&t(Le[0])&&Jt.IsObject(Se.patternProperties)&&se(Se.patternProperties[Le[0]])})(L)}a(Fe,"TRecord");e.TRecord=Fe;function Oe(L){return Jt.IsObject(L)&&_e.Hint in L&&L[_e.Hint]==="Recursive"}a(Oe,"TRecursive");e.TRecursive=Oe;function M(L){return C(L,"Ref")&&u(L.$id)&&Jt.IsString(L.$ref)}a(M,"TRef");e.TRef=M;function Q(L){return C(L,"String")&&L.type==="string"&&u(L.$id)&&s(L.minLength)&&s(L.maxLength)&&l(L.pattern)&&c(L.format)}a(Q,"TString");e.TString=Q;function fe(L){return C(L,"Symbol")&&L.type==="symbol"&&u(L.$id)}a(fe,"TSymbol");e.TSymbol=fe;function B(L){return C(L,"TemplateLiteral")&&L.type==="string"&&Jt.IsString(L.pattern)&&L.pattern[0]==="^"&&L.pattern[L.pattern.length-1]==="$"}a(B,"TTemplateLiteral");e.TTemplateLiteral=B;function ye(L){return C(L,"This")&&u(L.$id)&&Jt.IsString(L.$ref)}a(ye,"TThis");e.TThis=ye;function De(L){return Jt.IsObject(L)&&_e.Transform in L}a(De,"TTransform");e.TTransform=De;function $e(L){return C(L,"Tuple")&&L.type==="array"&&u(L.$id)&&Jt.IsNumber(L.minItems)&&Jt.IsNumber(L.maxItems)&&L.minItems===L.maxItems&&(Jt.IsUndefined(L.items)&&Jt.IsUndefined(L.additionalItems)&&L.minItems===0||Jt.IsArray(L.items)&&L.items.every(Se=>se(Se)))}a($e,"TTuple");e.TTuple=$e;function gt(L){return C(L,"Undefined")&&L.type==="undefined"&&u(L.$id)}a(gt,"TUndefined");e.TUndefined=gt;function ut(L){return F(L)&&L.anyOf.every(Se=>O(Se)||P(Se))}a(ut,"TUnionLiteral");e.TUnionLiteral=ut;function F(L){return C(L,"Union")&&u(L.$id)&&Jt.IsObject(L)&&Jt.IsArray(L.anyOf)&&L.anyOf.every(Se=>se(Se))}a(F,"TUnion");e.TUnion=F;function G(L){return C(L,"Uint8Array")&&L.type==="Uint8Array"&&u(L.$id)&&s(L.minByteLength)&&s(L.maxByteLength)}a(G,"TUint8Array");e.TUint8Array=G;function $(L){return C(L,"Unknown")&&u(L.$id)}a($,"TUnknown");e.TUnknown=$;function W(L){return C(L,"Unsafe")}a(W,"TUnsafe");e.TUnsafe=W;function pe(L){return C(L,"Void")&&L.type==="void"&&u(L.$id)}a(pe,"TVoid");e.TVoid=pe;function H(L){return Jt.IsObject(L)&&L[_e.Readonly]==="Readonly"}a(H,"TReadonly");e.TReadonly=H;function de(L){return Jt.IsObject(L)&&L[_e.Optional]==="Optional"}a(de,"TOptional");e.TOptional=de;function se(L){return Jt.IsObject(L)&&(p(L)||f(L)||g(L)||h(L)||m(L)||_(L)||v(L)||S(L)||E(L)||b(L)||A(L)||I(L)||D(L)||U(L)||te(L)||ve(L)||me(L)||he(L)||Fe(L)||M(L)||Q(L)||fe(L)||B(L)||ye(L)||$e(L)||gt(L)||F(L)||G(L)||$(L)||W(L)||pe(L)||T(L)&&GRe.Has(L[_e.Kind]))}a(se,"TSchema");e.TSchema=se})(Ee||(_e.TypeGuard=Ee={}));var bxt;(function(e){function t(r){return r[_e.Kind]==="Intersect"?r.allOf.every(n=>t(n)):r[_e.Kind]==="Union"?r.anyOf.some(n=>t(n)):r[_e.Kind]==="Undefined"?true:r[_e.Kind]==="Not"?!t(r.not):false}a(t,"Check");e.Check=t})(bxt||(_e.ExtendsUndefined=bxt={}));var BJ=class extends hh{static{a(this,"TypeExtendsError")}};_e.TypeExtendsError=BJ;var at;(function(e){e[e["Union"]=0]="Union";e[e["True"]=1]="True";e[e["False"]=2]="False"})(at||(_e.TypeExtendsResult=at={}));var sC;(function(e){function t(N){return N===at.False?N:at.True}a(t,"IntoBooleanResult");function r(N){throw new BJ(N)}a(r,"Throw");function n(N){return Ee.TNever(N)||Ee.TIntersect(N)||Ee.TUnion(N)||Ee.TUnknown(N)||Ee.TAny(N)}a(n,"IsStructuralRight");function i(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):r("StructuralRight")}a(i,"StructuralRight");function s(N,k){return at.True}a(s,"TAnyRight");function o(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)&&k.anyOf.some(Ae=>Ee.TAny(Ae)||Ee.TUnknown(Ae))?at.True:Ee.TUnion(k)?at.Union:Ee.TUnknown(k)?at.True:Ee.TAny(k)?at.True:at.Union}a(o,"TAny");function u(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)?at.True:at.False}a(u,"TArrayRight");function l(N,k){return Ee.TObject(k)&&B(k)?at.True:n(k)?i(N,k):!Ee.TArray(k)?at.False:t(J(N.items,k.items))}a(l,"TArray");function c(N,k){return n(k)?i(N,k):!Ee.TAsyncIterator(k)?at.False:t(J(N.items,k.items))}a(c,"TAsyncIterator");function d(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBigInt(k)?at.True:at.False}a(d,"TBigInt");function p(N,k){return Ee.TLiteral(N)&&Jt.IsBoolean(N.const)?at.True:Ee.TBoolean(N)?at.True:at.False}a(p,"TBooleanRight");function f(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBoolean(k)?at.True:at.False}a(f,"TBoolean");function m(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TConstructor(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(m,"TConstructor");function h(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TDate(k)?at.True:at.False}a(h,"TDate");function g(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TFunction(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(g,"TFunction");function _(N,k){return Ee.TLiteral(N)&&Jt.IsNumber(N.const)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(_,"TIntegerRight");function v(N,k){return Ee.TInteger(k)||Ee.TNumber(k)?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):at.False}a(v,"TInteger");function S(N,k){return k.allOf.every(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(S,"TIntersectRight");function E(N,k){return N.allOf.some(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(E,"TIntersect");function b(N,k){return n(k)?i(N,k):!Ee.TIterator(k)?at.False:t(J(N.items,k.items))}a(b,"TIterator");function A(N,k){return Ee.TLiteral(k)&&k.const===N.const?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):at.False}a(A,"TLiteral");function C(N,k){return at.False}a(C,"TNeverRight");function T(N,k){return at.True}a(T,"TNever");function O(N){let[k,Ae]=[N,0];while(true){if(!Ee.TNot(k))break;k=k.not;Ae+=1}return Ae%2===0?k:_e.Type.Unknown()}a(O,"UnwrapTNot");function P(N,k){return Ee.TNot(N)?J(O(N),k):Ee.TNot(k)?J(N,O(k)):r("Invalid fallthrough for Not")}a(P,"TNot");function R(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TNull(k)?at.True:at.False}a(R,"TNull");function I(N,k){return Ee.TLiteralNumber(N)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(I,"TNumberRight");function D(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TInteger(k)||Ee.TNumber(k)?at.True:at.False}a(D,"TNumber");function U(N,k){return Object.getOwnPropertyNames(N.properties).length===k}a(U,"IsObjectPropertyCount");function te(N){return B(N)}a(te,"IsObjectStringLike");function ve(N){return U(N,0)||U(N,1)&&"description"in N.properties&&Ee.TUnion(N.properties.description)&&N.properties.description.anyOf.length===2&&(Ee.TString(N.properties.description.anyOf[0])&&Ee.TUndefined(N.properties.description.anyOf[1])||Ee.TString(N.properties.description.anyOf[1])&&Ee.TUndefined(N.properties.description.anyOf[0]))}a(ve,"IsObjectSymbolLike");function me(N){return U(N,0)}a(me,"IsObjectNumberLike");function he(N){return U(N,0)}a(he,"IsObjectBooleanLike");function Fe(N){return U(N,0)}a(Fe,"IsObjectBigIntLike");function Oe(N){return U(N,0)}a(Oe,"IsObjectDateLike");function M(N){return B(N)}a(M,"IsObjectUint8ArrayLike");function Q(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(Q,"IsObjectFunctionLike");function fe(N){return U(N,0)}a(fe,"IsObjectConstructorLike");function B(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(B,"IsObjectArrayLike");function ye(N){const k=_e.Type.Function([_e.Type.Any()],_e.Type.Any());return U(N,0)||U(N,1)&&"then"in N.properties&&t(J(N.properties["then"],k))===at.True}a(ye,"IsObjectPromiseLike");function De(N,k){return J(N,k)===at.False?at.False:Ee.TOptional(N)&&!Ee.TOptional(k)?at.False:at.True}a(De,"Property");function $e(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)||Ee.TLiteralString(N)&&te(k)||Ee.TLiteralNumber(N)&&me(k)||Ee.TLiteralBoolean(N)&&he(k)||Ee.TSymbol(N)&&ve(k)||Ee.TBigInt(N)&&Fe(k)||Ee.TString(N)&&te(k)||Ee.TSymbol(N)&&ve(k)||Ee.TNumber(N)&&me(k)||Ee.TInteger(N)&&me(k)||Ee.TBoolean(N)&&he(k)||Ee.TUint8Array(N)&&M(k)||Ee.TDate(N)&&Oe(k)||Ee.TConstructor(N)&&fe(k)||Ee.TFunction(N)&&Q(k)?at.True:Ee.TRecord(N)&&Ee.TString(F(N))?(()=>{return k[_e.Hint]==="Record"?at.True:at.False})():Ee.TRecord(N)&&Ee.TNumber(F(N))?(()=>{return U(k,0)?at.True:at.False})():at.False}a($e,"TObjectRight");function gt(N,k){return n(k)?i(N,k):Ee.TRecord(k)?$(N,k):!Ee.TObject(k)?at.False:(()=>{for(const Ae of Object.getOwnPropertyNames(k.properties)){if(!(Ae in N.properties))return at.False;if(De(N.properties[Ae],k.properties[Ae])===at.False){return at.False}}return at.True})()}a(gt,"TObject");function ut(N,k){return n(k)?i(N,k):Ee.TObject(k)&&ye(k)?at.True:!Ee.TPromise(k)?at.False:t(J(N.item,k.item))}a(ut,"TPromise");function F(N){return _e.PatternNumberExact in N.patternProperties?_e.Type.Number():_e.PatternStringExact in N.patternProperties?_e.Type.String():r("Unknown record key pattern")}a(F,"RecordKey");function G(N){return _e.PatternNumberExact in N.patternProperties?N.patternProperties[_e.PatternNumberExact]:_e.PatternStringExact in N.patternProperties?N.patternProperties[_e.PatternStringExact]:r("Unable to get record value schema")}a(G,"RecordValue");function $(N,k){const[Ae,Be]=[F(k),G(k)];return Ee.TLiteralString(N)&&Ee.TNumber(Ae)&&t(J(N,Be))===at.True?at.True:Ee.TUint8Array(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TString(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TArray(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TObject(N)?(()=>{for(const et of Object.getOwnPropertyNames(N.properties)){if(De(Be,N.properties[et])===at.False){return at.False}}return at.True})():at.False}a($,"TRecordRight");function W(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TRecord(k)?at.False:J(G(N),G(k))}a(W,"TRecord");function pe(N,k){return Ee.TLiteral(N)&&Jt.IsString(N.const)?at.True:Ee.TString(N)?at.True:at.False}a(pe,"TStringRight");function H(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?at.True:at.False}a(H,"TString");function de(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TSymbol(k)?at.True:at.False}a(de,"TSymbol");function se(N,k){return Ee.TTemplateLiteral(N)?J(xy.Resolve(N),k):Ee.TTemplateLiteral(k)?J(N,xy.Resolve(k)):r("Invalid fallthrough for TemplateLiteral")}a(se,"TTemplateLiteral");function L(N,k){return Ee.TArray(k)&&N.items!==void 0&&N.items.every(Ae=>J(Ae,k.items)===at.True)}a(L,"IsArrayOfTuple");function Se(N,k){return Ee.TNever(N)?at.True:Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:at.False}a(Se,"TTupleRight");function Le(N,k){return n(k)?i(N,k):Ee.TObject(k)&&B(k)?at.True:Ee.TArray(k)&&L(N,k)?at.True:!Ee.TTuple(k)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)||!Jt.IsUndefined(N.items)&&Jt.IsUndefined(k.items)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)?at.True:N.items.every((Ae,Be)=>J(Ae,k.items[Be])===at.True)?at.True:at.False}a(Le,"TTuple");function Ke(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TUint8Array(k)?at.True:at.False}a(Ke,"TUint8Array");function St(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TVoid(k)?j(N,k):Ee.TUndefined(k)?at.True:at.False}a(St,"TUndefined");function Mt(N,k){return k.anyOf.some(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(Mt,"TUnionRight");function _r(N,k){return N.anyOf.every(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(_r,"TUnion");function Ur(N,k){return at.True}a(Ur,"TUnknownRight");function Ve(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TAny(k)?s(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):Ee.TArray(k)?u(N,k):Ee.TTuple(k)?Se(N,k):Ee.TObject(k)?$e(N,k):Ee.TUnknown(k)?at.True:at.False}a(Ve,"TUnknown");function j(N,k){return Ee.TUndefined(N)?at.True:Ee.TUndefined(N)?at.True:at.False}a(j,"VoidRight");function q(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):Ee.TObject(k)?$e(N,k):Ee.TVoid(k)?at.True:at.False}a(q,"TVoid");function J(N,k){return Ee.TTemplateLiteral(N)||Ee.TTemplateLiteral(k)?se(N,k):Ee.TNot(N)||Ee.TNot(k)?P(N,k):Ee.TAny(N)?o(N,k):Ee.TArray(N)?l(N,k):Ee.TBigInt(N)?d(N,k):Ee.TBoolean(N)?f(N,k):Ee.TAsyncIterator(N)?c(N,k):Ee.TConstructor(N)?m(N,k):Ee.TDate(N)?h(N,k):Ee.TFunction(N)?g(N,k):Ee.TInteger(N)?v(N,k):Ee.TIntersect(N)?E(N,k):Ee.TIterator(N)?b(N,k):Ee.TLiteral(N)?A(N,k):Ee.TNever(N)?T(N,k):Ee.TNull(N)?R(N,k):Ee.TNumber(N)?D(N,k):Ee.TObject(N)?gt(N,k):Ee.TRecord(N)?W(N,k):Ee.TString(N)?H(N,k):Ee.TSymbol(N)?de(N,k):Ee.TTuple(N)?Le(N,k):Ee.TPromise(N)?ut(N,k):Ee.TUint8Array(N)?Ke(N,k):Ee.TUndefined(N)?St(N,k):Ee.TUnion(N)?_r(N,k):Ee.TUnknown(N)?Ve(N,k):Ee.TVoid(N)?q(N,k):r(`Unknown left type operand '${N[_e.Kind]}'`)}a(J,"Visit");function ae(N,k){return J(N,k)}a(ae,"Extends");e.Extends=ae})(sC||(_e.TypeExtends=sC={}));var Rr;(function(e){function t(o){const u=Object.getOwnPropertyNames(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});const l=Object.getOwnPropertySymbols(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});return{...u,...l}}a(t,"ObjectType");function r(o){return o.map(u=>n(u))}a(r,"ArrayType");function n(o){return Jt.IsArray(o)?r(o):Jt.IsObject(o)?t(o):o}a(n,"Visit");function i(o){return o.map(u=>s(u))}a(i,"Rest");e.Rest=i;function s(o,u={}){return{...n(o),...u}}a(s,"Type");e.Type=s})(Rr||(_e.TypeClone=Rr={}));var VRe;(function(e){function t(m){return m.map(h=>{const{[_e.Optional]:g,..._}=Rr.Type(h);return _})}a(t,"OptionalUnwrap");function r(m){return m.every(h=>Ee.TOptional(h))}a(r,"IsIntersectOptional");function n(m){return m.some(h=>Ee.TOptional(h))}a(n,"IsUnionOptional");function i(m){return r(m.allOf)?_e.Type.Optional(_e.Type.Intersect(t(m.allOf))):m}a(i,"ResolveIntersect");function s(m){return n(m.anyOf)?_e.Type.Optional(_e.Type.Union(t(m.anyOf))):m}a(s,"ResolveUnion");function o(m){return m[_e.Kind]==="Intersect"?i(m):m[_e.Kind]==="Union"?s(m):m}a(o,"ResolveOptional");function u(m,h){const g=m.allOf.reduce((_,v)=>{const S=p(v,h);return S[_e.Kind]==="Never"?_:[..._,S]},[]);return o(_e.Type.Intersect(g))}a(u,"TIntersect");function l(m,h){const g=m.anyOf.map(_=>p(_,h));return o(_e.Type.Union(g))}a(l,"TUnion");function c(m,h){const g=m.properties[h];return Jt.IsUndefined(g)?_e.Type.Never():_e.Type.Union([g])}a(c,"TObject");function d(m,h){const g=m.items;if(Jt.IsUndefined(g))return _e.Type.Never();const _=g[h];if(Jt.IsUndefined(_))return _e.Type.Never();return _}a(d,"TTuple");function p(m,h){return m[_e.Kind]==="Intersect"?u(m,h):m[_e.Kind]==="Union"?l(m,h):m[_e.Kind]==="Object"?c(m,h):m[_e.Kind]==="Tuple"?d(m,h):_e.Type.Never()}a(p,"Visit");function f(m,h,g={}){const _=h.map(v=>p(m,v.toString()));return o(_e.Type.Union(_,g))}a(f,"Resolve");e.Resolve=f})(VRe||(_e.IndexedAccessor=VRe={}));var gP;(function(e){function t(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toLowerCase()}${f}`}a(t,"Uncapitalize");function r(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toUpperCase()}${f}`}a(r,"Capitalize");function n(d){return d.toUpperCase()}a(n,"Uppercase");function i(d){return d.toLowerCase()}a(i,"Lowercase");function s(d,p){const f=_P.ParseExact(d.pattern);const m=vP.Check(f);if(!m)return{...d,pattern:o(d.pattern,p)};const h=[...EP.Generate(f)];const g=h.map(S=>_e.Type.Literal(S));const _=u(g,p);const v=_e.Type.Union(_);return _e.Type.TemplateLiteral([v])}a(s,"IntrinsicTemplateLiteral");function o(d,p){return typeof d==="string"?p==="Uncapitalize"?t(d):p==="Capitalize"?r(d):p==="Uppercase"?n(d):p==="Lowercase"?i(d):d:d.toString()}a(o,"IntrinsicLiteral");function u(d,p){if(d.length===0)return[];const[f,...m]=d;return[c(f,p),...u(m,p)]}a(u,"IntrinsicRest");function l(d,p){return Ee.TTemplateLiteral(d)?s(d,p):Ee.TUnion(d)?_e.Type.Union(u(d.anyOf,p)):Ee.TLiteral(d)?_e.Type.Literal(o(d.const,p)):d}a(l,"Visit");function c(d,p){return l(d,p)}a(c,"Map");e.Map=c})(gP||(_e.Intrinsic=gP={}));var yP;(function(e){function t(o,u){return _e.Type.Intersect(o.allOf.map(l=>i(l,u)),{...o})}a(t,"TIntersect");function r(o,u){return _e.Type.Union(o.anyOf.map(l=>i(l,u)),{...o})}a(r,"TUnion");function n(o,u){return u(o)}a(n,"TObject");function i(o,u){return o[_e.Kind]==="Intersect"?t(o,u):o[_e.Kind]==="Union"?r(o,u):o[_e.Kind]==="Object"?n(o,u):o}a(i,"Visit");function s(o,u,l){return{...i(Rr.Type(o),u),...l}}a(s,"Map");e.Map=s})(yP||(_e.ObjectMap=yP={}));var MJ;(function(e){function t(c){return c[0]==="^"&&c[c.length-1]==="$"?c.slice(1,c.length-1):c}a(t,"UnwrapPattern");function r(c,d){return c.allOf.reduce((p,f)=>[...p,...o(f,d)],[])}a(r,"TIntersect");function n(c,d){const p=c.anyOf.map(f=>o(f,d));return[...p.reduce((f,m)=>m.map(h=>p.every(g=>g.includes(h))?f.add(h):f)[0],new Set)]}a(n,"TUnion");function i(c,d){return Object.getOwnPropertyNames(c.properties)}a(i,"TObject");function s(c,d){return d.includePatterns?Object.getOwnPropertyNames(c.patternProperties):[]}a(s,"TRecord");function o(c,d){return Ee.TIntersect(c)?r(c,d):Ee.TUnion(c)?n(c,d):Ee.TObject(c)?i(c,d):Ee.TRecord(c)?s(c,d):[]}a(o,"Visit");function u(c,d){return[...new Set(o(c,d))]}a(u,"ResolveKeys");e.ResolveKeys=u;function l(c){const d=u(c,{includePatterns:true});const p=d.map(f=>`(${t(f)})`);return`^(${p.join("|")})$`}a(l,"ResolvePattern");e.ResolvePattern=l})(MJ||(_e.KeyResolver=MJ={}));var qJ=class extends hh{static{a(this,"KeyArrayResolverError")}};_e.KeyArrayResolverError=qJ;var BF;(function(e){function t(r){return Array.isArray(r)?r:Ee.TUnionLiteral(r)?r.anyOf.map(n=>n.const.toString()):Ee.TLiteral(r)?[r.const]:Ee.TTemplateLiteral(r)?(()=>{const n=_P.ParseExact(r.pattern);if(!vP.Check(n))throw new qJ("Cannot resolve keys from infinite template expression");return[...EP.Generate(n)]})():[]}a(t,"Resolve");e.Resolve=t})(BF||(_e.KeyArrayResolver=BF={}));var zRe;(function(e){function*t(n){for(const i of n.anyOf){if(i[_e.Kind]==="Union"){yield*t(i)}else{yield i}}}a(t,"TUnion");function r(n){return _e.Type.Union([...t(n)],{...n})}a(r,"Resolve");e.Resolve=r})(zRe||(_e.UnionResolver=zRe={}));var UJ=class extends hh{static{a(this,"TemplateLiteralPatternError")}};_e.TemplateLiteralPatternError=UJ;var $J;(function(e){function t(s){throw new UJ(s)}a(t,"Throw");function r(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(r,"Escape");function n(s,o){return Ee.TTemplateLiteral(s)?s.pattern.slice(1,s.pattern.length-1):Ee.TUnion(s)?`(${s.anyOf.map(u=>n(u,o)).join("|")})`:Ee.TNumber(s)?`${o}${_e.PatternNumber}`:Ee.TInteger(s)?`${o}${_e.PatternNumber}`:Ee.TBigInt(s)?`${o}${_e.PatternNumber}`:Ee.TString(s)?`${o}${_e.PatternString}`:Ee.TLiteral(s)?`${o}${r(s.const.toString())}`:Ee.TBoolean(s)?`${o}${_e.PatternBoolean}`:t(`Unexpected Kind '${s[_e.Kind]}'`)}a(n,"Visit");function i(s){return`^${s.map(o=>n(o,"")).join("")}$`}a(i,"Create");e.Create=i})($J||(_e.TemplateLiteralPattern=$J={}));var xy;(function(e){function t(r){const n=_P.ParseExact(r.pattern);if(!vP.Check(n))return _e.Type.String();const i=[...EP.Generate(n)].map(s=>_e.Type.Literal(s));return _e.Type.Union(i)}a(t,"Resolve");e.Resolve=t})(xy||(_e.TemplateLiteralResolver=xy={}));var MF=class extends hh{static{a(this,"TemplateLiteralParserError")}};_e.TemplateLiteralParserError=MF;var _P;(function(e){function t(m,h,g){return m[h]===g&&m.charCodeAt(h-1)!==92}a(t,"IsNonEscaped");function r(m,h){return t(m,h,"(")}a(r,"IsOpenParen");function n(m,h){return t(m,h,")")}a(n,"IsCloseParen");function i(m,h){return t(m,h,"|")}a(i,"IsSeparator");function s(m){if(!(r(m,0)&&n(m,m.length-1)))return false;let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(h===0&&g!==m.length-1)return false}return true}a(s,"IsGroup");function o(m){return m.slice(1,m.length-1)}a(o,"InGroup");function u(m){let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(i(m,g)&&h===0)return true}return false}a(u,"IsPrecedenceOr");function l(m){for(let h=0;h<m.length;h++){if(r(m,h))return true}return false}a(l,"IsPrecedenceAnd");function c(m){let[h,g]=[0,0];const _=[];for(let S=0;S<m.length;S++){if(r(m,S))h+=1;if(n(m,S))h-=1;if(i(m,S)&&h===0){const E=m.slice(g,S);if(E.length>0)_.push(p(E));g=S+1}}const v=m.slice(g);if(v.length>0)_.push(p(v));if(_.length===0)return{type:"const",const:""};if(_.length===1)return _[0];return{type:"or",expr:_}}a(c,"Or");function d(m){function h(v,S){if(!r(v,S))throw new MF(`TemplateLiteralParser: Index must point to open parens`);let E=0;for(let b=S;b<v.length;b++){if(r(v,b))E+=1;if(n(v,b))E-=1;if(E===0)return[S,b]}throw new MF(`TemplateLiteralParser: Unclosed group parens in expression`)}a(h,"Group");function g(v,S){for(let E=S;E<v.length;E++){if(r(v,E))return[S,E]}return[S,v.length]}a(g,"Range");const _=[];for(let v=0;v<m.length;v++){if(r(m,v)){const[S,E]=h(m,v);const b=m.slice(S,E+1);_.push(p(b));v=E}else{const[S,E]=g(m,v);const b=m.slice(S,E);if(b.length>0)_.push(p(b));v=E-1}}return _.length===0?{type:"const",const:""}:_.length===1?_[0]:{type:"and",expr:_}}a(d,"And");function p(m){return s(m)?p(o(m)):u(m)?c(m):l(m)?d(m):{type:"const",const:m}}a(p,"Parse");e.Parse=p;function f(m){return p(m.slice(1,m.length-1))}a(f,"ParseExact");e.ParseExact=f})(_P||(_e.TemplateLiteralParser=_P={}));var jJ=class extends hh{static{a(this,"TemplateLiteralFiniteError")}};_e.TemplateLiteralFiniteError=jJ;var vP;(function(e){function t(o){throw new jJ(o)}a(t,"Throw");function r(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="0"&&o.expr[1].type==="const"&&o.expr[1].const==="[1-9][0-9]*"}a(r,"IsNumber");function n(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="true"&&o.expr[1].type==="const"&&o.expr[1].const==="false"}a(n,"IsBoolean");function i(o){return o.type==="const"&&o.const===".*"}a(i,"IsString");function s(o){return n(o)?true:r(o)||i(o)?false:o.type==="and"?o.expr.every(u=>s(u)):o.type==="or"?o.expr.every(u=>s(u)):o.type==="const"?true:t(`Unknown expression type`)}a(s,"Check");e.Check=s})(vP||(_e.TemplateLiteralFinite=vP={}));var GJ=class extends hh{static{a(this,"TemplateLiteralGeneratorError")}};_e.TemplateLiteralGeneratorError=GJ;var EP;(function(e){function*t(o){if(o.length===1)return yield*o[0];for(const u of o[0]){for(const l of t(o.slice(1))){yield`${u}${l}`}}}a(t,"Reduce");function*r(o){return yield*t(o.expr.map(u=>[...s(u)]))}a(r,"And");function*n(o){for(const u of o.expr)yield*s(u)}a(n,"Or");function*i(o){return yield o.const}a(i,"Const");function*s(o){return o.type==="and"?yield*r(o):o.type==="or"?yield*n(o):o.type==="const"?yield*i(o):(()=>{throw new GJ("Unknown expression")})()}a(s,"Generate");e.Generate=s})(EP||(_e.TemplateLiteralGenerator=EP={}));var KRe;(function(e){function*t(s){const o=s.trim().replace(/"|'/g,"");return o==="boolean"?yield _e.Type.Boolean():o==="number"?yield _e.Type.Number():o==="bigint"?yield _e.Type.BigInt():o==="string"?yield _e.Type.String():yield(()=>{const u=o.split("|").map(l=>_e.Type.Literal(l.trim()));return u.length===0?_e.Type.Never():u.length===1?u[0]:_e.Type.Union(u)})()}a(t,"ParseUnion");function*r(s){if(s[1]!=="{"){const o=_e.Type.Literal("$");const u=n(s.slice(1));return yield*[o,...u]}for(let o=2;o<s.length;o++){if(s[o]==="}"){const u=t(s.slice(2,o));const l=n(s.slice(o+1));return yield*[...u,...l]}}yield _e.Type.Literal(s)}a(r,"ParseTerminal");function*n(s){for(let o=0;o<s.length;o++){if(s[o]==="$"){const u=_e.Type.Literal(s.slice(0,o));const l=r(s.slice(o));return yield*[u,...l]}}yield _e.Type.Literal(s)}a(n,"ParseLiteral");function i(s){return[...n(s)]}a(i,"Parse");e.Parse=i})(KRe||(_e.TemplateLiteralDslParser=KRe={}));var HJ=class{static{a(this,"TransformDecodeBuilder")}constructor(t){this.schema=t}Decode(t){return new VJ(this.schema,t)}};_e.TransformDecodeBuilder=HJ;var VJ=class{static{a(this,"TransformEncodeBuilder")}constructor(t,r){this.schema=t;this.decode=r}Encode(t){const r=Rr.Type(this.schema);return Ee.TTransform(r)?(()=>{const n=a(o=>r[_e.Transform].Encode(t(o)),"Encode");const i=a(o=>this.decode(r[_e.Transform].Decode(o)),"Decode");const s={Encode:n,Decode:i};return{...r,[_e.Transform]:s}})():(()=>{const n={Decode:this.decode,Encode:t};return{...r,[_e.Transform]:n}})()}};_e.TransformEncodeBuilder=VJ;var Fxn=0;var zJ=class extends hh{static{a(this,"TypeBuilderError")}};_e.TypeBuilderError=zJ;var KJ=class{static{a(this,"TypeBuilder")}Create(t){return t}Throw(t){throw new zJ(t)}Discard(t,r){const{[r]:n,...i}=t;return i}Strict(t){return JSON.parse(JSON.stringify(t))}};_e.TypeBuilder=KJ;var qF=class extends KJ{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(t){return this.Readonly(this.Optional(t))}Readonly(t){return{...Rr.Type(t),[_e.Readonly]:"Readonly"}}Optional(t){return{...Rr.Type(t),[_e.Optional]:"Optional"}}Any(t={}){return this.Create({...t,[_e.Kind]:"Any"})}Array(t,r={}){return this.Create({...r,[_e.Kind]:"Array",type:"array",items:Rr.Type(t)})}Boolean(t={}){return this.Create({...t,[_e.Kind]:"Boolean",type:"boolean"})}Capitalize(t,r={}){return{...gP.Map(Rr.Type(t),"Capitalize"),...r}}Composite(t,r){const n=_e.Type.Intersect(t,{});const i=MJ.ResolveKeys(n,{includePatterns:false});const s=i.reduce((o,u)=>({...o,[u]:_e.Type.Index(n,[u])}),{});return _e.Type.Object(s,r)}Enum(t,r={}){const n=Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]);const i=n.map(s=>Jt.IsString(s)?{[_e.Kind]:"Literal",type:"string",const:s}:{[_e.Kind]:"Literal",type:"number",const:s});return this.Create({...r,[_e.Kind]:"Union",anyOf:i})}Extends(t,r,n,i,s={}){switch(sC.Extends(t,r)){case at.Union:return this.Union([Rr.Type(n,s),Rr.Type(i,s)]);case at.True:return Rr.Type(n,s);case at.False:return Rr.Type(i,s)}}Exclude(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Exclude(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Exclude(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)===at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?this.Never(n):Rr.Type(t,n)}Extract(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Extract(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Extract(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)!==at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?Rr.Type(t,n):this.Never(n)}Index(t,r,n={}){return Ee.TArray(t)&&Ee.TNumber(r)?(()=>{return Rr.Type(t.items,n)})():Ee.TTuple(t)&&Ee.TNumber(r)?(()=>{const i=Jt.IsUndefined(t.items)?[]:t.items;const s=i.map(o=>Rr.Type(o));return this.Union(s,n)})():(()=>{const i=BF.Resolve(r);const s=Rr.Type(t);return VRe.Resolve(s,i,n)})()}Integer(t={}){return this.Create({...t,[_e.Kind]:"Integer",type:"integer"})}Intersect(t,r={}){if(t.length===0)return _e.Type.Never();if(t.length===1)return Rr.Type(t[0],r);if(t.some(o=>Ee.TTransform(o)))this.Throw("Cannot intersect transform types");const n=t.every(o=>Ee.TObject(o));const i=Rr.Rest(t);const s=Ee.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:Rr.Type(r.unevaluatedProperties)}:{};return r.unevaluatedProperties===false||Ee.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[_e.Kind]:"Intersect",type:"object",allOf:i}):this.Create({...r,...s,[_e.Kind]:"Intersect",allOf:i})}KeyOf(t,r={}){return Ee.TRecord(t)?(()=>{const n=Object.getOwnPropertyNames(t.patternProperties)[0];return n===_e.PatternNumberExact?this.Number(r):n===_e.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():Ee.TTuple(t)?(()=>{const n=Jt.IsUndefined(t.items)?[]:t.items;const i=n.map((s,o)=>_e.Type.Literal(o.toString()));return this.Union(i,r)})():Ee.TArray(t)?(()=>{return this.Number(r)})():(()=>{const n=MJ.ResolveKeys(t,{includePatterns:false});if(n.length===0)return this.Never(r);const i=n.map(s=>this.Literal(s));return this.Union(i,r)})()}Literal(t,r={}){return this.Create({...r,[_e.Kind]:"Literal",const:t,type:typeof t})}Lowercase(t,r={}){return{...gP.Map(Rr.Type(t),"Lowercase"),...r}}Never(t={}){return this.Create({...t,[_e.Kind]:"Never",not:{}})}Not(t,r){return this.Create({...r,[_e.Kind]:"Not",not:Rr.Type(t)})}Null(t={}){return this.Create({...t,[_e.Kind]:"Null",type:"null"})}Number(t={}){return this.Create({...t,[_e.Kind]:"Number",type:"number"})}Object(t,r={}){const n=Object.getOwnPropertyNames(t);const i=n.filter(l=>Ee.TOptional(t[l]));const s=n.filter(l=>!i.includes(l));const o=Ee.TSchema(r.additionalProperties)?{additionalProperties:Rr.Type(r.additionalProperties)}:{};const u=n.reduce((l,c)=>({...l,[c]:Rr.Type(t[c])}),{});return s.length>0?this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u,required:s}):this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u})}Omit(t,r,n={}){const i=BF.Resolve(r);return yP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>!i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Partial(t,r={}){return yP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Optional(n.properties[o])}},{});return this.Object(i,this.Discard(n,"required"))},r)}Pick(t,r,n={}){const i=BF.Resolve(r);return yP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(!i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Record(t,r,n={}){return Ee.TTemplateLiteral(t)?(()=>{const i=_P.ParseExact(t.pattern);return vP.Check(i)?this.Object([...EP.Generate(i)].reduce((s,o)=>({...s,[o]:Rr.Type(r)}),{}),n):this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[t.pattern]:Rr.Type(r)}})})():Ee.TUnion(t)?(()=>{const i=zRe.Resolve(t);if(Ee.TUnionLiteral(i)){const s=i.anyOf.reduce((o,u)=>({...o,[u.const]:Rr.Type(r)}),{});return this.Object(s,{...n,[_e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():Ee.TLiteral(t)?(()=>{return Jt.IsString(t.const)||Jt.IsNumber(t.const)?this.Object({[t.const]:Rr.Type(r)},n):this.Throw("Record key of type literal is not of type string or number")})():Ee.TInteger(t)||Ee.TNumber(t)?(()=>{return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[_e.PatternNumberExact]:Rr.Type(r)}})})():Ee.TString(t)?(()=>{const i=Jt.IsUndefined(t.pattern)?_e.PatternStringExact:t.pattern;return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[i]:Rr.Type(r)}})})():this.Never()}Recursive(t,r={}){if(Jt.IsUndefined(r.$id))r.$id=`T${Fxn++}`;const n=t({[_e.Kind]:"This",$ref:`${r.$id}`});n.$id=r.$id;return this.Create({...r,[_e.Hint]:"Recursive",...n})}Ref(t,r={}){if(Jt.IsString(t))return this.Create({...r,[_e.Kind]:"Ref",$ref:t});if(Jt.IsUndefined(t.$id))this.Throw("Reference target type must specify an $id");return this.Create({...r,[_e.Kind]:"Ref",$ref:t.$id})}Required(t,r={}){return yP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Discard(n.properties[o],_e.Optional)}},{});return this.Object(i,n)},r)}Rest(t){return Ee.TTuple(t)&&!Jt.IsUndefined(t.items)?Rr.Rest(t.items):Ee.TIntersect(t)?Rr.Rest(t.allOf):Ee.TUnion(t)?Rr.Rest(t.anyOf):[]}String(t={}){return this.Create({...t,[_e.Kind]:"String",type:"string"})}TemplateLiteral(t,r={}){const n=Jt.IsString(t)?$J.Create(KRe.Parse(t)):$J.Create(t);return this.Create({...r,[_e.Kind]:"TemplateLiteral",type:"string",pattern:n})}Transform(t){return new HJ(t)}Tuple(t,r={}){const[n,i,s]=[false,t.length,t.length];const o=Rr.Rest(t);const u=t.length>0?{...r,[_e.Kind]:"Tuple",type:"array",items:o,additionalItems:n,minItems:i,maxItems:s}:{...r,[_e.Kind]:"Tuple",type:"array",minItems:i,maxItems:s};return this.Create(u)}Uncapitalize(t,r={}){return{...gP.Map(Rr.Type(t),"Uncapitalize"),...r}}Union(t,r={}){return Ee.TTemplateLiteral(t)?xy.Resolve(t):(()=>{const n=t;if(n.length===0)return this.Never(r);if(n.length===1)return this.Create(Rr.Type(n[0],r));const i=Rr.Rest(n);return this.Create({...r,[_e.Kind]:"Union",anyOf:i})})()}Unknown(t={}){return this.Create({...t,[_e.Kind]:"Unknown"})}Unsafe(t={}){return this.Create({...t,[_e.Kind]:t[_e.Kind]||"Unsafe"})}Uppercase(t,r={}){return{...gP.Map(Rr.Type(t),"Uppercase"),...r}}};_e.JsonTypeBuilder=qF;var WJ=class extends qF{static{a(this,"JavaScriptTypeBuilder")}AsyncIterator(t,r={}){return this.Create({...r,[_e.Kind]:"AsyncIterator",type:"AsyncIterator",items:Rr.Type(t)})}Awaited(t,r={}){const n=a(i=>i.length>0?(()=>{const[s,...o]=i;return[this.Awaited(s),...n(o)]})():i,"Unwrap");return Ee.TIntersect(t)?_e.Type.Intersect(n(t.allOf)):Ee.TUnion(t)?_e.Type.Union(n(t.anyOf)):Ee.TPromise(t)?this.Awaited(t.item):Rr.Type(t,r)}BigInt(t={}){return this.Create({...t,[_e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(t,r={}){return this.Tuple([...t.parameters],{...r})}Constructor(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Constructor",type:"constructor",parameters:i,returns:s})}Date(t={}){return this.Create({...t,[_e.Kind]:"Date",type:"Date"})}Function(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Function",type:"function",parameters:i,returns:s})}InstanceType(t,r={}){return Rr.Type(t.returns,r)}Iterator(t,r={}){return this.Create({...r,[_e.Kind]:"Iterator",type:"Iterator",items:Rr.Type(t)})}Parameters(t,r={}){return this.Tuple(t.parameters,{...r})}Promise(t,r={}){return this.Create({...r,[_e.Kind]:"Promise",type:"Promise",item:Rr.Type(t)})}RegExp(t,r={}){const n=Jt.IsString(t)?t:t.source;return this.Create({...r,[_e.Kind]:"String",type:"string",pattern:n})}RegEx(t,r={}){return this.RegExp(t,r)}ReturnType(t,r={}){return Rr.Type(t.returns,r)}Symbol(t){return this.Create({...t,[_e.Kind]:"Symbol",type:"symbol"})}Undefined(t={}){return this.Create({...t,[_e.Kind]:"Undefined",type:"undefined"})}Uint8Array(t={}){return this.Create({...t,[_e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(t={}){return this.Create({...t,[_e.Kind]:"Void",type:"void"})}};_e.JavaScriptTypeBuilder=WJ;_e.JsonType=new qF;_e.Type=new WJ});var Axt=y(YJ=>{"use strict";Object.defineProperty(YJ,"__esModule",{value:true});YJ.CustomTypeBuilder=void 0;var UF=Sxt();var WRe=class extends UF.TypeBuilder{static{a(this,"CustomTypeBuilder")}static Date(){return UF.Type.Unsafe({type:"string",format:"date-time"})}static Nullable(t){return UF.Type.Union([t,UF.Type.Null()])}static StringEnum(t){return UF.Type.Unsafe({type:"string",enum:t})}};YJ.CustomTypeBuilder=WRe});var xxt=y(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:true});Tr.throwIfNotNumber=Tr.throwIfNotString=Tr.throwIfUndefinedOrNull=Tr.throwIfUndefined=Tr.ArgumentTypeError=Tr.ArgumentUndefinedError=Tr.ValidationError=Tr.withUndefinedAsNull=Tr.withNullAsUndefined=Tr.validateConstraint=Tr.validateConstraints=Tr.areFunctions=Tr.isFunction=Tr.isEmptyObject=Tr.assertAllDefined=Tr.assertIsDefined=Tr.assertType=Tr.isUndefinedOrNull=Tr.isDefined=Tr.isUndefined=Tr.isBoolean=Tr.isIterable=Tr.isNumber=Tr.isTypedArray=Tr.isObject=Tr.isStringArray=Tr.isString=void 0;function XJ(e){return typeof e==="string"}a(XJ,"isString");Tr.isString=XJ;function Bxn(e){return Array.isArray(e)&&e.every(t=>XJ(t))}a(Bxn,"isStringArray");Tr.isStringArray=Bxn;function Cxt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}a(Cxt,"isObject");Tr.isObject=Cxt;function Mxn(e){const t=Object.getPrototypeOf(Uint8Array);return typeof e==="object"&&e instanceof t}a(Mxn,"isTypedArray");Tr.isTypedArray=Mxn;function wxt(e){return typeof e==="number"&&!isNaN(e)}a(wxt,"isNumber");Tr.isNumber=wxt;function qxn(e){return!!e&&typeof e[Symbol.iterator]==="function"}a(qxn,"isIterable");Tr.isIterable=qxn;function Uxn(e){return e===true||e===false}a(Uxn,"isBoolean");Tr.isBoolean=Uxn;function YRe(e){return typeof e==="undefined"}a(YRe,"isUndefined");Tr.isUndefined=YRe;function $xn(e){return!bP(e)}a($xn,"isDefined");Tr.isDefined=$xn;function bP(e){return YRe(e)||e===null}a(bP,"isUndefinedOrNull");Tr.isUndefinedOrNull=bP;function jxn(e,t){if(!e){throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}}a(jxn,"assertType");Tr.assertType=jxn;function Gxn(e){if(bP(e)){throw new Error("Assertion Failed: argument is undefined or null")}return e}a(Gxn,"assertIsDefined");Tr.assertIsDefined=Gxn;function Hxn(...e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(bP(n)){throw new Error(`Assertion Failed: argument at index ${r} is undefined or null`)}t.push(n)}return t}a(Hxn,"assertAllDefined");Tr.assertAllDefined=Hxn;var Vxn=Object.prototype.hasOwnProperty;function zxn(e){if(!Cxt(e)){return false}for(const t in e){if(Vxn.call(e,t)){return false}}return true}a(zxn,"isEmptyObject");Tr.isEmptyObject=zxn;function XRe(e){return typeof e==="function"}a(XRe,"isFunction");Tr.isFunction=XRe;function Kxn(...e){return e.length>0&&e.every(XRe)}a(Kxn,"areFunctions");Tr.areFunctions=Kxn;function Wxn(e,t){const r=Math.min(e.length,t.length);for(let n=0;n<r;n++){Txt(e[n],t[n])}}a(Wxn,"validateConstraints");Tr.validateConstraints=Wxn;function Txt(e,t){if(XJ(t)){if(typeof e!==t){throw new Error(`argument does not match constraint: typeof ${t}`)}}else if(XRe(t)){try{if(e instanceof t){return}}catch{}if(!bP(e)&&e.constructor===t){return}if(t.length===1&&t.call(void 0,e)===true){return}throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}a(Txt,"validateConstraint");Tr.validateConstraint=Txt;function Yxn(e){return e===null?void 0:e}a(Yxn,"withNullAsUndefined");Tr.withNullAsUndefined=Yxn;function Xxn(e){return typeof e==="undefined"?null:e}a(Xxn,"withUndefinedAsNull");Tr.withUndefinedAsNull=Xxn;var $F=class extends Error{static{a(this,"ValidationError")}constructor(t){super(t)}};Tr.ValidationError=$F;var jF=class extends $F{static{a(this,"ArgumentUndefinedError")}constructor(t){super(`The argument '${t}' is undefined.`)}};Tr.ArgumentUndefinedError=jF;var GF=class extends $F{static{a(this,"ArgumentTypeError")}constructor(t,r){super(`The argument '${t}' must be of type '${r}'.`)}};Tr.ArgumentTypeError=GF;function Jxn(e,t){if(YRe(e)){throw new jF(t)}return true}a(Jxn,"throwIfUndefined");Tr.throwIfUndefined=Jxn;function JRe(e,t){if(bP(e)){throw new jF(t)}}a(JRe,"throwIfUndefinedOrNull");Tr.throwIfUndefinedOrNull=JRe;function Qxn(e,t){JRe(e,t);if(!XJ(e)){throw new GF(t,"string")}return true}a(Qxn,"throwIfNotString");Tr.throwIfNotString=Qxn;function Zxn(e,t){JRe(e,t);if(!wxt(e)){throw new GF(t,"number")}return true}a(Zxn,"throwIfNotNumber");Tr.throwIfNotNumber=Zxn});var hn=y(mt=>{"use strict";var Rxt=mt&&mt.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var eRn=mt&&mt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var JJ=mt&&mt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Rxt(t,e,r)}eRn(t,e);return t};var zE=mt&&mt.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))Rxt(t,e,r)};Object.defineProperty(mt,"__esModule",{value:true});mt.getRequiredEnvVar=mt.env=mt.EnvironmentalVariableRequiredError=mt.xfs=mt.RouteValidator=mt.JsonValidator=mt.MeteringService=mt.TenantService=mt.OpenFGAService=mt.DevApiService=mt.getContentApiStorageTarballPath=mt.contentApiTarballFileName=mt.ContentApiService=mt.AuthApiService=mt.getServiceAccountIdToken=mt.createApiKeyServiceClient=mt.ApiKeyService=mt.RouteVersions=mt.startsWithReservedKeyword=mt.logger=mt.createNewLogger=mt.graphQL=mt.CloudStorage=mt.fly=mt.ApiServer=mt.featureFlagsPlugin=mt.ensureZuploUserPlugin=mt.ensureZuploAdminPlugin=mt.apiKeyAuthPlugin=mt.errorHandler=mt.DeploymentLogState=mt.signString=mt.FeatureFlags=mt.VALID_COMPATIBILITY_DATES=mt.DEFAULT_COMPATIBILITY_DATE=mt.COMPATIBILITY_FLAG_MAPPINGS=mt.WARNING_STATUS=mt.WARNING_SEVERITY=mt.GOOD_STATUS=mt.FAILURE_STATUS=mt.ERROR_SEVERITY=mt.BuildIssueError=mt.hasBlockedNotifications=mt.getDefaultFlags=mt.getBuildFlagsForDeployment=mt.CommonAuth=void 0;var QRe=JJ(Jd());mt.env=QRe.default;Object.defineProperty(mt,"EnvironmentalVariableRequiredError",{enumerable:true,get:function(){return QRe.EnvironmentalVariableRequiredError}});Object.defineProperty(mt,"getRequiredEnvVar",{enumerable:true,get:function(){return QRe.getRequiredEnvVar}});zE(Hc(),mt);var tRn=$ce();Object.defineProperty(mt,"CommonAuth",{enumerable:true,get:function(){return tRn.CommonAuth}});var ZRe=HGe();Object.defineProperty(mt,"getBuildFlagsForDeployment",{enumerable:true,get:function(){return ZRe.getBuildFlagsForDeployment}});Object.defineProperty(mt,"getDefaultFlags",{enumerable:true,get:function(){return ZRe.getDefaultFlags}});Object.defineProperty(mt,"hasBlockedNotifications",{enumerable:true,get:function(){return ZRe.hasBlockedNotifications}});var SP=VGe();Object.defineProperty(mt,"BuildIssueError",{enumerable:true,get:function(){return SP.BuildIssueError}});Object.defineProperty(mt,"ERROR_SEVERITY",{enumerable:true,get:function(){return SP.ERROR_SEVERITY}});Object.defineProperty(mt,"FAILURE_STATUS",{enumerable:true,get:function(){return SP.FAILURE_STATUS}});Object.defineProperty(mt,"GOOD_STATUS",{enumerable:true,get:function(){return SP.GOOD_STATUS}});Object.defineProperty(mt,"WARNING_SEVERITY",{enumerable:true,get:function(){return SP.WARNING_SEVERITY}});Object.defineProperty(mt,"WARNING_STATUS",{enumerable:true,get:function(){return SP.WARNING_STATUS}});var rRn=zGe();Object.defineProperty(mt,"COMPATIBILITY_FLAG_MAPPINGS",{enumerable:true,get:function(){return rRn.COMPATIBILITY_FLAG_MAPPINGS}});var Oxt=YGe();Object.defineProperty(mt,"DEFAULT_COMPATIBILITY_DATE",{enumerable:true,get:function(){return Oxt.DEFAULT_COMPATIBILITY_DATE}});Object.defineProperty(mt,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return Oxt.VALID_COMPATIBILITY_DATES}});var nRn=jce();Object.defineProperty(mt,"FeatureFlags",{enumerable:true,get:function(){return nRn.FeatureFlags}});var iRn=XGe();Object.defineProperty(mt,"signString",{enumerable:true,get:function(){return iRn.signString}});zE(JGe(),mt);var sRn=Vce();Object.defineProperty(mt,"DeploymentLogState",{enumerable:true,get:function(){return sRn.DeploymentLogState}});zE(sHe(),mt);zE(zce(),mt);var aRn=Kce();Object.defineProperty(mt,"errorHandler",{enumerable:true,get:function(){return aRn.errorHandler}});var QJ=Qce();Object.defineProperty(mt,"apiKeyAuthPlugin",{enumerable:true,get:function(){return QJ.apiKeyAuthPlugin}});Object.defineProperty(mt,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return QJ.ensureZuploAdminPlugin}});Object.defineProperty(mt,"ensureZuploUserPlugin",{enumerable:true,get:function(){return QJ.ensureZuploUserPlugin}});Object.defineProperty(mt,"featureFlagsPlugin",{enumerable:true,get:function(){return QJ.featureFlagsPlugin}});var oRn=bft();Object.defineProperty(mt,"ApiServer",{enumerable:true,get:function(){return oRn.ApiServer}});mt.fly=JJ(Cft());mt.CloudStorage=JJ(lvt());var uRn=cvt();Object.defineProperty(mt,"graphQL",{enumerable:true,get:function(){return uRn.graphQL}});zE(I2t(),mt);var Pxt=lEe();Object.defineProperty(mt,"createNewLogger",{enumerable:true,get:function(){return Pxt.createNewLogger}});Object.defineProperty(mt,"logger",{enumerable:true,get:function(){return Pxt.logger}});var lRn=ZCe();Object.defineProperty(mt,"startsWithReservedKeyword",{enumerable:true,get:function(){return lRn.startsWithReservedKeyword}});var cRn=k2t();Object.defineProperty(mt,"RouteVersions",{enumerable:true,get:function(){return cRn.RouteVersions}});var Nxt=nwt();Object.defineProperty(mt,"ApiKeyService",{enumerable:true,get:function(){return Nxt.ApiKeyService}});Object.defineProperty(mt,"createApiKeyServiceClient",{enumerable:true,get:function(){return Nxt.createApiKeyServiceClient}});var dRn=XO();Object.defineProperty(mt,"getServiceAccountIdToken",{enumerable:true,get:function(){return dRn.getServiceAccountIdToken}});var pRn=swt();Object.defineProperty(mt,"AuthApiService",{enumerable:true,get:function(){return pRn.AuthApiService}});var eOe=lwt();Object.defineProperty(mt,"ContentApiService",{enumerable:true,get:function(){return eOe.ContentApiService}});Object.defineProperty(mt,"contentApiTarballFileName",{enumerable:true,get:function(){return eOe.contentApiTarballFileName}});Object.defineProperty(mt,"getContentApiStorageTarballPath",{enumerable:true,get:function(){return eOe.getContentApiStorageTarballPath}});var fRn=pwt();Object.defineProperty(mt,"DevApiService",{enumerable:true,get:function(){return fRn.DevApiService}});var mRn=fxt();Object.defineProperty(mt,"OpenFGAService",{enumerable:true,get:function(){return mRn.OpenFGAService}});var hRn=gxt();Object.defineProperty(mt,"TenantService",{enumerable:true,get:function(){return hRn.TenantService}});var gRn=_xt();Object.defineProperty(mt,"MeteringService",{enumerable:true,get:function(){return gRn.MeteringService}});zE(vxt(),mt);zE(Axt(),mt);zE(xxt(),mt);var yRn=$Y();Object.defineProperty(mt,"JsonValidator",{enumerable:true,get:function(){return yRn.JsonValidator}});var _Rn=awe();Object.defineProperty(mt,"RouteValidator",{enumerable:true,get:function(){return _Rn.RouteValidator}});mt.xfs=JJ(nAe())});var Fn=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:true});Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.NODE_BUILD_OUTPUT_FILE=Vt.NODE_ENTRY_NAME=Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE=Vt.WORKER_BUILD_OUTPUT_FILE=Vt.WORKER_ENTRY_NAME=Vt.ENV_MODULE_FILE=Vt.ZUPLO_SYSTEM_ENV_FILE=Vt.ENV_FILE=Vt.CACHE_DIRECTORY=Vt.BUILD_CACHE_FILE=Vt.ZUPLO_FILE_SCHEMA=Vt.NON_STANDARD_NODE_ENV=Vt.GENERATED_TYPES_DIR_NAME=Vt.GENERATED_BUILD_JSON_FILE=Vt.GENERATED_SOURCE_DIR_NAME=Vt.BUILD_OUTPUT_DIR=Vt.DEFAULT_TEST_FILE=Vt.DEFAULT_DOCS_MARKDOWN_FILE=Vt.DOCS_THEME_FILE=Vt.DOCS_SIDEBAR_FILE=Vt.ZUPLO_FALLBACK_JSON_FILE=Vt.ZUPLO_PREFERRED_JSON_FILE=Vt.DEFAULT_MODULE_FILE=Vt.OPEN_API_FILE_SUFFIX=Vt.OPEN_API_CONFIG_FILE=Vt.OPEN_API_UNVERSIONED_DIR_NAME=Vt.DEV_PORTAL_OUTPUT_DIR_NAME=Vt.DEV_PORTAL_CONFIG_FILE=Vt.POLICIES_CONFIG_FILE=Vt.ROUTES_OAS_CONFIG_FILE=Vt.LOCAL_API_KEYS_CONFIG_FILE=Vt.DEV_PORTAL_V4_PATH=Vt.USER_DOCS_DIR_NAME=Vt.USER_SCHEMAS_DIR_NAME=Vt.USER_CONFIG_DIR_NAME=Vt.USER_TEST_DIR_NAME=Vt.USER_MODULES_DIR_NAME=void 0;Vt.USER_MODULES_DIR_NAME="modules";Vt.USER_TEST_DIR_NAME="tests";Vt.USER_CONFIG_DIR_NAME="config";Vt.USER_SCHEMAS_DIR_NAME="schemas";Vt.USER_DOCS_DIR_NAME="docs";Vt.DEV_PORTAL_V4_PATH="v4";Vt.LOCAL_API_KEYS_CONFIG_FILE="api-keys.json";Vt.ROUTES_OAS_CONFIG_FILE="routes.oas.json";Vt.POLICIES_CONFIG_FILE="policies.json";Vt.DEV_PORTAL_CONFIG_FILE="dev-portal.json";Vt.DEV_PORTAL_OUTPUT_DIR_NAME="dev-portal";Vt.OPEN_API_UNVERSIONED_DIR_NAME="unversioned";Vt.OPEN_API_CONFIG_FILE="open-api.json";Vt.OPEN_API_FILE_SUFFIX=".oas.json";Vt.DEFAULT_MODULE_FILE="hello-world.ts";Vt.ZUPLO_PREFERRED_JSON_FILE="zuplo.jsonc";Vt.ZUPLO_FALLBACK_JSON_FILE="zuplo.json";Vt.DOCS_SIDEBAR_FILE="sidebar.json";Vt.DOCS_THEME_FILE="theme.css";Vt.DEFAULT_DOCS_MARKDOWN_FILE="index.md";Vt.DEFAULT_TEST_FILE="hello-world.json";Vt.BUILD_OUTPUT_DIR="dist";Vt.GENERATED_SOURCE_DIR_NAME=".zuplo";Vt.GENERATED_BUILD_JSON_FILE="build.json";Vt.GENERATED_TYPES_DIR_NAME="types";Vt.NON_STANDARD_NODE_ENV=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against.`;Vt.ZUPLO_FILE_SCHEMA="zuplo";Vt.BUILD_CACHE_FILE="buildstate.json";Vt.CACHE_DIRECTORY=".cache";Vt.ENV_FILE=".env";Vt.ZUPLO_SYSTEM_ENV_FILE=".env.zuplo";Vt.ENV_MODULE_FILE="environment.ts";Vt.WORKER_ENTRY_NAME="worker.ts";Vt.WORKER_BUILD_OUTPUT_FILE="worker.js";Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE="worker.js.map";Vt.NODE_ENTRY_NAME="server.ts";Vt.NODE_BUILD_OUTPUT_FILE="main.js";Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.OPEN_API_CONFIG_FILE});var ru=y(AP=>{"use strict";Object.defineProperty(AP,"__esModule",{value:true});AP.runPlugins=AP.PluginResult=void 0;var tOe=class{static{a(this,"PluginResult")}errors=[];warnings=[];constructor(t){if(t){this.errors.push(t)}}};AP.PluginResult=tOe;async function vRn(e,t){const r=[];const n=[];const i=new Map;for await(const s of e){try{const o=await s(t,i);n.push(...o.errors.map(u=>{if(u.pluginName===""){u.pluginName=s.name}return u}));r.push(...o.warnings);if(o.errors.length>0){break}}catch(o){n.push(o);break}}return{errors:n,warnings:r}}a(vRn,"runPlugins");AP.runPlugins=vRn});var xs=y(nOe=>{"use strict";Object.defineProperty(nOe,"__esModule",{value:true});var ZJ=require("perf_hooks");var rOe=[];async function ERn(e,t){const r=ZJ.performance.timerify(t);const n=new ZJ.PerformanceObserver(i=>{const s=i.getEntries()[0];rOe.push({name:e,duration:s.duration});n.disconnect()});n.observe({entryTypes:["function"]});return r()}a(ERn,"timeFn");var bRn={mark:e=>{ZJ.performance.mark(e)},measure:(e,t,r)=>{ZJ.performance.measure(e,t,r)},timeFn:ERn,report:()=>{if(rOe.length>0){console.table(rOe)}}};nOe.default=bRn});var iOe=y(CP=>{"use strict";var SRn=CP&&CP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(CP,"__esModule",{value:true});CP.getZuploConfig=void 0;var HF=hn();var ARn=require("jsonc-parser");var CRn=require("fs/promises");var Ixt=SRn(require("path"));var kxt=Fn();async function wRn(e){const t=Ixt.default.join(e,kxt.ZUPLO_PREFERRED_JSON_FILE);const r=Ixt.default.join(e,kxt.ZUPLO_FALLBACK_JSON_FILE);let n=false;let i=t;if(await HF.xfs.fileExists(t)){n=true;i=t}else if(await HF.xfs.fileExists(r)){n=true;i=r}const s={};if(n){const o=await(0,CRn.readFile)(i,"utf-8");const u=[];const l=(0,ARn.parse)(o,u);if(typeof l!=="object"){const c={message:`Invalid zuplo.json file`,detail:`The zuplo.json file is not a valid JSON object`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("version"in l&&l.version!==1){const c={message:`Invalid version set in zuplo.config`,detail:`version in zuplo.json must be set to 1`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("compatibilityDate"in l&&HF.VALID_COMPATIBILITY_DATES&&typeof l.compatibilityDate==="string"){if(!HF.VALID_COMPATIBILITY_DATES.includes(l.compatibilityDate)){const c={message:`Invalid compatibilityDate set in zuplo.config`,detail:`compatibilityDate was set to ${l.compatibilityDate}. Valid compatibility dates are ${HF.VALID_COMPATIBILITY_DATES.join(", ")}`,pluginName:"buildData",severity:"error"};return{errors:[c]}}s.compatibilityDate=l.compatibilityDate}}return{config:s,errors:[]}}a(wRn,"getZuploConfig");CP.getZuploConfig=wRn});var VF=y(eQ=>{"use strict";Object.defineProperty(eQ,"__esModule",{value:true});eQ.TargetPlatform=void 0;var Dxt;(function(e){e["Worker"]="worker"})(Dxt||(eQ.TargetPlatform=Dxt={}))});var Fxt=y(wP=>{"use strict";var Lxt=wP&&wP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(wP,"__esModule",{value:true});wP.cleanOutput=void 0;var TRn=Lxt(require("fs/promises"));var xRn=Lxt(xs());var RRn=a(async function({outputDirectory:e,systemDirectory:t,logger:r}){return xRn.default.timeFn("Cleaning output",async()=>{r.debug("Cleaning output");const n=[e,t];for await(const i of n){try{await TRn.default.rm(i,{recursive:true,force:true})}catch(s){r.error(s)}}return{warnings:[],errors:[]}})},"cleanOutput");wP.cleanOutput=RRn});var Mxt=y(TP=>{"use strict";var Bxt=TP&&TP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(TP,"__esModule",{value:true});TP.createSystemDir=void 0;var ORn=hn();var PRn=Bxt(require("fs/promises"));var NRn=Bxt(xs());var IRn=a(async function({systemDirectory:e,logger:t}){return NRn.default.timeFn("Creating system directory",async()=>{t.debug("Creating system directory");try{if(await ORn.xfs.dirExists(e)){t.debug("System directory already exists, skipping");return{warnings:[],errors:[]}}await PRn.default.mkdir(e)}catch(r){t.error(r);return{warnings:[],errors:[]}}return{warnings:[],errors:[]}})},"createSystemDir");TP.createSystemDir=IRn});var qxt=y(xP=>{"use strict";var kRn=xP&&xP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(xP,"__esModule",{value:true});xP.checkForDeprecations=void 0;var DRn=kRn(xs());var LRn=a(async function({logger:e}){return DRn.default.timeFn("Checking for breaking changes",async()=>{e.debug("Checking for breaking changes");return{warnings:[],errors:[]}})},"checkForDeprecations");xP.checkForDeprecations=LRn});var Uxt=y(sOe=>{var aC=require("path");var WE=process.platform==="win32";var KE=require("fs");var FRn=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function BRn(){var e;if(FRn){var t=new Error;e=r}else e=n;return e;function r(i){if(i){t.message=i.message;i=t;n(i)}}a(r,"debugCallback");function n(i){if(i){if(process.throwDeprecation)throw i;else if(!process.noDeprecation){var s="fs: missing callback "+(i.stack||i.message);if(process.traceDeprecation)console.trace(s);else console.error(s)}}}a(n,"missingCallback")}a(BRn,"rethrow");function MRn(e){return typeof e==="function"?e:BRn()}a(MRn,"maybeCallback");var P5s=aC.normalize;if(WE){Ry=/(.*?)(?:[\/\\]+|$)/g}else{Ry=/(.*?)(?:[\/]+|$)/g}var Ry;if(WE){zF=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{zF=/^[\/]*/}var zF;sOe.realpathSync=a(function e(t,r){t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var n=t,i={},s={};var o;var u;var l;var c;d();function d(){var _=zF.exec(t);o=_[0].length;u=_[0];l=_[0];c="";if(WE&&!s[l]){KE.lstatSync(l);s[l]=true}}a(d,"start");while(o<t.length){Ry.lastIndex=o;var p=Ry.exec(t);c=u;u+=p[0];l=c+p[1];o=Ry.lastIndex;if(s[l]||r&&r[l]===l){continue}var f;if(r&&Object.prototype.hasOwnProperty.call(r,l)){f=r[l]}else{var m=KE.lstatSync(l);if(!m.isSymbolicLink()){s[l]=true;if(r)r[l]=l;continue}var h=null;if(!WE){var g=m.dev.toString(32)+":"+m.ino.toString(32);if(i.hasOwnProperty(g)){h=i[g]}}if(h===null){KE.statSync(l);h=KE.readlinkSync(l)}f=aC.resolve(c,h);if(r)r[l]=f;if(!WE)i[g]=h}t=aC.resolve(f,t.slice(o));d()}if(r)r[n]=t;return t},"realpathSync");sOe.realpath=a(function e(t,r,n){if(typeof n!=="function"){n=MRn(r);r=null}t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(n.bind(null,null,r[t]))}var i=t,s={},o={};var u;var l;var c;var d;p();function p(){var _=zF.exec(t);u=_[0].length;l=_[0];c=_[0];d="";if(WE&&!o[c]){KE.lstat(c,function(v){if(v)return n(v);o[c]=true;f()})}else{process.nextTick(f)}}a(p,"start");function f(){if(u>=t.length){if(r)r[i]=t;return n(null,t)}Ry.lastIndex=u;var _=Ry.exec(t);d=l;l+=_[0];c=d+_[1];u=Ry.lastIndex;if(o[c]||r&&r[c]===c){return process.nextTick(f)}if(r&&Object.prototype.hasOwnProperty.call(r,c)){return g(r[c])}return KE.lstat(c,m)}a(f,"LOOP");function m(_,v){if(_)return n(_);if(!v.isSymbolicLink()){o[c]=true;if(r)r[c]=c;return process.nextTick(f)}if(!WE){var S=v.dev.toString(32)+":"+v.ino.toString(32);if(s.hasOwnProperty(S)){return h(null,s[S],c)}}KE.stat(c,function(E){if(E)return n(E);KE.readlink(c,function(b,A){if(!WE)s[S]=A;h(b,A)})})}a(m,"gotStat");function h(_,v,S){if(_)return n(_);var E=aC.resolve(d,v);if(r)r[S]=E;g(E)}a(h,"gotTarget");function g(_){t=aC.resolve(_,t.slice(u));p()}a(g,"gotResolvedLink")},"realpath")});var lOe=y((k5s,Hxt)=>{Hxt.exports=YE;YE.realpath=YE;YE.sync=uOe;YE.realpathSync=uOe;YE.monkeypatch=URn;YE.unmonkeypatch=$Rn;var RP=require("fs");var aOe=RP.realpath;var oOe=RP.realpathSync;var qRn=process.version;var $xt=/^v[0-5]\./.test(qRn);var jxt=Uxt();function Gxt(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}a(Gxt,"newError");function YE(e,t,r){if($xt){return aOe(e,t,r)}if(typeof t==="function"){r=t;t=null}aOe(e,t,function(n,i){if(Gxt(n)){jxt.realpath(e,t,r)}else{r(n,i)}})}a(YE,"realpath");function uOe(e,t){if($xt){return oOe(e,t)}try{return oOe(e,t)}catch(r){if(Gxt(r)){return jxt.realpathSync(e,t)}else{throw r}}}a(uOe,"realpathSync");function URn(){RP.realpath=YE;RP.realpathSync=uOe}a(URn,"monkeypatch");function $Rn(){RP.realpath=aOe;RP.realpathSync=oOe}a($Rn,"unmonkeypatch")});var zxt=y((L5s,Vxt)=>{Vxt.exports=function(e,t){var r=[];for(var n=0;n<e.length;n++){var i=t(e[n],n);if(jRn(i))r.push.apply(r,i);else r.push(i)}return r};var jRn=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}});var cOe=y((F5s,Xxt)=>{"use strict";Xxt.exports=Wxt;function Wxt(e,t,r){if(e instanceof RegExp)e=Kxt(e,r);if(t instanceof RegExp)t=Kxt(t,r);var n=Yxt(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}a(Wxt,"balanced");function Kxt(e,t){var r=t.match(e);return r?r[0]:null}a(Kxt,"maybeMatch");Wxt.range=Yxt;function Yxt(e,t,r){var n,i,s,o,u;var l=r.indexOf(e);var c=r.indexOf(t,l+1);var d=l;if(l>=0&&c>0){if(e===t){return[l,c]}n=[];s=r.length;while(d>=0&&!u){if(d==l){n.push(d);l=r.indexOf(e,d+1)}else if(n.length==1){u=[n.pop(),c]}else{i=n.pop();if(i<s){s=i;o=c}c=r.indexOf(t,d+1)}d=l<c&&l>=0?l:c}if(n.length){u=[s,o]}}return u}a(Yxt,"range")});var iRt=y((M5s,nRt)=>{var GRn=zxt();var Jxt=cOe();nRt.exports=zRn;var Qxt="\0SLASH"+Math.random()+"\0";var Zxt="\0OPEN"+Math.random()+"\0";var pOe="\0CLOSE"+Math.random()+"\0";var eRt="\0COMMA"+Math.random()+"\0";var tRt="\0PERIOD"+Math.random()+"\0";function dOe(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}a(dOe,"numeric");function HRn(e){return e.split("\\\\").join(Qxt).split("\\{").join(Zxt).split("\\}").join(pOe).split("\\,").join(eRt).split("\\.").join(tRt)}a(HRn,"escapeBraces");function VRn(e){return e.split(Qxt).join("\\").split(Zxt).join("{").split(pOe).join("}").split(eRt).join(",").split(tRt).join(".")}a(VRn,"unescapeBraces");function rRt(e){if(!e)return[""];var t=[];var r=Jxt("{","}",e);if(!r)return e.split(",");var n=r.pre;var i=r.body;var s=r.post;var o=n.split(",");o[o.length-1]+="{"+i+"}";var u=rRt(s);if(s.length){o[o.length-1]+=u.shift();o.push.apply(o,u)}t.push.apply(t,o);return t}a(rRt,"parseCommaParts");function zRn(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return OP(HRn(e),true).map(VRn)}a(zRn,"expandTop");function KRn(e){return"{"+e+"}"}a(KRn,"embrace");function WRn(e){return/^-?0\d/.test(e)}a(WRn,"isPadded");function YRn(e,t){return e<=t}a(YRn,"lte");function XRn(e,t){return e>=t}a(XRn,"gte");function OP(e,t){var r=[];var n=Jxt("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var o=i||s;var u=n.body.indexOf(",")>=0;if(!o&&!u){if(n.post.match(/,.*\}/)){e=n.pre+"{"+n.body+pOe+n.post;return OP(e)}return[e]}var l;if(o){l=n.body.split(/\.\./)}else{l=rRt(n.body);if(l.length===1){l=OP(l[0],false).map(KRn);if(l.length===1){var d=n.post.length?OP(n.post,false):[""];return d.map(function(I){return n.pre+l[0]+I})}}}var c=n.pre;var d=n.post.length?OP(n.post,false):[""];var p;if(o){var f=dOe(l[0]);var m=dOe(l[1]);var h=Math.max(l[0].length,l[1].length);var g=l.length==3?Math.abs(dOe(l[2])):1;var _=YRn;var v=m<f;if(v){g*=-1;_=XRn}var S=l.some(WRn);p=[];for(var E=f;_(E,m);E+=g){var b;if(s){b=String.fromCharCode(E);if(b==="\\")b=""}else{b=String(E);if(S){var A=h-b.length;if(A>0){var C=new Array(A+1).join("0");if(E<0)b="-"+C+b.slice(1);else b=C+b}}}p.push(b)}}else{p=GRn(l,function(R){return OP(R,false)})}for(var T=0;T<p.length;T++){for(var O=0;O<d.length;O++){var P=c+p[T]+d[O];if(!t||o||P)r.push(P)}}return r}a(OP,"expand")});var nQ=y((U5s,lRt)=>{lRt.exports=pp;pp.Minimatch=ul;var KF=function(){try{return require("path")}catch(e){}}()||{sep:"/"};pp.sep=KF.sep;var hOe=pp.GLOBSTAR=ul.GLOBSTAR={};var JRn=iRt();var sRt={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var fOe="[^/]";var mOe=fOe+"*?";var QRn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var ZRn="(?:(?!(?:\\/|^)\\.).)*?";var aRt=eOn("().*{}+?[]^$\\!");function eOn(e){return e.split("").reduce(function(t,r){t[r]=true;return t},{})}a(eOn,"charSet");var oRt=/\/+/;pp.filter=tOn;function tOn(e,t){t=t||{};return function(r,n,i){return pp(r,e,t)}}a(tOn,"filter");function XE(e,t){t=t||{};var r={};Object.keys(e).forEach(function(n){r[n]=e[n]});Object.keys(t).forEach(function(n){r[n]=t[n]});return r}a(XE,"ext");pp.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return pp}var t=pp;var r=a(function n(i,s,o){return t(i,s,XE(e,o))},"minimatch");r.Minimatch=a(function n(i,s){return new t.Minimatch(i,XE(e,s))},"Minimatch");r.Minimatch.defaults=a(function n(i){return t.defaults(XE(e,i)).Minimatch},"defaults");r.filter=a(function n(i,s){return t.filter(i,XE(e,s))},"filter");r.defaults=a(function n(i){return t.defaults(XE(e,i))},"defaults");r.makeRe=a(function n(i,s){return t.makeRe(i,XE(e,s))},"makeRe");r.braceExpand=a(function n(i,s){return t.braceExpand(i,XE(e,s))},"braceExpand");r.match=function(n,i,s){return t.match(n,i,XE(e,s))};return r};ul.defaults=function(e){return pp.defaults(e).Minimatch};function pp(e,t,r){rQ(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new ul(t,r).match(e)}a(pp,"minimatch");function ul(e,t){if(!(this instanceof ul)){return new ul(e,t)}rQ(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&KF.sep!=="/"){e=e.split(KF.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}a(ul,"Minimatch");ul.prototype.debug=function(){};ul.prototype.make=rOn;function rOn(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=a(function n(){console.error.apply(console,arguments)},"debug");this.debug(this.pattern,r);r=this.globParts=r.map(function(n){return n.split(oRt)});this.debug(this.pattern,r);r=r.map(function(n,i,s){return n.map(this.parse,this)},this);this.debug(this.pattern,r);r=r.filter(function(n){return n.indexOf(false)===-1});this.debug(this.pattern,r);this.set=r}a(rOn,"make");ul.prototype.parseNegate=nOn;function nOn(){var e=this.pattern;var t=false;var r=this.options;var n=0;if(r.nonegate)return;for(var i=0,s=e.length;i<s&&e.charAt(i)==="!";i++){t=!t;n++}if(n)this.pattern=e.substr(n);this.negate=t}a(nOn,"parseNegate");pp.braceExpand=function(e,t){return uRt(e,t)};ul.prototype.braceExpand=uRt;function uRt(e,t){if(!t){if(this instanceof ul){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;rQ(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return JRn(e)}a(uRt,"braceExpand");var iOn=1024*64;var rQ=a(function(e){if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>iOn){throw new TypeError("pattern is too long")}},"assertValidPattern");ul.prototype.parse=sOn;var tQ={};function sOn(e,t){rQ(e);var r=this.options;if(e==="**"){if(!r.noglobstar)return hOe;else e="*"}if(e==="")return"";var n="";var i=!!r.nocase;var s=false;var o=[];var u=[];var l;var c=false;var d=-1;var p=-1;var f=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var m=this;function h(){if(l){switch(l){case"*":n+=mOe;i=true;break;case"?":n+=fOe;i=true;break;default:n+="\\"+l;break}m.debug("clearStateChar %j %j",l,n);l=false}}a(h,"clearStateChar");for(var g=0,_=e.length,v;g<_&&(v=e.charAt(g));g++){this.debug("%s %s %s %j",e,g,n,v);if(s&&aRt[v]){n+="\\"+v;s=false;continue}switch(v){case"/":{return false}case"\\":h();s=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",e,g,n,v);if(c){this.debug(" in class");if(v==="!"&&g===p+1)v="^";n+=v;continue}m.debug("call clearStateChar %j",l);h();l=v;if(r.noext)h();continue;case"(":if(c){n+="(";continue}if(!l){n+="\\(";continue}o.push({type:l,start:g-1,reStart:n.length,open:sRt[l].open,close:sRt[l].close});n+=l==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",l,n);l=false;continue;case")":if(c||!o.length){n+="\\)";continue}h();i=true;var S=o.pop();n+=S.close;if(S.type==="!"){u.push(S)}S.reEnd=n.length;continue;case"|":if(c||!o.length||s){n+="\\|";s=false;continue}h();n+="|";continue;case"[":h();if(c){n+="\\"+v;continue}c=true;p=g;d=n.length;n+=v;continue;case"]":if(g===p+1||!c){n+="\\"+v;s=false;continue}var E=e.substring(p+1,g);try{RegExp("["+E+"]")}catch(M){var b=this.parse(E,tQ);n=n.substr(0,d)+"\\["+b[0]+"\\]";i=i||b[1];c=false;continue}i=true;c=false;n+=v;continue;default:h();if(s){s=false}else if(aRt[v]&&!(v==="^"&&c)){n+="\\"}n+=v}}if(c){E=e.substr(p+1);b=this.parse(E,tQ);n=n.substr(0,d)+"\\["+b[0];i=i||b[1]}for(S=o.pop();S;S=o.pop()){var A=n.slice(S.reStart+S.open.length);this.debug("setting tail",n,S);A=A.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(M,Q,fe){if(!fe){fe="\\"}return Q+Q+fe+"|"});this.debug("tail=%j\n %s",A,A,S,n);var C=S.type==="*"?mOe:S.type==="?"?fOe:"\\"+S.type;i=true;n=n.slice(0,S.reStart)+C+"\\("+A}h();if(s){n+="\\\\"}var T=false;switch(n.charAt(0)){case"[":case".":case"(":T=true}for(var O=u.length-1;O>-1;O--){var P=u[O];var R=n.slice(0,P.reStart);var I=n.slice(P.reStart,P.reEnd-8);var D=n.slice(P.reEnd-8,P.reEnd);var U=n.slice(P.reEnd);D+=U;var te=R.split("(").length-1;var ve=U;for(g=0;g<te;g++){ve=ve.replace(/\)[+*?]?/,"")}U=ve;var me="";if(U===""&&t!==tQ){me="$"}var he=R+I+U+me+D;n=he}if(n!==""&&i){n="(?=.)"+n}if(T){n=f+n}if(t===tQ){return[n,i]}if(!i){return oOn(e)}var Fe=r.nocase?"i":"";try{var Oe=new RegExp("^"+n+"$",Fe)}catch(M){return new RegExp("$.")}Oe._glob=e;Oe._src=n;return Oe}a(sOn,"parse");pp.makeRe=function(e,t){return new ul(e,t||{}).makeRe()};ul.prototype.makeRe=aOn;function aOn(){if(this.regexp||this.regexp===false)return this.regexp;var e=this.set;if(!e.length){this.regexp=false;return this.regexp}var t=this.options;var r=t.noglobstar?mOe:t.dot?QRn:ZRn;var n=t.nocase?"i":"";var i=e.map(function(s){return s.map(function(o){return o===hOe?r:typeof o==="string"?uOn(o):o._src}).join("\\/")}).join("|");i="^(?:"+i+")$";if(this.negate)i="^(?!"+i+").*$";try{this.regexp=new RegExp(i,n)}catch(s){this.regexp=false}return this.regexp}a(aOn,"makeRe");pp.match=function(e,t,r){r=r||{};var n=new ul(t,r);e=e.filter(function(i){return n.match(i)});if(n.options.nonull&&!e.length){e.push(t)}return e};ul.prototype.match=a(function e(t,r){if(typeof r==="undefined")r=this.partial;this.debug("match",t,this.pattern);if(this.comment)return false;if(this.empty)return t==="";if(t==="/"&&r)return true;var n=this.options;if(KF.sep!=="/"){t=t.split(KF.sep).join("/")}t=t.split(oRt);this.debug(this.pattern,"split",t);var i=this.set;this.debug(this.pattern,"set",i);var s;var o;for(o=t.length-1;o>=0;o--){s=t[o];if(s)break}for(o=0;o<i.length;o++){var u=i[o];var l=t;if(n.matchBase&&u.length===1){l=[s]}var c=this.matchOne(l,u,r);if(c){if(n.flipNegate)return true;return!this.negate}}if(n.flipNegate)return false;return this.negate},"match");ul.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{"this":this,file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var i=0,s=0,o=e.length,u=t.length;i<o&&s<u;i++,s++){this.debug("matchOne loop");var l=t[s];var c=e[i];this.debug(t,l,c);if(l===false)return false;if(l===hOe){this.debug("GLOBSTAR",[t,l,c]);var d=i;var p=s+1;if(p===u){this.debug("** at the end");for(;i<o;i++){if(e[i]==="."||e[i]===".."||!n.dot&&e[i].charAt(0)===".")return false}return true}while(d<o){var f=e[d];this.debug("\nglobstar while",e,d,t,p,f);if(this.matchOne(e.slice(d),t.slice(p),r)){this.debug("globstar found match!",d,o,f);return true}else{if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue");d++}}if(r){this.debug("\n>>> no match, partial?",e,d,t,p);if(d===o)return true}return false}var m;if(typeof l==="string"){m=c===l;this.debug("string match",l,c,m)}else{m=c.match(l);this.debug("pattern match",l,c,m)}if(!m)return false}if(i===o&&s===u){return true}else if(i===o){return r}else if(s===u){return i===o-1&&e[i]===""}throw new Error("wtf?")};function oOn(e){return e.replace(/\\(.)/g,"$1")}a(oOn,"globUnescape");function uOn(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}a(uOn,"regExpEscape")});var sQ=y((j5s,iQ)=>{"use strict";function cRt(e){return e.charAt(0)==="/"}a(cRt,"posix");function dRt(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var n=r[1]||"";var i=Boolean(n&&n.charAt(1)!==":");return Boolean(r[2]||i)}a(dRt,"win32");iQ.exports=process.platform==="win32"?dRt:cRt;iQ.exports.posix=cRt;iQ.exports.win32=dRt});var yOe=y(JE=>{JE.setopts=mOn;JE.ownProp=pRt;JE.makeAbs=WF;JE.finish=hOn;JE.mark=gOn;JE.isIgnored=mRt;JE.childrenIgnored=yOn;function pRt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}a(pRt,"ownProp");var lOn=require("fs");var PP=require("path");var cOn=nQ();var fRt=sQ();var gOe=cOn.Minimatch;function dOn(e,t){return e.localeCompare(t,"en")}a(dOn,"alphasort");function pOn(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(fOn)}}a(pOn,"setupIgnores");function fOn(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new gOe(r,{dot:true})}return{matcher:new gOe(e,{dot:true}),gmatcher:t}}a(fOn,"ignoreMap");function mOn(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.fs=r.fs||lOn;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);pOn(e,r);e.changedCwd=false;var n=process.cwd();if(!pRt(r,"cwd"))e.cwd=n;else{e.cwd=PP.resolve(r.cwd);e.changedCwd=e.cwd!==n}e.root=r.root||PP.resolve(e.cwd,"/");e.root=PP.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=fRt(e.cwd)?e.cwd:WF(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;r.allowWindowsEscape=false;e.minimatch=new gOe(t,r);e.options=e.minimatch.options}a(mOn,"setopts");function hOn(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var n=0,i=e.matches.length;n<i;n++){var s=e.matches[n];if(!s||Object.keys(s).length===0){if(e.nonull){var o=e.minimatch.globSet[n];if(t)r.push(o);else r[o]=true}}else{var u=Object.keys(s);if(t)r.push.apply(r,u);else u.forEach(function(l){r[l]=true})}}if(!t)r=Object.keys(r);if(!e.nosort)r=r.sort(dOn);if(e.mark){for(var n=0;n<r.length;n++){r[n]=e._mark(r[n])}if(e.nodir){r=r.filter(function(l){var c=!/\/$/.test(l);var d=e.cache[l]||e.cache[WF(e,l)];if(c&&d)c=d!=="DIR"&&!Array.isArray(d);return c})}}if(e.ignore.length)r=r.filter(function(l){return!mRt(e,l)});e.found=r}a(hOn,"finish");function gOn(e,t){var r=WF(e,t);var n=e.cache[r];var i=t;if(n){var s=n==="DIR"||Array.isArray(n);var o=t.slice(-1)==="/";if(s&&!o)i+="/";else if(!s&&o)i=i.slice(0,-1);if(i!==t){var u=WF(e,i);e.statCache[u]=e.statCache[r];e.cache[u]=e.cache[r]}}return i}a(gOn,"mark");function WF(e,t){var r=t;if(t.charAt(0)==="/"){r=PP.join(e.root,t)}else if(fRt(t)||t===""){r=t}else if(e.changedCwd){r=PP.resolve(e.cwd,t)}else{r=PP.resolve(t)}if(process.platform==="win32")r=r.replace(/\\/g,"/");return r}a(WF,"makeAbs");function mRt(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return r.matcher.match(t)||!!(r.gmatcher&&r.gmatcher.match(t))})}a(mRt,"isIgnored");function yOn(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(t))})}a(yOn,"childrenIgnored")});var vRt=y((Y5s,_Rt)=>{_Rt.exports=yRt;yRt.GlobSync=nu;var _On=lOe();var hRt=nQ();var z5s=hRt.Minimatch;var K5s=EOe().Glob;var W5s=require("util");var _Oe=require("path");var gRt=require("assert");var aQ=sQ();var oC=yOe();var vOn=oC.setopts;var vOe=oC.ownProp;var EOn=oC.childrenIgnored;var bOn=oC.isIgnored;function yRt(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new nu(e,t).found}a(yRt,"globSync");function nu(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof nu))return new nu(e,t);vOn(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++){this._process(this.minimatch.set[n],n,false)}this._finish()}a(nu,"GlobSync");nu.prototype._finish=function(){gRt.ok(this instanceof nu);if(this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t){try{i=e._makeAbs(i);var s=_On.realpathSync(i,e.realpathCache);n[s]=true}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=true;else throw o}}})}oC.finish(this)};nu.prototype._process=function(e,t,r){gRt.ok(this instanceof nu);var n=0;while(typeof e[n]==="string"){n++}var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var s=e.slice(n);var o;if(i===null)o=".";else if(aQ(i)||aQ(e.map(function(c){return typeof c==="string"?c:"[*]"}).join("/"))){if(!i||!aQ(i))i="/"+i;o=i}else o=i;var u=this._makeAbs(o);if(EOn(this,o))return;var l=s[0]===hRt.GLOBSTAR;if(l)this._processGlobStar(i,o,u,s,t,r);else this._processReaddir(i,o,u,s,t,r)};nu.prototype._processReaddir=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n[0];var l=!!this.minimatch.negate;var c=u._glob;var d=this.dot||c.charAt(0)===".";var p=[];for(var f=0;f<o.length;f++){var m=o[f];if(m.charAt(0)!=="."||d){var h;if(l&&!e){h=!m.match(u)}else{h=m.match(u)}if(h)p.push(m)}}var g=p.length;if(g===0)return;if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var f=0;f<g;f++){var m=p[f];if(e){if(e.slice(-1)!=="/")m=e+"/"+m;else m=e+m}if(m.charAt(0)==="/"&&!this.nomount){m=_Oe.join(this.root,m)}this._emitMatch(i,m)}return}n.shift();for(var f=0;f<g;f++){var m=p[f];var _;if(e)_=[e,m];else _=[m];this._process(_.concat(n),i,s)}};nu.prototype._emitMatch=function(e,t){if(bOn(this,t))return;var r=this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute){t=r}if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;if(this.stat)this._stat(t)};nu.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,false);var t;var r;var n;try{r=this.fs.lstatSync(e)}catch(s){if(s.code==="ENOENT"){return null}}var i=r&&r.isSymbolicLink();this.symlinks[e]=i;if(!i&&r&&!r.isDirectory())this.cache[e]="FILE";else t=this._readdir(e,false);return t};nu.prototype._readdir=function(e,t){var r;if(t&&!vOe(this.symlinks,e))return this._readdirInGlobStar(e);if(vOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){this._readdirError(e,i);return null}};nu.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat){for(var r=0;r<t.length;r++){var n=t[r];if(e==="/")n=e+n;else n=e+"/"+n;this.cache[n]=true}}this.cache[e]=t;return t};nu.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);this.cache[r]="FILE";if(r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);n.path=this.cwd;n.code=t.code;throw n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict)throw t;if(!this.silent)console.error("glob error",t);break}};nu.prototype._processGlobStar=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n.slice(1);var l=e?[e]:[];var c=l.concat(u);this._process(c,i,false);var d=o.length;var p=this.symlinks[r];if(p&&s)return;for(var f=0;f<d;f++){var m=o[f];if(m.charAt(0)==="."&&!this.dot)continue;var h=l.concat(o[f],u);this._process(h,i,true);var g=l.concat(o[f],n);this._process(g,i,true)}};nu.prototype._processSimple=function(e,t){var r=this._stat(e);if(!this.matches[t])this.matches[t]=Object.create(null);if(!r)return;if(e&&aQ(e)&&!this.nomount){var n=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=_Oe.join(this.root,e)}else{e=_Oe.resolve(this.root,e);if(n)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e)};nu.prototype._stat=function(e){var t=this._makeAbs(e);var r=e.slice(-1)==="/";if(e.length>this.maxLength)return false;if(!this.stat&&vOe(this.cache,t)){var o=this.cache[t];if(Array.isArray(o))o="DIR";if(!r||o==="DIR")return o;if(r&&o==="FILE")return false}var n;var i=this.statCache[t];if(!i){var s;try{s=this.fs.lstatSync(t)}catch(u){if(u&&(u.code==="ENOENT"||u.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(s&&s.isSymbolicLink()){try{i=this.fs.statSync(t)}catch(u){i=s}}else{i=s}}this.statCache[t]=i;var o=true;if(i)o=i.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(r&&o==="FILE")return false;return o};nu.prototype._mark=function(e){return oC.mark(this,e)};nu.prototype._makeAbs=function(e){return oC.makeAbs(this,e)}});var bRt=y((J5s,ERt)=>{var SOn=Q2e();var YF=Object.create(null);var AOn=CW();ERt.exports=SOn(COn);function COn(e,t){if(YF[e]){YF[e].push(t);return null}else{YF[e]=[t];return wOn(e)}}a(COn,"inflight");function wOn(e){return AOn(a(function t(){var r=YF[e];var n=r.length;var i=TOn(arguments);try{for(var s=0;s<n;s++){r[s].apply(null,i)}}finally{if(r.length>n){r.splice(0,n);process.nextTick(function(){t.apply(null,i)})}else{delete YF[e]}}},"RES"))}a(wOn,"makeres");function TOn(e){var t=e.length;var r=[];for(var n=0;n<t;n++)r[n]=e[n];return r}a(TOn,"slice")});var EOe=y((t8s,ARt)=>{ARt.exports=uC;var xOn=lOe();var SRt=nQ();var Z5s=SRt.Minimatch;var ROn=Yv();var OOn=require("events").EventEmitter;var bOe=require("path");var SOe=require("assert");var XF=sQ();var COe=vRt();var lC=yOe();var POn=lC.setopts;var AOe=lC.ownProp;var wOe=bRt();var e8s=require("util");var NOn=lC.childrenIgnored;var IOn=lC.isIgnored;var kOn=CW();function uC(e,t,r){if(typeof t==="function")r=t,t={};if(!t)t={};if(t.sync){if(r)throw new TypeError("callback provided to sync glob");return COe(e,t)}return new Cs(e,t,r)}a(uC,"glob");uC.sync=COe;var DOn=uC.GlobSync=COe.GlobSync;uC.glob=uC;function LOn(e,t){if(t===null||typeof t!=="object"){return e}var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e}a(LOn,"extend");uC.hasMagic=function(e,t){var r=LOn({},t);r.noprocess=true;var n=new Cs(e,r);var i=n.minimatch.set;if(!e)return false;if(i.length>1)return true;for(var s=0;s<i[0].length;s++){if(typeof i[0][s]!=="string")return true}return false};uC.Glob=Cs;ROn(Cs,OOn);function Cs(e,t,r){if(typeof t==="function"){r=t;t=null}if(t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new DOn(e,t)}if(!(this instanceof Cs))return new Cs(e,t,r);POn(this,e,t);this._didRealPath=false;var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof r==="function"){r=kOn(r);this.on("error",r);this.on("end",function(l){r(null,l)})}var i=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return u();var s=true;for(var o=0;o<n;o++){this._process(this.minimatch.set[o],o,false,u)}s=false;function u(){--i._processing;if(i._processing<=0){if(s){process.nextTick(function(){i._finish()})}else{i._finish()}}}a(u,"done")}a(Cs,"Glob");Cs.prototype._finish=function(){SOe(this instanceof Cs);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();lC.finish(this);this.emit("end",this.found)};Cs.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var e=this.matches.length;if(e===0)return this._finish();var t=this;for(var r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){if(--e===0)t._finish()}a(n,"next")};Cs.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r);var i=this;var s=n.length;if(s===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(u,l){u=i._makeAbs(u);xOn.realpath(u,i.realpathCache,function(c,d){if(!c)o[d]=true;else if(c.syscall==="stat")o[u]=true;else i.emit("error",c);if(--s===0){i.matches[e]=o;t()}})})};Cs.prototype._mark=function(e){return lC.mark(this,e)};Cs.prototype._makeAbs=function(e){return lC.makeAbs(this,e)};Cs.prototype.abort=function(){this.aborted=true;this.emit("abort")};Cs.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Cs.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--;this._process(i[0],i[1],i[2],i[3])}}}};Cs.prototype._process=function(e,t,r,n){SOe(this instanceof Cs);SOe(typeof n==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([e,t,r,n]);return}var i=0;while(typeof e[i]==="string"){i++}var s;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:s=null;break;default:s=e.slice(0,i).join("/");break}var o=e.slice(i);var u;if(s===null)u=".";else if(XF(s)||XF(e.map(function(d){return typeof d==="string"?d:"[*]"}).join("/"))){if(!s||!XF(s))s="/"+s;u=s}else u=s;var l=this._makeAbs(u);if(NOn(this,u))return n();var c=o[0]===SRt.GLOBSTAR;if(c)this._processGlobStar(s,u,l,o,t,r,n);else this._processReaddir(s,u,l,o,t,r,n)};Cs.prototype._processReaddir=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){return u._processReaddir2(e,t,r,n,i,s,c,o)})};Cs.prototype._processReaddir2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n[0];var c=!!this.minimatch.negate;var d=l._glob;var p=this.dot||d.charAt(0)===".";var f=[];for(var m=0;m<o.length;m++){var h=o[m];if(h.charAt(0)!=="."||p){var g;if(c&&!e){g=!h.match(l)}else{g=h.match(l)}if(g)f.push(h)}}var _=f.length;if(_===0)return u();if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var m=0;m<_;m++){var h=f[m];if(e){if(e!=="/")h=e+"/"+h;else h=e+h}if(h.charAt(0)==="/"&&!this.nomount){h=bOe.join(this.root,h)}this._emitMatch(i,h)}return u()}n.shift();for(var m=0;m<_;m++){var h=f[m];var v;if(e){if(e!=="/")h=e+"/"+h;else h=e+h}this._process([h].concat(n),i,s,u)}u()};Cs.prototype._emitMatch=function(e,t){if(this.aborted)return;if(IOn(this,t))return;if(this.paused){this._emitQueue.push([e,t]);return}var r=XF(t)?t:this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute)t=r;if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;var i=this.statCache[r];if(i)this.emit("stat",t,i);this.emit("match",t)};Cs.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,false,t);var r="lstat\0"+e;var n=this;var i=wOe(r,s);if(i)n.fs.lstat(e,i);function s(o,u){if(o&&o.code==="ENOENT")return t();var l=u&&u.isSymbolicLink();n.symlinks[e]=l;if(!l&&u&&!u.isDirectory()){n.cache[e]="FILE";t()}else n._readdir(e,false,t)}a(s,"lstatcb_")};Cs.prototype._readdir=function(e,t,r){if(this.aborted)return;r=wOe("readdir\0"+e+"\0"+t,r);if(!r)return;if(t&&!AOe(this.symlinks,e))return this._readdirInGlobStar(e,r);if(AOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,FOn(this,e,r))};function FOn(e,t,r){return function(n,i){if(n)e._readdirError(t,n,r);else e._readdirEntries(t,i,r)}}a(FOn,"readdirCb");Cs.prototype._readdirEntries=function(e,t,r){if(this.aborted)return;if(!this.mark&&!this.stat){for(var n=0;n<t.length;n++){var i=t[n];if(e==="/")i=e+i;else i=e+"/"+i;this.cache[i]=true}}this.cache[e]=t;return r(null,t)};Cs.prototype._readdirError=function(e,t,r){if(this.aborted)return;switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);this.cache[n]="FILE";if(n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd;i.code=t.code;this.emit("error",i);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict){this.emit("error",t);this.abort()}if(!this.silent)console.error("glob error",t);break}return r()};Cs.prototype._processGlobStar=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){u._processGlobStar2(e,t,r,n,i,s,c,o)})};Cs.prototype._processGlobStar2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n.slice(1);var c=e?[e]:[];var d=c.concat(l);this._process(d,i,false,u);var p=this.symlinks[r];var f=o.length;if(p&&s)return u();for(var m=0;m<f;m++){var h=o[m];if(h.charAt(0)==="."&&!this.dot)continue;var g=c.concat(o[m],l);this._process(g,i,true,u);var _=c.concat(o[m],n);this._process(_,i,true,u)}u()};Cs.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,s){n._processSimple2(e,t,i,s,r)})};Cs.prototype._processSimple2=function(e,t,r,n,i){if(!this.matches[t])this.matches[t]=Object.create(null);if(!n)return i();if(e&&XF(e)&&!this.nomount){var s=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=bOe.join(this.root,e)}else{e=bOe.resolve(this.root,e);if(s)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e);i()};Cs.prototype._stat=function(e,t){var r=this._makeAbs(e);var n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&AOe(this.cache,r)){var i=this.cache[r];if(Array.isArray(i))i="DIR";if(!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var s;var o=this.statCache[r];if(o!==void 0){if(o===false)return t(null,o);else{var u=o.isDirectory()?"DIR":"FILE";if(n&&u==="FILE")return t();else return t(null,u,o)}}var l=this;var c=wOe("stat\0"+r,d);if(c)l.fs.lstat(r,c);function d(p,f){if(f&&f.isSymbolicLink()){return l.fs.stat(r,function(m,h){if(m)l._stat2(e,r,null,f,t);else l._stat2(e,r,m,h,t)})}else{l._stat2(e,r,p,f,t)}}a(d,"lstatcb_")};Cs.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var s=e.slice(-1)==="/";this.statCache[t]=n;if(t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,false,n);var o=true;if(n)o=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(s&&o==="FILE")return i();return i(null,o,n)}});var IRt=y((n8s,NRt)=>{NRt.exports=ROe;ROe.sync=PRt;var ds=require("assert");var xRt=require("path");var CRt=require("fs");var lQ=EOe();var RRt=parseInt("666",8);var BOn={nosort:true,silent:true};var TOe=0;var JF=process.platform==="win32";function ORt(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(function(r){e[r]=e[r]||CRt[r];r=r+"Sync";e[r]=e[r]||CRt[r]});e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}e.disableGlob=e.disableGlob||false;e.glob=e.glob||BOn}a(ORt,"defaults");function ROe(e,t,r){if(typeof t==="function"){r=t;t={}}ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds.equal(typeof r,"function","rimraf: callback function required");ds(t,"rimraf: invalid options argument provided");ds.equal(typeof t,"object","rimraf: options should be object");ORt(t);var n=0;var i=null;var s=0;if(t.disableGlob||!lQ.hasMagic(e))return u(null,[e]);t.lstat(e,function(l,c){if(!l)return u(null,[e]);lQ(e,t.glob,u)});function o(l){i=i||l;if(--s===0)r(i)}a(o,"next");function u(l,c){if(l)return r(l);s=c.length;if(s===0)return r();c.forEach(function(d){xOe(d,t,a(function p(f){if(f){if((f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<t.maxBusyTries){n++;var m=n*100;return setTimeout(function(){xOe(d,t,p)},m)}if(f.code==="EMFILE"&&TOe<t.emfileWait){return setTimeout(function(){xOe(d,t,p)},TOe++)}if(f.code==="ENOENT")f=null}TOe=0;o(f)},"CB"))})}a(u,"afterGlob")}a(ROe,"rimraf");function xOe(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.lstat(e,function(n,i){if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&JF)wRt(e,t,n,r);if(i&&i.isDirectory())return oQ(e,t,n,r);t.unlink(e,function(s){if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return JF?wRt(e,t,s,r):oQ(e,t,s,r);if(s.code==="EISDIR")return oQ(e,t,s,r)}return r(s)})})}a(xOe,"rimraf_");function wRt(e,t,r,n){ds(e);ds(t);ds(typeof n==="function");if(r)ds(r instanceof Error);t.chmod(e,RRt,function(i){if(i)n(i.code==="ENOENT"?null:r);else t.stat(e,function(s,o){if(s)n(s.code==="ENOENT"?null:r);else if(o.isDirectory())oQ(e,t,r,n);else t.unlink(e,n)})})}a(wRt,"fixWinEPERM");function TRt(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.chmodSync(e,RRt)}catch(i){if(i.code==="ENOENT")return;else throw r}try{var n=t.statSync(e)}catch(i){if(i.code==="ENOENT")return;else throw r}if(n.isDirectory())uQ(e,t,r);else t.unlinkSync(e)}a(TRt,"fixWinEPERMSync");function oQ(e,t,r,n){ds(e);ds(t);if(r)ds(r instanceof Error);ds(typeof n==="function");t.rmdir(e,function(i){if(i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM"))MOn(e,t,n);else if(i&&i.code==="ENOTDIR")n(r);else n(i)})}a(oQ,"rmdir");function MOn(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.readdir(e,function(n,i){if(n)return r(n);var s=i.length;if(s===0)return t.rmdir(e,r);var o;i.forEach(function(u){ROe(xRt.join(e,u),t,function(l){if(o)return;if(l)return r(o=l);if(--s===0)t.rmdir(e,r)})})})}a(MOn,"rmkids");function PRt(e,t){t=t||{};ORt(t);ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds(t,"rimraf: missing options");ds.equal(typeof t,"object","rimraf: options should be object");var r;if(t.disableGlob||!lQ.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(s){r=lQ.sync(e,t.glob)}}if(!r.length)return;for(var n=0;n<r.length;n++){var e=r[n];try{var i=t.lstatSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM"&&JF)TRt(e,t,o)}try{if(i&&i.isDirectory())uQ(e,t,null);else t.unlinkSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM")return JF?TRt(e,t,o):uQ(e,t,o);if(o.code!=="EISDIR")throw o;uQ(e,t,o)}}}a(PRt,"rimrafSync");function uQ(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")qOn(e,t)}}a(uQ,"rmdirSync");function qOn(e,t){ds(e);ds(t);t.readdirSync(e).forEach(function(o){PRt(xRt.join(e,o),t)});var r=JF?100:1;var n=0;do{var i=true;try{var s=t.rmdirSync(e,t);i=false;return s}finally{if(++n<r&&i)continue}}while(true)}a(qOn,"rmkidsSync")});var FRt=y((s8s,LRt)=>{var QF=require("path");var kRt=require("fs");var DRt=parseInt("0777",8);LRt.exports=NP.mkdirp=NP.mkdirP=NP;function NP(e,t,r,n){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}var i=t.mode;var s=t.fs||kRt;if(i===void 0){i=DRt}if(!n)n=null;var o=r||function(){};e=QF.resolve(e);s.mkdir(e,i,function(u){if(!u){n=n||e;return o(null,n)}switch(u.code){case"ENOENT":if(QF.dirname(e)===e)return o(u);NP(QF.dirname(e),t,function(l,c){if(l)o(l,c);else NP(e,t,o,c)});break;default:s.stat(e,function(l,c){if(l||!c.isDirectory())o(u,n);else o(null,n)});break}})}a(NP,"mkdirP");NP.sync=a(function e(t,r,n){if(!r||typeof r!=="object"){r={mode:r}}var i=r.mode;var s=r.fs||kRt;if(i===void 0){i=DRt}if(!n)n=null;t=QF.resolve(t);try{s.mkdirSync(t,i);n=n||t}catch(u){switch(u.code){case"ENOENT":n=e(QF.dirname(t),r,n);e(t,r,n);break;default:var o;try{o=s.statSync(t)}catch(l){throw u}if(!o.isDirectory())throw u;break}}return n},"sync")});var zRt=y((gh,VRt)=>{var OOe=require("fs");var MRt=require("path");var cQ=require("constants");var UOn=require("os");var POe=IRt();var qRt=FRt();var o8s=require("os").tmpdir();var URt=POe.sync;var $Rt=MRt.resolve(UOn.tmpdir());var NOe=cQ.O_CREAT|cQ.O_TRUNC|cQ.O_RDWR|cQ.O_EXCL;var ZF=a(function(e){if(typeof e==="function"){return[void 0,e]}var t;var r=new Promise(function(n,i){t=a(function(){var s=Array.from(arguments);var o=s.shift();process.nextTick(function(){if(o){i(o)}else if(s.length===1){n(s[0])}else{n(s)}})},"promiseCallback")});return[r,t]},"promisify");var IP=a(function(e,t){var r=$On(e,t);var n=new Date;var i=[r.prefix,n.getFullYear(),n.getMonth(),n.getDate(),"-",process.pid,"-",(Math.random()*4294967296+1).toString(36),r.suffix].join("");return MRt.join(r.dir||$Rt,i)},"generateName");var $On=a(function(e,t){var r={prefix:null,suffix:null};if(e){switch(typeof e){case"string":r.prefix=e;break;case"object":r=e;break;default:throw new Error("Unknown affix declaration: "+r)}}else{r.prefix=t}return r},"parseAffixes");var ag=false;var jOn=a(function(e){ag=e!==false;return VRt.exports},"track");var BRt=false;var dQ=[];var pQ=[];function IOe(e){if(!ag)return false;GRt();dQ.push(e)}a(IOe,"deleteFileOnExit");function jRt(e){if(!ag)return false;GRt();pQ.push(e)}a(jRt,"deleteDirOnExit");function GRt(){if(!ag)return false;if(!BRt){process.addListener("exit",function(){try{HRt()}catch(e){console.warn("Fail to clean temporary files on exit : ",e);throw e}});BRt=true}}a(GRt,"attachExitListener");function GOn(){if(!ag){return false}var e=0;var t;while((t=dQ.shift())!==void 0){URt(t,{maxBusyTries:6});e++}return e}a(GOn,"cleanupFilesSync");function HOn(e){var t=ZF(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=dQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=dQ.shift())!==void 0){POe(s,{maxBusyTries:6},o)}return r}a(HOn,"cleanupFiles");function VOn(){if(!ag){return false}var e=0;var t;while((t=pQ.shift())!==void 0){URt(t,{maxBusyTries:6});e++}return e}a(VOn,"cleanupDirsSync");function zOn(e){var t=ZF(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=pQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u,n);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=pQ.shift())!==void 0){POe(s,{maxBusyTries:6},o)}return r}a(zOn,"cleanupDirs");function HRt(){if(!ag){return false}var e=GOn();var t=VOn();return{files:e,dirs:t}}a(HRt,"cleanupSync");function KOn(e){var t=ZF(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}HOn(function(n,i){if(n){e(n,{files:i})}else{zOn(function(s,o){e(s,{files:i,dirs:o})})}});return r}a(KOn,"cleanup");var WOn=a((e,t)=>{const r=ZF(t);const n=r[0];t=r[1];let i=IP(e,"d-");qRt(i,448,s=>{if(!s){jRt(i)}t(s,i)});return n},"mkdir");var YOn=a(e=>{let t=IP(e,"d-");qRt.sync(t,448);jRt(t);return t},"mkdirSync");var XOn=a((e,t)=>{const r=ZF(t);const n=r[0];t=r[1];const i=IP(e,"f-");OOe.open(i,NOe,384,(s,o)=>{if(!s){IOe(i)}t(s,{path:i,fd:o})});return n},"open");var JOn=a(e=>{const t=IP(e,"f-");let r=OOe.openSync(t,NOe,384);IOe(t);return{path:t,fd:r}},"openSync");var QOn=a(e=>{const t=IP(e,"s-");let r=OOe.createWriteStream(t,{flags:NOe,mode:384});IOe(t);return r},"createWriteStream");gh.dir=$Rt;gh.track=jOn;gh.mkdir=WOn;gh.mkdirSync=YOn;gh.open=XOn;gh.openSync=JOn;gh.path=IP;gh.cleanup=KOn;gh.cleanupSync=HRt;gh.createWriteStream=QOn});var XRt=y(kP=>{"use strict";var YRt=kP&&kP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(kP,"__esModule",{value:true});kP.generateBuildData=void 0;var fQ=hn();var KRt=require("fs/promises");var WRt=YRt(require("path"));var ZOn=Fn();var ePn=YRt(xs());var tPn=a(async function({systemDirectory:e,buildId:t,logger:r,config:n,publicZuploEnvironmentVariables:i}){return ePn.default.timeFn("Generating build data",async()=>{r.debug(`Generating build data`);const s=await(0,KRt.readFile)(WRt.default.resolve(__dirname,"../../../package.json"),"utf-8");const o=JSON.parse(s);const u={BUILD_ID:t??"",GIT_SHA:process.env.GIT_SHA,TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:fQ.env.isProduction(),BUILD_ENV:fQ.env.NODE_ENV,ZUPLO_VERSION:o.version,API_VERSION:process.env.API_VERSION,COMPATIBILITY_DATE:n?.compatibilityDate,ACCOUNT_NAME:i?.ZUPLO_ACCOUNT_NAME,PROJECT_NAME:i?.ZUPLO_PROJECT_NAME,ENVIRONMENT_TYPE:i?.ZUPLO_ENVIRONMENT_TYPE,COMPATIBILITY_FLAGS:fQ.COMPATIBILITY_FLAG_MAPPINGS?fQ.COMPATIBILITY_FLAG_MAPPINGS[n?.compatibilityDate??"none"]:{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false}};const l=JSON.stringify(u,void 0,2);const c=WRt.default.join(e,ZOn.GENERATED_BUILD_JSON_FILE);try{await(0,KRt.writeFile)(c,l.trimStart(),"utf-8")}catch(d){r.error(d);const p={message:`Error creating file at ${c}`,pluginName:"buildData",severity:"error"};return{warnings:[],errors:[p]}}return{warnings:[],errors:[]}})},"generateBuildData");kP.generateBuildData=tPn});var JRt=y(DP=>{"use strict";var DOe=DP&&DP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(DP,"__esModule",{value:true});DP.generateWorker=void 0;var rPn=DOe(require("fs/promises"));var nPn=DOe(require("path"));var kOe=Fn();var iPn=DOe(xs());var sPn=a(async function({systemDirectory:e,logger:t}){return iPn.default.timeFn("Generating Worker shim",async()=>{t.debug("Generating Worker shim");const r=`import { Handler, ServiceProviderImpl } from "@zuplo/runtime";
|
|
410
|
+
`+await e.crypto.sha256DigestHex(m);const _=await FSn(e.crypto,e.securityCredentials.secretAccessKey,o,e.region,n);const v=await yF(e.crypto,_,g);const S=`${LCt} Credential=${e.securityCredentials.accessKeyId}/${h}, SignedHeaders=${p}, Signature=${(0,FCt.fromArrayBufferToHex)(v)}`;return{amzDate:u.date?void 0:s,authorizationHeader:S,canonicalQuerystring:e.canonicalQuerystring}}a(BSn,"generateAuthenticationHeaderMap")});var txe=y(XX=>{"use strict";Object.defineProperty(XX,"__esModule",{value:true});XX.AwsClient=void 0;var MSn=BCt();var qSn=BE();var _F=class extends qSn.BaseExternalAccountClient{static{a(this,"AwsClient")}constructor(t,r){super(t,r);this.environmentId=t.credential_source.environment_id;this.regionUrl=t.credential_source.region_url;this.securityCredentialsUrl=t.credential_source.url;this.regionalCredVerificationUrl=t.credential_source.regional_cred_verification_url;this.imdsV2SessionTokenUrl=t.credential_source.imdsv2_session_token_url;this.awsRequestSigner=null;this.region="";this.validateEnvironmentId()}validateEnvironmentId(){var t;const r=(t=this.environmentId)===null||t===void 0?void 0:t.match(/^(aws)(\d+)$/);if(!r||!this.regionalCredVerificationUrl){throw new Error('No valid AWS "credential_source" provided')}else if(parseInt(r[2],10)!==1){throw new Error(`aws version "${r[2]}" is not supported in the current build.`)}}async retrieveSubjectToken(){if(!this.awsRequestSigner){const i={};if(this.shouldUseMetadataServer()&&this.imdsV2SessionTokenUrl){i["x-aws-ec2-metadata-token"]=await this.getImdsV2SessionToken()}this.region=await this.getAwsRegion(i);this.awsRequestSigner=new MSn.AwsRequestSigner(async()=>{if(this.securityCredentialsFromEnv){return this.securityCredentialsFromEnv}const s=await this.getAwsRoleName(i);const o=await this.getAwsSecurityCredentials(s,i);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}},this.region)}const t=await this.awsRequestSigner.getRequestOptions({url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"});const r=[];const n=Object.assign({"x-goog-cloud-target-resource":this.audience},t.headers);for(const i in n){r.push({key:i,value:n[i]})}return encodeURIComponent(JSON.stringify({url:t.url,method:t.method,headers:r}))}async getImdsV2SessionToken(){const t={url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};const r=await this.transporter.request(t);return r.data}async getAwsRegion(t){if(this.regionFromEnv){return this.regionFromEnv}if(!this.regionUrl){throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"')}const r={url:this.regionUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data.substr(0,n.data.length-1)}async getAwsRoleName(t){if(!this.securityCredentialsUrl){throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"')}const r={url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data}async getAwsSecurityCredentials(t,r){const n=await this.transporter.request({url:`${this.securityCredentialsUrl}/${t}`,responseType:"json",headers:r});return n.data}shouldUseMetadataServer(){return!this.regionFromEnv||!this.securityCredentialsFromEnv}get regionFromEnv(){return process.env["AWS_REGION"]||process.env["AWS_DEFAULT_REGION"]||null}get securityCredentialsFromEnv(){if(process.env["AWS_ACCESS_KEY_ID"]&&process.env["AWS_SECRET_ACCESS_KEY"]){return{accessKeyId:process.env["AWS_ACCESS_KEY_ID"],secretAccessKey:process.env["AWS_SECRET_ACCESS_KEY"],token:process.env["AWS_SESSION_TOKEN"]}}return null}};XX.AwsClient=_F;_F.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";_F.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var axe=y(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:true});Lo.InvalidSubjectTokenError=Lo.InvalidMessageFieldError=Lo.InvalidCodeFieldError=Lo.InvalidTokenTypeFieldError=Lo.InvalidExpirationTimeFieldError=Lo.InvalidSuccessFieldError=Lo.InvalidVersionFieldError=Lo.ExecutableResponseError=Lo.ExecutableResponse=void 0;var JX="urn:ietf:params:oauth:token-type:saml2";var rxe="urn:ietf:params:oauth:token-type:id_token";var nxe="urn:ietf:params:oauth:token-type:jwt";var ixe=class{static{a(this,"ExecutableResponse")}constructor(t){if(!t.version){throw new QX("Executable response must contain a 'version' field.")}if(t.success===void 0){throw new ZX("Executable response must contain a 'success' field.")}this.version=t.version;this.success=t.success;if(this.success){this.expirationTime=t.expiration_time;this.tokenType=t.token_type;if(this.tokenType!==JX&&this.tokenType!==rxe&&this.tokenType!==nxe){throw new eJ(`Executable response must contain a 'token_type' field when successful and it must be one of ${rxe}, ${nxe}, or ${JX}.`)}if(this.tokenType===JX){if(!t.saml_response){throw new vF(`Executable response must contain a 'saml_response' field when token_type=${JX}.`)}this.subjectToken=t.saml_response}else{if(!t.id_token){throw new vF(`Executable response must contain a 'id_token' field when token_type=${rxe} or ${nxe}.`)}this.subjectToken=t.id_token}}else{if(!t.code){throw new tJ("Executable response must contain a 'code' field when unsuccessful.")}if(!t.message){throw new rJ("Executable response must contain a 'message' field when unsuccessful.")}this.errorCode=t.code;this.errorMessage=t.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};Lo.ExecutableResponse=ixe;var tg=class extends Error{static{a(this,"ExecutableResponseError")}constructor(t){super(t);Object.setPrototypeOf(this,new.target.prototype)}};Lo.ExecutableResponseError=tg;var QX=class extends tg{static{a(this,"InvalidVersionFieldError")}};Lo.InvalidVersionFieldError=QX;var ZX=class extends tg{static{a(this,"InvalidSuccessFieldError")}};Lo.InvalidSuccessFieldError=ZX;var sxe=class extends tg{static{a(this,"InvalidExpirationTimeFieldError")}};Lo.InvalidExpirationTimeFieldError=sxe;var eJ=class extends tg{static{a(this,"InvalidTokenTypeFieldError")}};Lo.InvalidTokenTypeFieldError=eJ;var tJ=class extends tg{static{a(this,"InvalidCodeFieldError")}};Lo.InvalidCodeFieldError=tJ;var rJ=class extends tg{static{a(this,"InvalidMessageFieldError")}};Lo.InvalidMessageFieldError=rJ;var vF=class extends tg{static{a(this,"InvalidSubjectTokenError")}};Lo.InvalidSubjectTokenError=vF});var MCt=y(nJ=>{"use strict";Object.defineProperty(nJ,"__esModule",{value:true});nJ.PluggableAuthHandler=void 0;var USn=iJ();var QA=axe();var $Sn=require("child_process");var oxe=require("fs");var uxe=class e{static{a(this,"PluggableAuthHandler")}constructor(t){if(!t.command){throw new Error("No command provided.")}this.commandComponents=e.parseCommand(t.command);this.timeoutMillis=t.timeoutMillis;if(!this.timeoutMillis){throw new Error("No timeoutMillis provided.")}this.outputFile=t.outputFile}retrieveResponseFromExecutable(t){return new Promise((r,n)=>{const i=$Sn.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(t)}});let s="";i.stdout.on("data",u=>{s+=u});i.stderr.on("data",u=>{s+=u});const o=setTimeout(()=>{i.removeAllListeners();i.kill();return n(new Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);i.on("close",u=>{clearTimeout(o);if(u===0){try{const l=JSON.parse(s);const c=new QA.ExecutableResponse(l);return r(c)}catch(l){if(l instanceof QA.ExecutableResponseError){return n(l)}return n(new QA.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}}else{return n(new USn.ExecutableError(s,u.toString()))}})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0){return void 0}let t;try{t=await oxe.promises.realpath(this.outputFile)}catch(n){return void 0}if(!(await oxe.promises.lstat(t)).isFile()){return void 0}const r=await oxe.promises.readFile(t,{encoding:"utf8"});if(r===""){return void 0}try{const n=JSON.parse(r);const i=new QA.ExecutableResponse(n);if(i.isValid()){return new QA.ExecutableResponse(n)}return void 0}catch(n){if(n instanceof QA.ExecutableResponseError){throw n}throw new QA.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(t){const r=t.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r){throw new Error(`Provided command: "${t}" could not be parsed.`)}for(let n=0;n<r.length;n++){if(r[n][0]==='"'&&r[n].slice(-1)==='"'){r[n]=r[n].slice(1,-1)}}return r}};nJ.PluggableAuthHandler=uxe});var iJ=y(VO=>{"use strict";Object.defineProperty(VO,"__esModule",{value:true});VO.PluggableAuthClient=VO.ExecutableError=void 0;var jSn=BE();var GSn=axe();var HSn=MCt();var sJ=class extends Error{static{a(this,"ExecutableError")}constructor(t,r){super(`The executable failed with exit code: ${r} and error message: ${t}.`);this.code=r;Object.setPrototypeOf(this,new.target.prototype)}};VO.ExecutableError=sJ;var VSn=30*1e3;var qCt=5*1e3;var UCt=120*1e3;var zSn="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES";var $Ct=1;var lxe=class extends jSn.BaseExternalAccountClient{static{a(this,"PluggableAuthClient")}constructor(t,r){super(t,r);if(!t.credential_source.executable){throw new Error('No valid Pluggable Auth "credential_source" provided.')}this.command=t.credential_source.executable.command;if(!this.command){throw new Error('No valid Pluggable Auth "credential_source" provided.')}if(t.credential_source.executable.timeout_millis===void 0){this.timeoutMillis=VSn}else{this.timeoutMillis=t.credential_source.executable.timeout_millis;if(this.timeoutMillis<qCt||this.timeoutMillis>UCt){throw new Error(`Timeout must be between ${qCt} and ${UCt} milliseconds.`)}}this.outputFile=t.credential_source.executable.output_file;this.handler=new HSn.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile})}async retrieveSubjectToken(){if(process.env[zSn]!=="1"){throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.")}let t=void 0;if(this.outputFile){t=await this.handler.retrieveCachedResponse()}if(!t){const r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience);r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType);r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0");if(this.outputFile){r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile)}const n=this.getServiceAccountEmail();if(n){r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n)}t=await this.handler.retrieveResponseFromExecutable(r)}if(t.version>$Ct){throw new Error(`Version of executable is not currently supported, maximum supported version is ${$Ct}.`)}if(!t.success){throw new sJ(t.errorMessage,t.errorCode)}if(this.outputFile){if(!t.expirationTime){throw new GSn.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.")}}if(t.isExpired()){throw new Error("Executable response is expired.")}return t.subjectToken}};VO.PluggableAuthClient=lxe});var dxe=y(aJ=>{"use strict";Object.defineProperty(aJ,"__esModule",{value:true});aJ.ExternalAccountClient=void 0;var KSn=BE();var WSn=ZTe();var YSn=txe();var XSn=iJ();var cxe=class{static{a(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(t,r){var n,i;if(t&&t.type===KSn.EXTERNAL_ACCOUNT_TYPE){if((n=t.credential_source)===null||n===void 0?void 0:n.environment_id){return new YSn.AwsClient(t,r)}else if((i=t.credential_source)===null||i===void 0?void 0:i.executable){return new XSn.PluggableAuthClient(t,r)}else{return new WSn.IdentityPoolClient(t,r)}}else{return null}}};aJ.ExternalAccountClient=cxe});var GCt=y(zO=>{"use strict";Object.defineProperty(zO,"__esModule",{value:true});zO.ExternalAccountAuthorizedUserClient=zO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var JSn=wO();var jCt=jTe();var QSn=Ey();var ZSn=require("stream");var eAn=BE();zO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var pxe=class extends jCt.OAuthClientAuthHandler{static{a(this,"ExternalAccountAuthorizedUserHandler")}constructor(t,r,n){super(n);this.url=t;this.transporter=r}async refreshToken(t,r){const n=new URLSearchParams({grant_type:"refresh_token",refresh_token:t});const i={"Content-Type":"application/x-www-form-urlencoded",...r};const s={url:this.url,method:"POST",headers:i,data:n.toString(),responseType:"json"};this.applyClientAuthenticationOptions(s);try{const o=await this.transporter.request(s);const u=o.data;u.res=o;return u}catch(o){if(o instanceof QSn.GaxiosError&&o.response){throw(0,jCt.getErrorFromOAuthErrorResponse)(o.response.data,o)}throw o}}};var fxe=class extends JSn.AuthClient{static{a(this,"ExternalAccountAuthorizedUserClient")}constructor(t,r){super();this.refreshToken=t.refresh_token;const n={confidentialClientType:"basic",clientId:t.client_id,clientSecret:t.client_secret};this.externalAccountAuthorizedUserHandler=new pxe(t.token_url,this.transporter,n);this.cachedAccessToken=null;this.quotaProjectId=t.quota_project_id;if(typeof(r===null||r===void 0?void 0:r.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=eAn.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=r.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(r===null||r===void 0?void 0:r.forceRefreshOnFailure)}async getAccessToken(){if(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof ZSn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){const t=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);this.cachedAccessToken={access_token:t.access_token,expiry_date:new Date().getTime()+t.expires_in*1e3,res:t.res};if(t.refresh_token!==void 0){this.refreshToken=t.refresh_token}return this.cachedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};zO.ExternalAccountAuthorizedUserClient=fxe});var zCt=y(WO=>{"use strict";Object.defineProperty(WO,"__esModule",{value:true});WO.GoogleAuth=WO.CLOUD_SDK_CLIENT_ID=void 0;var tAn=require("child_process");var EF=require("fs");var mxe=ZY();var rAn=require("os");var hxe=require("path");var nAn=AO();var iAn=eF();var sAn=Cwe();var aAn=Twe();var oAn=xwe();var KO=FTe();var gxe=MTe();var oJ=UTe();var uAn=dxe();var bF=BE();var HCt=GCt();WO.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";var VCt={NO_PROJECT_ID_FOUND:"Unable to detect a Project Id in the current environment. \nTo learn more about authentication and Google APIs, visit: \nhttps://cloud.google.com/docs/authentication/getting-started"};var uJ=class{static{a(this,"GoogleAuth")}get isGCE(){return this.checkIsGCE}constructor(t){this.checkIsGCE=void 0;this.jsonContent=null;this.cachedCredential=null;t=t||{};this._cachedProjectId=t.projectId||null;this.cachedCredential=t.authClient||null;this.keyFilename=t.keyFilename||t.keyFile;this.scopes=t.scopes;this.jsonContent=t.credentials||null;this.clientOptions=t.clientOptions}setGapicJWTValues(t){t.defaultServicePath=this.defaultServicePath;t.useJWTAccessWithScope=this.useJWTAccessWithScope;t.defaultScopes=this.defaultScopes}getProjectId(t){if(t){this.getProjectIdAsync().then(r=>t(null,r),t)}else{return this.getProjectIdAsync()}}async getProjectIdOptional(){try{return await this.getProjectId()}catch(t){if(t instanceof Error&&t.message===VCt.NO_PROJECT_ID_FOUND){return null}else{throw t}}}async findAndCacheProjectId(){let t=null;t||(t=await this.getProductionProjectId());t||(t=await this.getFileProjectId());t||(t=await this.getDefaultServiceProjectId());t||(t=await this.getGCEProjectId());t||(t=await this.getExternalAccountClientProjectId());if(t){this._cachedProjectId=t;return t}else{throw new Error(VCt.NO_PROJECT_ID_FOUND)}}async getProjectIdAsync(){if(this._cachedProjectId){return this._cachedProjectId}if(!this._findProjectIdPromise){this._findProjectIdPromise=this.findAndCacheProjectId()}return this._findProjectIdPromise}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(t={},r){let n;if(typeof t==="function"){r=t}else{n=t}if(r){this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r)}else{return this.getApplicationDefaultAsync(n)}}async getApplicationDefaultAsync(t={}){if(this.cachedCredential){return await this.prepareAndCacheADC(this.cachedCredential)}const r=process.env["GOOGLE_CLOUD_QUOTA_PROJECT"];let n;n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(t);if(n){if(n instanceof KO.JWT){n.scopes=this.scopes}else if(n instanceof bF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}n=await this._tryGetApplicationCredentialsFromWellKnownFile(t);if(n){if(n instanceof KO.JWT){n.scopes=this.scopes}else if(n instanceof bF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}let i;try{i=await this._checkIsGCE()}catch(s){if(s instanceof Error){s.message=`Unexpected error determining execution environment: ${s.message}`}throw s}if(!i){throw new Error("Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.")}t.scopes=this.getAnyScopes();return await this.prepareAndCacheADC(new sAn.Compute(t),r)}async prepareAndCacheADC(t,r){const n=await this.getProjectIdOptional();if(r){t.quotaProjectId=r}this.cachedCredential=t;return{credential:t,projectId:n}}async _checkIsGCE(){if(this.checkIsGCE===void 0){this.checkIsGCE=await mxe.isAvailable()}return this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(t){const r=process.env["GOOGLE_APPLICATION_CREDENTIALS"]||process.env["google_application_credentials"];if(!r||r.length===0){return null}try{return this._getApplicationCredentialsFromFilePath(r,t)}catch(n){if(n instanceof Error){n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`}throw n}}async _tryGetApplicationCredentialsFromWellKnownFile(t){let r=null;if(this._isWindows()){r=process.env["APPDATA"]}else{const i=process.env["HOME"];if(i){r=hxe.join(i,".config")}}if(r){r=hxe.join(r,"gcloud","application_default_credentials.json");if(!EF.existsSync(r)){r=null}}if(!r){return null}const n=await this._getApplicationCredentialsFromFilePath(r,t);return n}async _getApplicationCredentialsFromFilePath(t,r={}){if(!t||t.length===0){throw new Error("The file path is invalid.")}try{t=EF.realpathSync(t);if(!EF.lstatSync(t).isFile()){throw new Error}}catch(i){if(i instanceof Error){i.message=`The file at ${t} does not exist, or it is not a file. ${i.message}`}throw i}const n=EF.createReadStream(t);return this.fromStream(n,r)}fromImpersonatedJSON(t){var r,n,i,s;if(!t){throw new Error("Must pass in a JSON object containing an impersonated refresh token")}if(t.type!==oJ.IMPERSONATED_ACCOUNT_TYPE){throw new Error(`The incoming JSON object does not have the "${oJ.IMPERSONATED_ACCOUNT_TYPE}" type`)}if(!t.source_credentials){throw new Error("The incoming JSON object does not contain a source_credentials field")}if(!t.service_account_impersonation_url){throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field")}const o=new gxe.UserRefreshClient(t.source_credentials.client_id,t.source_credentials.client_secret,t.source_credentials.refresh_token);const u=(n=(r=/(?<target>[^/]+):generateAccessToken$/.exec(t.service_account_impersonation_url))===null||r===void 0?void 0:r.groups)===null||n===void 0?void 0:n.target;if(!u){throw new RangeError(`Cannot extract target principal from ${t.service_account_impersonation_url}`)}const l=(i=this.getAnyScopes())!==null&&i!==void 0?i:[];const c=new oJ.Impersonated({delegates:(s=t.delegates)!==null&&s!==void 0?s:[],sourceClient:o,targetPrincipal:u,targetScopes:Array.isArray(l)?l:[l]});return c}fromJSON(t,r={}){let n;r=r||{};if(t.type===gxe.USER_REFRESH_ACCOUNT_TYPE){n=new gxe.UserRefreshClient(r);n.fromJSON(t)}else if(t.type===oJ.IMPERSONATED_ACCOUNT_TYPE){n=this.fromImpersonatedJSON(t)}else if(t.type===bF.EXTERNAL_ACCOUNT_TYPE){n=uAn.ExternalAccountClient.fromJSON(t,r);n.scopes=this.getAnyScopes()}else if(t.type===HCt.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE){n=new HCt.ExternalAccountAuthorizedUserClient(t,r)}else{r.scopes=this.scopes;n=new KO.JWT(r);this.setGapicJWTValues(n);n.fromJSON(t)}return n}_cacheClientFromJSON(t,r){const n=this.fromJSON(t,r);this.jsonContent=t;this.cachedCredential=n;return n}fromStream(t,r={},n){let i={};if(typeof r==="function"){n=r}else{i=r}if(n){this.fromStreamAsync(t,i).then(s=>n(null,s),n)}else{return this.fromStreamAsync(t,i)}}fromStreamAsync(t,r){return new Promise((n,i)=>{if(!t){throw new Error("Must pass in a stream containing the Google auth settings.")}let s="";t.setEncoding("utf8").on("error",i).on("data",o=>s+=o).on("end",()=>{try{try{const o=JSON.parse(s);const u=this._cacheClientFromJSON(o,r);return n(u)}catch(o){if(!this.keyFilename)throw o;const u=new KO.JWT({...this.clientOptions,keyFile:this.keyFilename});this.cachedCredential=u;this.setGapicJWTValues(u);return n(u)}}catch(o){return i(o)}})})}fromAPIKey(t,r){r=r||{};const n=new KO.JWT(r);n.fromAPIKey(t);return n}_isWindows(){const t=rAn.platform();if(t&&t.length>=3){if(t.substring(0,3).toLowerCase()==="win"){return true}}return false}async getDefaultServiceProjectId(){return new Promise(t=>{(0,tAn.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n){try{const i=JSON.parse(n).configuration.properties.core.project;t(i);return}catch(i){}}t(null)})})}getProductionProjectId(){return process.env["GCLOUD_PROJECT"]||process.env["GOOGLE_CLOUD_PROJECT"]||process.env["gcloud_project"]||process.env["google_cloud_project"]}async getFileProjectId(){if(this.cachedCredential){return this.cachedCredential.projectId}if(this.keyFilename){const r=await this.getClient();if(r&&r.projectId){return r.projectId}}const t=await this._tryGetApplicationCredentialsFromEnvironmentVariable();if(t){return t.projectId}else{return null}}async getExternalAccountClientProjectId(){if(!this.jsonContent||this.jsonContent.type!==bF.EXTERNAL_ACCOUNT_TYPE){return null}const t=await this.getClient();return await t.getProjectId()}async getGCEProjectId(){try{const t=await mxe.project("project-id");return t}catch(t){return null}}getCredentials(t){if(t){this.getCredentialsAsync().then(r=>t(null,r),t)}else{return this.getCredentialsAsync()}}async getCredentialsAsync(){const t=await this.getClient();if(t instanceof bF.BaseExternalAccountClient){const i=t.getServiceAccountEmail();if(i){return{client_email:i}}}if(this.jsonContent){const i={client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key};return i}const r=await this._checkIsGCE();if(!r){throw new Error("Unknown error.")}const n=await mxe.instance({property:"service-accounts/",params:{recursive:"true"}});if(!n||!n.default||!n.default.email){throw new Error("Failure from metadata server.")}return{client_email:n.default.email}}async getClient(){if(!this.cachedCredential){if(this.jsonContent){this._cacheClientFromJSON(this.jsonContent,this.clientOptions)}else if(this.keyFilename){const t=hxe.resolve(this.keyFilename);const r=EF.createReadStream(t);await this.fromStreamAsync(r,this.clientOptions)}else{await this.getApplicationDefaultAsync(this.clientOptions)}}return this.cachedCredential}async getIdTokenClient(t){const r=await this.getClient();if(!("fetchIdToken"in r)){throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.")}return new aAn.IdTokenClient({targetAudience:t,idTokenProvider:r})}async getAccessToken(){const t=await this.getClient();return(await t.getAccessToken()).token}async getRequestHeaders(t){const r=await this.getClient();return r.getRequestHeaders(t)}async authorizeRequest(t){t=t||{};const r=t.url||t.uri;const n=await this.getClient();const i=await n.getRequestHeaders(r);t.headers=Object.assign(t.headers||{},i);return t}async request(t){const r=await this.getClient();return r.request(t)}getEnv(){return(0,oAn.getEnv)()}async sign(t){const r=await this.getClient();const n=(0,nAn.createCrypto)();if(r instanceof KO.JWT&&r.key){const s=await n.sign(r.key,t);return s}const i=await this.getCredentials();if(!i.client_email){throw new Error("Cannot sign data without `client_email`.")}return this.signBlob(n,i.client_email,t)}async signBlob(t,r,n){const i=`https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${r}:signBlob`;const s=await this.request({method:"POST",url:i,data:{payload:t.encodeBase64StringUtf8(n)}});return s.data.signedBlob}};WO.GoogleAuth=uJ;uJ.DefaultTransporter=iAn.DefaultTransporter});var KCt=y(lJ=>{"use strict";Object.defineProperty(lJ,"__esModule",{value:true});lJ.IAMAuth=void 0;var yxe=class{static{a(this,"IAMAuth")}constructor(t,r){this.selector=t;this.token=r;this.selector=t;this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};lJ.IAMAuth=yxe});var WCt=y(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:true});ph.DownscopedClient=ph.EXPIRATION_TIME_OFFSET=ph.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var lAn=require("stream");var cAn=wO();var dAn=HTe();var pAn="urn:ietf:params:oauth:grant-type:token-exchange";var fAn="urn:ietf:params:oauth:token-type:access_token";var mAn="urn:ietf:params:oauth:token-type:access_token";var hAn="https://sts.googleapis.com/v1/token";ph.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;ph.EXPIRATION_TIME_OFFSET=5*60*1e3;var _xe=class extends cAn.AuthClient{static{a(this,"DownscopedClient")}constructor(t,r,n,i){super();this.authClient=t;this.credentialAccessBoundary=r;if(r.accessBoundary.accessBoundaryRules.length===0){throw new Error("At least one access boundary rule needs to be defined.")}else if(r.accessBoundary.accessBoundaryRules.length>ph.MAX_ACCESS_BOUNDARY_RULES_COUNT){throw new Error(`The provided access boundary has more than ${ph.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`)}for(const s of r.accessBoundary.accessBoundaryRules){if(s.availablePermissions.length===0){throw new Error("At least one permission should be defined in access boundary rules.")}}this.stsCredential=new dAn.StsCredentials(hAn);this.cachedDownscopedAccessToken=null;if(typeof(n===null||n===void 0?void 0:n.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=ph.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(n===null||n===void 0?void 0:n.forceRefreshOnFailure);this.quotaProjectId=i}setCredentials(t){if(!t.expiry_date){throw new Error("The access token expiry_date field is missing in the provided credentials.")}super.setCredentials(t);this.cachedDownscopedAccessToken=t}async getAccessToken(){if(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof lAn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){var t;const r=(await this.authClient.getAccessToken()).token;const n={grantType:pAn,requestedTokenType:fAn,subjectToken:r,subjectTokenType:mAn};const i=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary);const s=((t=this.authClient.credentials)===null||t===void 0?void 0:t.expiry_date)||null;const o=i.expires_in?new Date().getTime()+i.expires_in*1e3:s;this.cachedDownscopedAccessToken={access_token:i.access_token,expiry_date:o,res:i.res};this.credentials={};Object.assign(this.credentials,this.cachedDownscopedAccessToken);delete this.credentials.res;this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null});return this.cachedDownscopedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};ph.DownscopedClient=_xe});var vxe=y(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:true});mn.GoogleAuth=mn.auth=mn.DefaultTransporter=mn.PluggableAuthClient=mn.DownscopedClient=mn.BaseExternalAccountClient=mn.ExternalAccountClient=mn.IdentityPoolClient=mn.AwsClient=mn.UserRefreshClient=mn.LoginTicket=mn.OAuth2Client=mn.CodeChallengeMethod=mn.Impersonated=mn.JWT=mn.JWTAccess=mn.IdTokenClient=mn.IAMAuth=mn.GCPEnv=mn.Compute=mn.AuthClient=void 0;var YCt=zCt();Object.defineProperty(mn,"GoogleAuth",{enumerable:true,get:function(){return YCt.GoogleAuth}});var gAn=wO();Object.defineProperty(mn,"AuthClient",{enumerable:true,get:function(){return gAn.AuthClient}});var yAn=Cwe();Object.defineProperty(mn,"Compute",{enumerable:true,get:function(){return yAn.Compute}});var _An=xwe();Object.defineProperty(mn,"GCPEnv",{enumerable:true,get:function(){return _An.GCPEnv}});var vAn=KCt();Object.defineProperty(mn,"IAMAuth",{enumerable:true,get:function(){return vAn.IAMAuth}});var EAn=Twe();Object.defineProperty(mn,"IdTokenClient",{enumerable:true,get:function(){return EAn.IdTokenClient}});var bAn=DTe();Object.defineProperty(mn,"JWTAccess",{enumerable:true,get:function(){return bAn.JWTAccess}});var SAn=FTe();Object.defineProperty(mn,"JWT",{enumerable:true,get:function(){return SAn.JWT}});var AAn=UTe();Object.defineProperty(mn,"Impersonated",{enumerable:true,get:function(){return AAn.Impersonated}});var XCt=jA();Object.defineProperty(mn,"CodeChallengeMethod",{enumerable:true,get:function(){return XCt.CodeChallengeMethod}});Object.defineProperty(mn,"OAuth2Client",{enumerable:true,get:function(){return XCt.OAuth2Client}});var CAn=bwe();Object.defineProperty(mn,"LoginTicket",{enumerable:true,get:function(){return CAn.LoginTicket}});var wAn=MTe();Object.defineProperty(mn,"UserRefreshClient",{enumerable:true,get:function(){return wAn.UserRefreshClient}});var TAn=txe();Object.defineProperty(mn,"AwsClient",{enumerable:true,get:function(){return TAn.AwsClient}});var xAn=ZTe();Object.defineProperty(mn,"IdentityPoolClient",{enumerable:true,get:function(){return xAn.IdentityPoolClient}});var RAn=dxe();Object.defineProperty(mn,"ExternalAccountClient",{enumerable:true,get:function(){return RAn.ExternalAccountClient}});var OAn=BE();Object.defineProperty(mn,"BaseExternalAccountClient",{enumerable:true,get:function(){return OAn.BaseExternalAccountClient}});var PAn=WCt();Object.defineProperty(mn,"DownscopedClient",{enumerable:true,get:function(){return PAn.DownscopedClient}});var NAn=iJ();Object.defineProperty(mn,"PluggableAuthClient",{enumerable:true,get:function(){return NAn.PluggableAuthClient}});var IAn=eF();Object.defineProperty(mn,"DefaultTransporter",{enumerable:true,get:function(){return IAn.DefaultTransporter}});var kAn=new YCt.GoogleAuth;mn.auth=kAn});var XO=y(YO=>{"use strict";var DAn=YO&&YO.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(YO,"__esModule",{value:true});YO.getServiceAccountIdToken=void 0;var LAn=vxe();var FAn=DAn(Fm());var BAn=new LAn.GoogleAuth;var JCt=new FAn.default({max:50,maxAge:1e3*60*50});async function MAn(e){let t=JCt.get(e);if(!t){const r=await BAn.getIdTokenClient(e);t=await r.idTokenProvider.fetchIdToken(e);JCt.set(e,t)}return t}a(MAn,"getServiceAccountIdToken");YO.getServiceAccountIdToken=MAn});var rwt=y(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:true});kf.mergeHeaders=kf.createFinalURL=kf.defaultBodySerializer=kf.defaultQuerySerializer=kf.createClient=void 0;var JO=Hc();var qAn=XO();var UAn=/\/*$/;async function $An(e){const{baseUrl:t,fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:i,zuploExtensions:s,...o}=e;const u=s?.fastifyRequest.log;const l=s?.fastifyRequest.id;const c=s?.options?.userSub??s?.fastifyRequest.getUserSub();const d=new Headers({"zuplo-user":c,"zp-rid":l,...o.headers??{}});const p=await(0,qAn.getServiceAccountIdToken)(t);d.set("Authorization",`Bearer ${p}`);async function f(m,h){const{headers:g,body:_,params:v={},parseAs:S="json",querySerializer:E=n??QCt,bodySerializer:b=i??ZCt,...A}=h||{};const C=ewt(m,{baseUrl:t,params:v,querySerializer:E});if(A.method){if(["GET","DELETE","HEAD","OPTIONS","TRACE"].includes(A.method.toUpperCase()??"")){d.delete("Content-Type")}else{d.set("Content-Type","application/json")}}else{d.delete("Content-Type")}const T=twt(d,g,v.header);const O={redirect:"follow",...o,...A,headers:T};if(_)O.body=b(_);if(O.body instanceof FormData)T.delete("Content-Type");const P=await r(C,O);if(P.status===404){const R=await P.json();if(R&&R.hasOwnProperty("type")&&R.hasOwnProperty("title")&&R.hasOwnProperty("status")){throw new JO.ApiError(R)}throw new JO.ApiError(JO.Problems.NOT_FOUND)}if(P.status===204||P.headers.get("Content-Length")==="0"){return P.ok?{data:{},response:P}:{error:{},response:P}}if(P.ok){let R=P.body;if(S!=="stream"){const I=P.clone();R=typeof I[S]==="function"?await I[S]():await I.text()}return{data:R,response:P}}else{u.debug(`Error on internal api: path: ${C}, status: ${P.status}, headers: ${JSON.stringify(P.headers)}, body: ${await P.clone().text()}`);let R={};try{R=await P.clone().json();if(R.type&&R.status&&R.title){throw new JO.ApiError(R)}}catch(I){}throw new JO.ApiError(JO.Problems.INTERNAL_SERVER_ERROR)}}a(f,"coreFetch");return{async GET(m,h){return f(m,{...h,method:"GET"})},async PUT(m,h){return f(m,{...h,method:"PUT"})},async POST(m,h){return f(m,{...h,method:"POST"})},async DELETE(m,h){return f(m,{...h,method:"DELETE"})},async OPTIONS(m,h){return f(m,{...h,method:"OPTIONS"})},async HEAD(m,h){return f(m,{...h,method:"HEAD"})},async PATCH(m,h){return f(m,{...h,method:"PATCH"})},async TRACE(m,h){return f(m,{...h,method:"TRACE"})}}}a($An,"createClient");kf.createClient=$An;function QCt(e){const t=new URLSearchParams;if(e&&typeof e==="object"){for(const[r,n]of Object.entries(e)){if(n===void 0||n===null)continue;t.set(r,n)}}return t.toString()}a(QCt,"defaultQuerySerializer");kf.defaultQuerySerializer=QCt;function ZCt(e){return JSON.stringify(e)}a(ZCt,"defaultBodySerializer");kf.defaultBodySerializer=ZCt;function ewt(e,t){let r=`${t.baseUrl?t.baseUrl.replace(UAn,""):""}${e}`;if(t.params.path){for(const[n,i]of Object.entries(t.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(i)))}if(t.params.query){const n=t.querySerializer(t.params.query);if(n)r+=`?${n}`}return r}a(ewt,"createFinalURL");kf.createFinalURL=ewt;function twt(...e){const t=new Headers;for(const r of e){if(!r||typeof r!=="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n){if(s!==void 0&&s!==null){t.set(i,s)}}}return t}a(twt,"mergeHeaders");kf.mergeHeaders=twt});var nwt=y(ME=>{"use strict";var jAn=ME&&ME.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ME,"__esModule",{value:true});ME.ApiKeyService=ME.createApiKeyServiceClient=void 0;var QO=Hc();var GAn=vxe();var cJ=jAn(Jd());var HAn=rwt();async function VAn(e){return(0,HAn.createClient)({baseUrl:cJ.default.API_KEY_MANAGEMENT_SERVICE_URL,zuploExtensions:{fastifyRequest:e}})}a(VAn,"createApiKeyServiceClient");ME.createApiKeyServiceClient=VAn;var Exe=class{static{a(this,"ApiKeyService")}logger;requestId;constructor(t){this.logger=t.log;this.requestId=t.id}async fetchGCP(t,r={}){this.logger.info(`Fetching with GCP JWT ${r.method} ${t} from Api Key Service API.`);const n=new GAn.GoogleAuth;const i=await n.getIdTokenClient(cJ.default.API_KEY_MANAGEMENT_SERVICE_URL);this.logger.info(`Payload to send: ${JSON.stringify({url:`${cJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:"GET",body:r.body,headers:{...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}}})}`);const s=await i.getRequestHeaders();const o=await i.request({url:`${cJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:r.method||"GET",body:r.body,headers:{...s,...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}},validateStatus:u=>u>=200&&u<500});if(o.status===404){const u=await o.data;if(u&&u.hasOwnProperty("type")&&u.hasOwnProperty("title")&&u.hasOwnProperty("status")){throw new QO.ApiError(u)}throw new QO.ApiError(QO.Problems.NOT_FOUND)}if(o.status>=300){this.logger.debug(`Error on api-key-service: path: ${t}, status: ${o.status}, headers: ${JSON.stringify(o.headers)}, body: ${JSON.stringify(o.data)}`);const u=o.data;if(u.type&&u.status&&u.title){throw new QO.ApiError(u)}this.logger.error(`Error not handled on api-key-service: path: ${t}, status: ${o.status}`);throw new QO.ApiError(QO.Problems.INTERNAL_SERVER_ERROR)}if(o.status===204){return{}}return o.data}};ME.ApiKeyService=Exe});var swt=y(ZO=>{"use strict";var zAn=ZO&&ZO.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ZO,"__esModule",{value:true});ZO.AuthApiService=void 0;var ZA=Hc();var iwt=zAn(Jd());var KAn=XO();var bxe=class{static{a(this,"AuthApiService")}logger;requestId;baseUrl;constructor(t){this.logger=t.log;this.requestId=t.id;if(!iwt.default.AUTH_API_URL){throw new Error("AUTH_API_URL is not set")}this.baseUrl=iwt.default.AUTH_API_URL}async getClientJWT(t,r){let n;try{n=await this.fetch(`/v1/clients/${t}`,{method:"GET"})}catch(s){if(s.status===ZA.Problems.NOT_FOUND.status){n=await this.fetch(`/v1/clients`,{method:"POST",body:JSON.stringify({client_id:t})})}else{throw s}}const i=await this.fetch(`/v1/oauth/token`,{method:"POST",body:JSON.stringify({client_id:t,client_secret:n.client_secret,grant_type:"client_credentials",custom_claims:r})});return i.access_token}async fetch(t,r){this.logger.info(`Fetching internally ${t} from Auth API V2.`);const n=new Headers({"content-type":"application/json","zp-rid":this.requestId,authorization:""});if(process.env.K_SERVICE){const s=await(0,KAn.getServiceAccountIdToken)(this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===ZA.HttpStatusCode.NOT_FOUND){throw new ZA.ApiError(ZA.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on auth-api: path: ${t}, status: ${i.status}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new ZA.ApiError(s)}this.logger.error(`Error not handled on auth-api: path: ${t}, status: ${i.status}`);throw new ZA.ApiError(ZA.Problems.INTERNAL_SERVER_ERROR)}return i.clone().json()}};ZO.AuthApiService=bxe});var SF=y(dJ=>{"use strict";Object.defineProperty(dJ,"__esModule",{value:true});dJ.ApiServiceClient=void 0;var eP=Hc();var WAn=XO();var Sxe=class{static{a(this,"ApiServiceClient")}userSub;logger;requestId;baseUrl;cache;targetAudience;constructor(t,r,n){this.userSub=n.userSub;this.logger=n.logger;this.requestId=n.requestId;this.baseUrl=t;this.cache=r;this.targetAudience=n.targetAudience}async cachedFetch(t,r,n){if(!this.userSub||!n){throw new Error("userSub and cacheKey parameters are required to use cachedFetch")}const i=`${this.userSub}@${n}`;if(this.cache.has(i)){return this.cache.get(i)}const s=await this.fetchInternally(t,r);this.cache.set(i,s);return s}async fetchInternally(t,r){this.logger.info(`Fetching internally ${r.method} ${this.baseUrl}${t}`);const n=new Headers({...r.headers,"zuplo-user":this.userSub,"content-type":"application/json","zp-rid":this.requestId});if(process.env.K_SERVICE){const s=await(0,WAn.getServiceAccountIdToken)(this.targetAudience??this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===404){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.json();if(s&&s.hasOwnProperty("type")&&s.hasOwnProperty("title")&&s.hasOwnProperty("status")){throw new eP.ApiError(s)}throw new eP.ApiError(eP.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new eP.ApiError(s)}this.logger.error(`Error not handled on internal api: path: ${t}, status: ${i.status}`);throw new eP.ApiError(eP.Problems.INTERNAL_SERVER_ERROR)}if(i.status===204){return{}}return i.clone().json()}};dJ.ApiServiceClient=Sxe});var lwt=y(rg=>{"use strict";var owt=rg&&rg.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(rg,"__esModule",{value:true});rg.ContentApiService=rg.getContentApiStorageTarballPath=rg.contentApiTarballFileName=void 0;var YAn=owt(Fm());var awt=owt(Jd());var XAn=SF();var JAn=new YAn.default({max:500,maxAge:1e3*60*50});function uwt(e,t){return`${e}--${t}.tar.gz`}a(uwt,"contentApiTarballFileName");rg.contentApiTarballFileName=uwt;function QAn(e,t){const r=uwt(e,t);return`${e}/builds/${r}`}a(QAn,"getContentApiStorageTarballPath");rg.getContentApiStorageTarballPath=QAn;var Axe=class extends XAn.ApiServiceClient{static{a(this,"ContentApiService")}constructor(t){if(!awt.default.CONTENT_API_URL){throw new Error("CONTENT_API_URL is not set")}super(awt.default.CONTENT_API_URL,JAn,t)}};rg.ContentApiService=Axe});var pwt=y(tP=>{"use strict";var dwt=tP&&tP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(tP,"__esModule",{value:true});tP.DevApiService=void 0;var ZAn=dwt(Fm());var cwt=dwt(Jd());var eCn=SF();var tCn=new ZAn.default({max:500,maxAge:1e3*60*50});var Cxe=class extends eCn.ApiServiceClient{static{a(this,"DevApiService")}constructor(t,r){if(!cwt.default.DEV_API_URL){throw new Error("DEV_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(cwt.default.DEV_API_URL,tCn,{userSub:n,logger:t.log,requestId:t.id})}};tP.DevApiService=Cxe});var hwt=y((jDs,mwt)=>{var fwt=require("stream").Stream;var rCn=require("util");mwt.exports=fh;function fh(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}a(fh,"DelayedStream");rCn.inherits(fh,fwt);fh.create=function(e,t){var r=new this;t=t||{};for(var n in t){r[n]=t[n]}r.source=e;var i=e.emit;e.emit=function(){r._handleEmit(arguments);return i.apply(e,arguments)};e.on("error",function(){});if(r.pauseStream){e.pause()}return r};Object.defineProperty(fh.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});fh.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fh.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};fh.prototype.pause=function(){this.source.pause()};fh.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this));this._bufferedEvents=[]};fh.prototype.pipe=function(){var e=fwt.prototype.pipe.apply(this,arguments);this.resume();return e};fh.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}if(e[0]==="data"){this.dataSize+=e[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(e)};fh.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}});var vwt=y((HDs,_wt)=>{var nCn=require("util");var ywt=require("stream").Stream;var gwt=hwt();_wt.exports=ao;function ao(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}a(ao,"CombinedStream");nCn.inherits(ao,ywt);ao.create=function(e){var t=new this;e=e||{};for(var r in e){t[r]=e[r]}return t};ao.isStreamLike=function(e){return typeof e!=="function"&&typeof e!=="string"&&typeof e!=="boolean"&&typeof e!=="number"&&!Buffer.isBuffer(e)};ao.prototype.append=function(e){var t=ao.isStreamLike(e);if(t){if(!(e instanceof gwt)){var r=gwt.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this));e=r}this._handleErrors(e);if(this.pauseStreams){e.pause()}}this._streams.push(e);return this};ao.prototype.pipe=function(e,t){ywt.prototype.pipe.call(this,e,t);this.resume();return e};ao.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};ao.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e=="undefined"){this.end();return}if(typeof e!=="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ao.isStreamLike(r);if(n){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};ao.prototype._pipeNext=function(e){this._currentStream=e;var t=ao.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this));e.pipe(this,{end:false});return}var r=e;this.write(r);this._getNext()};ao.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ao.prototype.write=function(e){this.emit("data",e)};ao.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};ao.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};ao.prototype.end=function(){this._reset();this.emit("end")};ao.prototype.destroy=function(){this._reset();this.emit("close")};ao.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};ao.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))};ao.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){if(!t.dataSize){return}e.dataSize+=t.dataSize});if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};ao.prototype._emitError=function(e){this._reset();this.emit("error",e)}});var bwt=y((zDs,Ewt)=>{Ewt.exports=iCn;function iCn(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t){t(e)}else{setTimeout(e,0)}}a(iCn,"defer")});var wxe=y((WDs,Awt)=>{var Swt=bwt();Awt.exports=sCn;function sCn(e){var t=false;Swt(function(){t=true});return a(function r(n,i){if(t){e(n,i)}else{Swt(a(function s(){e(n,i)},"nextTick_callback"))}},"async_callback")}a(sCn,"async")});var Txe=y((XDs,Cwt)=>{Cwt.exports=aCn;function aCn(e){Object.keys(e.jobs).forEach(oCn.bind(e));e.jobs={}}a(aCn,"abort");function oCn(e){if(typeof this.jobs[e]=="function"){this.jobs[e]()}}a(oCn,"clean")});var xxe=y((QDs,Twt)=>{var wwt=wxe();var uCn=Txe();Twt.exports=lCn;function lCn(e,t,r,n){var i=r["keyedList"]?r["keyedList"][r.index]:r.index;r.jobs[i]=cCn(t,i,e[i],function(s,o){if(!(i in r.jobs)){return}delete r.jobs[i];if(s){uCn(r)}else{r.results[i]=o}n(s,r.results)})}a(lCn,"iterate");function cCn(e,t,r,n){var i;if(e.length==2){i=e(r,wwt(n))}else{i=e(r,t,wwt(n))}return i}a(cCn,"runJob")});var Rxe=y((e6s,xwt)=>{xwt.exports=dCn;function dCn(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};if(t){n.keyedList.sort(r?t:function(i,s){return t(e[i],e[s])})}return n}a(dCn,"state")});var Oxe=y((r6s,Rwt)=>{var pCn=Txe();var fCn=wxe();Rwt.exports=mCn;function mCn(e){if(!Object.keys(this.jobs).length){return}this.index=this.size;pCn(this);fCn(e)(null,this.results)}a(mCn,"terminator")});var Pwt=y((i6s,Owt)=>{var hCn=xxe();var gCn=Rxe();var yCn=Oxe();Owt.exports=_Cn;function _Cn(e,t,r){var n=gCn(e);while(n.index<(n["keyedList"]||e).length){hCn(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}});n.index++}return yCn.bind(n,r)}a(_Cn,"parallel")});var Pxe=y((a6s,pJ)=>{var Nwt=xxe();var vCn=Rxe();var ECn=Oxe();pJ.exports=bCn;pJ.exports.ascending=Iwt;pJ.exports.descending=SCn;function bCn(e,t,r,n){var i=vCn(e,r);Nwt(e,t,i,a(function s(o,u){if(o){n(o,u);return}i.index++;if(i.index<(i["keyedList"]||e).length){Nwt(e,t,i,s);return}n(null,i.results)},"iteratorHandler"));return ECn.bind(i,n)}a(bCn,"serialOrdered");function Iwt(e,t){return e<t?-1:e>t?1:0}a(Iwt,"ascending");function SCn(e,t){return-1*Iwt(e,t)}a(SCn,"descending")});var Dwt=y((u6s,kwt)=>{var ACn=Pxe();kwt.exports=CCn;function CCn(e,t,r){return ACn(e,t,null,r)}a(CCn,"serial")});var Fwt=y((c6s,Lwt)=>{Lwt.exports={parallel:Pwt(),serial:Dwt(),serialOrdered:Pxe()}});var Mwt=y((d6s,Bwt)=>{Bwt.exports=function(e,t){Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]});return e}});var $wt=y((p6s,Uwt)=>{var Dxe=vwt();var qwt=require("util");var Nxe=require("path");var wCn=require("http");var TCn=require("https");var xCn=require("url").parse;var RCn=require("fs");var OCn=require("stream").Stream;var Ixe=fSe();var PCn=Fwt();var kxe=Mwt();Uwt.exports=es;qwt.inherits(es,Dxe);function es(e){if(!(this instanceof es)){return new es(e)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];Dxe.call(this);e=e||{};for(var t in e){this[t]=e[t]}}a(es,"FormData");es.LINE_BREAK="\r\n";es.DEFAULT_CONTENT_TYPE="application/octet-stream";es.prototype.append=function(e,t,r){r=r||{};if(typeof r=="string"){r={filename:r}}var n=Dxe.prototype.append.bind(this);if(typeof t=="number"){t=""+t}if(qwt.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r);var s=this._multiPartFooter();n(i);n(t);n(s);this._trackLength(i,t,r)};es.prototype._trackLength=function(e,t,r){var n=0;if(r.knownLength!=null){n+=+r.knownLength}else if(Buffer.isBuffer(t)){n=t.length}else if(typeof t==="string"){n=Buffer.byteLength(t)}this._valueLength+=n;this._overheadLength+=Buffer.byteLength(e)+es.LINE_BREAK.length;if(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof OCn)){return}if(!r.knownLength){this._valuesToMeasure.push(t)}};es.prototype._lengthRetriever=function(e,t){if(e.hasOwnProperty("fd")){if(e.end!=void 0&&e.end!=Infinity&&e.start!=void 0){t(null,e.end+1-(e.start?e.start:0))}else{RCn.stat(e.path,function(r,n){var i;if(r){t(r);return}i=n.size-(e.start?e.start:0);t(null,i)})}}else if(e.hasOwnProperty("httpVersion")){t(null,+e.headers["content-length"])}else if(e.hasOwnProperty("httpModule")){e.on("response",function(r){e.pause();t(null,+r.headers["content-length"])});e.resume()}else{t("Unknown stream")}};es.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string"){return r.header}var n=this._getContentDisposition(t,r);var i=this._getContentType(t,r);var s="";var o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};if(typeof r.header=="object"){kxe(o,r.header)}var u;for(var l in o){if(!o.hasOwnProperty(l))continue;u=o[l];if(u==null){continue}if(!Array.isArray(u)){u=[u]}if(u.length){s+=l+": "+u.join("; ")+es.LINE_BREAK}}return"--"+this.getBoundary()+es.LINE_BREAK+s+es.LINE_BREAK};es.prototype._getContentDisposition=function(e,t){var r,n;if(typeof t.filepath==="string"){r=Nxe.normalize(t.filepath).replace(/\\/g,"/")}else if(t.filename||e.name||e.path){r=Nxe.basename(t.filename||e.name||e.path)}else if(e.readable&&e.hasOwnProperty("httpVersion")){r=Nxe.basename(e.client._httpMessage.path||"")}if(r){n='filename="'+r+'"'}return n};es.prototype._getContentType=function(e,t){var r=t.contentType;if(!r&&e.name){r=Ixe.lookup(e.name)}if(!r&&e.path){r=Ixe.lookup(e.path)}if(!r&&e.readable&&e.hasOwnProperty("httpVersion")){r=e.headers["content-type"]}if(!r&&(t.filepath||t.filename)){r=Ixe.lookup(t.filepath||t.filename)}if(!r&&typeof e=="object"){r=es.DEFAULT_CONTENT_TYPE}return r};es.prototype._multiPartFooter=function(){return function(e){var t=es.LINE_BREAK;var r=this._streams.length===0;if(r){t+=this._lastBoundary()}e(t)}.bind(this)};es.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+es.LINE_BREAK};es.prototype.getHeaders=function(e){var t;var r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e){if(e.hasOwnProperty(t)){r[t.toLowerCase()]=e[t]}}return r};es.prototype.setBoundary=function(e){this._boundary=e};es.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};es.prototype.getBuffer=function(){var e=new Buffer.alloc(0);var t=this.getBoundary();for(var r=0,n=this._streams.length;r<n;r++){if(typeof this._streams[r]!=="function"){if(Buffer.isBuffer(this._streams[r])){e=Buffer.concat([e,this._streams[r]])}else{e=Buffer.concat([e,Buffer.from(this._streams[r])])}if(typeof this._streams[r]!=="string"||this._streams[r].substring(2,t.length+2)!==t){e=Buffer.concat([e,Buffer.from(es.LINE_BREAK)])}}}return Buffer.concat([e,Buffer.from(this._lastBoundary())])};es.prototype._generateBoundary=function(){var e="--------------------------";for(var t=0;t<24;t++){e+=Math.floor(Math.random()*10).toString(16)}this._boundary=e};es.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;if(this._streams.length){e+=this._lastBoundary().length}if(!this.hasKnownLength()){this._error(new Error("Cannot calculate proper length in synchronous way."))}return e};es.prototype.hasKnownLength=function(){var e=true;if(this._valuesToMeasure.length){e=false}return e};es.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length){t+=this._lastBoundary().length}if(!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}PCn.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i});e(null,t)})};es.prototype.submit=function(e,t){var r,n,i={method:"post"};if(typeof e=="string"){e=xCn(e);n=kxe({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)}else{n=kxe(e,i);if(!n.port){n.port=n.protocol=="https:"?443:80}}n.headers=this.getHeaders(e.headers);if(n.protocol=="https:"){r=TCn.request(n)}else{r=wCn.request(n)}this.getLength(function(s,o){if(s&&s!=="Unknown stream"){this._error(s);return}if(o){r.setHeader("Content-Length",o)}this.pipe(r);if(t){var u;var l=a(function(c,d){r.removeListener("error",l);r.removeListener("response",u);return t.call(this,c,d)},"callback");u=l.bind(this,null);r.on("error",l);r.on("response",u)}}.bind(this));return r};es.prototype._error=function(e){if(!this.error){this.error=e;this.pause();this.emit("error",e)}};es.prototype.toString=function(){return"[object FormData]"}});var Gwt=y(jwt=>{"use strict";var NCn=require("url").parse;var ICn={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var kCn=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function DCn(e){var t=typeof e==="string"?NCn(e):e||{};var r=t.protocol;var n=t.host;var i=t.port;if(typeof n!=="string"||!n||typeof r!=="string"){return""}r=r.split(":",1)[0];n=n.replace(/:\d*$/,"");i=parseInt(i)||ICn[r]||0;if(!LCn(n,i)){return""}var s=rP("npm_config_"+r+"_proxy")||rP(r+"_proxy")||rP("npm_config_proxy")||rP("all_proxy");if(s&&s.indexOf("://")===-1){s=r+"://"+s}return s}a(DCn,"getProxyForUrl");function LCn(e,t){var r=(rP("npm_config_no_proxy")||rP("no_proxy")).toLowerCase();if(!r){return true}if(r==="*"){return false}return r.split(/[,\s]/).every(function(n){if(!n){return true}var i=n.match(/^(.+):(\d+)$/);var s=i?i[1]:n;var o=i?parseInt(i[2]):0;if(o&&o!==t){return true}if(!/^[.*]/.test(s)){return e!==s}if(s.charAt(0)==="*"){s=s.slice(1)}return!kCn.call(e,s)})}a(LCn,"shouldProxy");function rP(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}a(rP,"getEnv");jwt.getProxyForUrl=DCn});var Vwt=y((g6s,Hwt)=>{var AF;Hwt.exports=function(){if(!AF){try{AF=Zd()("follow-redirects")}catch(e){}if(typeof AF!=="function"){AF=a(function(){},"debug")}}AF.apply(null,arguments)}});var Xwt=y((_6s,zxe)=>{var TF=require("url");var CF=TF.URL;var FCn=require("http");var BCn=require("https");var qxe=require("stream").Writable;var Uxe=require("assert");var zwt=Vwt();var $xe=false;try{Uxe(new CF)}catch(e){$xe=e.code==="ERR_INVALID_URL"}var MCn=["auth","host","hostname","href","path","pathname","port","protocol","query","search"];var jxe=["abort","aborted","connect","error","socket","timeout"];var Gxe=Object.create(null);jxe.forEach(function(e){Gxe[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Fxe=xF("ERR_INVALID_URL","Invalid URL",TypeError);var Bxe=xF("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var qCn=xF("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Bxe);var UCn=xF("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var $Cn=xF("ERR_STREAM_WRITE_AFTER_END","write after end");var jCn=qxe.prototype.destroy||Wwt;function hd(e,t){qxe.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof Bxe?i:new Bxe({cause:i}))}};this._performRequest()}a(hd,"RedirectableRequest");hd.prototype=Object.create(qxe.prototype);hd.prototype.abort=function(){Vxe(this._currentRequest);this._currentRequest.abort();this.emit("abort")};hd.prototype.destroy=function(e){Vxe(this._currentRequest,e);jCn.call(this,e);return this};hd.prototype.write=function(e,t,r){if(this._ending){throw new $Cn}if(!eC(e)&&!VCn(e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(wF(t)){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new UCn);this.abort()}};hd.prototype.end=function(e,t,r){if(wF(e)){r=e;e=t=null}else if(wF(t)){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var i=this._currentRequest;this.write(e,t,function(){n._ended=true;i.end(null,null,r)});this._ending=true}};hd.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};hd.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};hd.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e);o.removeListener("timeout",o.destroy);o.addListener("timeout",o.destroy)}a(n,"destroyOnTimeout");function i(o){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout(function(){r.emit("timeout");s()},e);n(o)}a(i,"startTimer");function s(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",s);r.removeListener("error",s);r.removeListener("response",s);r.removeListener("close",s);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",i)}}a(s,"clearTimer");if(t){this.on("timeout",t)}if(this.socket){i(this.socket)}else{this._currentRequest.once("socket",i)}this.on("socket",n);this.on("abort",s);this.on("error",s);this.on("response",s);this.on("close",s);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){hd.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(hd.prototype,e,{get:function(){return this._currentRequest[e]}})});hd.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};hd.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){throw new TypeError("Unsupported protocol "+e)}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of jxe){n.on(i,Gxe[i])}this._currentUrl=/^\//.test(this._options.path)?TF.format(this._options):this._options.path;if(this._isRedirect){var s=0;var o=this;var u=this._requestBodyBuffers;a(function l(c){if(n===o._currentRequest){if(c){o.emit("error",c)}else if(s<u.length){var d=u[s++];if(!n.finished){n.write(d.data,d.encoding,l)}}else if(o._ended){n.end()}}},"writeNext")()}};hd.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}Vxe(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){throw new qCn}var n;var i=this._options.beforeRedirect;if(i){n=Object.assign({Host:e.req.getHeader("host")},this._options.headers)}var s=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];Lxe(/^content-/i,this._options.headers)}var o=Lxe(/^host$/i,this._options.headers);var u=Hxe(this._currentUrl);var l=o||u.host;var c=/^\w+:/.test(r)?this._currentUrl:TF.format(Object.assign(u,{host:l}));var d=GCn(r,c);zwt("redirecting to",d.href);this._isRedirect=true;Mxe(d,this._options);if(d.protocol!==u.protocol&&d.protocol!=="https:"||d.host!==l&&!HCn(d.host,l)){Lxe(/^(?:authorization|cookie)$/i,this._options.headers)}if(wF(i)){var p={headers:e.headers,statusCode:t};var f={url:c,method:s,headers:n};i(this._options,p,f);this._sanitizeOptions(this._options)}this._performRequest()};function Kwt(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach(function(n){var i=n+":";var s=r[i]=e[n];var o=t[n]=Object.create(s);function u(c,d,p){if(zCn(c)){c=Mxe(c)}else if(eC(c)){c=Mxe(Hxe(c))}else{p=d;d=Ywt(c);c={protocol:i}}if(wF(d)){p=d;d=null}d=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,d);d.nativeProtocols=r;if(!eC(d.host)&&!eC(d.hostname)){d.hostname="::1"}Uxe.equal(d.protocol,i,"protocol mismatch");zwt("options",d);return new hd(d,p)}a(u,"request");function l(c,d,p){var f=o.request(c,d,p);f.end();return f}a(l,"get");Object.defineProperties(o,{request:{value:u,configurable:true,enumerable:true,writable:true},get:{value:l,configurable:true,enumerable:true,writable:true}})});return t}a(Kwt,"wrap");function Wwt(){}a(Wwt,"noop");function Hxe(e){var t;if($xe){t=new CF(e)}else{t=Ywt(TF.parse(e));if(!eC(t.protocol)){throw new Fxe({input:e})}}return t}a(Hxe,"parseUrl");function GCn(e,t){return $xe?new CF(e,t):Hxe(TF.resolve(t,e))}a(GCn,"resolveUrl");function Ywt(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname)){throw new Fxe({input:e.href||e})}if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host)){throw new Fxe({input:e.href||e})}return e}a(Ywt,"validateUrl");function Mxe(e,t){var r=t||{};for(var n of MCn){r[n]=e[n]}if(r.hostname.startsWith("[")){r.hostname=r.hostname.slice(1,-1)}if(r.port!==""){r.port=Number(r.port)}r.path=r.search?r.pathname+r.search:r.pathname;return r}a(Mxe,"spreadUrlObject");function Lxe(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?void 0:String(r).trim()}a(Lxe,"removeMatchingHeaders");function xF(e,t,r){function n(i){Error.captureStackTrace(this,this.constructor);Object.assign(this,i||{});this.code=e;this.message=this.cause?t+": "+this.cause.message:t}a(n,"CustomError");n.prototype=new(r||Error);Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:false},name:{value:"Error ["+e+"]",enumerable:false}});return n}a(xF,"createErrorType");function Vxe(e,t){for(var r of jxe){e.removeListener(r,Gxe[r])}e.on("error",Wwt);e.destroy(t)}a(Vxe,"destroyRequest");function HCn(e,t){Uxe(eC(e)&&eC(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}a(HCn,"isSubdomain");function eC(e){return typeof e==="string"||e instanceof String}a(eC,"isString");function wF(e){return typeof e==="function"}a(wF,"isFunction");function VCn(e){return typeof e==="object"&&"length"in e}a(VCn,"isBuffer");function zCn(e){return CF&&e instanceof CF}a(zCn,"isURL");zxe.exports=Kwt({http:FCn,https:BCn});zxe.exports.wrap=Kwt});var SJ=y((E6s,qTt)=>{"use strict";var KCn=$wt();var WCn=require("url");var YCn=Gwt();var XCn=require("http");var JCn=require("https");var mTt=require("util");var QCn=Xwt();var ZCn=require("zlib");var hTt=require("stream");var ewn=require("events");function Ty(e){return e&&typeof e==="object"&&"default"in e?e:{"default":e}}a(Ty,"_interopDefaultLegacy");var gTt=Ty(KCn);var twn=Ty(WCn);var rwn=Ty(XCn);var nwn=Ty(JCn);var iwn=Ty(mTt);var swn=Ty(QCn);var jE=Ty(ZCn);var UE=Ty(hTt);var awn=Ty(ewn);function yTt(e,t){return a(function r(){return e.apply(t,arguments)},"wrap")}a(yTt,"bind");var{toString:own}=Object.prototype;var{getPrototypeOf:oRe}=Object;var _J=(e=>t=>{const r=own.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));var ng=a(e=>{e=e.toLowerCase();return t=>_J(t)===e},"kindOfTest");var vJ=a(e=>t=>typeof t===e,"typeOfTest");var{isArray:aP}=Array;var PF=vJ("undefined");function uwn(e){return e!==null&&!PF(e)&&e.constructor!==null&&!PF(e.constructor)&&Lf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}a(uwn,"isBuffer");var _Tt=ng("ArrayBuffer");function lwn(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&_Tt(e.buffer)}return t}a(lwn,"isArrayBufferView");var cwn=vJ("string");var Lf=vJ("function");var vTt=vJ("number");var EJ=a(e=>e!==null&&typeof e==="object","isObject");var dwn=a(e=>e===true||e===false,"isBoolean");var mJ=a(e=>{if(_J(e)!=="object"){return false}const t=oRe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},"isPlainObject");var pwn=ng("Date");var fwn=ng("File");var mwn=ng("Blob");var hwn=ng("FileList");var gwn=a(e=>EJ(e)&&Lf(e.pipe),"isStream");var ywn=a(e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||Lf(e.append)&&((t=_J(e))==="formdata"||t==="object"&&Lf(e.toString)&&e.toString()==="[object FormData]"))},"isFormData");var _wn=ng("URLSearchParams");var vwn=a(e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function IF(e,t,{allOwnKeys:r=false}={}){if(e===null||typeof e==="undefined"){return}let n;let i;if(typeof e!=="object"){e=[e]}if(aP(e)){for(n=0,i=e.length;n<i;n++){t.call(null,e[n],n,e)}}else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e);const o=s.length;let u;for(n=0;n<o;n++){u=s[n];t.call(null,e[u],u,e)}}}a(IF,"forEach");function ETt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length;let i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}a(ETt,"findKey");var bTt=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();var STt=a(e=>!PF(e)&&e!==bTt,"isContextDefined");function Jxe(){const{caseless:e}=STt(this)&&this||{};const t={};const r=a((n,i)=>{const s=e&&ETt(t,i)||i;if(mJ(t[s])&&mJ(n)){t[s]=Jxe(t[s],n)}else if(mJ(n)){t[s]=Jxe({},n)}else if(aP(n)){t[s]=n.slice()}else{t[s]=n}},"assignValue");for(let n=0,i=arguments.length;n<i;n++){arguments[n]&&IF(arguments[n],r)}return t}a(Jxe,"merge");var Ewn=a((e,t,r,{allOwnKeys:n}={})=>{IF(t,(i,s)=>{if(r&&Lf(i)){e[s]=yTt(i,r)}else{e[s]=i}},{allOwnKeys:n});return e},"extend");var bwn=a(e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e},"stripBOM");var Swn=a((e,t,r,n)=>{e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)},"inherits");var Awn=a((e,t,r,n)=>{let i;let s;let o;const u={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);s=i.length;while(s-- >0){o=i[s];if((!n||n(o,e,t))&&!u[o]){t[o]=e[o];u[o]=true}}e=r!==false&&oRe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},"toFlatObject");var Cwn=a((e,t,r)=>{e=String(e);if(r===void 0||r>e.length){r=e.length}r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},"endsWith");var wwn=a(e=>{if(!e)return null;if(aP(e))return e;let t=e.length;if(!vTt(t))return null;const r=new Array(t);while(t-- >0){r[t]=e[t]}return r},"toArray");var Twn=(e=>{return t=>{return e&&t instanceof e}})(typeof Uint8Array!=="undefined"&&oRe(Uint8Array));var xwn=a((e,t)=>{const r=e&&e[Symbol.iterator];const n=r.call(e);let i;while((i=n.next())&&!i.done){const s=i.value;t.call(e,s[0],s[1])}},"forEachEntry");var Rwn=a((e,t)=>{let r;const n=[];while((r=e.exec(t))!==null){n.push(r)}return n},"matchAll");var Own=ng("HTMLFormElement");var Pwn=a(e=>{return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function t(r,n,i){return n.toUpperCase()+i},"replacer"))},"toCamelCase");var Jwt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype);var Nwn=ng("RegExp");var ATt=a((e,t)=>{const r=Object.getOwnPropertyDescriptors(e);const n={};IF(r,(i,s)=>{let o;if((o=t(i,s,e))!==false){n[s]=o||i}});Object.defineProperties(e,n)},"reduceDescriptors");var Iwn=a(e=>{ATt(e,(t,r)=>{if(Lf(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=e[r];if(!Lf(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})},"freezeMethods");var kwn=a((e,t)=>{const r={};const n=a(i=>{i.forEach(s=>{r[s]=true})},"define");aP(e)?n(e):n(String(e).split(t));return r},"toObjectSet");var Dwn=a(()=>{},"noop");var Lwn=a((e,t)=>{e=+e;return Number.isFinite(e)?e:t},"toFiniteNumber");var Kxe="abcdefghijklmnopqrstuvwxyz";var Qwt="0123456789";var CTt={DIGIT:Qwt,ALPHA:Kxe,ALPHA_DIGIT:Kxe+Kxe.toUpperCase()+Qwt};var Fwn=a((e=16,t=CTt.ALPHA_DIGIT)=>{let r="";const{length:n}=t;while(e--){r+=t[Math.random()*n|0]}return r},"generateString");function Bwn(e){return!!(e&&Lf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}a(Bwn,"isSpecCompliantForm");var Mwn=a(e=>{const t=new Array(10);const r=a((n,i)=>{if(EJ(n)){if(t.indexOf(n)>=0){return}if(!("toJSON"in n)){t[i]=n;const s=aP(n)?[]:{};IF(n,(o,u)=>{const l=r(o,i+1);!PF(l)&&(s[u]=l)});t[i]=void 0;return s}}return n},"visit");return r(e,0)},"toJSONObject");var qwn=ng("AsyncFunction");var Uwn=a(e=>e&&(EJ(e)||Lf(e))&&Lf(e.then)&&Lf(e.catch),"isThenable");var Je={isArray:aP,isArrayBuffer:_Tt,isBuffer:uwn,isFormData:ywn,isArrayBufferView:lwn,isString:cwn,isNumber:vTt,isBoolean:dwn,isObject:EJ,isPlainObject:mJ,isUndefined:PF,isDate:pwn,isFile:fwn,isBlob:mwn,isRegExp:Nwn,isFunction:Lf,isStream:gwn,isURLSearchParams:_wn,isTypedArray:Twn,isFileList:hwn,forEach:IF,merge:Jxe,extend:Ewn,trim:vwn,stripBOM:bwn,inherits:Swn,toFlatObject:Awn,kindOf:_J,kindOfTest:ng,endsWith:Cwn,toArray:wwn,forEachEntry:xwn,matchAll:Rwn,isHTMLForm:Own,hasOwnProperty:Jwt,hasOwnProp:Jwt,reduceDescriptors:ATt,freezeMethods:Iwn,toObjectSet:kwn,toCamelCase:Pwn,noop:Dwn,toFiniteNumber:Lwn,findKey:ETt,global:bTt,isContextDefined:STt,ALPHABET:CTt,generateString:Fwn,isSpecCompliantForm:Bwn,toJSONObject:Mwn,isAsyncFn:qwn,isThenable:Uwn};function yr(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}a(yr,"AxiosError");Je.inherits(yr,Error,{toJSON:a(function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Je.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var wTt=yr.prototype;var TTt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{TTt[e]={value:e}});Object.defineProperties(yr,TTt);Object.defineProperty(wTt,"isAxiosError",{value:true});yr.from=(e,t,r,n,i,s)=>{const o=Object.create(wTt);Je.toFlatObject(e,o,a(function u(l){return l!==Error.prototype},"filter"),u=>{return u!=="isAxiosError"});yr.call(o,e.message,t,r,n,i);o.cause=e;o.name=e.name;s&&Object.assign(o,s);return o};function Qxe(e){return Je.isPlainObject(e)||Je.isArray(e)}a(Qxe,"isVisitable");function xTt(e){return Je.endsWith(e,"[]")?e.slice(0,-2):e}a(xTt,"removeBrackets");function Zwt(e,t,r){if(!e)return t;return e.concat(t).map(a(function n(i,s){i=xTt(i);return!r&&s?"["+i+"]":i},"each")).join(r?".":"")}a(Zwt,"renderKey");function $wn(e){return Je.isArray(e)&&!e.some(Qxe)}a($wn,"isFlatArray");var jwn=Je.toFlatObject(Je,{},null,a(function e(t){return/^is[A-Z]/.test(t)},"filter"));function bJ(e,t,r){if(!Je.isObject(e)){throw new TypeError("target must be an object")}t=t||new(gTt["default"]||FormData);r=Je.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,a(function h(g,_){return!Je.isUndefined(_[g])},"defined"));const n=r.metaTokens;const i=r.visitor||d;const s=r.dots;const o=r.indexes;const u=r.Blob||typeof Blob!=="undefined"&&Blob;const l=u&&Je.isSpecCompliantForm(t);if(!Je.isFunction(i)){throw new TypeError("visitor must be a function")}function c(h){if(h===null)return"";if(Je.isDate(h)){return h.toISOString()}if(!l&&Je.isBlob(h)){throw new yr("Blob is not supported. Use a Buffer instead.")}if(Je.isArrayBuffer(h)||Je.isTypedArray(h)){return l&&typeof Blob==="function"?new Blob([h]):Buffer.from(h)}return h}a(c,"convertValue");function d(h,g,_){let v=h;if(h&&!_&&typeof h==="object"){if(Je.endsWith(g,"{}")){g=n?g:g.slice(0,-2);h=JSON.stringify(h)}else if(Je.isArray(h)&&$wn(h)||(Je.isFileList(h)||Je.endsWith(g,"[]"))&&(v=Je.toArray(h))){g=xTt(g);v.forEach(a(function S(E,b){!(Je.isUndefined(E)||E===null)&&t.append(o===true?Zwt([g],b,s):o===null?g:g+"[]",c(E))},"each"));return false}}if(Qxe(h)){return true}t.append(Zwt(_,g,s),c(h));return false}a(d,"defaultVisitor");const p=[];const f=Object.assign(jwn,{defaultVisitor:d,convertValue:c,isVisitable:Qxe});function m(h,g){if(Je.isUndefined(h))return;if(p.indexOf(h)!==-1){throw Error("Circular reference detected in "+g.join("."))}p.push(h);Je.forEach(h,a(function _(v,S){const E=!(Je.isUndefined(v)||v===null)&&i.call(t,v,Je.isString(S)?S.trim():S,g,f);if(E===true){m(v,g?g.concat(S):[S])}},"each"));p.pop()}a(m,"build");if(!Je.isObject(e)){throw new TypeError("data must be an object")}m(e);return t}a(bJ,"toFormData");function eTt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,a(function r(n){return t[n]},"replacer"))}a(eTt,"encode$1");function RTt(e,t){this._pairs=[];e&&bJ(e,this,t)}a(RTt,"AxiosURLSearchParams");var OTt=RTt.prototype;OTt.append=a(function e(t,r){this._pairs.push([t,r])},"append");OTt.toString=a(function e(t){const r=t?function(n){return t.call(this,n,eTt)}:eTt;return this._pairs.map(a(function n(i){return r(i[0])+"="+r(i[1])},"each"),"").join("&")},"toString");function Gwn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}a(Gwn,"encode");function uRe(e,t,r){if(!t){return e}const n=r&&r.encode||Gwn;const i=r&&r.serialize;let s;if(i){s=i(t,r)}else{s=Je.isURLSearchParams(t)?t.toString():new RTt(t,r).toString(n)}if(s){const o=e.indexOf("#");if(o!==-1){e=e.slice(0,o)}e+=(e.indexOf("?")===-1?"?":"&")+s}return e}a(uRe,"buildURL");var Zxe=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){Je.forEach(this.handlers,a(function r(n){if(n!==null){t(n)}},"forEachHandler"))}};var tTt=Zxe;var lRe={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var Hwn=twn["default"].URLSearchParams;var Vwn={isNode:true,classes:{URLSearchParams:Hwn,FormData:gTt["default"],Blob:typeof Blob!=="undefined"&&Blob||null},protocols:["http","https","file","data"]};var PTt=typeof window!=="undefined"&&typeof document!=="undefined";var zwn=(e=>{return PTt&&["ReactNative","NativeScript","NS"].indexOf(e)<0})(typeof navigator!=="undefined"&&navigator.product);var Kwn=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();var Wwn=Object.freeze({__proto__:null,hasBrowserEnv:PTt,hasStandardBrowserWebWorkerEnv:Kwn,hasStandardBrowserEnv:zwn});var Df={...Wwn,...Vwn};function Ywn(e,t){return bJ(e,new Df.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){if(Df.isNode&&Je.isBuffer(r)){this.append(n,r.toString("base64"));return false}return s.defaultVisitor.apply(this,arguments)}},t))}a(Ywn,"toURLEncodedForm");function Xwn(e){return Je.matchAll(/\w+|\[(\w*)]/g,e).map(t=>{return t[0]==="[]"?"":t[1]||t[0]})}a(Xwn,"parsePropPath");function Jwn(e){const t={};const r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++){s=r[n];t[s]=e[s]}return t}a(Jwn,"arrayToObject");function NTt(e){function t(r,n,i,s){let o=r[s++];const u=Number.isFinite(+o);const l=s>=r.length;o=!o&&Je.isArray(i)?i.length:o;if(l){if(Je.hasOwnProp(i,o)){i[o]=[i[o],n]}else{i[o]=n}return!u}if(!i[o]||!Je.isObject(i[o])){i[o]=[]}const c=t(r,n,i[o],s);if(c&&Je.isArray(i[o])){i[o]=Jwn(i[o])}return!u}a(t,"buildPath");if(Je.isFormData(e)&&Je.isFunction(e.entries)){const r={};Je.forEachEntry(e,(n,i)=>{t(Xwn(n),i,r,0)});return r}return null}a(NTt,"formDataToJSON");function Qwn(e,t,r){if(Je.isString(e)){try{(t||JSON.parse)(e);return Je.trim(e)}catch(n){if(n.name!=="SyntaxError"){throw n}}}return(r||JSON.stringify)(e)}a(Qwn,"stringifySafely");var cRe={transitional:lRe,adapter:["xhr","http"],transformRequest:[a(function e(t,r){const n=r.getContentType()||"";const i=n.indexOf("application/json")>-1;const s=Je.isObject(t);if(s&&Je.isHTMLForm(t)){t=new FormData(t)}const o=Je.isFormData(t);if(o){if(!i){return t}return i?JSON.stringify(NTt(t)):t}if(Je.isArrayBuffer(t)||Je.isBuffer(t)||Je.isStream(t)||Je.isFile(t)||Je.isBlob(t)){return t}if(Je.isArrayBufferView(t)){return t.buffer}if(Je.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Ywn(t,this.formSerializer).toString()}if((u=Je.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return bJ(u?{"files[]":t}:t,l&&new l,this.formSerializer)}}if(s||i){r.setContentType("application/json",false);return Qwn(t)}return t},"transformRequest")],transformResponse:[a(function e(t){const r=this.transitional||cRe.transitional;const n=r&&r.forcedJSONParsing;const i=this.responseType==="json";if(t&&Je.isString(t)&&(n&&!this.responseType||i)){const s=r&&r.silentJSONParsing;const o=!s&&i;try{return JSON.parse(t)}catch(u){if(o){if(u.name==="SyntaxError"){throw yr.from(u,yr.ERR_BAD_RESPONSE,this,null,this.response)}throw u}}}return t},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Df.classes.FormData,Blob:Df.classes.Blob},validateStatus:a(function e(t){return t>=200&&t<300},"validateStatus"),headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],e=>{cRe.headers[e]={}});var dRe=cRe;var Zwn=Je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var eTn=a(e=>{const t={};let r;let n;let i;e&&e.split("\n").forEach(a(function s(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&Zwn[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}},"parser"));return t},"parseHeaders");var rTt=Symbol("internals");function RF(e){return e&&String(e).trim().toLowerCase()}a(RF,"normalizeHeader");function hJ(e){if(e===false||e==null){return e}return Je.isArray(e)?e.map(hJ):String(e)}a(hJ,"normalizeValue");function tTn(e){const t=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}a(tTn,"parseTokens");var rTn=a(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),"isValidHeaderName");function Wxe(e,t,r,n,i){if(Je.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Je.isString(t))return;if(Je.isString(n)){return t.indexOf(n)!==-1}if(Je.isRegExp(n)){return n.test(t)}}a(Wxe,"matchHeaderValue");function nTn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>{return r.toUpperCase()+n})}a(nTn,"formatHeader");function iTn(e,t){const r=Je.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:true})})}a(iTn,"buildAccessors");var nP=class{static{a(this,"AxiosHeaders")}constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(u,l,c){const d=RF(l);if(!d){throw new Error("header name must be a non-empty string")}const p=Je.findKey(i,d);if(!p||i[p]===void 0||c===true||c===void 0&&i[p]!==false){i[p||l]=hJ(u)}}a(s,"setHeader");const o=a((u,l)=>Je.forEach(u,(c,d)=>s(c,d,l)),"setHeaders");if(Je.isPlainObject(t)||t instanceof this.constructor){o(t,r)}else if(Je.isString(t)&&(t=t.trim())&&!rTn(t)){o(eTn(t),r)}else{t!=null&&s(r,t,n)}return this}get(t,r){t=RF(t);if(t){const n=Je.findKey(this,t);if(n){const i=this[n];if(!r){return i}if(r===true){return tTn(i)}if(Je.isFunction(r)){return r.call(this,i,n)}if(Je.isRegExp(r)){return r.exec(i)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){t=RF(t);if(t){const n=Je.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Wxe(this,this[n],n,r)))}return false}delete(t,r){const n=this;let i=false;function s(o){o=RF(o);if(o){const u=Je.findKey(n,o);if(u&&(!r||Wxe(n,n[u],u,r))){delete n[u];i=true}}}a(s,"deleteHeader");if(Je.isArray(t)){t.forEach(s)}else{s(t)}return i}clear(t){const r=Object.keys(this);let n=r.length;let i=false;while(n--){const s=r[n];if(!t||Wxe(this,this[s],s,t,true)){delete this[s];i=true}}return i}normalize(t){const r=this;const n={};Je.forEach(this,(i,s)=>{const o=Je.findKey(n,s);if(o){r[o]=hJ(i);delete r[s];return}const u=t?nTn(s):String(s).trim();if(u!==s){delete r[s]}r[u]=hJ(i);n[u]=true});return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);Je.forEach(this,(n,i)=>{n!=null&&n!==false&&(r[i]=t&&Je.isArray(n)?n.join(", "):n)});return r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);r.forEach(i=>n.set(i));return n}static accessor(t){const r=this[rTt]=this[rTt]={accessors:{}};const n=r.accessors;const i=this.prototype;function s(o){const u=RF(o);if(!n[u]){iTn(i,o);n[u]=true}}a(s,"defineAccessor");Je.isArray(t)?t.forEach(s):s(t);return this}};nP.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Je.reduceDescriptors(nP.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Je.freezeMethods(nP);var Ff=nP;function Yxe(e,t){const r=this||dRe;const n=t||r;const i=Ff.from(n.headers);let s=n.data;Je.forEach(e,a(function o(u){s=u.call(r,s,i.normalize(),t?t.status:void 0)},"transform"));i.normalize();return s}a(Yxe,"transformData");function ITt(e){return!!(e&&e.__CANCEL__)}a(ITt,"isCancel");function tC(e,t,r){yr.call(this,e==null?"canceled":e,yr.ERR_CANCELED,t,r);this.name="CanceledError"}a(tC,"CanceledError");Je.inherits(tC,yr,{__CANCEL__:true});function OF(e,t,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new yr("Request failed with status code "+r.status,[yr.ERR_BAD_REQUEST,yr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}a(OF,"settle");function sTn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}a(sTn,"isAbsoluteURL");function aTn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}a(aTn,"combineURLs");function pRe(e,t){if(e&&!sTn(t)){return aTn(e,t)}return t}a(pRe,"buildFullPath");var yJ="1.6.2";function kTt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}a(kTt,"parseProtocol");var oTn=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function uTn(e,t,r){const n=r&&r.Blob||Df.classes.Blob;const i=kTt(e);if(t===void 0&&n){t=true}if(i==="data"){e=i.length?e.slice(i.length+1):e;const s=oTn.exec(e);if(!s){throw new yr("Invalid URL",yr.ERR_INVALID_URL)}const o=s[1];const u=s[2];const l=s[3];const c=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(t){if(!n){throw new yr("Blob is not supported",yr.ERR_NOT_SUPPORT)}return new n([c],{type:o})}return c}throw new yr("Unsupported protocol "+i,yr.ERR_NOT_SUPPORT)}a(uTn,"fromDataURI");function lTn(e,t){let r=0;const n=1e3/t;let i=null;return a(function s(o,u){const l=Date.now();if(o||l-r>n){if(i){clearTimeout(i);i=null}r=l;return e.apply(null,u)}if(!i){i=setTimeout(()=>{i=null;r=Date.now();return e.apply(null,u)},n-(l-r))}},"throttled")}a(lTn,"throttle");function DTt(e,t){e=e||10;const r=new Array(e);const n=new Array(e);let i=0;let s=0;let o;t=t!==void 0?t:1e3;return a(function u(l){const c=Date.now();const d=n[s];if(!o){o=c}r[i]=l;n[i]=c;let p=s;let f=0;while(p!==i){f+=r[p++];p=p%e}i=(i+1)%e;if(i===s){s=(s+1)%e}if(c-o<t){return}const m=d&&c-d;return m?Math.round(f*1e3/m):void 0},"push")}a(DTt,"speedometer");var fJ=Symbol("internals");var eRe=class extends UE["default"].Transform{static{a(this,"AxiosTransformStream")}constructor(t){t=Je.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,l)=>{return!Je.isUndefined(l[u])});super({readableHighWaterMark:t.chunkSize});const r=this;const n=this[fJ]={length:t.length,timeWindow:t.timeWindow,ticksRate:t.ticksRate,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:false,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};const i=DTt(n.ticksRate*t.samplesCount,n.timeWindow);this.on("newListener",u=>{if(u==="progress"){if(!n.isCaptured){n.isCaptured=true}}});let s=0;n.updateProgress=lTn(a(function u(){const l=n.length;const c=n.bytesSeen;const d=c-s;if(!d||r.destroyed)return;const p=i(d);s=c;process.nextTick(()=>{r.emit("progress",{"loaded":c,"total":l,"progress":l?c/l:void 0,"bytes":d,"rate":p?p:void 0,"estimated":p&&l&&c<=l?(l-c)/p:void 0})})},"throttledHandler"),n.ticksRate);const o=a(()=>{n.updateProgress(true)},"onFinish");this.once("end",o);this.once("error",o)}_read(t){const r=this[fJ];if(r.onReadCallback){r.onReadCallback()}return super._read(t)}_transform(t,r,n){const i=this;const s=this[fJ];const o=s.maxRate;const u=this.readableHighWaterMark;const l=s.timeWindow;const c=1e3/l;const d=o/c;const p=s.minChunkSize!==false?Math.max(s.minChunkSize,d*.01):0;function f(h,g){const _=Buffer.byteLength(h);s.bytesSeen+=_;s.bytes+=_;if(s.isCaptured){s.updateProgress()}if(i.push(h)){process.nextTick(g)}else{s.onReadCallback=()=>{s.onReadCallback=null;process.nextTick(g)}}}a(f,"pushChunk");const m=a((h,g)=>{const _=Buffer.byteLength(h);let v=null;let S=u;let E;let b=0;if(o){const A=Date.now();if(!s.ts||(b=A-s.ts)>=l){s.ts=A;E=d-s.bytes;s.bytes=E<0?-E:0;b=0}E=d-s.bytes}if(o){if(E<=0){return setTimeout(()=>{g(null,h)},l-b)}if(E<S){S=E}}if(S&&_>S&&_-S>p){v=h.subarray(S);h=h.subarray(0,S)}f(h,v?()=>{process.nextTick(g,null,v)}:g)},"transformChunk");m(t,a(function h(g,_){if(g){return n(g)}if(_){m(_,h)}else{n(null)}},"transformNextChunk"))}setLength(t){this[fJ].length=+t;return this}};var nTt=eRe;var{asyncIterator:iTt}=Symbol;var cTn=a(async function*(e){if(e.stream){yield*e.stream()}else if(e.arrayBuffer){yield await e.arrayBuffer()}else if(e[iTt]){yield*e[iTt]()}else{yield e}},"readBlob");var LTt=cTn;var dTn=Je.ALPHABET.ALPHA_DIGIT+"-_";var NF=new mTt.TextEncoder;var $E="\r\n";var pTn=NF.encode($E);var fTn=2;var tRe=class{static{a(this,"FormDataPart")}constructor(t,r){const{escapeName:n}=this.constructor;const i=Je.isString(r);let s=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${$E}`;if(i){r=NF.encode(String(r).replace(/\r?\n|\r\n?/g,$E))}else{s+=`Content-Type: ${r.type||"application/octet-stream"}${$E}`}this.headers=NF.encode(s+$E);this.contentLength=i?r.byteLength:r.size;this.size=this.headers.byteLength+this.contentLength+fTn;this.name=t;this.value=r}async*encode(){yield this.headers;const{value:t}=this;if(Je.isTypedArray(t)){yield t}else{yield*LTt(t)}yield pTn}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}};var mTn=a((e,t,r)=>{const{tag:n="form-data-boundary",size:i=25,boundary:s=n+"-"+Je.generateString(i,dTn)}=r||{};if(!Je.isFormData(e)){throw TypeError("FormData instance required")}if(s.length<1||s.length>70){throw Error("boundary must be 10-70 characters long")}const o=NF.encode("--"+s+$E);const u=NF.encode("--"+s+"--"+$E+$E);let l=u.byteLength;const c=Array.from(e.entries()).map(([p,f])=>{const m=new tRe(p,f);l+=m.size;return m});l+=o.byteLength*c.length;l=Je.toFiniteNumber(l);const d={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(l)){d["Content-Length"]=l}t&&t(d);return hTt.Readable.from(async function*(){for(const p of c){yield o;yield*p.encode()}yield u}())},"formDataToStream");var hTn=mTn;var rRe=class extends UE["default"].Transform{static{a(this,"ZlibHeaderTransformStream")}__transform(t,r,n){this.push(t);n()}_transform(t,r,n){if(t.length!==0){this._transform=this.__transform;if(t[0]!==120){const i=Buffer.alloc(2);i[0]=120;i[1]=156;this.push(i,r)}}this.__transform(t,r,n)}};var gTn=rRe;var yTn=a((e,t)=>{return Je.isAsyncFn(e)?function(...r){const n=r.pop();e.apply(this,r).then(i=>{try{t?n(null,...t(i)):n(null,i)}catch(s){n(s)}},n)}:e},"callbackify");var _Tn=yTn;var sTt={flush:jE["default"].constants.Z_SYNC_FLUSH,finishFlush:jE["default"].constants.Z_SYNC_FLUSH};var vTn={flush:jE["default"].constants.BROTLI_OPERATION_FLUSH,finishFlush:jE["default"].constants.BROTLI_OPERATION_FLUSH};var aTt=Je.isFunction(jE["default"].createBrotliDecompress);var{http:ETn,https:bTn}=swn["default"];var STn=/https:?/;var oTt=Df.protocols.map(e=>{return e+":"});function ATn(e){if(e.beforeRedirects.proxy){e.beforeRedirects.proxy(e)}if(e.beforeRedirects.config){e.beforeRedirects.config(e)}}a(ATn,"dispatchBeforeRedirect");function FTt(e,t,r){let n=t;if(!n&&n!==false){const i=YCn.getProxyForUrl(r);if(i){n=new URL(i)}}if(n){if(n.username){n.auth=(n.username||"")+":"+(n.password||"")}if(n.auth){if(n.auth.username||n.auth.password){n.auth=(n.auth.username||"")+":"+(n.auth.password||"")}const s=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");const i=n.hostname||n.host;e.hostname=i;e.host=i;e.port=n.port;e.path=r;if(n.protocol){e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`}}e.beforeRedirects.proxy=a(function i(s){FTt(s,t,s.href)},"beforeRedirect")}a(FTt,"setProxy");var CTn=typeof process!=="undefined"&&Je.kindOf(process)==="process";var wTn=a(e=>{return new Promise((t,r)=>{let n;let i;const s=a((l,c)=>{if(i)return;i=true;n&&n(l,c)},"done");const o=a(l=>{s(l);t(l)},"_resolve");const u=a(l=>{s(l,true);r(l)},"_reject");e(o,u,l=>n=l).catch(u)})},"wrapAsync");var TTn=a(({address:e,family:t})=>{if(!Je.isString(e)){throw TypeError("address must be a string")}return{address:e,family:t||(e.indexOf(".")<0?6:4)}},"resolveFamily");var uTt=a((e,t)=>TTn(Je.isObject(e)?e:{address:e,family:t}),"buildAddressEntry");var xTn=CTn&&a(function e(t){return wTn(a(async function r(n,i,s){let{data:o,lookup:u,family:l}=t;const{responseType:c,responseEncoding:d}=t;const p=t.method.toUpperCase();let f;let m=false;let h;if(u){const he=_Tn(u,Fe=>Je.isArray(Fe)?Fe:[Fe]);u=a((Fe,Oe,M)=>{he(Fe,Oe,(Q,fe,B)=>{const ye=Je.isArray(fe)?fe.map(De=>uTt(De)):[uTt(fe,B)];Oe.all?M(Q,ye):M(Q,ye[0].address,ye[0].family)})},"lookup")}const g=new awn["default"];const _=a(()=>{if(t.cancelToken){t.cancelToken.unsubscribe(v)}if(t.signal){t.signal.removeEventListener("abort",v)}g.removeAllListeners()},"onFinished");s((he,Fe)=>{f=true;if(Fe){m=true;_()}});function v(he){g.emit("abort",!he||he.type?new tC(null,t,h):he)}a(v,"abort");g.once("abort",i);if(t.cancelToken||t.signal){t.cancelToken&&t.cancelToken.subscribe(v);if(t.signal){t.signal.aborted?v():t.signal.addEventListener("abort",v)}}const S=pRe(t.baseURL,t.url);const E=new URL(S,"http://localhost");const b=E.protocol||oTt[0];if(b==="data:"){let he;if(p!=="GET"){return OF(n,i,{status:405,statusText:"method not allowed",headers:{},config:t})}try{he=uTn(t.url,c==="blob",{Blob:t.env&&t.env.Blob})}catch(Fe){throw yr.from(Fe,yr.ERR_BAD_REQUEST,t)}if(c==="text"){he=he.toString(d);if(!d||d==="utf8"){he=Je.stripBOM(he)}}else if(c==="stream"){he=UE["default"].Readable.from(he)}return OF(n,i,{data:he,status:200,statusText:"OK",headers:new Ff,config:t})}if(oTt.indexOf(b)===-1){return i(new yr("Unsupported protocol "+b,yr.ERR_BAD_REQUEST,t))}const A=Ff.from(t.headers).normalize();A.set("User-Agent","axios/"+yJ,false);const C=t.onDownloadProgress;const T=t.onUploadProgress;const O=t.maxRate;let P=void 0;let R=void 0;if(Je.isSpecCompliantForm(o)){const he=A.getContentType(/boundary=([-_\w\d]{10,70})/i);o=hTn(o,Fe=>{A.set(Fe)},{tag:`axios-${yJ}-boundary`,boundary:he&&he[1]||void 0})}else if(Je.isFormData(o)&&Je.isFunction(o.getHeaders)){A.set(o.getHeaders());if(!A.hasContentLength()){try{const he=await iwn["default"].promisify(o.getLength).call(o);Number.isFinite(he)&&he>=0&&A.setContentLength(he)}catch(he){}}}else if(Je.isBlob(o)){o.size&&A.setContentType(o.type||"application/octet-stream");A.setContentLength(o.size||0);o=UE["default"].Readable.from(LTt(o))}else if(o&&!Je.isStream(o)){if(Buffer.isBuffer(o));else if(Je.isArrayBuffer(o)){o=Buffer.from(new Uint8Array(o))}else if(Je.isString(o)){o=Buffer.from(o,"utf-8")}else{return i(new yr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",yr.ERR_BAD_REQUEST,t))}A.setContentLength(o.length,false);if(t.maxBodyLength>-1&&o.length>t.maxBodyLength){return i(new yr("Request body larger than maxBodyLength limit",yr.ERR_BAD_REQUEST,t))}}const I=Je.toFiniteNumber(A.getContentLength());if(Je.isArray(O)){P=O[0];R=O[1]}else{P=R=O}if(o&&(T||P)){if(!Je.isStream(o)){o=UE["default"].Readable.from(o,{objectMode:false})}o=UE["default"].pipeline([o,new nTt({length:I,maxRate:Je.toFiniteNumber(P)})],Je.noop);T&&o.on("progress",he=>{T(Object.assign(he,{upload:true}))})}let D=void 0;if(t.auth){const he=t.auth.username||"";const Fe=t.auth.password||"";D=he+":"+Fe}if(!D&&E.username){const he=E.username;const Fe=E.password;D=he+":"+Fe}D&&A.delete("authorization");let U;try{U=uRe(E.pathname+E.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(he){const Fe=new Error(he.message);Fe.config=t;Fe.url=t.url;Fe.exists=true;return i(Fe)}A.set("Accept-Encoding","gzip, compress, deflate"+(aTt?", br":""),false);const te={path:U,method:p,headers:A.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:D,protocol:b,family:l,beforeRedirect:ATn,beforeRedirects:{}};!Je.isUndefined(u)&&(te.lookup=u);if(t.socketPath){te.socketPath=t.socketPath}else{te.hostname=E.hostname;te.port=E.port;FTt(te,t.proxy,b+"//"+E.hostname+(E.port?":"+E.port:"")+te.path)}let ve;const me=STn.test(te.protocol);te.agent=me?t.httpsAgent:t.httpAgent;if(t.transport){ve=t.transport}else if(t.maxRedirects===0){ve=me?nwn["default"]:rwn["default"]}else{if(t.maxRedirects){te.maxRedirects=t.maxRedirects}if(t.beforeRedirect){te.beforeRedirects.config=t.beforeRedirect}ve=me?bTn:ETn}if(t.maxBodyLength>-1){te.maxBodyLength=t.maxBodyLength}else{te.maxBodyLength=Infinity}if(t.insecureHTTPParser){te.insecureHTTPParser=t.insecureHTTPParser}h=ve.request(te,a(function he(Fe){if(h.destroyed)return;const Oe=[Fe];const M=+Fe.headers["content-length"];if(C){const De=new nTt({length:Je.toFiniteNumber(M),maxRate:Je.toFiniteNumber(R)});C&&De.on("progress",$e=>{C(Object.assign($e,{download:true}))});Oe.push(De)}let Q=Fe;const fe=Fe.req||h;if(t.decompress!==false&&Fe.headers["content-encoding"]){if(p==="HEAD"||Fe.statusCode===204){delete Fe.headers["content-encoding"]}switch((Fe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Oe.push(jE["default"].createUnzip(sTt));delete Fe.headers["content-encoding"];break;case"deflate":Oe.push(new gTn);Oe.push(jE["default"].createUnzip(sTt));delete Fe.headers["content-encoding"];break;case"br":if(aTt){Oe.push(jE["default"].createBrotliDecompress(vTn));delete Fe.headers["content-encoding"]}}}Q=Oe.length>1?UE["default"].pipeline(Oe,Je.noop):Oe[0];const B=UE["default"].finished(Q,()=>{B();_()});const ye={status:Fe.statusCode,statusText:Fe.statusMessage,headers:new Ff(Fe.headers),config:t,request:fe};if(c==="stream"){ye.data=Q;OF(n,i,ye)}else{const De=[];let $e=0;Q.on("data",a(function gt(ut){De.push(ut);$e+=ut.length;if(t.maxContentLength>-1&&$e>t.maxContentLength){m=true;Q.destroy();i(new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe))}},"handleStreamData"));Q.on("aborted",a(function gt(){if(m){return}const ut=new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe);Q.destroy(ut);i(ut)},"handlerStreamAborted"));Q.on("error",a(function gt(ut){if(h.destroyed)return;i(yr.from(ut,null,t,fe))},"handleStreamError"));Q.on("end",a(function gt(){try{let ut=De.length===1?De[0]:Buffer.concat(De);if(c!=="arraybuffer"){ut=ut.toString(d);if(!d||d==="utf8"){ut=Je.stripBOM(ut)}}ye.data=ut}catch(ut){return i(yr.from(ut,null,t,ye.request,ye))}OF(n,i,ye)},"handleStreamEnd"))}g.once("abort",De=>{if(!Q.destroyed){Q.emit("error",De);Q.destroy()}})},"handleResponse"));g.once("abort",he=>{i(he);h.destroy(he)});h.on("error",a(function he(Fe){i(yr.from(Fe,null,t,h))},"handleRequestError"));h.on("socket",a(function he(Fe){Fe.setKeepAlive(true,1e3*60)},"handleRequestSocket"));if(t.timeout){const he=parseInt(t.timeout,10);if(Number.isNaN(he)){i(new yr("error trying to parse `config.timeout` to int",yr.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(he,a(function Fe(){if(f)return;let Oe=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||lRe;if(t.timeoutErrorMessage){Oe=t.timeoutErrorMessage}i(new yr(Oe,M.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,t,h));v()},"handleRequestTimeout"))}if(Je.isStream(o)){let he=false;let Fe=false;o.on("end",()=>{he=true});o.once("error",Oe=>{Fe=true;h.destroy(Oe)});o.on("close",()=>{if(!he&&!Fe){v(new tC("Request stream has been aborted",t,h))}});o.pipe(h)}else{h.end(o)}},"dispatchHttpRequest"))},"httpAdapter");var RTn=Df.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];Je.isNumber(r)&&o.push("expires="+new Date(r).toGMTString());Je.isString(n)&&o.push("path="+n);Je.isString(i)&&o.push("domain="+i);s===true&&o.push("secure");document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var OTn=Df.hasStandardBrowserEnv?a(function e(){const t=/(msie|trident)/i.test(navigator.userAgent);const r=document.createElement("a");let n;function i(s){let o=s;if(t){r.setAttribute("href",o);o=r.href}r.setAttribute("href",o);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}a(i,"resolveURL");n=i(window.location.href);return a(function s(o){const u=Je.isString(o)?i(o):o;return u.protocol===n.protocol&&u.host===n.host},"isURLSameOrigin")},"standardBrowserEnv")():a(function e(){return a(function t(){return true},"isURLSameOrigin")},"nonStandardBrowserEnv")();function lTt(e,t){let r=0;const n=DTt(50,250);return i=>{const s=i.loaded;const o=i.lengthComputable?i.total:void 0;const u=s-r;const l=n(u);const c=s<=o;r=s;const d={loaded:s,total:o,progress:o?s/o:void 0,bytes:u,rate:l?l:void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};d[t?"download":"upload"]=true;e(d)}}a(lTt,"progressEventReducer");var PTn=typeof XMLHttpRequest!=="undefined";var NTn=PTn&&function(e){return new Promise(a(function t(r,n){let i=e.data;const s=Ff.from(e.headers).normalize();let{responseType:o,withXSRFToken:u}=e;let l;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(l)}if(e.signal){e.signal.removeEventListener("abort",l)}}a(c,"done");let d;if(Je.isFormData(i)){if(Df.hasStandardBrowserEnv||Df.hasStandardBrowserWebWorkerEnv){s.setContentType(false)}else if((d=s.getContentType())!==false){const[g,..._]=d?d.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",..._].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const g=e.auth.username||"";const _=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+_))}const f=pRe(e.baseURL,e.url);p.open(e.method.toUpperCase(),uRe(f,e.params,e.paramsSerializer),true);p.timeout=e.timeout;function m(){if(!p){return}const g=Ff.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());const _=!o||o==="text"||o==="json"?p.responseText:p.response;const v={data:_,status:p.status,statusText:p.statusText,headers:g,config:e,request:p};OF(a(function S(E){r(E);c()},"_resolve"),a(function S(E){n(E);c()},"_reject"),v);p=null}a(m,"onloadend");if("onloadend"in p){p.onloadend=m}else{p.onreadystatechange=a(function g(){if(!p||p.readyState!==4){return}if(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)){return}setTimeout(m)},"handleLoad")}p.onabort=a(function g(){if(!p){return}n(new yr("Request aborted",yr.ECONNABORTED,e,p));p=null},"handleAbort");p.onerror=a(function g(){n(new yr("Network Error",yr.ERR_NETWORK,e,p));p=null},"handleError");p.ontimeout=a(function g(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||lRe;if(e.timeoutErrorMessage){_=e.timeoutErrorMessage}n(new yr(_,v.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,e,p));p=null},"handleTimeout");if(Df.hasStandardBrowserEnv){u&&Je.isFunction(u)&&(u=u(e));if(u||u!==false&&OTn(f)){const g=e.xsrfHeaderName&&e.xsrfCookieName&&RTn.read(e.xsrfCookieName);if(g){s.set(e.xsrfHeaderName,g)}}}i===void 0&&s.setContentType(null);if("setRequestHeader"in p){Je.forEach(s.toJSON(),a(function g(_,v){p.setRequestHeader(v,_)},"setRequestHeader"))}if(!Je.isUndefined(e.withCredentials)){p.withCredentials=!!e.withCredentials}if(o&&o!=="json"){p.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){p.addEventListener("progress",lTt(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&p.upload){p.upload.addEventListener("progress",lTt(e.onUploadProgress))}if(e.cancelToken||e.signal){l=a(g=>{if(!p){return}n(!g||g.type?new tC(null,e,p):g);p.abort();p=null},"onCanceled");e.cancelToken&&e.cancelToken.subscribe(l);if(e.signal){e.signal.aborted?l():e.signal.addEventListener("abort",l)}}const h=kTt(f);if(h&&Df.protocols.indexOf(h)===-1){n(new yr("Unsupported protocol "+h+":",yr.ERR_BAD_REQUEST,e));return}p.send(i||null)},"dispatchXhrRequest"))};var nRe={http:xTn,xhr:NTn};Je.forEach(nRe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});var cTt=a(e=>`- ${e}`,"renderReason");var ITn=a(e=>Je.isFunction(e)||e===null||e===false,"isResolvedHandle");var BTt={getAdapter:e=>{e=Je.isArray(e)?e:[e];const{length:t}=e;let r;let n;const i={};for(let s=0;s<t;s++){r=e[s];let o;n=r;if(!ITn(r)){n=nRe[(o=String(r)).toLowerCase()];if(n===void 0){throw new yr(`Unknown adapter '${o}'`)}}if(n){break}i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===false?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?"since :\n"+s.map(cTt).join("\n"):" "+cTt(s[0]):"as no adapter specified";throw new yr(`There is no suitable adapter to dispatch the request `+o,"ERR_NOT_SUPPORT")}return n},adapters:nRe};function Xxe(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new tC(null,e)}}a(Xxe,"throwIfCancellationRequested");function dTt(e){Xxe(e);e.headers=Ff.from(e.headers);e.data=Yxe.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=BTt.getAdapter(e.adapter||dRe.adapter);return t(e).then(a(function r(n){Xxe(e);n.data=Yxe.call(e,e.transformResponse,n);n.headers=Ff.from(n.headers);return n},"onAdapterResolution"),a(function r(n){if(!ITt(n)){Xxe(e);if(n&&n.response){n.response.data=Yxe.call(e,e.transformResponse,n.response);n.response.headers=Ff.from(n.response.headers)}}return Promise.reject(n)},"onAdapterRejection"))}a(dTt,"dispatchRequest");var pTt=a(e=>e instanceof Ff?e.toJSON():e,"headersToObject");function iP(e,t){t=t||{};const r={};function n(c,d,p){if(Je.isPlainObject(c)&&Je.isPlainObject(d)){return Je.merge.call({caseless:p},c,d)}else if(Je.isPlainObject(d)){return Je.merge({},d)}else if(Je.isArray(d)){return d.slice()}return d}a(n,"getMergedValue");function i(c,d,p){if(!Je.isUndefined(d)){return n(c,d,p)}else if(!Je.isUndefined(c)){return n(void 0,c,p)}}a(i,"mergeDeepProperties");function s(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}}a(s,"valueFromConfig2");function o(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}else if(!Je.isUndefined(c)){return n(void 0,c)}}a(o,"defaultToConfig2");function u(c,d,p){if(p in t){return n(c,d)}else if(p in e){return n(void 0,c)}}a(u,"mergeDirectKeys");const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(c,d)=>i(pTt(c),pTt(d),true)};Je.forEach(Object.keys(Object.assign({},e,t)),a(function c(d){const p=l[d]||i;const f=p(e[d],t[d],d);Je.isUndefined(f)&&p!==u||(r[d]=f)},"computeConfigValue"));return r}a(iP,"mergeConfig");var fRe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fRe[e]=a(function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e},"validator")});var fTt={};fRe.transitional=a(function e(t,r,n){function i(s,o){return"[Axios v"+yJ+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}a(i,"formatMessage");return(s,o,u)=>{if(t===false){throw new yr(i(o," has been removed"+(r?" in "+r:"")),yr.ERR_DEPRECATED)}if(r&&!fTt[o]){fTt[o]=true;console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(s,o,u):true}},"transitional");function kTn(e,t,r){if(typeof e!=="object"){throw new yr("options must be an object",yr.ERR_BAD_OPTION_VALUE)}const n=Object.keys(e);let i=n.length;while(i-- >0){const s=n[i];const o=t[s];if(o){const u=e[s];const l=u===void 0||o(u,s,e);if(l!==true){throw new yr("option "+s+" must be "+l,yr.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new yr("Unknown option "+s,yr.ERR_BAD_OPTION)}}}a(kTn,"assertOptions");var iRe={assertOptions:kTn,validators:fRe};var qE=iRe.validators;var sP=class{static{a(this,"Axios")}constructor(t){this.defaults=t;this.interceptors={request:new tTt,response:new tTt}}request(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=iP(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;if(n!==void 0){iRe.assertOptions(n,{silentJSONParsing:qE.transitional(qE.boolean),forcedJSONParsing:qE.transitional(qE.boolean),clarifyTimeoutError:qE.transitional(qE.boolean)},false)}if(i!=null){if(Je.isFunction(i)){r.paramsSerializer={serialize:i}}else{iRe.assertOptions(i,{encode:qE.function,serialize:qE.function},true)}}r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Je.merge(s.common,s[r.method]);s&&Je.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]});r.headers=Ff.concat(o,s);const u=[];let l=true;this.interceptors.request.forEach(a(function h(g){if(typeof g.runWhen==="function"&&g.runWhen(r)===false){return}l=l&&g.synchronous;u.unshift(g.fulfilled,g.rejected)},"unshiftRequestInterceptors"));const c=[];this.interceptors.response.forEach(a(function h(g){c.push(g.fulfilled,g.rejected)},"pushResponseInterceptors"));let d;let p=0;let f;if(!l){const h=[dTt.bind(this),void 0];h.unshift.apply(h,u);h.push.apply(h,c);f=h.length;d=Promise.resolve(r);while(p<f){d=d.then(h[p++],h[p++])}return d}f=u.length;let m=r;p=0;while(p<f){const h=u[p++];const g=u[p++];try{m=h(m)}catch(_){g.call(this,_);break}}try{d=dTt.call(this,m)}catch(h){return Promise.reject(h)}p=0;f=c.length;while(p<f){d=d.then(c[p++],c[p++])}return d}getUri(t){t=iP(this.defaults,t);const r=pRe(t.baseURL,t.url);return uRe(r,t.params,t.paramsSerializer)}};Je.forEach(["delete","get","head","options"],a(function e(t){sP.prototype[t]=function(r,n){return this.request(iP(n||{},{method:t,url:r,data:(n||{}).data}))}},"forEachMethodNoData"));Je.forEach(["post","put","patch"],a(function e(t){function r(n){return a(function i(s,o,u){return this.request(iP(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))},"httpMethod")}a(r,"generateHTTPMethod");sP.prototype[t]=r();sP.prototype[t+"Form"]=r(true)},"forEachMethodWithData"));var gJ=sP;var sRe=class e{static{a(this,"CancelToken")}constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let r;this.promise=new Promise(a(function i(s){r=s},"promiseExecutor"));const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;while(s-- >0){n._listeners[s](i)}n._listeners=null});this.promise.then=i=>{let s;const o=new Promise(u=>{n.subscribe(u);s=u}).then(i);o.cancel=a(function u(){n.unsubscribe(s)},"reject");return o};t(a(function i(s,o,u){if(n.reason){return}n.reason=new tC(s,o,u);r(n.reason)},"cancel"))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}}static source(){let t;const r=new e(a(function n(i){t=i},"executor"));return{token:r,cancel:t}}};var DTn=sRe;function LTn(e){return a(function t(r){return e.apply(null,r)},"wrap")}a(LTn,"spread");function FTn(e){return Je.isObject(e)&&e.isAxiosError===true}a(FTn,"isAxiosError");var aRe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aRe).forEach(([e,t])=>{aRe[t]=e});var BTn=aRe;function MTt(e){const t=new gJ(e);const r=yTt(gJ.prototype.request,t);Je.extend(r,gJ.prototype,t,{allOwnKeys:true});Je.extend(r,t,null,{allOwnKeys:true});r.create=a(function n(i){return MTt(iP(e,i))},"create");return r}a(MTt,"createInstance");var Fo=MTt(dRe);Fo.Axios=gJ;Fo.CanceledError=tC;Fo.CancelToken=DTn;Fo.isCancel=ITt;Fo.VERSION=yJ;Fo.toFormData=bJ;Fo.AxiosError=yr;Fo.Cancel=Fo.CanceledError;Fo.all=a(function e(t){return Promise.all(t)},"all");Fo.spread=LTn;Fo.isAxiosError=FTn;Fo.mergeConfig=iP;Fo.AxiosHeaders=Ff;Fo.formToJSON=e=>NTt(Je.isHTMLForm(e)?new FormData(e):e);Fo.getAdapter=BTt.getAdapter;Fo.HttpStatusCode=BTn;Fo.default=Fo;qTt.exports=Fo});var CJ=y(AJ=>{"use strict";Object.defineProperty(AJ,"__esModule",{value:true});AJ.CredentialsMethod=void 0;var UTt;(function(e){e["None"]="none";e["ApiToken"]="api_token";e["ClientCredentials"]="client_credentials"})(UTt||(AJ.CredentialsMethod=UTt={}))});var nC=y(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:true});Bo.FgaRequiredParamError=Bo.FgaValidationError=Bo.FgaApiAuthenticationError=Bo.FgaApiInternalError=Bo.FgaApiRateLimitExceededError=Bo.FgaApiNotFoundError=Bo.FgaApiValidationError=Bo.FgaApiError=Bo.FgaError=void 0;var oP=class extends Error{static{a(this,"FgaError")}constructor(t,r){super(r||typeof t==="string"?t:`FGA Error${(t===null||t===void 0?void 0:t.message)?`: ${t.message}`:""}`);this.name="FgaError";if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Bo.FgaError=oP;function TJ(e){let t=(e||"").split("/");if(t.length<4){t=[]}const r=t[2]||"";const n=t[3]||"";return{storeId:r,endpointCategory:n}}a(TJ,"getRequestMetadataFromPath");var $Tt="fga-request-id";function ERe(e){return e.response?Object.fromEntries(Object.entries(e.response.headers).map(([t,r])=>[t.toLowerCase(),r])):{}}a(ERe,"getResponseHeaders");var rC=class extends oP{static{a(this,"FgaApiError")}constructor(t,r){var n,i,s,o,u,l,c,d,p,f;super(r?r:t);this.name="FgaApiError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestData=(s=t.config)===null||s===void 0?void 0:s.data;this.requestURL=(o=t.config)===null||o===void 0?void 0:o.url;this.method=(u=t.config)===null||u===void 0?void 0:u.method;const{storeId:m,endpointCategory:h}=TJ((l=t.request)===null||l===void 0?void 0:l.path);this.storeId=m;this.endpointCategory=h;this.apiErrorMessage=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message;this.responseData=(p=t.response)===null||p===void 0?void 0:p.data;this.responseHeader=(f=t.response)===null||f===void 0?void 0:f.headers;const g=ERe(t);this.requestId=g[$Tt];if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Bo.FgaApiError=rC;var mRe=class extends rC{static{a(this,"FgaApiValidationError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiValidationError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:p}=TJ((s=t.request)===null||s===void 0?void 0:s.path);this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Validation Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Bo.FgaApiValidationError=mRe;var hRe=class extends rC{static{a(this,"FgaApiNotFoundError")}constructor(t,r){var n,i,s,o,u,l,c;super(t);this.name="FgaApiNotFoundError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;this.message=r?r:((o=(s=t.response)===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.message)?`FGA API NotFound Error: ${(u=t.config)===null||u===void 0?void 0:u.method} : Error ${(c=(l=t.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message}`:t.message}};Bo.FgaApiNotFoundError=hRe;var gRe=class extends rC{static{a(this,"FgaApiRateLimitExceededError")}constructor(t,r){var n,i,s;super(t);this.name="FgaApiRateLimitExceededError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:o}=TJ((s=t.request)===null||s===void 0?void 0:s.path);const u=ERe(t);this.message=r?r:`FGA API Rate Limit Error for ${this.method} ${o}`}};Bo.FgaApiRateLimitExceededError=gRe;var yRe=class extends rC{static{a(this,"FgaApiInternalError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiInternalError";const{endpointCategory:p}=TJ((n=t.request)===null||n===void 0?void 0:n.path);this.apiErrorCode=(s=(i=t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.code;this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Internal Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Bo.FgaApiInternalError=yRe;var _Re=class extends oP{static{a(this,"FgaApiAuthenticationError")}constructor(t){var r,n,i,s,o,u,l,c,d,p;super(`FGA Authentication Error.${((r=t.response)===null||r===void 0?void 0:r.statusText)?` ${t.response.statusText}`:""}`);this.name="FgaApiAuthenticationError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestURL=(s=t.config)===null||s===void 0?void 0:s.url;this.method=(o=t.config)===null||o===void 0?void 0:o.method;this.responseData=(u=t.response)===null||u===void 0?void 0:u.data;this.responseHeader=(l=t.response)===null||l===void 0?void 0:l.headers;this.apiErrorCode=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.code;const f=ERe(t);this.requestId=f[$Tt];let m;try{m=JSON.parse(((p=t.config)===null||p===void 0?void 0:p.data)||"{}")}catch(h){}this.clientId=m===null||m===void 0?void 0:m.client_id;this.audience=m===null||m===void 0?void 0:m.audience;this.grantType=m===null||m===void 0?void 0:m.grant_type;if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Bo.FgaApiAuthenticationError=_Re;var wJ=class extends oP{static{a(this,"FgaValidationError")}constructor(t,r){super(r);this.field=t;this.name="FgaValidationError"}};Bo.FgaValidationError=wJ;var vRe=class extends wJ{static{a(this,"FgaRequiredParamError")}constructor(t,r,n){super(r,n);this.functionName=t;this.name="FgaRequiredParamError"}};Bo.FgaRequiredParamError=vRe});var kF=y(GE=>{"use strict";Object.defineProperty(GE,"__esModule",{value:true});GE.isWellFormedUlidString=GE.isWellFormedUriString=GE.assertParamExists=void 0;var MTn=nC();var qTn=a(function(e,t,r){if(r===null||r===void 0){throw new MTn.FgaRequiredParamError(e,t,`Required parameter ${t} was null or undefined when calling ${e}.`)}},"assertParamExists");GE.assertParamExists=qTn;var UTn=a(e=>{try{const t=new URL(e);return(t.toString()===e||t.toString()===`${e}/`)&&(t.protocol==="https:"||t.protocol==="http:")}catch(t){return false}},"isWellFormedUriString");GE.isWellFormedUriString=UTn;var $Tn=a(e=>{var t;const r=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;return!!(typeof e==="string"&&((t=e.match(r))===null||t===void 0?void 0:t.length))},"isWellFormedUlidString");GE.isWellFormedUlidString=$Tn});var SRe=y(uP=>{"use strict";Object.defineProperty(uP,"__esModule",{value:true});uP.Configuration=uP.GetDefaultRetryParams=void 0;var DF=CJ();var bRe=nC();var xJ=kF();var jTn=15;var GTn=100;var HTn="openfga-sdk js/0.3.0";function VTn(e=jTn,t=GTn){return{maxRetry:e,minWaitInMs:t}}a(VTn,"GetDefaultRetryParams");uP.GetDefaultRetryParams=VTn;var RJ=class{static{a(this,"Configuration")}constructor(t={}){this.apiScheme="https";this.getBasePath=()=>`${this.apiScheme}://${this.apiHost}`;this.apiScheme=t.apiScheme||this.apiScheme;this.apiHost=t.apiHost;this.storeId=t.storeId;const r=t.credentials;if(r){switch(r===null||r===void 0?void 0:r.method){case DF.CredentialsMethod.ApiToken:this.credentials={method:r.method,config:{token:r.config.token,headerName:"Authorization",headerValuePrefix:"Bearer"}};break;case DF.CredentialsMethod.ClientCredentials:this.credentials={method:DF.CredentialsMethod.ClientCredentials,config:{clientId:r.config.clientId,clientSecret:r.config.clientSecret,apiAudience:r.config.apiAudience,apiTokenIssuer:r.config.apiTokenIssuer}};break;case DF.CredentialsMethod.None:default:this.credentials={method:DF.CredentialsMethod.None};break}}const n=t.baseOptions||{};n.headers=n.headers||{};if(typeof process==="object"&&process.title==="node"&&!n.headers["User-Agent"]){n.headers["User-Agent"]=HTn}this.baseOptions=n;this.retryParams=t.retryParams}isValid(){var t;(0,xJ.assertParamExists)("Configuration","apiScheme",this.apiScheme);(0,xJ.assertParamExists)("Configuration","apiHost",this.apiHost);if(!(0,xJ.isWellFormedUriString)(this.getBasePath())){throw new bRe.FgaValidationError(`Configuration.apiScheme (${this.apiScheme}) and Configuration.apiHost (${this.apiHost}) do not form a valid URI (${this.getBasePath()})`)}if(this.storeId&&!(0,xJ.isWellFormedUlidString)(this.storeId)){throw new bRe.FgaValidationError("storeId")}if(((t=this.retryParams)===null||t===void 0?void 0:t.maxRetry)&&this.retryParams.maxRetry>15){throw new bRe.FgaValidationError("Configuration.retryParams.maxRetry exceeds maximum allowed limit of 15")}return true}};uP.Configuration=RJ;RJ.sdkVersion="0.3.0"});var jTt=y(OJ=>{"use strict";Object.defineProperty(OJ,"__esModule",{value:true});OJ.assertNever=void 0;function zTn(e){throw new Error(`Assertion failed. Unacceptable value: '${e}'`)}a(zTn,"assertNever");OJ.assertNever=zTn});var GTt=y(PJ=>{"use strict";Object.defineProperty(PJ,"__esModule",{value:true});PJ.chunkArray=void 0;function KTn(e,t){const r=[];const n=[...e];while(n.length>0){r.push(n.splice(0,t))}return r}a(KTn,"chunkArray");PJ.chunkArray=KTn});var VTt=y(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:true});lP.generateRandomIdWithNonUniqueFallback=lP.generateRandomId=void 0;var NJ=require("crypto");function HTt(){if(typeof NJ.randomUUID==="function"){return(0,NJ.randomUUID)()}if(typeof NJ.randomBytes==="function"){return(0,NJ.randomBytes)(20).toString("hex")}return}a(HTt,"generateRandomId");lP.generateRandomId=HTt;function WTn(){return HTt()||"00000000-0000-0000-0000-000000000000"}a(WTn,"generateRandomIdWithNonUniqueFallback");lP.generateRandomIdWithNonUniqueFallback=WTn});var zTt=y(IJ=>{"use strict";Object.defineProperty(IJ,"__esModule",{value:true});IJ.setHeaderIfNotSet=void 0;function YTn(e,t,r){if(!e[t]&&r){e[t]=r}}a(YTn,"setHeaderIfNotSet");IJ.setHeaderIfNotSet=YTn});var KTt=y(kJ=>{"use strict";Object.defineProperty(kJ,"__esModule",{value:true});kJ.setNotEnumerableProperty=void 0;function XTn(e,t,r){Object.defineProperty(e,t,{enumerable:false,writable:false,value:r})}a(XTn,"setNotEnumerableProperty");kJ.setNotEnumerableProperty=XTn});var ARe=y(mh=>{"use strict";var JTn=mh&&mh.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var LF=mh&&mh.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))JTn(t,e,r)};Object.defineProperty(mh,"__esModule",{value:true});LF(jTt(),mh);LF(GTt(),mh);LF(VTt(),mh);LF(zTt(),mh);LF(KTt(),mh)});var wRe=y(tu=>{"use strict";var CRe=tu&&tu.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(tu,"__esModule",{value:true});tu.createRequestFunction=tu.attemptHttpRequest=tu.toPathString=tu.serializeDataIfNeeded=tu.setSearchParams=tu.setBearerAuthToObject=tu.DUMMY_BASE_URL=void 0;var QTn=DJ();var iC=nC();var ZTn=ARe();tu.DUMMY_BASE_URL="https://example.com";var exn=a(function(e,t){return CRe(this,void 0,void 0,function*(){const r=yield t.getAccessTokenHeader();if(r&&!e[r.name]){e[r.name]=r.value}})},"setBearerAuthToObject");tu.setBearerAuthToObject=exn;var txn=a(function(e,...t){const r=new URLSearchParams(e.search);for(const n of t){for(const i in n){if(Array.isArray(n[i])){r.delete(i);for(const s of n[i]){r.append(i,s)}}else{r.set(i,n[i])}}}e.search=r.toString()},"setSearchParams");tu.setSearchParams=txn;var rxn=a(e=>{const t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(t.test(e)||e.toLowerCase()==="application/json-patch+json")},"isJsonMime");var nxn=a(function(e,t){const r=typeof e!=="string";const n=r?rxn(t.headers["Content-Type"]):r;return n?JSON.stringify(e!==void 0?e:{}):e||""},"serializeDataIfNeeded");tu.serializeDataIfNeeded=nxn;var ixn=a(function(e){return e.pathname+e.search+e.hash},"toPathString");tu.toPathString=ixn;function sxn(e){return e&&typeof e==="object"&&e.isAxiosError===true}a(sxn,"isAxiosError");function axn(e,t){const r=Math.ceil(Math.pow(2,e)*t);const n=Math.ceil(Math.pow(2,e+1)*t);return Math.floor(Math.random()*(n-r)+r)}a(axn,"randomTime");function WTt(e,t,r){var n;return CRe(this,void 0,void 0,function*(){let i=0;do{i++;try{return yield r(e)}catch(s){if(!sxn(s)){throw new iC.FgaError(s)}const o=(n=s===null||s===void 0?void 0:s.response)===null||n===void 0?void 0:n.status;if(o===400||o===422){throw new iC.FgaApiValidationError(s)}else if(o===401||o===403){throw new iC.FgaApiAuthenticationError(s)}else if(o===404){throw new iC.FgaApiNotFoundError(s)}else if(o===429||o>=500){if(i>=t.maxRetry){if(o===429){throw new iC.FgaApiRateLimitExceededError(s)}else{throw new iC.FgaApiInternalError(s)}}yield new Promise(u=>setTimeout(u,axn(i,t.minWaitInMs)))}else{throw new iC.FgaApiError(s)}}}while(i<t.maxRetry+1)})}a(WTt,"attemptHttpRequest");tu.attemptHttpRequest=WTt;var oxn=a(function(e,t,r,n){var i,s;r.isValid();const o=((i=e.options)===null||i===void 0?void 0:i.retryParams)?(s=e.options)===null||s===void 0?void 0:s.retryParams:r.retryParams;const u=o?o.maxRetry:0;const l=o?o.minWaitInMs:0;if(!n){n=QTn.Credentials.init(r)}return(c=t)=>CRe(this,void 0,void 0,function*(){yield(0,tu.setBearerAuthToObject)(e.options.headers,n);const d=Object.assign(Object.assign({},e.options),{url:r.getBasePath()+e.url});const p=yield WTt(d,{maxRetry:u,minWaitInMs:l},c);const f=typeof(p===null||p===void 0?void 0:p.data)==="undefined"?{}:p===null||p===void 0?void 0:p.data;const m=Object.assign({},f);(0,ZTn.setNotEnumerableProperty)(m,"$response",p);return m})},"createRequestFunction");tu.createRequestFunction=oxn});var XTt=y(cP=>{"use strict";var TRe=cP&&cP.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(cP,"__esModule",{value:true});cP.Credentials=void 0;var YTt=SJ();var HE=kF();var xRe=nC();var uxn=wRe();var Bf=CJ();var RRe=class e{static{a(this,"Credentials")}static init(t){return new e(t.credentials)}constructor(t,r=YTt.default){this.authConfig=t;this.axios=r;this.initConfig();this.isValid()}initConfig(){var t;switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Bf.CredentialsMethod.ApiToken:if(this.authConfig.config){if(!this.authConfig.config.headerName){this.authConfig.config.headerName="Authorization"}if(!this.authConfig.config.headerValuePrefix){this.authConfig.config.headerValuePrefix="Bearer"}}break;case Bf.CredentialsMethod.ClientCredentials:case Bf.CredentialsMethod.None:default:break}}isValid(){var t,r,n,i,s,o,u,l,c;const{authConfig:d}=this;switch(d===null||d===void 0?void 0:d.method){case Bf.CredentialsMethod.None:break;case Bf.CredentialsMethod.ApiToken:(0,HE.assertParamExists)("Credentials","config.token",(t=d.config)===null||t===void 0?void 0:t.token);(0,HE.assertParamExists)("Credentials","config.headerName",(r=d.config)===null||r===void 0?void 0:r.headerName);(0,HE.assertParamExists)("Credentials","config.headerName",(n=d.config)===null||n===void 0?void 0:n.headerName);break;case Bf.CredentialsMethod.ClientCredentials:(0,HE.assertParamExists)("Credentials","config.clientId",(i=d.config)===null||i===void 0?void 0:i.clientId);(0,HE.assertParamExists)("Credentials","config.clientSecret",(s=d.config)===null||s===void 0?void 0:s.clientSecret);(0,HE.assertParamExists)("Credentials","config.apiTokenIssuer",(o=d.config)===null||o===void 0?void 0:o.apiTokenIssuer);(0,HE.assertParamExists)("Credentials","config.apiAudience",(u=d.config)===null||u===void 0?void 0:u.apiAudience);if(!(0,HE.isWellFormedUriString)(`https://${(l=d.config)===null||l===void 0?void 0:l.apiTokenIssuer}`)){throw new xRe.FgaValidationError(`Configuration.apiTokenIssuer does not form a valid URI (https://${(c=d.config)===null||c===void 0?void 0:c.apiTokenIssuer})`)}break}}getAccessTokenHeader(){var t;return TRe(this,void 0,void 0,function*(){const r=yield this.getAccessTokenValue();switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Bf.CredentialsMethod.None:return;case Bf.CredentialsMethod.ApiToken:return{name:this.authConfig.config.headerName,value:`${this.authConfig.config.headerValuePrefix?`${this.authConfig.config.headerValuePrefix} `:""}${r}`};case Bf.CredentialsMethod.ClientCredentials:return{name:"Authorization",value:`Bearer ${r}`}}})}getAccessTokenValue(){var t;return TRe(this,void 0,void 0,function*(){switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Bf.CredentialsMethod.None:return;case Bf.CredentialsMethod.ApiToken:return this.authConfig.config.token;case Bf.CredentialsMethod.ClientCredentials:if(this.accessToken&&(!this.accessTokenExpiryDate||this.accessTokenExpiryDate>new Date)){return this.accessToken}return this.refreshAccessToken()}})}refreshAccessToken(){var t;return TRe(this,void 0,void 0,function*(){const r=(t=this.authConfig)===null||t===void 0?void 0:t.config;try{const n=yield(0,uxn.attemptHttpRequest)({url:`https://${r.apiTokenIssuer}/oauth/token`,method:"post",data:{client_id:r.clientId,client_secret:r.clientSecret,audience:r.apiAudience,grant_type:"client_credentials"}},{maxRetry:3,minWaitInMs:100},YTt.default);if(n){this.accessToken=n.data.access_token;this.accessTokenExpiryDate=new Date(Date.now()+n.data.expires_in*1e3)}return this.accessToken}catch(n){if(n instanceof xRe.FgaApiError){n.constructor=xRe.FgaApiAuthenticationError;n.name="FgaApiAuthenticationError";n.clientId=r.clientId;n.audience=r.apiAudience;n.grantType="client_credentials"}throw n}})}};cP.Credentials=RRe});var DJ=y(VE=>{"use strict";var lxn=VE&&VE.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var JTt=VE&&VE.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))lxn(t,e,r)};Object.defineProperty(VE,"__esModule",{value:true});JTt(XTt(),VE);JTt(CJ(),VE)});var PRe=y(LJ=>{"use strict";Object.defineProperty(LJ,"__esModule",{value:true});LJ.BaseAPI=void 0;var cxn=SJ();var dxn=require("http");var pxn=require("https");var QTt=SRe();var fxn=DJ();var mxn=1e4;var ORe=class{static{a(this,"BaseAPI")}constructor(t,r){var n;this.axios=r;if(t instanceof QTt.Configuration){this.configuration=t}else{this.configuration=new QTt.Configuration(t)}this.configuration.isValid();this.credentials=fxn.Credentials.init(this.configuration);if(!this.axios){const i=new dxn.Agent({keepAlive:true});const s=new pxn.Agent({keepAlive:true});this.axios=cxn.default.create({httpAgent:i,httpsAgent:s,timeout:mxn,headers:(n=this.configuration.baseOptions)===null||n===void 0?void 0:n.headers})}}get storeId(){return this.configuration.storeId}set storeId(t){this.configuration.storeId=t}};LJ.BaseAPI=ORe});var IRe=y(Ts=>{"use strict";var As=Ts&&Ts.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(Ts,"__esModule",{value:true});Ts.OpenFgaApi=Ts.OpenFgaApiFactory=Ts.OpenFgaApiFp=Ts.OpenFgaApiAxiosParamCreator=void 0;var Tc=SJ();var hxn=PRe();var sr=wRe();var za=kF();var gxn=a(function(e,t){return{check:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("check","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/check".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),createStore:(r,n={})=>As(this,void 0,void 0,function*(){const i="/stores";const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),deleteStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"DELETE"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),expand:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("expand","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/expand".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),getStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"GET"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),listObjects:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("listObjects","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/list-objects".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),listStores:(r,n,i={})=>As(this,void 0,void 0,function*(){const s="/stores";const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),read:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("read","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/read".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),readAssertions:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAssertions","authorizationModelId",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAuthorizationModel","id",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models/{id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModels:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),readChanges:(r,n,i,s={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const o="/stores/{store_id}/changes".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const u=new URL(o,sr.DUMMY_BASE_URL);let l;if(e){l=e.baseOptions}const c=Object.assign(Object.assign({method:"GET"},l),s);const d={};const p={};if(r!==void 0){p["type"]=r}if(n!==void 0){p["page_size"]=n}if(i!==void 0){p["continuation_token"]=i}(0,sr.setSearchParams)(u,p,s.query);c.headers=Object.assign(Object.assign({},d),s.headers);return{url:(0,sr.toPathString)(u),options:c}}),write:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("write","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/write".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),writeAssertions:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAssertions","authorizationModelId",r);(0,za.assertParamExists)("writeAssertions","body",n);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"PUT"},u),i);const c={};const d={};c["Content-Type"]="application/json";(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);l.data=(0,sr.serializeDataIfNeeded)(n,l);return{url:(0,sr.toPathString)(o),options:l}}),writeAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAuthorizationModel","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}})}},"OpenFgaApiAxiosParamCreator");Ts.OpenFgaApiAxiosParamCreator=gxn;var yxn=a(function(e,t){const r=(0,Ts.OpenFgaApiAxiosParamCreator)(e,t);return{check(n,i){return As(this,void 0,void 0,function*(){const s=yield r.check(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},createStore(n,i){return As(this,void 0,void 0,function*(){const s=yield r.createStore(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},deleteStore(n){return As(this,void 0,void 0,function*(){const i=yield r.deleteStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},expand(n,i){return As(this,void 0,void 0,function*(){const s=yield r.expand(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},getStore(n){return As(this,void 0,void 0,function*(){const i=yield r.getStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},listObjects(n,i){return As(this,void 0,void 0,function*(){const s=yield r.listObjects(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},listStores(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.listStores(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},read(n,i){return As(this,void 0,void 0,function*(){const s=yield r.read(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAssertions(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAssertions(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModels(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.readAuthorizationModels(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},readChanges(n,i,s,o){return As(this,void 0,void 0,function*(){const u=yield r.readChanges(n,i,s,o);return(0,sr.createRequestFunction)(u,Tc.default,e,t)})},write(n,i){return As(this,void 0,void 0,function*(){const s=yield r.write(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},writeAssertions(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.writeAssertions(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},writeAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.writeAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})}}},"OpenFgaApiFp");Ts.OpenFgaApiFp=yxn;var _xn=a(function(e,t,r){const n=(0,Ts.OpenFgaApiFp)(e,t);return{check(i,s){return n.check(i,s).then(o=>o(r))},createStore(i,s){return n.createStore(i,s).then(o=>o(r))},deleteStore(i){return n.deleteStore(i).then(s=>s(r))},expand(i,s){return n.expand(i,s).then(o=>o(r))},getStore(i){return n.getStore(i).then(s=>s(r))},listObjects(i,s){return n.listObjects(i,s).then(o=>o(r))},listStores(i,s,o){return n.listStores(i,s,o).then(u=>u(r))},read(i,s){return n.read(i,s).then(o=>o(r))},readAssertions(i,s){return n.readAssertions(i,s).then(o=>o(r))},readAuthorizationModel(i,s){return n.readAuthorizationModel(i,s).then(o=>o(r))},readAuthorizationModels(i,s,o){return n.readAuthorizationModels(i,s,o).then(u=>u(r))},readChanges(i,s,o,u){return n.readChanges(i,s,o,u).then(l=>l(r))},write(i,s){return n.write(i,s).then(o=>o(r))},writeAssertions(i,s,o){return n.writeAssertions(i,s,o).then(u=>u(r))},writeAuthorizationModel(i,s){return n.writeAuthorizationModel(i,s).then(o=>o(r))}}},"OpenFgaApiFactory");Ts.OpenFgaApiFactory=_xn;var NRe=class extends hxn.BaseAPI{static{a(this,"OpenFgaApi")}check(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).check(t,r).then(n=>n(this.axios))}createStore(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).createStore(t,r).then(n=>n(this.axios))}deleteStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).deleteStore(t).then(r=>r(this.axios))}expand(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).expand(t,r).then(n=>n(this.axios))}getStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).getStore(t).then(r=>r(this.axios))}listObjects(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listObjects(t,r).then(n=>n(this.axios))}listStores(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listStores(t,r,n).then(i=>i(this.axios))}read(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).read(t,r).then(n=>n(this.axios))}readAssertions(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAssertions(t,r).then(n=>n(this.axios))}readAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModel(t,r).then(n=>n(this.axios))}readAuthorizationModels(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModels(t,r,n).then(i=>i(this.axios))}readChanges(t,r,n,i){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readChanges(t,r,n,i).then(s=>s(this.axios))}write(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).write(t,r).then(n=>n(this.axios))}writeAssertions(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAssertions(t,r,n).then(i=>i(this.axios))}writeAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAuthorizationModel(t,r).then(n=>n(this.axios))}};Ts.OpenFgaApi=NRe});var ext=y((Y6s,ZTt)=>{async function*vxn(e,t,r){const n=new Set;async function i(){const[s,o]=await Promise.race(n);n.delete(s);return o}a(i,"consume");for(const s of t){const o=(async()=>await r(s,t))().then(u=>[o,u]);n.add(o);if(n.size>=e){yield await i()}}while(n.size){yield await i()}}a(vxn,"asyncPool");ZTt.exports=vxn});var txt=y(ig=>{"use strict";var Ka=ig&&ig.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};var kRe=ig&&ig.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(u,l){o=e[s](o),i(u,l,o.done,o.value)})}}a(n,"verb");function i(s,o,u,l){Promise.resolve(l).then(function(c){s({value:c,done:u})},o)}a(i,"settle")};Object.defineProperty(ig,"__esModule",{value:true});ig.OpenFgaClient=ig.ClientWriteStatus=void 0;var DRe=ext();var Exn=IRe();var bxn=PRe();var LRe=nC();var gd=ARe();var Sxn=kF();var FRe=10;var dP="X-OpenFGA-Client-Method";var BRe="X-OpenFGA-Client-Bulk-Request-Id";var pP;(function(e){e["SUCCESS"]="success";e["FAILURE"]="failure"})(pP||(ig.ClientWriteStatus=pP={}));var MRe=class extends bxn.BaseAPI{static{a(this,"OpenFgaClient")}constructor(t,r){super(t,r);this.axios=r;this.api=new Exn.OpenFgaApi(this.configuration,r);this.authorizationModelId=t.authorizationModelId;this.getAuthorizationModelId()}getAuthorizationModelId(t={}){const r=(t===null||t===void 0?void 0:t.authorizationModelId)||this.authorizationModelId;if(r&&!(0,Sxn.isWellFormedUlidString)(r)){throw new LRe.FgaValidationError("authorizationModelId")}return r}checkValidApiConnection(t={}){return Ka(this,void 0,void 0,function*(){if(this.getAuthorizationModelId(t)){yield this.readAuthorizationModel(t)}else{yield this.readLatestAuthorizationModel(t)}})}listStores(t={}){return Ka(this,void 0,void 0,function*(){return this.api.listStores(t.pageSize,t.continuationToken,t)})}createStore(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.createStore(t,r)})}getStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.getStore(t)})}deleteStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.deleteStore(t)})}readAuthorizationModels(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAuthorizationModels(t.pageSize,t.continuationToken,t)})}writeAuthorizationModel(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAuthorizationModel(t,r)})}readAuthorizationModel(t={}){return Ka(this,void 0,void 0,function*(){const r=this.getAuthorizationModelId(t);if(!r){throw new LRe.FgaRequiredParamError("ClientConfiguration","authorizationModelId")}return this.api.readAuthorizationModel(r,t)})}readLatestAuthorizationModel(t={}){var r;return Ka(this,void 0,void 0,function*(){const{headers:n={}}=t;(0,gd.setHeaderIfNotSet)(n,dP,"ReadLatestAuthorizationModel");const i=yield this.readAuthorizationModels(Object.assign(Object.assign({},t),{pageSize:1,headers:n}));const s=i;s.authorization_model=(r=i.authorization_models)===null||r===void 0?void 0:r[0];delete s.authorization_models;return s})}readChanges(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.readChanges(t.type,r.pageSize,r.continuationToken,r)})}read(t={},r={}){return Ka(this,void 0,void 0,function*(){const n={page_size:r.pageSize,continuation_token:r.continuationToken};if(t.user||t.object||t.relation){n.tuple_key=t}return this.api.read(n,r)})}write(t,r={}){return Ka(this,void 0,void 0,function*(){const{transaction:n={},headers:i={}}=r;const{maxPerChunk:s=1,maxParallelRequests:o=FRe}=n;const{writes:u,deletes:l}=t;const c=this.getAuthorizationModelId(r);if(!(n===null||n===void 0?void 0:n.disable)){const d={authorization_model_id:c};if(u===null||u===void 0?void 0:u.length){d.writes={tuple_keys:u}}if(l===null||l===void 0?void 0:l.length){d.deletes={tuple_keys:l}}yield this.api.write(d,r);return{writes:(u===null||u===void 0?void 0:u.map(p=>({tuple_key:p,status:pP.SUCCESS})))||[],deletes:(l===null||l===void 0?void 0:l.map(p=>({tuple_key:p,status:pP.SUCCESS})))||[]}}return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var d,p,f,m,h,g,_,v;(0,gd.setHeaderIfNotSet)(i,dP,"Write");(0,gd.setHeaderIfNotSet)(i,BRe,(0,gd.generateRandomIdWithNonUniqueFallback)());const S=[];if(u===null||u===void 0?void 0:u.length){try{for(var E=true,b=kRe(DRe(o,(0,gd.chunkArray)(u,s),R=>this.writeTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:R.map(D=>({tuple_key:D,status:pP.FAILURE,err:I})),deletes:[]})))),A;A=yield b.next(),d=A.done,!d;E=true){m=A.value;E=false;const R=m;S.push(R.writes)}}catch(R){p={error:R}}finally{try{if(!E&&!d&&(f=b.return))yield f.call(b)}finally{if(p)throw p.error}}}const C=[];if(l===null||l===void 0?void 0:l.length){try{for(var T=true,O=kRe(DRe(o,(0,gd.chunkArray)(l,s),R=>this.deleteTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:[],deletes:R.map(D=>({tuple_key:D,status:pP.FAILURE,err:I}))})))),P;P=yield O.next(),h=P.done,!h;T=true){v=P.value;T=false;const R=v;C.push(R.deletes)}}catch(R){g={error:R}}finally{try{if(!T&&!h&&(_=O.return))yield _.call(O)}finally{if(g)throw g.error}}}return{writes:S.flat(),deletes:C.flat()}}))(),this.checkValidApiConnection(r)]).then(d=>d[0])})}writeTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,gd.setHeaderIfNotSet)(n,dP,"WriteTuples");return this.write({writes:t},Object.assign(Object.assign({},r),{headers:n}))})}deleteTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,gd.setHeaderIfNotSet)(n,dP,"DeleteTuples");return this.write({deletes:t},Object.assign(Object.assign({},r),{headers:n}))})}check(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.check({tuple_key:{user:t.user,relation:t.relation,object:t.object},context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]},authorization_model_id:this.getAuthorizationModelId(r)},r)})}batchCheck(t,r={}){return Ka(this,void 0,void 0,function*(){return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var n,i,s,o;const{headers:u={},maxParallelRequests:l=FRe}=r;(0,gd.setHeaderIfNotSet)(u,dP,"BatchCheck");(0,gd.setHeaderIfNotSet)(u,BRe,(0,gd.generateRandomIdWithNonUniqueFallback)());const c=[];try{for(var d=true,p=kRe(DRe(l,t,m=>this.check(m,Object.assign(Object.assign({},r),{headers:u})).then(h=>{h._request=m;return h}).catch(h=>{return{allowed:void 0,error:h,_request:m}}))),f;f=yield p.next(),n=f.done,!n;d=true){o=f.value;d=false;const m=o;c.push(m)}}catch(m){i={error:m}}finally{try{if(!d&&!n&&(s=p.return))yield s.call(p)}finally{if(i)throw i.error}}return{responses:c}}))(),this.checkValidApiConnection(r)]).then(n=>n[0])})}expand(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.expand({authorization_model_id:this.getAuthorizationModelId(r),tuple_key:t},r)})}listObjects(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.listObjects({authorization_model_id:this.getAuthorizationModelId(r),user:t.user,relation:t.relation,type:t.type,context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]}},r)})}listRelations(t,r={}){return Ka(this,void 0,void 0,function*(){const{user:n,object:i,relations:s,contextualTuples:o,context:u}=t;const{headers:l={},maxParallelRequests:c=FRe}=r;(0,gd.setHeaderIfNotSet)(l,dP,"ListRelations");(0,gd.setHeaderIfNotSet)(l,BRe,(0,gd.generateRandomIdWithNonUniqueFallback)());if(!(s===null||s===void 0?void 0:s.length)){throw new LRe.FgaValidationError("relations","When calling listRelations, at least one relation must be passed in the relations field")}const d=yield this.batchCheck(s.map(f=>({user:n,relation:f,object:i,contextualTuples:o,context:u})),Object.assign(Object.assign({},r),{headers:l,maxParallelRequests:c}));const p=d.responses.find(f=>f.error);if(p){throw p.error}return{relations:d.responses.filter(f=>f.allowed).map(f=>f._request.relation)}})}readAssertions(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAssertions(this.getAuthorizationModelId(t),t)})}writeAssertions(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAssertions(this.getAuthorizationModelId(r),{assertions:t.map(n=>({tuple_key:{user:n.user,relation:n.relation,object:n.object},expectation:n.expectation}))},r)})}};ig.OpenFgaClient=MRe});var uxt=y(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:true});yd.TypeName=yd.TupleOperation=yd.NullValue=yd.NotFoundErrorCode=yd.InternalErrorCode=yd.ErrorCode=void 0;var rxt;(function(e){e["NoError"]="no_error";e["ValidationError"]="validation_error";e["AuthorizationModelNotFound"]="authorization_model_not_found";e["AuthorizationModelResolutionTooComplex"]="authorization_model_resolution_too_complex";e["InvalidWriteInput"]="invalid_write_input";e["CannotAllowDuplicateTuplesInOneRequest"]="cannot_allow_duplicate_tuples_in_one_request";e["CannotAllowDuplicateTypesInOneRequest"]="cannot_allow_duplicate_types_in_one_request";e["CannotAllowMultipleReferencesToOneRelation"]="cannot_allow_multiple_references_to_one_relation";e["InvalidContinuationToken"]="invalid_continuation_token";e["InvalidTupleSet"]="invalid_tuple_set";e["InvalidCheckInput"]="invalid_check_input";e["InvalidExpandInput"]="invalid_expand_input";e["UnsupportedUserSet"]="unsupported_user_set";e["InvalidObjectFormat"]="invalid_object_format";e["WriteFailedDueToInvalidInput"]="write_failed_due_to_invalid_input";e["AuthorizationModelAssertionsNotFound"]="authorization_model_assertions_not_found";e["LatestAuthorizationModelNotFound"]="latest_authorization_model_not_found";e["TypeNotFound"]="type_not_found";e["RelationNotFound"]="relation_not_found";e["EmptyRelationDefinition"]="empty_relation_definition";e["InvalidUser"]="invalid_user";e["InvalidTuple"]="invalid_tuple";e["UnknownRelation"]="unknown_relation";e["StoreIdInvalidLength"]="store_id_invalid_length";e["AssertionsTooManyItems"]="assertions_too_many_items";e["IdTooLong"]="id_too_long";e["AuthorizationModelIdTooLong"]="authorization_model_id_too_long";e["TupleKeyValueNotSpecified"]="tuple_key_value_not_specified";e["TupleKeysTooManyOrTooFewItems"]="tuple_keys_too_many_or_too_few_items";e["PageSizeInvalid"]="page_size_invalid";e["ParamMissingValue"]="param_missing_value";e["DifferenceBaseMissingValue"]="difference_base_missing_value";e["SubtractBaseMissingValue"]="subtract_base_missing_value";e["ObjectTooLong"]="object_too_long";e["RelationTooLong"]="relation_too_long";e["TypeDefinitionsTooFewItems"]="type_definitions_too_few_items";e["TypeInvalidLength"]="type_invalid_length";e["TypeInvalidPattern"]="type_invalid_pattern";e["RelationsTooFewItems"]="relations_too_few_items";e["RelationsTooLong"]="relations_too_long";e["RelationsInvalidPattern"]="relations_invalid_pattern";e["ObjectInvalidPattern"]="object_invalid_pattern";e["QueryStringTypeContinuationTokenMismatch"]="query_string_type_continuation_token_mismatch";e["ExceededEntityLimit"]="exceeded_entity_limit";e["InvalidContextualTuple"]="invalid_contextual_tuple";e["DuplicateContextualTuple"]="duplicate_contextual_tuple";e["InvalidAuthorizationModel"]="invalid_authorization_model";e["UnsupportedSchemaVersion"]="unsupported_schema_version"})(rxt||(yd.ErrorCode=rxt={}));var nxt;(function(e){e["NoInternalError"]="no_internal_error";e["InternalError"]="internal_error";e["Cancelled"]="cancelled";e["DeadlineExceeded"]="deadline_exceeded";e["AlreadyExists"]="already_exists";e["ResourceExhausted"]="resource_exhausted";e["FailedPrecondition"]="failed_precondition";e["Aborted"]="aborted";e["OutOfRange"]="out_of_range";e["Unavailable"]="unavailable";e["DataLoss"]="data_loss"})(nxt||(yd.InternalErrorCode=nxt={}));var ixt;(function(e){e["NoNotFoundError"]="no_not_found_error";e["UndefinedEndpoint"]="undefined_endpoint";e["StoreIdNotFound"]="store_id_not_found";e["Unimplemented"]="unimplemented"})(ixt||(yd.NotFoundErrorCode=ixt={}));var sxt;(function(e){e["NullValue"]="NULL_VALUE"})(sxt||(yd.NullValue=sxt={}));var axt;(function(e){e["Write"]="TUPLE_OPERATION_WRITE";e["Delete"]="TUPLE_OPERATION_DELETE"})(axt||(yd.TupleOperation=axt={}));var oxt;(function(e){e["Unspecified"]="TYPE_NAME_UNSPECIFIED";e["Any"]="TYPE_NAME_ANY";e["Bool"]="TYPE_NAME_BOOL";e["String"]="TYPE_NAME_STRING";e["Int"]="TYPE_NAME_INT";e["Uint"]="TYPE_NAME_UINT";e["Double"]="TYPE_NAME_DOUBLE";e["Duration"]="TYPE_NAME_DURATION";e["Timestamp"]="TYPE_NAME_TIMESTAMP";e["Map"]="TYPE_NAME_MAP";e["List"]="TYPE_NAME_LIST";e["Ipaddress"]="TYPE_NAME_IPADDRESS"})(oxt||(yd.TypeName=oxt={}))});var dxt=y(Cu=>{"use strict";var Axn=Cu&&Cu.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var FJ=Cu&&Cu.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))Axn(t,e,r)};Object.defineProperty(Cu,"__esModule",{value:true});Cu.CredentialsMethod=Cu.Credentials=Cu.GetDefaultRetryParams=Cu.Configuration=void 0;FJ(IRe(),Cu);FJ(txt(),Cu);FJ(uxt(),Cu);var lxt=SRe();Object.defineProperty(Cu,"Configuration",{enumerable:true,get:function(){return lxt.Configuration}});Object.defineProperty(Cu,"GetDefaultRetryParams",{enumerable:true,get:function(){return lxt.GetDefaultRetryParams}});var cxt=DJ();Object.defineProperty(Cu,"Credentials",{enumerable:true,get:function(){return cxt.Credentials}});Object.defineProperty(Cu,"CredentialsMethod",{enumerable:true,get:function(){return cxt.CredentialsMethod}});FJ(nC(),Cu)});var fxt=y(fP=>{"use strict";var Cxn=fP&&fP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(fP,"__esModule",{value:true});fP.OpenFGAService=void 0;var FF=Cxn(Jd());var pxt=dxt();var wxn=XO();var qRe=class{static{a(this,"OpenFGAService")}logger;openFGAClient;baseUrl;apiHost;storeId;modelId;userSub;constructor(t,r){if(!FF.default.OPENFGA_SERVICE_URL){throw new Error("OPENFGA_SERVICE_URL is not set")}this.userSub=r&&r.userSub?r.userSub:t.getUserSub();this.baseUrl=FF.default.OPENFGA_SERVICE_URL;this.apiHost=FF.default.OPENFGA_SERVICE_URL.replace(/^(https:\/\/)/,"");this.storeId=FF.default.OPENFGA_STORE_ID;this.modelId=FF.default.OPENFGA_MODEL_ID;this.logger=t.log}async getOpenFgaClient(){if(!this.openFGAClient){const t=await(0,wxn.getServiceAccountIdToken)(this.baseUrl);this.openFGAClient=new pxt.OpenFgaClient({apiScheme:"https",apiHost:this.apiHost,storeId:this.storeId,authorizationModelId:this.modelId,credentials:{method:pxt.CredentialsMethod.ApiToken,config:{token:t}}})}return this.openFGAClient}async createAccountMember(t){try{const r=await this.getOpenFgaClient();await r.write({writes:[{user:`user:${this.userSub}`,relation:"admin",object:`account:${t}`}]})}catch(r){this.logger.warn(`RBAC failed to create account membership. Error: ${r.message}`)}}async getAccountMemberships(){const t=await this.getOpenFgaClient();const r=await t.listObjects({user:`user:${this.userSub}`,relation:"member",type:"account"});if(r){return r.objects.map(n=>n.replace(/^(account:)/,""))}return[]}async isAccountMember(t){try{const r=await this.getOpenFgaClient();const{allowed:n}=await r.check({user:`user:${this.userSub}`,relation:"member",object:`account:${t}`});if(!n){return false}return n}catch(r){this.logger.warn(`RBAC failed to check account membership. Error: ${r.message}`);return false}}async isZuploAdmin(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-admin"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo admin. Error: ${t.message}`);return false}}async isDeployerServiceAccount(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-deployer"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo deployer. Error: ${t.message}`);return false}}async createProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({writes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to create account-project association. Error: ${n.message}`)}}async deleteProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({deletes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to delete account-project association. Error: ${n.message}`)}}};fP.OpenFGAService=qRe});var gxt=y(mP=>{"use strict";var hxt=mP&&mP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(mP,"__esModule",{value:true});mP.TenantService=void 0;var Txn=hxt(Fm());var mxt=hxt(Jd());var xxn=SF();var Rxn=new Txn.default({max:500,maxAge:1e3*60*50});var URe=class extends xxn.ApiServiceClient{static{a(this,"TenantService")}constructor(t,r){if(!mxt.default.TENANT_API_URL){throw new Error("TENANT_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(mxt.default.TENANT_API_URL,Rxn,{userSub:n,logger:t.log,requestId:t.id})}};mP.TenantService=URe});var _xt=y(hP=>{"use strict";var yxt=hP&&hP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(hP,"__esModule",{value:true});hP.MeteringService=void 0;var Oxn=yxt(Fm());var $Re=yxt(Jd());var Pxn=SF();var Nxn=new Oxn.default({max:500,maxAge:1e3*60*50});var jRe=class extends Pxn.ApiServiceClient{static{a(this,"MeteringService")}constructor(t,r){if(!$Re.default.METERING_SERVICE_URL){throw new Error("METERING_SERVICE_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super($Re.default.METERING_SERVICE_URL,Nxn,{userSub:n,logger:t.log,requestId:t.id,targetAudience:$Re.default.METERING_SERVICE_URL})}};hP.MeteringService=jRe});var vxt=y(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:true});sg.validateHostname=sg.kebabCase=sg.snakeCase=sg.sizeInBytes=void 0;function Ixn(e){return new TextEncoder().encode(JSON.stringify(e)).length}a(Ixn,"sizeInBytes");sg.sizeInBytes=Ixn;function kxn(e){if(!e||e===null){return""}return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(t=>t.toLowerCase()).join("_")}a(kxn,"snakeCase");sg.snakeCase=kxn;function Dxn(e){if(!e||e===null){return""}const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(t===null){return""}return t.map(r=>r.toLowerCase()).join("-")}a(Dxn,"kebabCase");sg.kebabCase=Dxn;function Lxn(e){try{const t=/^(?!https?:\/\/)([a-zA-Z0-9.-]*|(\*))*\.[a-zA-Z]+$/;if(e&&!t.test(e)){return false}return true}catch(t){}return false}a(Lxn,"validateHostname");sg.validateHostname=Lxn});var Sxt=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:true});_e.Type=_e.JsonType=_e.JavaScriptTypeBuilder=_e.JsonTypeBuilder=_e.TypeBuilder=_e.TypeBuilderError=_e.TransformEncodeBuilder=_e.TransformDecodeBuilder=_e.TemplateLiteralDslParser=_e.TemplateLiteralGenerator=_e.TemplateLiteralGeneratorError=_e.TemplateLiteralFinite=_e.TemplateLiteralFiniteError=_e.TemplateLiteralParser=_e.TemplateLiteralParserError=_e.TemplateLiteralResolver=_e.TemplateLiteralPattern=_e.TemplateLiteralPatternError=_e.UnionResolver=_e.KeyArrayResolver=_e.KeyArrayResolverError=_e.KeyResolver=_e.ObjectMap=_e.Intrinsic=_e.IndexedAccessor=_e.TypeClone=_e.TypeExtends=_e.TypeExtendsResult=_e.TypeExtendsError=_e.ExtendsUndefined=_e.TypeGuard=_e.TypeGuardUnknownTypeError=_e.ValueGuard=_e.FormatRegistry=_e.TypeBoxError=_e.TypeRegistry=_e.PatternStringExact=_e.PatternNumberExact=_e.PatternBooleanExact=_e.PatternString=_e.PatternNumber=_e.PatternBoolean=_e.Kind=_e.Hint=_e.Optional=_e.Readonly=_e.Transform=void 0;_e.Transform=Symbol.for("TypeBox.Transform");_e.Readonly=Symbol.for("TypeBox.Readonly");_e.Optional=Symbol.for("TypeBox.Optional");_e.Hint=Symbol.for("TypeBox.Hint");_e.Kind=Symbol.for("TypeBox.Kind");_e.PatternBoolean="(true|false)";_e.PatternNumber="(0|[1-9][0-9]*)";_e.PatternString="(.*)";_e.PatternBooleanExact=`^${_e.PatternBoolean}$`;_e.PatternNumberExact=`^${_e.PatternNumber}$`;_e.PatternStringExact=`^${_e.PatternString}$`;var GRe;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})(GRe||(_e.TypeRegistry=GRe={}));var hh=class extends Error{static{a(this,"TypeBoxError")}constructor(t){super(t)}};_e.TypeBoxError=hh;var Ext;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})(Ext||(_e.FormatRegistry=Ext={}));var Jt;(function(e){function t(c){return Array.isArray(c)}a(t,"IsArray");e.IsArray=t;function r(c){return typeof c==="bigint"}a(r,"IsBigInt");e.IsBigInt=r;function n(c){return typeof c==="boolean"}a(n,"IsBoolean");e.IsBoolean=n;function i(c){return c===null}a(i,"IsNull");e.IsNull=i;function s(c){return typeof c==="number"}a(s,"IsNumber");e.IsNumber=s;function o(c){return typeof c==="object"&&c!==null}a(o,"IsObject");e.IsObject=o;function u(c){return typeof c==="string"}a(u,"IsString");e.IsString=u;function l(c){return c===void 0}a(l,"IsUndefined");e.IsUndefined=l})(Jt||(_e.ValueGuard=Jt={}));var HRe=class extends hh{static{a(this,"TypeGuardUnknownTypeError")}};_e.TypeGuardUnknownTypeError=HRe;var Ee;(function(e){function t(L){try{new RegExp(L);return true}catch{return false}}a(t,"IsPattern");function r(L){if(!Jt.IsString(L))return false;for(let Se=0;Se<L.length;Se++){const Le=L.charCodeAt(Se);if(Le>=7&&Le<=13||Le===27||Le===127){return false}}return true}a(r,"IsControlCharacterFree");function n(L){return o(L)||se(L)}a(n,"IsAdditionalProperties");function i(L){return Jt.IsUndefined(L)||Jt.IsBigInt(L)}a(i,"IsOptionalBigInt");function s(L){return Jt.IsUndefined(L)||Jt.IsNumber(L)}a(s,"IsOptionalNumber");function o(L){return Jt.IsUndefined(L)||Jt.IsBoolean(L)}a(o,"IsOptionalBoolean");function u(L){return Jt.IsUndefined(L)||Jt.IsString(L)}a(u,"IsOptionalString");function l(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)&&t(L)}a(l,"IsOptionalPattern");function c(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)}a(c,"IsOptionalFormat");function d(L){return Jt.IsUndefined(L)||se(L)}a(d,"IsOptionalSchema");function p(L){return C(L,"Any")&&u(L.$id)}a(p,"TAny");e.TAny=p;function f(L){return C(L,"Array")&&L.type==="array"&&u(L.$id)&&se(L.items)&&s(L.minItems)&&s(L.maxItems)&&o(L.uniqueItems)&&d(L.contains)&&s(L.minContains)&&s(L.maxContains)}a(f,"TArray");e.TArray=f;function m(L){return C(L,"AsyncIterator")&&L.type==="AsyncIterator"&&u(L.$id)&&se(L.items)}a(m,"TAsyncIterator");e.TAsyncIterator=m;function h(L){return C(L,"BigInt")&&L.type==="bigint"&&u(L.$id)&&i(L.exclusiveMaximum)&&i(L.exclusiveMinimum)&&i(L.maximum)&&i(L.minimum)&&i(L.multipleOf)}a(h,"TBigInt");e.TBigInt=h;function g(L){return C(L,"Boolean")&&L.type==="boolean"&&u(L.$id)}a(g,"TBoolean");e.TBoolean=g;function _(L){return C(L,"Constructor")&&L.type==="constructor"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(_,"TConstructor");e.TConstructor=_;function v(L){return C(L,"Date")&&L.type==="Date"&&u(L.$id)&&s(L.exclusiveMaximumTimestamp)&&s(L.exclusiveMinimumTimestamp)&&s(L.maximumTimestamp)&&s(L.minimumTimestamp)&&s(L.multipleOfTimestamp)}a(v,"TDate");e.TDate=v;function S(L){return C(L,"Function")&&L.type==="function"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(S,"TFunction");e.TFunction=S;function E(L){return C(L,"Integer")&&L.type==="integer"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(E,"TInteger");e.TInteger=E;function b(L){return C(L,"Intersect")&&(Jt.IsString(L.type)&&L.type!=="object"?false:true)&&Jt.IsArray(L.allOf)&&L.allOf.every(Se=>se(Se)&&!De(Se))&&u(L.type)&&(o(L.unevaluatedProperties)||d(L.unevaluatedProperties))&&u(L.$id)}a(b,"TIntersect");e.TIntersect=b;function A(L){return C(L,"Iterator")&&L.type==="Iterator"&&u(L.$id)&&se(L.items)}a(A,"TIterator");e.TIterator=A;function C(L,Se){return T(L)&&L[_e.Kind]===Se}a(C,"TKindOf");e.TKindOf=C;function T(L){return Jt.IsObject(L)&&_e.Kind in L&&Jt.IsString(L[_e.Kind])}a(T,"TKind");e.TKind=T;function O(L){return I(L)&&Jt.IsString(L.const)}a(O,"TLiteralString");e.TLiteralString=O;function P(L){return I(L)&&Jt.IsNumber(L.const)}a(P,"TLiteralNumber");e.TLiteralNumber=P;function R(L){return I(L)&&Jt.IsBoolean(L.const)}a(R,"TLiteralBoolean");e.TLiteralBoolean=R;function I(L){return C(L,"Literal")&&u(L.$id)&&(Jt.IsBoolean(L.const)||Jt.IsNumber(L.const)||Jt.IsString(L.const))}a(I,"TLiteral");e.TLiteral=I;function D(L){return C(L,"Never")&&Jt.IsObject(L.not)&&Object.getOwnPropertyNames(L.not).length===0}a(D,"TNever");e.TNever=D;function U(L){return C(L,"Not")&&se(L.not)}a(U,"TNot");e.TNot=U;function te(L){return C(L,"Null")&&L.type==="null"&&u(L.$id)}a(te,"TNull");e.TNull=te;function ve(L){return C(L,"Number")&&L.type==="number"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(ve,"TNumber");e.TNumber=ve;function me(L){return C(L,"Object")&&L.type==="object"&&u(L.$id)&&Jt.IsObject(L.properties)&&n(L.additionalProperties)&&s(L.minProperties)&&s(L.maxProperties)&&Object.entries(L.properties).every(([Se,Le])=>r(Se)&&se(Le))}a(me,"TObject");e.TObject=me;function he(L){return C(L,"Promise")&&L.type==="Promise"&&u(L.$id)&&se(L.item)}a(he,"TPromise");e.TPromise=he;function Fe(L){return C(L,"Record")&&L.type==="object"&&u(L.$id)&&n(L.additionalProperties)&&Jt.IsObject(L.patternProperties)&&(Se=>{const Le=Object.getOwnPropertyNames(Se.patternProperties);return Le.length===1&&t(Le[0])&&Jt.IsObject(Se.patternProperties)&&se(Se.patternProperties[Le[0]])})(L)}a(Fe,"TRecord");e.TRecord=Fe;function Oe(L){return Jt.IsObject(L)&&_e.Hint in L&&L[_e.Hint]==="Recursive"}a(Oe,"TRecursive");e.TRecursive=Oe;function M(L){return C(L,"Ref")&&u(L.$id)&&Jt.IsString(L.$ref)}a(M,"TRef");e.TRef=M;function Q(L){return C(L,"String")&&L.type==="string"&&u(L.$id)&&s(L.minLength)&&s(L.maxLength)&&l(L.pattern)&&c(L.format)}a(Q,"TString");e.TString=Q;function fe(L){return C(L,"Symbol")&&L.type==="symbol"&&u(L.$id)}a(fe,"TSymbol");e.TSymbol=fe;function B(L){return C(L,"TemplateLiteral")&&L.type==="string"&&Jt.IsString(L.pattern)&&L.pattern[0]==="^"&&L.pattern[L.pattern.length-1]==="$"}a(B,"TTemplateLiteral");e.TTemplateLiteral=B;function ye(L){return C(L,"This")&&u(L.$id)&&Jt.IsString(L.$ref)}a(ye,"TThis");e.TThis=ye;function De(L){return Jt.IsObject(L)&&_e.Transform in L}a(De,"TTransform");e.TTransform=De;function $e(L){return C(L,"Tuple")&&L.type==="array"&&u(L.$id)&&Jt.IsNumber(L.minItems)&&Jt.IsNumber(L.maxItems)&&L.minItems===L.maxItems&&(Jt.IsUndefined(L.items)&&Jt.IsUndefined(L.additionalItems)&&L.minItems===0||Jt.IsArray(L.items)&&L.items.every(Se=>se(Se)))}a($e,"TTuple");e.TTuple=$e;function gt(L){return C(L,"Undefined")&&L.type==="undefined"&&u(L.$id)}a(gt,"TUndefined");e.TUndefined=gt;function ut(L){return F(L)&&L.anyOf.every(Se=>O(Se)||P(Se))}a(ut,"TUnionLiteral");e.TUnionLiteral=ut;function F(L){return C(L,"Union")&&u(L.$id)&&Jt.IsObject(L)&&Jt.IsArray(L.anyOf)&&L.anyOf.every(Se=>se(Se))}a(F,"TUnion");e.TUnion=F;function G(L){return C(L,"Uint8Array")&&L.type==="Uint8Array"&&u(L.$id)&&s(L.minByteLength)&&s(L.maxByteLength)}a(G,"TUint8Array");e.TUint8Array=G;function $(L){return C(L,"Unknown")&&u(L.$id)}a($,"TUnknown");e.TUnknown=$;function W(L){return C(L,"Unsafe")}a(W,"TUnsafe");e.TUnsafe=W;function pe(L){return C(L,"Void")&&L.type==="void"&&u(L.$id)}a(pe,"TVoid");e.TVoid=pe;function H(L){return Jt.IsObject(L)&&L[_e.Readonly]==="Readonly"}a(H,"TReadonly");e.TReadonly=H;function de(L){return Jt.IsObject(L)&&L[_e.Optional]==="Optional"}a(de,"TOptional");e.TOptional=de;function se(L){return Jt.IsObject(L)&&(p(L)||f(L)||g(L)||h(L)||m(L)||_(L)||v(L)||S(L)||E(L)||b(L)||A(L)||I(L)||D(L)||U(L)||te(L)||ve(L)||me(L)||he(L)||Fe(L)||M(L)||Q(L)||fe(L)||B(L)||ye(L)||$e(L)||gt(L)||F(L)||G(L)||$(L)||W(L)||pe(L)||T(L)&&GRe.Has(L[_e.Kind]))}a(se,"TSchema");e.TSchema=se})(Ee||(_e.TypeGuard=Ee={}));var bxt;(function(e){function t(r){return r[_e.Kind]==="Intersect"?r.allOf.every(n=>t(n)):r[_e.Kind]==="Union"?r.anyOf.some(n=>t(n)):r[_e.Kind]==="Undefined"?true:r[_e.Kind]==="Not"?!t(r.not):false}a(t,"Check");e.Check=t})(bxt||(_e.ExtendsUndefined=bxt={}));var BJ=class extends hh{static{a(this,"TypeExtendsError")}};_e.TypeExtendsError=BJ;var at;(function(e){e[e["Union"]=0]="Union";e[e["True"]=1]="True";e[e["False"]=2]="False"})(at||(_e.TypeExtendsResult=at={}));var sC;(function(e){function t(N){return N===at.False?N:at.True}a(t,"IntoBooleanResult");function r(N){throw new BJ(N)}a(r,"Throw");function n(N){return Ee.TNever(N)||Ee.TIntersect(N)||Ee.TUnion(N)||Ee.TUnknown(N)||Ee.TAny(N)}a(n,"IsStructuralRight");function i(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):r("StructuralRight")}a(i,"StructuralRight");function s(N,k){return at.True}a(s,"TAnyRight");function o(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)&&k.anyOf.some(Ae=>Ee.TAny(Ae)||Ee.TUnknown(Ae))?at.True:Ee.TUnion(k)?at.Union:Ee.TUnknown(k)?at.True:Ee.TAny(k)?at.True:at.Union}a(o,"TAny");function u(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)?at.True:at.False}a(u,"TArrayRight");function l(N,k){return Ee.TObject(k)&&B(k)?at.True:n(k)?i(N,k):!Ee.TArray(k)?at.False:t(J(N.items,k.items))}a(l,"TArray");function c(N,k){return n(k)?i(N,k):!Ee.TAsyncIterator(k)?at.False:t(J(N.items,k.items))}a(c,"TAsyncIterator");function d(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBigInt(k)?at.True:at.False}a(d,"TBigInt");function p(N,k){return Ee.TLiteral(N)&&Jt.IsBoolean(N.const)?at.True:Ee.TBoolean(N)?at.True:at.False}a(p,"TBooleanRight");function f(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBoolean(k)?at.True:at.False}a(f,"TBoolean");function m(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TConstructor(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(m,"TConstructor");function h(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TDate(k)?at.True:at.False}a(h,"TDate");function g(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TFunction(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(g,"TFunction");function _(N,k){return Ee.TLiteral(N)&&Jt.IsNumber(N.const)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(_,"TIntegerRight");function v(N,k){return Ee.TInteger(k)||Ee.TNumber(k)?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):at.False}a(v,"TInteger");function S(N,k){return k.allOf.every(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(S,"TIntersectRight");function E(N,k){return N.allOf.some(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(E,"TIntersect");function b(N,k){return n(k)?i(N,k):!Ee.TIterator(k)?at.False:t(J(N.items,k.items))}a(b,"TIterator");function A(N,k){return Ee.TLiteral(k)&&k.const===N.const?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):at.False}a(A,"TLiteral");function C(N,k){return at.False}a(C,"TNeverRight");function T(N,k){return at.True}a(T,"TNever");function O(N){let[k,Ae]=[N,0];while(true){if(!Ee.TNot(k))break;k=k.not;Ae+=1}return Ae%2===0?k:_e.Type.Unknown()}a(O,"UnwrapTNot");function P(N,k){return Ee.TNot(N)?J(O(N),k):Ee.TNot(k)?J(N,O(k)):r("Invalid fallthrough for Not")}a(P,"TNot");function R(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TNull(k)?at.True:at.False}a(R,"TNull");function I(N,k){return Ee.TLiteralNumber(N)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(I,"TNumberRight");function D(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TInteger(k)||Ee.TNumber(k)?at.True:at.False}a(D,"TNumber");function U(N,k){return Object.getOwnPropertyNames(N.properties).length===k}a(U,"IsObjectPropertyCount");function te(N){return B(N)}a(te,"IsObjectStringLike");function ve(N){return U(N,0)||U(N,1)&&"description"in N.properties&&Ee.TUnion(N.properties.description)&&N.properties.description.anyOf.length===2&&(Ee.TString(N.properties.description.anyOf[0])&&Ee.TUndefined(N.properties.description.anyOf[1])||Ee.TString(N.properties.description.anyOf[1])&&Ee.TUndefined(N.properties.description.anyOf[0]))}a(ve,"IsObjectSymbolLike");function me(N){return U(N,0)}a(me,"IsObjectNumberLike");function he(N){return U(N,0)}a(he,"IsObjectBooleanLike");function Fe(N){return U(N,0)}a(Fe,"IsObjectBigIntLike");function Oe(N){return U(N,0)}a(Oe,"IsObjectDateLike");function M(N){return B(N)}a(M,"IsObjectUint8ArrayLike");function Q(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(Q,"IsObjectFunctionLike");function fe(N){return U(N,0)}a(fe,"IsObjectConstructorLike");function B(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(B,"IsObjectArrayLike");function ye(N){const k=_e.Type.Function([_e.Type.Any()],_e.Type.Any());return U(N,0)||U(N,1)&&"then"in N.properties&&t(J(N.properties["then"],k))===at.True}a(ye,"IsObjectPromiseLike");function De(N,k){return J(N,k)===at.False?at.False:Ee.TOptional(N)&&!Ee.TOptional(k)?at.False:at.True}a(De,"Property");function $e(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)||Ee.TLiteralString(N)&&te(k)||Ee.TLiteralNumber(N)&&me(k)||Ee.TLiteralBoolean(N)&&he(k)||Ee.TSymbol(N)&&ve(k)||Ee.TBigInt(N)&&Fe(k)||Ee.TString(N)&&te(k)||Ee.TSymbol(N)&&ve(k)||Ee.TNumber(N)&&me(k)||Ee.TInteger(N)&&me(k)||Ee.TBoolean(N)&&he(k)||Ee.TUint8Array(N)&&M(k)||Ee.TDate(N)&&Oe(k)||Ee.TConstructor(N)&&fe(k)||Ee.TFunction(N)&&Q(k)?at.True:Ee.TRecord(N)&&Ee.TString(F(N))?(()=>{return k[_e.Hint]==="Record"?at.True:at.False})():Ee.TRecord(N)&&Ee.TNumber(F(N))?(()=>{return U(k,0)?at.True:at.False})():at.False}a($e,"TObjectRight");function gt(N,k){return n(k)?i(N,k):Ee.TRecord(k)?$(N,k):!Ee.TObject(k)?at.False:(()=>{for(const Ae of Object.getOwnPropertyNames(k.properties)){if(!(Ae in N.properties))return at.False;if(De(N.properties[Ae],k.properties[Ae])===at.False){return at.False}}return at.True})()}a(gt,"TObject");function ut(N,k){return n(k)?i(N,k):Ee.TObject(k)&&ye(k)?at.True:!Ee.TPromise(k)?at.False:t(J(N.item,k.item))}a(ut,"TPromise");function F(N){return _e.PatternNumberExact in N.patternProperties?_e.Type.Number():_e.PatternStringExact in N.patternProperties?_e.Type.String():r("Unknown record key pattern")}a(F,"RecordKey");function G(N){return _e.PatternNumberExact in N.patternProperties?N.patternProperties[_e.PatternNumberExact]:_e.PatternStringExact in N.patternProperties?N.patternProperties[_e.PatternStringExact]:r("Unable to get record value schema")}a(G,"RecordValue");function $(N,k){const[Ae,Be]=[F(k),G(k)];return Ee.TLiteralString(N)&&Ee.TNumber(Ae)&&t(J(N,Be))===at.True?at.True:Ee.TUint8Array(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TString(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TArray(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TObject(N)?(()=>{for(const et of Object.getOwnPropertyNames(N.properties)){if(De(Be,N.properties[et])===at.False){return at.False}}return at.True})():at.False}a($,"TRecordRight");function W(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TRecord(k)?at.False:J(G(N),G(k))}a(W,"TRecord");function pe(N,k){return Ee.TLiteral(N)&&Jt.IsString(N.const)?at.True:Ee.TString(N)?at.True:at.False}a(pe,"TStringRight");function H(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?at.True:at.False}a(H,"TString");function de(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TSymbol(k)?at.True:at.False}a(de,"TSymbol");function se(N,k){return Ee.TTemplateLiteral(N)?J(xy.Resolve(N),k):Ee.TTemplateLiteral(k)?J(N,xy.Resolve(k)):r("Invalid fallthrough for TemplateLiteral")}a(se,"TTemplateLiteral");function L(N,k){return Ee.TArray(k)&&N.items!==void 0&&N.items.every(Ae=>J(Ae,k.items)===at.True)}a(L,"IsArrayOfTuple");function Se(N,k){return Ee.TNever(N)?at.True:Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:at.False}a(Se,"TTupleRight");function Le(N,k){return n(k)?i(N,k):Ee.TObject(k)&&B(k)?at.True:Ee.TArray(k)&&L(N,k)?at.True:!Ee.TTuple(k)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)||!Jt.IsUndefined(N.items)&&Jt.IsUndefined(k.items)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)?at.True:N.items.every((Ae,Be)=>J(Ae,k.items[Be])===at.True)?at.True:at.False}a(Le,"TTuple");function Ke(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TUint8Array(k)?at.True:at.False}a(Ke,"TUint8Array");function St(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TVoid(k)?j(N,k):Ee.TUndefined(k)?at.True:at.False}a(St,"TUndefined");function Mt(N,k){return k.anyOf.some(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(Mt,"TUnionRight");function _r(N,k){return N.anyOf.every(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(_r,"TUnion");function Ur(N,k){return at.True}a(Ur,"TUnknownRight");function Ve(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TAny(k)?s(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):Ee.TArray(k)?u(N,k):Ee.TTuple(k)?Se(N,k):Ee.TObject(k)?$e(N,k):Ee.TUnknown(k)?at.True:at.False}a(Ve,"TUnknown");function j(N,k){return Ee.TUndefined(N)?at.True:Ee.TUndefined(N)?at.True:at.False}a(j,"VoidRight");function q(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):Ee.TObject(k)?$e(N,k):Ee.TVoid(k)?at.True:at.False}a(q,"TVoid");function J(N,k){return Ee.TTemplateLiteral(N)||Ee.TTemplateLiteral(k)?se(N,k):Ee.TNot(N)||Ee.TNot(k)?P(N,k):Ee.TAny(N)?o(N,k):Ee.TArray(N)?l(N,k):Ee.TBigInt(N)?d(N,k):Ee.TBoolean(N)?f(N,k):Ee.TAsyncIterator(N)?c(N,k):Ee.TConstructor(N)?m(N,k):Ee.TDate(N)?h(N,k):Ee.TFunction(N)?g(N,k):Ee.TInteger(N)?v(N,k):Ee.TIntersect(N)?E(N,k):Ee.TIterator(N)?b(N,k):Ee.TLiteral(N)?A(N,k):Ee.TNever(N)?T(N,k):Ee.TNull(N)?R(N,k):Ee.TNumber(N)?D(N,k):Ee.TObject(N)?gt(N,k):Ee.TRecord(N)?W(N,k):Ee.TString(N)?H(N,k):Ee.TSymbol(N)?de(N,k):Ee.TTuple(N)?Le(N,k):Ee.TPromise(N)?ut(N,k):Ee.TUint8Array(N)?Ke(N,k):Ee.TUndefined(N)?St(N,k):Ee.TUnion(N)?_r(N,k):Ee.TUnknown(N)?Ve(N,k):Ee.TVoid(N)?q(N,k):r(`Unknown left type operand '${N[_e.Kind]}'`)}a(J,"Visit");function ae(N,k){return J(N,k)}a(ae,"Extends");e.Extends=ae})(sC||(_e.TypeExtends=sC={}));var Rr;(function(e){function t(o){const u=Object.getOwnPropertyNames(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});const l=Object.getOwnPropertySymbols(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});return{...u,...l}}a(t,"ObjectType");function r(o){return o.map(u=>n(u))}a(r,"ArrayType");function n(o){return Jt.IsArray(o)?r(o):Jt.IsObject(o)?t(o):o}a(n,"Visit");function i(o){return o.map(u=>s(u))}a(i,"Rest");e.Rest=i;function s(o,u={}){return{...n(o),...u}}a(s,"Type");e.Type=s})(Rr||(_e.TypeClone=Rr={}));var VRe;(function(e){function t(m){return m.map(h=>{const{[_e.Optional]:g,..._}=Rr.Type(h);return _})}a(t,"OptionalUnwrap");function r(m){return m.every(h=>Ee.TOptional(h))}a(r,"IsIntersectOptional");function n(m){return m.some(h=>Ee.TOptional(h))}a(n,"IsUnionOptional");function i(m){return r(m.allOf)?_e.Type.Optional(_e.Type.Intersect(t(m.allOf))):m}a(i,"ResolveIntersect");function s(m){return n(m.anyOf)?_e.Type.Optional(_e.Type.Union(t(m.anyOf))):m}a(s,"ResolveUnion");function o(m){return m[_e.Kind]==="Intersect"?i(m):m[_e.Kind]==="Union"?s(m):m}a(o,"ResolveOptional");function u(m,h){const g=m.allOf.reduce((_,v)=>{const S=p(v,h);return S[_e.Kind]==="Never"?_:[..._,S]},[]);return o(_e.Type.Intersect(g))}a(u,"TIntersect");function l(m,h){const g=m.anyOf.map(_=>p(_,h));return o(_e.Type.Union(g))}a(l,"TUnion");function c(m,h){const g=m.properties[h];return Jt.IsUndefined(g)?_e.Type.Never():_e.Type.Union([g])}a(c,"TObject");function d(m,h){const g=m.items;if(Jt.IsUndefined(g))return _e.Type.Never();const _=g[h];if(Jt.IsUndefined(_))return _e.Type.Never();return _}a(d,"TTuple");function p(m,h){return m[_e.Kind]==="Intersect"?u(m,h):m[_e.Kind]==="Union"?l(m,h):m[_e.Kind]==="Object"?c(m,h):m[_e.Kind]==="Tuple"?d(m,h):_e.Type.Never()}a(p,"Visit");function f(m,h,g={}){const _=h.map(v=>p(m,v.toString()));return o(_e.Type.Union(_,g))}a(f,"Resolve");e.Resolve=f})(VRe||(_e.IndexedAccessor=VRe={}));var gP;(function(e){function t(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toLowerCase()}${f}`}a(t,"Uncapitalize");function r(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toUpperCase()}${f}`}a(r,"Capitalize");function n(d){return d.toUpperCase()}a(n,"Uppercase");function i(d){return d.toLowerCase()}a(i,"Lowercase");function s(d,p){const f=_P.ParseExact(d.pattern);const m=vP.Check(f);if(!m)return{...d,pattern:o(d.pattern,p)};const h=[...EP.Generate(f)];const g=h.map(S=>_e.Type.Literal(S));const _=u(g,p);const v=_e.Type.Union(_);return _e.Type.TemplateLiteral([v])}a(s,"IntrinsicTemplateLiteral");function o(d,p){return typeof d==="string"?p==="Uncapitalize"?t(d):p==="Capitalize"?r(d):p==="Uppercase"?n(d):p==="Lowercase"?i(d):d:d.toString()}a(o,"IntrinsicLiteral");function u(d,p){if(d.length===0)return[];const[f,...m]=d;return[c(f,p),...u(m,p)]}a(u,"IntrinsicRest");function l(d,p){return Ee.TTemplateLiteral(d)?s(d,p):Ee.TUnion(d)?_e.Type.Union(u(d.anyOf,p)):Ee.TLiteral(d)?_e.Type.Literal(o(d.const,p)):d}a(l,"Visit");function c(d,p){return l(d,p)}a(c,"Map");e.Map=c})(gP||(_e.Intrinsic=gP={}));var yP;(function(e){function t(o,u){return _e.Type.Intersect(o.allOf.map(l=>i(l,u)),{...o})}a(t,"TIntersect");function r(o,u){return _e.Type.Union(o.anyOf.map(l=>i(l,u)),{...o})}a(r,"TUnion");function n(o,u){return u(o)}a(n,"TObject");function i(o,u){return o[_e.Kind]==="Intersect"?t(o,u):o[_e.Kind]==="Union"?r(o,u):o[_e.Kind]==="Object"?n(o,u):o}a(i,"Visit");function s(o,u,l){return{...i(Rr.Type(o),u),...l}}a(s,"Map");e.Map=s})(yP||(_e.ObjectMap=yP={}));var MJ;(function(e){function t(c){return c[0]==="^"&&c[c.length-1]==="$"?c.slice(1,c.length-1):c}a(t,"UnwrapPattern");function r(c,d){return c.allOf.reduce((p,f)=>[...p,...o(f,d)],[])}a(r,"TIntersect");function n(c,d){const p=c.anyOf.map(f=>o(f,d));return[...p.reduce((f,m)=>m.map(h=>p.every(g=>g.includes(h))?f.add(h):f)[0],new Set)]}a(n,"TUnion");function i(c,d){return Object.getOwnPropertyNames(c.properties)}a(i,"TObject");function s(c,d){return d.includePatterns?Object.getOwnPropertyNames(c.patternProperties):[]}a(s,"TRecord");function o(c,d){return Ee.TIntersect(c)?r(c,d):Ee.TUnion(c)?n(c,d):Ee.TObject(c)?i(c,d):Ee.TRecord(c)?s(c,d):[]}a(o,"Visit");function u(c,d){return[...new Set(o(c,d))]}a(u,"ResolveKeys");e.ResolveKeys=u;function l(c){const d=u(c,{includePatterns:true});const p=d.map(f=>`(${t(f)})`);return`^(${p.join("|")})$`}a(l,"ResolvePattern");e.ResolvePattern=l})(MJ||(_e.KeyResolver=MJ={}));var qJ=class extends hh{static{a(this,"KeyArrayResolverError")}};_e.KeyArrayResolverError=qJ;var BF;(function(e){function t(r){return Array.isArray(r)?r:Ee.TUnionLiteral(r)?r.anyOf.map(n=>n.const.toString()):Ee.TLiteral(r)?[r.const]:Ee.TTemplateLiteral(r)?(()=>{const n=_P.ParseExact(r.pattern);if(!vP.Check(n))throw new qJ("Cannot resolve keys from infinite template expression");return[...EP.Generate(n)]})():[]}a(t,"Resolve");e.Resolve=t})(BF||(_e.KeyArrayResolver=BF={}));var zRe;(function(e){function*t(n){for(const i of n.anyOf){if(i[_e.Kind]==="Union"){yield*t(i)}else{yield i}}}a(t,"TUnion");function r(n){return _e.Type.Union([...t(n)],{...n})}a(r,"Resolve");e.Resolve=r})(zRe||(_e.UnionResolver=zRe={}));var UJ=class extends hh{static{a(this,"TemplateLiteralPatternError")}};_e.TemplateLiteralPatternError=UJ;var $J;(function(e){function t(s){throw new UJ(s)}a(t,"Throw");function r(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(r,"Escape");function n(s,o){return Ee.TTemplateLiteral(s)?s.pattern.slice(1,s.pattern.length-1):Ee.TUnion(s)?`(${s.anyOf.map(u=>n(u,o)).join("|")})`:Ee.TNumber(s)?`${o}${_e.PatternNumber}`:Ee.TInteger(s)?`${o}${_e.PatternNumber}`:Ee.TBigInt(s)?`${o}${_e.PatternNumber}`:Ee.TString(s)?`${o}${_e.PatternString}`:Ee.TLiteral(s)?`${o}${r(s.const.toString())}`:Ee.TBoolean(s)?`${o}${_e.PatternBoolean}`:t(`Unexpected Kind '${s[_e.Kind]}'`)}a(n,"Visit");function i(s){return`^${s.map(o=>n(o,"")).join("")}$`}a(i,"Create");e.Create=i})($J||(_e.TemplateLiteralPattern=$J={}));var xy;(function(e){function t(r){const n=_P.ParseExact(r.pattern);if(!vP.Check(n))return _e.Type.String();const i=[...EP.Generate(n)].map(s=>_e.Type.Literal(s));return _e.Type.Union(i)}a(t,"Resolve");e.Resolve=t})(xy||(_e.TemplateLiteralResolver=xy={}));var MF=class extends hh{static{a(this,"TemplateLiteralParserError")}};_e.TemplateLiteralParserError=MF;var _P;(function(e){function t(m,h,g){return m[h]===g&&m.charCodeAt(h-1)!==92}a(t,"IsNonEscaped");function r(m,h){return t(m,h,"(")}a(r,"IsOpenParen");function n(m,h){return t(m,h,")")}a(n,"IsCloseParen");function i(m,h){return t(m,h,"|")}a(i,"IsSeparator");function s(m){if(!(r(m,0)&&n(m,m.length-1)))return false;let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(h===0&&g!==m.length-1)return false}return true}a(s,"IsGroup");function o(m){return m.slice(1,m.length-1)}a(o,"InGroup");function u(m){let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(i(m,g)&&h===0)return true}return false}a(u,"IsPrecedenceOr");function l(m){for(let h=0;h<m.length;h++){if(r(m,h))return true}return false}a(l,"IsPrecedenceAnd");function c(m){let[h,g]=[0,0];const _=[];for(let S=0;S<m.length;S++){if(r(m,S))h+=1;if(n(m,S))h-=1;if(i(m,S)&&h===0){const E=m.slice(g,S);if(E.length>0)_.push(p(E));g=S+1}}const v=m.slice(g);if(v.length>0)_.push(p(v));if(_.length===0)return{type:"const",const:""};if(_.length===1)return _[0];return{type:"or",expr:_}}a(c,"Or");function d(m){function h(v,S){if(!r(v,S))throw new MF(`TemplateLiteralParser: Index must point to open parens`);let E=0;for(let b=S;b<v.length;b++){if(r(v,b))E+=1;if(n(v,b))E-=1;if(E===0)return[S,b]}throw new MF(`TemplateLiteralParser: Unclosed group parens in expression`)}a(h,"Group");function g(v,S){for(let E=S;E<v.length;E++){if(r(v,E))return[S,E]}return[S,v.length]}a(g,"Range");const _=[];for(let v=0;v<m.length;v++){if(r(m,v)){const[S,E]=h(m,v);const b=m.slice(S,E+1);_.push(p(b));v=E}else{const[S,E]=g(m,v);const b=m.slice(S,E);if(b.length>0)_.push(p(b));v=E-1}}return _.length===0?{type:"const",const:""}:_.length===1?_[0]:{type:"and",expr:_}}a(d,"And");function p(m){return s(m)?p(o(m)):u(m)?c(m):l(m)?d(m):{type:"const",const:m}}a(p,"Parse");e.Parse=p;function f(m){return p(m.slice(1,m.length-1))}a(f,"ParseExact");e.ParseExact=f})(_P||(_e.TemplateLiteralParser=_P={}));var jJ=class extends hh{static{a(this,"TemplateLiteralFiniteError")}};_e.TemplateLiteralFiniteError=jJ;var vP;(function(e){function t(o){throw new jJ(o)}a(t,"Throw");function r(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="0"&&o.expr[1].type==="const"&&o.expr[1].const==="[1-9][0-9]*"}a(r,"IsNumber");function n(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="true"&&o.expr[1].type==="const"&&o.expr[1].const==="false"}a(n,"IsBoolean");function i(o){return o.type==="const"&&o.const===".*"}a(i,"IsString");function s(o){return n(o)?true:r(o)||i(o)?false:o.type==="and"?o.expr.every(u=>s(u)):o.type==="or"?o.expr.every(u=>s(u)):o.type==="const"?true:t(`Unknown expression type`)}a(s,"Check");e.Check=s})(vP||(_e.TemplateLiteralFinite=vP={}));var GJ=class extends hh{static{a(this,"TemplateLiteralGeneratorError")}};_e.TemplateLiteralGeneratorError=GJ;var EP;(function(e){function*t(o){if(o.length===1)return yield*o[0];for(const u of o[0]){for(const l of t(o.slice(1))){yield`${u}${l}`}}}a(t,"Reduce");function*r(o){return yield*t(o.expr.map(u=>[...s(u)]))}a(r,"And");function*n(o){for(const u of o.expr)yield*s(u)}a(n,"Or");function*i(o){return yield o.const}a(i,"Const");function*s(o){return o.type==="and"?yield*r(o):o.type==="or"?yield*n(o):o.type==="const"?yield*i(o):(()=>{throw new GJ("Unknown expression")})()}a(s,"Generate");e.Generate=s})(EP||(_e.TemplateLiteralGenerator=EP={}));var KRe;(function(e){function*t(s){const o=s.trim().replace(/"|'/g,"");return o==="boolean"?yield _e.Type.Boolean():o==="number"?yield _e.Type.Number():o==="bigint"?yield _e.Type.BigInt():o==="string"?yield _e.Type.String():yield(()=>{const u=o.split("|").map(l=>_e.Type.Literal(l.trim()));return u.length===0?_e.Type.Never():u.length===1?u[0]:_e.Type.Union(u)})()}a(t,"ParseUnion");function*r(s){if(s[1]!=="{"){const o=_e.Type.Literal("$");const u=n(s.slice(1));return yield*[o,...u]}for(let o=2;o<s.length;o++){if(s[o]==="}"){const u=t(s.slice(2,o));const l=n(s.slice(o+1));return yield*[...u,...l]}}yield _e.Type.Literal(s)}a(r,"ParseTerminal");function*n(s){for(let o=0;o<s.length;o++){if(s[o]==="$"){const u=_e.Type.Literal(s.slice(0,o));const l=r(s.slice(o));return yield*[u,...l]}}yield _e.Type.Literal(s)}a(n,"ParseLiteral");function i(s){return[...n(s)]}a(i,"Parse");e.Parse=i})(KRe||(_e.TemplateLiteralDslParser=KRe={}));var HJ=class{static{a(this,"TransformDecodeBuilder")}constructor(t){this.schema=t}Decode(t){return new VJ(this.schema,t)}};_e.TransformDecodeBuilder=HJ;var VJ=class{static{a(this,"TransformEncodeBuilder")}constructor(t,r){this.schema=t;this.decode=r}Encode(t){const r=Rr.Type(this.schema);return Ee.TTransform(r)?(()=>{const n=a(o=>r[_e.Transform].Encode(t(o)),"Encode");const i=a(o=>this.decode(r[_e.Transform].Decode(o)),"Decode");const s={Encode:n,Decode:i};return{...r,[_e.Transform]:s}})():(()=>{const n={Decode:this.decode,Encode:t};return{...r,[_e.Transform]:n}})()}};_e.TransformEncodeBuilder=VJ;var Fxn=0;var zJ=class extends hh{static{a(this,"TypeBuilderError")}};_e.TypeBuilderError=zJ;var KJ=class{static{a(this,"TypeBuilder")}Create(t){return t}Throw(t){throw new zJ(t)}Discard(t,r){const{[r]:n,...i}=t;return i}Strict(t){return JSON.parse(JSON.stringify(t))}};_e.TypeBuilder=KJ;var qF=class extends KJ{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(t){return this.Readonly(this.Optional(t))}Readonly(t){return{...Rr.Type(t),[_e.Readonly]:"Readonly"}}Optional(t){return{...Rr.Type(t),[_e.Optional]:"Optional"}}Any(t={}){return this.Create({...t,[_e.Kind]:"Any"})}Array(t,r={}){return this.Create({...r,[_e.Kind]:"Array",type:"array",items:Rr.Type(t)})}Boolean(t={}){return this.Create({...t,[_e.Kind]:"Boolean",type:"boolean"})}Capitalize(t,r={}){return{...gP.Map(Rr.Type(t),"Capitalize"),...r}}Composite(t,r){const n=_e.Type.Intersect(t,{});const i=MJ.ResolveKeys(n,{includePatterns:false});const s=i.reduce((o,u)=>({...o,[u]:_e.Type.Index(n,[u])}),{});return _e.Type.Object(s,r)}Enum(t,r={}){const n=Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]);const i=n.map(s=>Jt.IsString(s)?{[_e.Kind]:"Literal",type:"string",const:s}:{[_e.Kind]:"Literal",type:"number",const:s});return this.Create({...r,[_e.Kind]:"Union",anyOf:i})}Extends(t,r,n,i,s={}){switch(sC.Extends(t,r)){case at.Union:return this.Union([Rr.Type(n,s),Rr.Type(i,s)]);case at.True:return Rr.Type(n,s);case at.False:return Rr.Type(i,s)}}Exclude(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Exclude(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Exclude(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)===at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?this.Never(n):Rr.Type(t,n)}Extract(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Extract(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Extract(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)!==at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?Rr.Type(t,n):this.Never(n)}Index(t,r,n={}){return Ee.TArray(t)&&Ee.TNumber(r)?(()=>{return Rr.Type(t.items,n)})():Ee.TTuple(t)&&Ee.TNumber(r)?(()=>{const i=Jt.IsUndefined(t.items)?[]:t.items;const s=i.map(o=>Rr.Type(o));return this.Union(s,n)})():(()=>{const i=BF.Resolve(r);const s=Rr.Type(t);return VRe.Resolve(s,i,n)})()}Integer(t={}){return this.Create({...t,[_e.Kind]:"Integer",type:"integer"})}Intersect(t,r={}){if(t.length===0)return _e.Type.Never();if(t.length===1)return Rr.Type(t[0],r);if(t.some(o=>Ee.TTransform(o)))this.Throw("Cannot intersect transform types");const n=t.every(o=>Ee.TObject(o));const i=Rr.Rest(t);const s=Ee.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:Rr.Type(r.unevaluatedProperties)}:{};return r.unevaluatedProperties===false||Ee.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[_e.Kind]:"Intersect",type:"object",allOf:i}):this.Create({...r,...s,[_e.Kind]:"Intersect",allOf:i})}KeyOf(t,r={}){return Ee.TRecord(t)?(()=>{const n=Object.getOwnPropertyNames(t.patternProperties)[0];return n===_e.PatternNumberExact?this.Number(r):n===_e.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():Ee.TTuple(t)?(()=>{const n=Jt.IsUndefined(t.items)?[]:t.items;const i=n.map((s,o)=>_e.Type.Literal(o.toString()));return this.Union(i,r)})():Ee.TArray(t)?(()=>{return this.Number(r)})():(()=>{const n=MJ.ResolveKeys(t,{includePatterns:false});if(n.length===0)return this.Never(r);const i=n.map(s=>this.Literal(s));return this.Union(i,r)})()}Literal(t,r={}){return this.Create({...r,[_e.Kind]:"Literal",const:t,type:typeof t})}Lowercase(t,r={}){return{...gP.Map(Rr.Type(t),"Lowercase"),...r}}Never(t={}){return this.Create({...t,[_e.Kind]:"Never",not:{}})}Not(t,r){return this.Create({...r,[_e.Kind]:"Not",not:Rr.Type(t)})}Null(t={}){return this.Create({...t,[_e.Kind]:"Null",type:"null"})}Number(t={}){return this.Create({...t,[_e.Kind]:"Number",type:"number"})}Object(t,r={}){const n=Object.getOwnPropertyNames(t);const i=n.filter(l=>Ee.TOptional(t[l]));const s=n.filter(l=>!i.includes(l));const o=Ee.TSchema(r.additionalProperties)?{additionalProperties:Rr.Type(r.additionalProperties)}:{};const u=n.reduce((l,c)=>({...l,[c]:Rr.Type(t[c])}),{});return s.length>0?this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u,required:s}):this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u})}Omit(t,r,n={}){const i=BF.Resolve(r);return yP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>!i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Partial(t,r={}){return yP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Optional(n.properties[o])}},{});return this.Object(i,this.Discard(n,"required"))},r)}Pick(t,r,n={}){const i=BF.Resolve(r);return yP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(!i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Record(t,r,n={}){return Ee.TTemplateLiteral(t)?(()=>{const i=_P.ParseExact(t.pattern);return vP.Check(i)?this.Object([...EP.Generate(i)].reduce((s,o)=>({...s,[o]:Rr.Type(r)}),{}),n):this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[t.pattern]:Rr.Type(r)}})})():Ee.TUnion(t)?(()=>{const i=zRe.Resolve(t);if(Ee.TUnionLiteral(i)){const s=i.anyOf.reduce((o,u)=>({...o,[u.const]:Rr.Type(r)}),{});return this.Object(s,{...n,[_e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():Ee.TLiteral(t)?(()=>{return Jt.IsString(t.const)||Jt.IsNumber(t.const)?this.Object({[t.const]:Rr.Type(r)},n):this.Throw("Record key of type literal is not of type string or number")})():Ee.TInteger(t)||Ee.TNumber(t)?(()=>{return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[_e.PatternNumberExact]:Rr.Type(r)}})})():Ee.TString(t)?(()=>{const i=Jt.IsUndefined(t.pattern)?_e.PatternStringExact:t.pattern;return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[i]:Rr.Type(r)}})})():this.Never()}Recursive(t,r={}){if(Jt.IsUndefined(r.$id))r.$id=`T${Fxn++}`;const n=t({[_e.Kind]:"This",$ref:`${r.$id}`});n.$id=r.$id;return this.Create({...r,[_e.Hint]:"Recursive",...n})}Ref(t,r={}){if(Jt.IsString(t))return this.Create({...r,[_e.Kind]:"Ref",$ref:t});if(Jt.IsUndefined(t.$id))this.Throw("Reference target type must specify an $id");return this.Create({...r,[_e.Kind]:"Ref",$ref:t.$id})}Required(t,r={}){return yP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Discard(n.properties[o],_e.Optional)}},{});return this.Object(i,n)},r)}Rest(t){return Ee.TTuple(t)&&!Jt.IsUndefined(t.items)?Rr.Rest(t.items):Ee.TIntersect(t)?Rr.Rest(t.allOf):Ee.TUnion(t)?Rr.Rest(t.anyOf):[]}String(t={}){return this.Create({...t,[_e.Kind]:"String",type:"string"})}TemplateLiteral(t,r={}){const n=Jt.IsString(t)?$J.Create(KRe.Parse(t)):$J.Create(t);return this.Create({...r,[_e.Kind]:"TemplateLiteral",type:"string",pattern:n})}Transform(t){return new HJ(t)}Tuple(t,r={}){const[n,i,s]=[false,t.length,t.length];const o=Rr.Rest(t);const u=t.length>0?{...r,[_e.Kind]:"Tuple",type:"array",items:o,additionalItems:n,minItems:i,maxItems:s}:{...r,[_e.Kind]:"Tuple",type:"array",minItems:i,maxItems:s};return this.Create(u)}Uncapitalize(t,r={}){return{...gP.Map(Rr.Type(t),"Uncapitalize"),...r}}Union(t,r={}){return Ee.TTemplateLiteral(t)?xy.Resolve(t):(()=>{const n=t;if(n.length===0)return this.Never(r);if(n.length===1)return this.Create(Rr.Type(n[0],r));const i=Rr.Rest(n);return this.Create({...r,[_e.Kind]:"Union",anyOf:i})})()}Unknown(t={}){return this.Create({...t,[_e.Kind]:"Unknown"})}Unsafe(t={}){return this.Create({...t,[_e.Kind]:t[_e.Kind]||"Unsafe"})}Uppercase(t,r={}){return{...gP.Map(Rr.Type(t),"Uppercase"),...r}}};_e.JsonTypeBuilder=qF;var WJ=class extends qF{static{a(this,"JavaScriptTypeBuilder")}AsyncIterator(t,r={}){return this.Create({...r,[_e.Kind]:"AsyncIterator",type:"AsyncIterator",items:Rr.Type(t)})}Awaited(t,r={}){const n=a(i=>i.length>0?(()=>{const[s,...o]=i;return[this.Awaited(s),...n(o)]})():i,"Unwrap");return Ee.TIntersect(t)?_e.Type.Intersect(n(t.allOf)):Ee.TUnion(t)?_e.Type.Union(n(t.anyOf)):Ee.TPromise(t)?this.Awaited(t.item):Rr.Type(t,r)}BigInt(t={}){return this.Create({...t,[_e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(t,r={}){return this.Tuple([...t.parameters],{...r})}Constructor(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Constructor",type:"constructor",parameters:i,returns:s})}Date(t={}){return this.Create({...t,[_e.Kind]:"Date",type:"Date"})}Function(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Function",type:"function",parameters:i,returns:s})}InstanceType(t,r={}){return Rr.Type(t.returns,r)}Iterator(t,r={}){return this.Create({...r,[_e.Kind]:"Iterator",type:"Iterator",items:Rr.Type(t)})}Parameters(t,r={}){return this.Tuple(t.parameters,{...r})}Promise(t,r={}){return this.Create({...r,[_e.Kind]:"Promise",type:"Promise",item:Rr.Type(t)})}RegExp(t,r={}){const n=Jt.IsString(t)?t:t.source;return this.Create({...r,[_e.Kind]:"String",type:"string",pattern:n})}RegEx(t,r={}){return this.RegExp(t,r)}ReturnType(t,r={}){return Rr.Type(t.returns,r)}Symbol(t){return this.Create({...t,[_e.Kind]:"Symbol",type:"symbol"})}Undefined(t={}){return this.Create({...t,[_e.Kind]:"Undefined",type:"undefined"})}Uint8Array(t={}){return this.Create({...t,[_e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(t={}){return this.Create({...t,[_e.Kind]:"Void",type:"void"})}};_e.JavaScriptTypeBuilder=WJ;_e.JsonType=new qF;_e.Type=new WJ});var Axt=y(YJ=>{"use strict";Object.defineProperty(YJ,"__esModule",{value:true});YJ.CustomTypeBuilder=void 0;var UF=Sxt();var WRe=class extends UF.TypeBuilder{static{a(this,"CustomTypeBuilder")}static Date(){return UF.Type.Unsafe({type:"string",format:"date-time"})}static Nullable(t){return UF.Type.Union([t,UF.Type.Null()])}static StringEnum(t){return UF.Type.Unsafe({type:"string",enum:t})}};YJ.CustomTypeBuilder=WRe});var xxt=y(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:true});Tr.throwIfNotNumber=Tr.throwIfNotString=Tr.throwIfUndefinedOrNull=Tr.throwIfUndefined=Tr.ArgumentTypeError=Tr.ArgumentUndefinedError=Tr.ValidationError=Tr.withUndefinedAsNull=Tr.withNullAsUndefined=Tr.validateConstraint=Tr.validateConstraints=Tr.areFunctions=Tr.isFunction=Tr.isEmptyObject=Tr.assertAllDefined=Tr.assertIsDefined=Tr.assertType=Tr.isUndefinedOrNull=Tr.isDefined=Tr.isUndefined=Tr.isBoolean=Tr.isIterable=Tr.isNumber=Tr.isTypedArray=Tr.isObject=Tr.isStringArray=Tr.isString=void 0;function XJ(e){return typeof e==="string"}a(XJ,"isString");Tr.isString=XJ;function Bxn(e){return Array.isArray(e)&&e.every(t=>XJ(t))}a(Bxn,"isStringArray");Tr.isStringArray=Bxn;function Cxt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}a(Cxt,"isObject");Tr.isObject=Cxt;function Mxn(e){const t=Object.getPrototypeOf(Uint8Array);return typeof e==="object"&&e instanceof t}a(Mxn,"isTypedArray");Tr.isTypedArray=Mxn;function wxt(e){return typeof e==="number"&&!isNaN(e)}a(wxt,"isNumber");Tr.isNumber=wxt;function qxn(e){return!!e&&typeof e[Symbol.iterator]==="function"}a(qxn,"isIterable");Tr.isIterable=qxn;function Uxn(e){return e===true||e===false}a(Uxn,"isBoolean");Tr.isBoolean=Uxn;function YRe(e){return typeof e==="undefined"}a(YRe,"isUndefined");Tr.isUndefined=YRe;function $xn(e){return!bP(e)}a($xn,"isDefined");Tr.isDefined=$xn;function bP(e){return YRe(e)||e===null}a(bP,"isUndefinedOrNull");Tr.isUndefinedOrNull=bP;function jxn(e,t){if(!e){throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}}a(jxn,"assertType");Tr.assertType=jxn;function Gxn(e){if(bP(e)){throw new Error("Assertion Failed: argument is undefined or null")}return e}a(Gxn,"assertIsDefined");Tr.assertIsDefined=Gxn;function Hxn(...e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(bP(n)){throw new Error(`Assertion Failed: argument at index ${r} is undefined or null`)}t.push(n)}return t}a(Hxn,"assertAllDefined");Tr.assertAllDefined=Hxn;var Vxn=Object.prototype.hasOwnProperty;function zxn(e){if(!Cxt(e)){return false}for(const t in e){if(Vxn.call(e,t)){return false}}return true}a(zxn,"isEmptyObject");Tr.isEmptyObject=zxn;function XRe(e){return typeof e==="function"}a(XRe,"isFunction");Tr.isFunction=XRe;function Kxn(...e){return e.length>0&&e.every(XRe)}a(Kxn,"areFunctions");Tr.areFunctions=Kxn;function Wxn(e,t){const r=Math.min(e.length,t.length);for(let n=0;n<r;n++){Txt(e[n],t[n])}}a(Wxn,"validateConstraints");Tr.validateConstraints=Wxn;function Txt(e,t){if(XJ(t)){if(typeof e!==t){throw new Error(`argument does not match constraint: typeof ${t}`)}}else if(XRe(t)){try{if(e instanceof t){return}}catch{}if(!bP(e)&&e.constructor===t){return}if(t.length===1&&t.call(void 0,e)===true){return}throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}a(Txt,"validateConstraint");Tr.validateConstraint=Txt;function Yxn(e){return e===null?void 0:e}a(Yxn,"withNullAsUndefined");Tr.withNullAsUndefined=Yxn;function Xxn(e){return typeof e==="undefined"?null:e}a(Xxn,"withUndefinedAsNull");Tr.withUndefinedAsNull=Xxn;var $F=class extends Error{static{a(this,"ValidationError")}constructor(t){super(t)}};Tr.ValidationError=$F;var jF=class extends $F{static{a(this,"ArgumentUndefinedError")}constructor(t){super(`The argument '${t}' is undefined.`)}};Tr.ArgumentUndefinedError=jF;var GF=class extends $F{static{a(this,"ArgumentTypeError")}constructor(t,r){super(`The argument '${t}' must be of type '${r}'.`)}};Tr.ArgumentTypeError=GF;function Jxn(e,t){if(YRe(e)){throw new jF(t)}return true}a(Jxn,"throwIfUndefined");Tr.throwIfUndefined=Jxn;function JRe(e,t){if(bP(e)){throw new jF(t)}}a(JRe,"throwIfUndefinedOrNull");Tr.throwIfUndefinedOrNull=JRe;function Qxn(e,t){JRe(e,t);if(!XJ(e)){throw new GF(t,"string")}return true}a(Qxn,"throwIfNotString");Tr.throwIfNotString=Qxn;function Zxn(e,t){JRe(e,t);if(!wxt(e)){throw new GF(t,"number")}return true}a(Zxn,"throwIfNotNumber");Tr.throwIfNotNumber=Zxn});var hn=y(mt=>{"use strict";var Rxt=mt&&mt.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var eRn=mt&&mt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var JJ=mt&&mt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Rxt(t,e,r)}eRn(t,e);return t};var zE=mt&&mt.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))Rxt(t,e,r)};Object.defineProperty(mt,"__esModule",{value:true});mt.getRequiredEnvVar=mt.env=mt.EnvironmentalVariableRequiredError=mt.xfs=mt.RouteValidator=mt.JsonValidator=mt.MeteringService=mt.TenantService=mt.OpenFGAService=mt.DevApiService=mt.getContentApiStorageTarballPath=mt.contentApiTarballFileName=mt.ContentApiService=mt.AuthApiService=mt.getServiceAccountIdToken=mt.createApiKeyServiceClient=mt.ApiKeyService=mt.RouteVersions=mt.startsWithReservedKeyword=mt.logger=mt.createNewLogger=mt.graphQL=mt.CloudStorage=mt.fly=mt.ApiServer=mt.featureFlagsPlugin=mt.ensureZuploUserPlugin=mt.ensureZuploAdminPlugin=mt.apiKeyAuthPlugin=mt.errorHandler=mt.DeploymentLogState=mt.signString=mt.FeatureFlags=mt.VALID_COMPATIBILITY_DATES=mt.DEFAULT_COMPATIBILITY_DATE=mt.COMPATIBILITY_FLAG_MAPPINGS=mt.WARNING_STATUS=mt.WARNING_SEVERITY=mt.GOOD_STATUS=mt.FAILURE_STATUS=mt.ERROR_SEVERITY=mt.BuildIssueError=mt.hasBlockedNotifications=mt.getDefaultFlags=mt.getBuildFlagsForDeployment=mt.CommonAuth=void 0;var QRe=JJ(Jd());mt.env=QRe.default;Object.defineProperty(mt,"EnvironmentalVariableRequiredError",{enumerable:true,get:function(){return QRe.EnvironmentalVariableRequiredError}});Object.defineProperty(mt,"getRequiredEnvVar",{enumerable:true,get:function(){return QRe.getRequiredEnvVar}});zE(Hc(),mt);var tRn=$ce();Object.defineProperty(mt,"CommonAuth",{enumerable:true,get:function(){return tRn.CommonAuth}});var ZRe=HGe();Object.defineProperty(mt,"getBuildFlagsForDeployment",{enumerable:true,get:function(){return ZRe.getBuildFlagsForDeployment}});Object.defineProperty(mt,"getDefaultFlags",{enumerable:true,get:function(){return ZRe.getDefaultFlags}});Object.defineProperty(mt,"hasBlockedNotifications",{enumerable:true,get:function(){return ZRe.hasBlockedNotifications}});var SP=VGe();Object.defineProperty(mt,"BuildIssueError",{enumerable:true,get:function(){return SP.BuildIssueError}});Object.defineProperty(mt,"ERROR_SEVERITY",{enumerable:true,get:function(){return SP.ERROR_SEVERITY}});Object.defineProperty(mt,"FAILURE_STATUS",{enumerable:true,get:function(){return SP.FAILURE_STATUS}});Object.defineProperty(mt,"GOOD_STATUS",{enumerable:true,get:function(){return SP.GOOD_STATUS}});Object.defineProperty(mt,"WARNING_SEVERITY",{enumerable:true,get:function(){return SP.WARNING_SEVERITY}});Object.defineProperty(mt,"WARNING_STATUS",{enumerable:true,get:function(){return SP.WARNING_STATUS}});var rRn=zGe();Object.defineProperty(mt,"COMPATIBILITY_FLAG_MAPPINGS",{enumerable:true,get:function(){return rRn.COMPATIBILITY_FLAG_MAPPINGS}});var Oxt=YGe();Object.defineProperty(mt,"DEFAULT_COMPATIBILITY_DATE",{enumerable:true,get:function(){return Oxt.DEFAULT_COMPATIBILITY_DATE}});Object.defineProperty(mt,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return Oxt.VALID_COMPATIBILITY_DATES}});var nRn=jce();Object.defineProperty(mt,"FeatureFlags",{enumerable:true,get:function(){return nRn.FeatureFlags}});var iRn=XGe();Object.defineProperty(mt,"signString",{enumerable:true,get:function(){return iRn.signString}});zE(JGe(),mt);var sRn=Vce();Object.defineProperty(mt,"DeploymentLogState",{enumerable:true,get:function(){return sRn.DeploymentLogState}});zE(sHe(),mt);zE(zce(),mt);var aRn=Kce();Object.defineProperty(mt,"errorHandler",{enumerable:true,get:function(){return aRn.errorHandler}});var QJ=Qce();Object.defineProperty(mt,"apiKeyAuthPlugin",{enumerable:true,get:function(){return QJ.apiKeyAuthPlugin}});Object.defineProperty(mt,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return QJ.ensureZuploAdminPlugin}});Object.defineProperty(mt,"ensureZuploUserPlugin",{enumerable:true,get:function(){return QJ.ensureZuploUserPlugin}});Object.defineProperty(mt,"featureFlagsPlugin",{enumerable:true,get:function(){return QJ.featureFlagsPlugin}});var oRn=bft();Object.defineProperty(mt,"ApiServer",{enumerable:true,get:function(){return oRn.ApiServer}});mt.fly=JJ(Cft());mt.CloudStorage=JJ(lvt());var uRn=cvt();Object.defineProperty(mt,"graphQL",{enumerable:true,get:function(){return uRn.graphQL}});zE(I2t(),mt);var Pxt=lEe();Object.defineProperty(mt,"createNewLogger",{enumerable:true,get:function(){return Pxt.createNewLogger}});Object.defineProperty(mt,"logger",{enumerable:true,get:function(){return Pxt.logger}});var lRn=ZCe();Object.defineProperty(mt,"startsWithReservedKeyword",{enumerable:true,get:function(){return lRn.startsWithReservedKeyword}});var cRn=k2t();Object.defineProperty(mt,"RouteVersions",{enumerable:true,get:function(){return cRn.RouteVersions}});var Nxt=nwt();Object.defineProperty(mt,"ApiKeyService",{enumerable:true,get:function(){return Nxt.ApiKeyService}});Object.defineProperty(mt,"createApiKeyServiceClient",{enumerable:true,get:function(){return Nxt.createApiKeyServiceClient}});var dRn=XO();Object.defineProperty(mt,"getServiceAccountIdToken",{enumerable:true,get:function(){return dRn.getServiceAccountIdToken}});var pRn=swt();Object.defineProperty(mt,"AuthApiService",{enumerable:true,get:function(){return pRn.AuthApiService}});var eOe=lwt();Object.defineProperty(mt,"ContentApiService",{enumerable:true,get:function(){return eOe.ContentApiService}});Object.defineProperty(mt,"contentApiTarballFileName",{enumerable:true,get:function(){return eOe.contentApiTarballFileName}});Object.defineProperty(mt,"getContentApiStorageTarballPath",{enumerable:true,get:function(){return eOe.getContentApiStorageTarballPath}});var fRn=pwt();Object.defineProperty(mt,"DevApiService",{enumerable:true,get:function(){return fRn.DevApiService}});var mRn=fxt();Object.defineProperty(mt,"OpenFGAService",{enumerable:true,get:function(){return mRn.OpenFGAService}});var hRn=gxt();Object.defineProperty(mt,"TenantService",{enumerable:true,get:function(){return hRn.TenantService}});var gRn=_xt();Object.defineProperty(mt,"MeteringService",{enumerable:true,get:function(){return gRn.MeteringService}});zE(vxt(),mt);zE(Axt(),mt);zE(xxt(),mt);var yRn=$Y();Object.defineProperty(mt,"JsonValidator",{enumerable:true,get:function(){return yRn.JsonValidator}});var _Rn=awe();Object.defineProperty(mt,"RouteValidator",{enumerable:true,get:function(){return _Rn.RouteValidator}});mt.xfs=JJ(nAe())});var Fn=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:true});Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.NODE_BUILD_OUTPUT_FILE=Vt.NODE_ENTRY_NAME=Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE=Vt.WORKER_BUILD_OUTPUT_FILE=Vt.WORKER_ENTRY_NAME=Vt.ENV_MODULE_FILE=Vt.ZUPLO_SYSTEM_ENV_FILE=Vt.ENV_FILE=Vt.CACHE_DIRECTORY=Vt.BUILD_CACHE_FILE=Vt.ZUPLO_FILE_SCHEMA=Vt.NON_STANDARD_NODE_ENV=Vt.GENERATED_TYPES_DIR_NAME=Vt.GENERATED_BUILD_JSON_FILE=Vt.GENERATED_SOURCE_DIR_NAME=Vt.BUILD_OUTPUT_DIR=Vt.DEFAULT_TEST_FILE=Vt.DEFAULT_DOCS_MARKDOWN_FILE=Vt.DOCS_THEME_FILE=Vt.DOCS_SIDEBAR_FILE=Vt.ZUPLO_FALLBACK_JSON_FILE=Vt.ZUPLO_PREFERRED_JSON_FILE=Vt.DEFAULT_MODULE_FILE=Vt.OPEN_API_FILE_SUFFIX=Vt.OPEN_API_CONFIG_FILE=Vt.OPEN_API_UNVERSIONED_DIR_NAME=Vt.DEV_PORTAL_OUTPUT_DIR_NAME=Vt.DEV_PORTAL_CONFIG_FILE=Vt.POLICIES_CONFIG_FILE=Vt.ROUTES_OAS_CONFIG_FILE=Vt.LOCAL_API_KEYS_CONFIG_FILE=Vt.DEV_PORTAL_V4_PATH=Vt.USER_DOCS_DIR_NAME=Vt.USER_SCHEMAS_DIR_NAME=Vt.USER_CONFIG_DIR_NAME=Vt.USER_TEST_DIR_NAME=Vt.USER_MODULES_DIR_NAME=void 0;Vt.USER_MODULES_DIR_NAME="modules";Vt.USER_TEST_DIR_NAME="tests";Vt.USER_CONFIG_DIR_NAME="config";Vt.USER_SCHEMAS_DIR_NAME="schemas";Vt.USER_DOCS_DIR_NAME="docs";Vt.DEV_PORTAL_V4_PATH="v4";Vt.LOCAL_API_KEYS_CONFIG_FILE="api-keys.json";Vt.ROUTES_OAS_CONFIG_FILE="routes.oas.json";Vt.POLICIES_CONFIG_FILE="policies.json";Vt.DEV_PORTAL_CONFIG_FILE="dev-portal.json";Vt.DEV_PORTAL_OUTPUT_DIR_NAME="dev-portal";Vt.OPEN_API_UNVERSIONED_DIR_NAME="unversioned";Vt.OPEN_API_CONFIG_FILE="open-api.json";Vt.OPEN_API_FILE_SUFFIX=".oas.json";Vt.DEFAULT_MODULE_FILE="hello-world.ts";Vt.ZUPLO_PREFERRED_JSON_FILE="zuplo.jsonc";Vt.ZUPLO_FALLBACK_JSON_FILE="zuplo.json";Vt.DOCS_SIDEBAR_FILE="sidebar.json";Vt.DOCS_THEME_FILE="theme.css";Vt.DEFAULT_DOCS_MARKDOWN_FILE="index.md";Vt.DEFAULT_TEST_FILE="hello-world.json";Vt.BUILD_OUTPUT_DIR="dist";Vt.GENERATED_SOURCE_DIR_NAME=".zuplo";Vt.GENERATED_BUILD_JSON_FILE="build.json";Vt.GENERATED_TYPES_DIR_NAME="types";Vt.NON_STANDARD_NODE_ENV=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against.`;Vt.ZUPLO_FILE_SCHEMA="zuplo";Vt.BUILD_CACHE_FILE="buildstate.json";Vt.CACHE_DIRECTORY=".cache";Vt.ENV_FILE=".env";Vt.ZUPLO_SYSTEM_ENV_FILE=".env.zuplo";Vt.ENV_MODULE_FILE="environment.ts";Vt.WORKER_ENTRY_NAME="worker.ts";Vt.WORKER_BUILD_OUTPUT_FILE="worker.js";Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE="worker.js.map";Vt.NODE_ENTRY_NAME="server.ts";Vt.NODE_BUILD_OUTPUT_FILE="main.js";Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.OPEN_API_CONFIG_FILE});var ru=y(AP=>{"use strict";Object.defineProperty(AP,"__esModule",{value:true});AP.runPlugins=AP.PluginResult=void 0;var tOe=class{static{a(this,"PluginResult")}errors=[];warnings=[];constructor(t){if(t){this.errors.push(t)}}};AP.PluginResult=tOe;async function vRn(e,t){const r=[];const n=[];const i=new Map;for await(const s of e){try{const o=await s(t,i);n.push(...o.errors.map(u=>{if(u.pluginName===""){u.pluginName=s.name}return u}));r.push(...o.warnings);if(o.errors.length>0){break}}catch(o){n.push(o);break}}return{errors:n,warnings:r}}a(vRn,"runPlugins");AP.runPlugins=vRn});var xs=y(nOe=>{"use strict";Object.defineProperty(nOe,"__esModule",{value:true});var ZJ=require("perf_hooks");var rOe=[];async function ERn(e,t){const r=ZJ.performance.timerify(t);const n=new ZJ.PerformanceObserver(i=>{const s=i.getEntries()[0];rOe.push({name:e,duration:s.duration});n.disconnect()});n.observe({entryTypes:["function"]});return r()}a(ERn,"timeFn");var bRn={mark:e=>{ZJ.performance.mark(e)},measure:(e,t,r)=>{ZJ.performance.measure(e,t,r)},timeFn:ERn,report:()=>{if(rOe.length>0){console.table(rOe)}}};nOe.default=bRn});var iOe=y(CP=>{"use strict";var SRn=CP&&CP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(CP,"__esModule",{value:true});CP.getZuploConfig=void 0;var HF=hn();var ARn=require("jsonc-parser");var CRn=require("fs/promises");var Ixt=SRn(require("path"));var kxt=Fn();async function wRn(e){const t=Ixt.default.join(e,kxt.ZUPLO_PREFERRED_JSON_FILE);const r=Ixt.default.join(e,kxt.ZUPLO_FALLBACK_JSON_FILE);let n=false;let i=t;if(await HF.xfs.fileExists(t)){n=true;i=t}else if(await HF.xfs.fileExists(r)){n=true;i=r}const s={};if(n){const o=await(0,CRn.readFile)(i,"utf-8");const u=[];const l=(0,ARn.parse)(o,u);if(typeof l!=="object"){const c={message:`Invalid zuplo.json file`,detail:`The zuplo.json file is not a valid JSON object`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("version"in l&&l.version!==1){const c={message:`Invalid version set in zuplo.config`,detail:`version in zuplo.json must be set to 1`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("compatibilityDate"in l&&HF.VALID_COMPATIBILITY_DATES&&typeof l.compatibilityDate==="string"){if(!HF.VALID_COMPATIBILITY_DATES.includes(l.compatibilityDate)){const c={message:`Invalid compatibilityDate set in zuplo.config`,detail:`compatibilityDate was set to ${l.compatibilityDate}. Valid compatibility dates are ${HF.VALID_COMPATIBILITY_DATES.join(", ")}`,pluginName:"buildData",severity:"error"};return{errors:[c]}}s.compatibilityDate=l.compatibilityDate}}return{config:s,errors:[]}}a(wRn,"getZuploConfig");CP.getZuploConfig=wRn});var VF=y(eQ=>{"use strict";Object.defineProperty(eQ,"__esModule",{value:true});eQ.TargetPlatform=void 0;var Dxt;(function(e){e["Worker"]="worker"})(Dxt||(eQ.TargetPlatform=Dxt={}))});var Fxt=y(wP=>{"use strict";var Lxt=wP&&wP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(wP,"__esModule",{value:true});wP.cleanOutput=void 0;var TRn=Lxt(require("fs/promises"));var xRn=Lxt(xs());var RRn=a(async function({outputDirectory:e,systemDirectory:t,logger:r}){return xRn.default.timeFn("Cleaning output",async()=>{r.debug("Cleaning output");const n=[e,t];for await(const i of n){try{await TRn.default.rm(i,{recursive:true,force:true})}catch(s){r.error(s)}}return{warnings:[],errors:[]}})},"cleanOutput");wP.cleanOutput=RRn});var Mxt=y(TP=>{"use strict";var Bxt=TP&&TP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(TP,"__esModule",{value:true});TP.createSystemDir=void 0;var ORn=hn();var PRn=Bxt(require("fs/promises"));var NRn=Bxt(xs());var IRn=a(async function({systemDirectory:e,logger:t}){return NRn.default.timeFn("Creating system directory",async()=>{t.debug("Creating system directory");try{if(await ORn.xfs.dirExists(e)){t.debug("System directory already exists, skipping");return{warnings:[],errors:[]}}await PRn.default.mkdir(e)}catch(r){t.error(r);return{warnings:[],errors:[]}}return{warnings:[],errors:[]}})},"createSystemDir");TP.createSystemDir=IRn});var qxt=y(xP=>{"use strict";var kRn=xP&&xP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(xP,"__esModule",{value:true});xP.checkForDeprecations=void 0;var DRn=kRn(xs());var LRn=a(async function({logger:e}){return DRn.default.timeFn("Checking for breaking changes",async()=>{e.debug("Checking for breaking changes");return{warnings:[],errors:[]}})},"checkForDeprecations");xP.checkForDeprecations=LRn});var Uxt=y(sOe=>{var aC=require("path");var WE=process.platform==="win32";var KE=require("fs");var FRn=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function BRn(){var e;if(FRn){var t=new Error;e=r}else e=n;return e;function r(i){if(i){t.message=i.message;i=t;n(i)}}a(r,"debugCallback");function n(i){if(i){if(process.throwDeprecation)throw i;else if(!process.noDeprecation){var s="fs: missing callback "+(i.stack||i.message);if(process.traceDeprecation)console.trace(s);else console.error(s)}}}a(n,"missingCallback")}a(BRn,"rethrow");function MRn(e){return typeof e==="function"?e:BRn()}a(MRn,"maybeCallback");var P5s=aC.normalize;if(WE){Ry=/(.*?)(?:[\/\\]+|$)/g}else{Ry=/(.*?)(?:[\/]+|$)/g}var Ry;if(WE){zF=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{zF=/^[\/]*/}var zF;sOe.realpathSync=a(function e(t,r){t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var n=t,i={},s={};var o;var u;var l;var c;d();function d(){var _=zF.exec(t);o=_[0].length;u=_[0];l=_[0];c="";if(WE&&!s[l]){KE.lstatSync(l);s[l]=true}}a(d,"start");while(o<t.length){Ry.lastIndex=o;var p=Ry.exec(t);c=u;u+=p[0];l=c+p[1];o=Ry.lastIndex;if(s[l]||r&&r[l]===l){continue}var f;if(r&&Object.prototype.hasOwnProperty.call(r,l)){f=r[l]}else{var m=KE.lstatSync(l);if(!m.isSymbolicLink()){s[l]=true;if(r)r[l]=l;continue}var h=null;if(!WE){var g=m.dev.toString(32)+":"+m.ino.toString(32);if(i.hasOwnProperty(g)){h=i[g]}}if(h===null){KE.statSync(l);h=KE.readlinkSync(l)}f=aC.resolve(c,h);if(r)r[l]=f;if(!WE)i[g]=h}t=aC.resolve(f,t.slice(o));d()}if(r)r[n]=t;return t},"realpathSync");sOe.realpath=a(function e(t,r,n){if(typeof n!=="function"){n=MRn(r);r=null}t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(n.bind(null,null,r[t]))}var i=t,s={},o={};var u;var l;var c;var d;p();function p(){var _=zF.exec(t);u=_[0].length;l=_[0];c=_[0];d="";if(WE&&!o[c]){KE.lstat(c,function(v){if(v)return n(v);o[c]=true;f()})}else{process.nextTick(f)}}a(p,"start");function f(){if(u>=t.length){if(r)r[i]=t;return n(null,t)}Ry.lastIndex=u;var _=Ry.exec(t);d=l;l+=_[0];c=d+_[1];u=Ry.lastIndex;if(o[c]||r&&r[c]===c){return process.nextTick(f)}if(r&&Object.prototype.hasOwnProperty.call(r,c)){return g(r[c])}return KE.lstat(c,m)}a(f,"LOOP");function m(_,v){if(_)return n(_);if(!v.isSymbolicLink()){o[c]=true;if(r)r[c]=c;return process.nextTick(f)}if(!WE){var S=v.dev.toString(32)+":"+v.ino.toString(32);if(s.hasOwnProperty(S)){return h(null,s[S],c)}}KE.stat(c,function(E){if(E)return n(E);KE.readlink(c,function(b,A){if(!WE)s[S]=A;h(b,A)})})}a(m,"gotStat");function h(_,v,S){if(_)return n(_);var E=aC.resolve(d,v);if(r)r[S]=E;g(E)}a(h,"gotTarget");function g(_){t=aC.resolve(_,t.slice(u));p()}a(g,"gotResolvedLink")},"realpath")});var lOe=y((k5s,Hxt)=>{Hxt.exports=YE;YE.realpath=YE;YE.sync=uOe;YE.realpathSync=uOe;YE.monkeypatch=URn;YE.unmonkeypatch=$Rn;var RP=require("fs");var aOe=RP.realpath;var oOe=RP.realpathSync;var qRn=process.version;var $xt=/^v[0-5]\./.test(qRn);var jxt=Uxt();function Gxt(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}a(Gxt,"newError");function YE(e,t,r){if($xt){return aOe(e,t,r)}if(typeof t==="function"){r=t;t=null}aOe(e,t,function(n,i){if(Gxt(n)){jxt.realpath(e,t,r)}else{r(n,i)}})}a(YE,"realpath");function uOe(e,t){if($xt){return oOe(e,t)}try{return oOe(e,t)}catch(r){if(Gxt(r)){return jxt.realpathSync(e,t)}else{throw r}}}a(uOe,"realpathSync");function URn(){RP.realpath=YE;RP.realpathSync=uOe}a(URn,"monkeypatch");function $Rn(){RP.realpath=aOe;RP.realpathSync=oOe}a($Rn,"unmonkeypatch")});var zxt=y((L5s,Vxt)=>{Vxt.exports=function(e,t){var r=[];for(var n=0;n<e.length;n++){var i=t(e[n],n);if(jRn(i))r.push.apply(r,i);else r.push(i)}return r};var jRn=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}});var cOe=y((F5s,Xxt)=>{"use strict";Xxt.exports=Wxt;function Wxt(e,t,r){if(e instanceof RegExp)e=Kxt(e,r);if(t instanceof RegExp)t=Kxt(t,r);var n=Yxt(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}a(Wxt,"balanced");function Kxt(e,t){var r=t.match(e);return r?r[0]:null}a(Kxt,"maybeMatch");Wxt.range=Yxt;function Yxt(e,t,r){var n,i,s,o,u;var l=r.indexOf(e);var c=r.indexOf(t,l+1);var d=l;if(l>=0&&c>0){if(e===t){return[l,c]}n=[];s=r.length;while(d>=0&&!u){if(d==l){n.push(d);l=r.indexOf(e,d+1)}else if(n.length==1){u=[n.pop(),c]}else{i=n.pop();if(i<s){s=i;o=c}c=r.indexOf(t,d+1)}d=l<c&&l>=0?l:c}if(n.length){u=[s,o]}}return u}a(Yxt,"range")});var iRt=y((M5s,nRt)=>{var GRn=zxt();var Jxt=cOe();nRt.exports=zRn;var Qxt="\0SLASH"+Math.random()+"\0";var Zxt="\0OPEN"+Math.random()+"\0";var pOe="\0CLOSE"+Math.random()+"\0";var eRt="\0COMMA"+Math.random()+"\0";var tRt="\0PERIOD"+Math.random()+"\0";function dOe(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}a(dOe,"numeric");function HRn(e){return e.split("\\\\").join(Qxt).split("\\{").join(Zxt).split("\\}").join(pOe).split("\\,").join(eRt).split("\\.").join(tRt)}a(HRn,"escapeBraces");function VRn(e){return e.split(Qxt).join("\\").split(Zxt).join("{").split(pOe).join("}").split(eRt).join(",").split(tRt).join(".")}a(VRn,"unescapeBraces");function rRt(e){if(!e)return[""];var t=[];var r=Jxt("{","}",e);if(!r)return e.split(",");var n=r.pre;var i=r.body;var s=r.post;var o=n.split(",");o[o.length-1]+="{"+i+"}";var u=rRt(s);if(s.length){o[o.length-1]+=u.shift();o.push.apply(o,u)}t.push.apply(t,o);return t}a(rRt,"parseCommaParts");function zRn(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return OP(HRn(e),true).map(VRn)}a(zRn,"expandTop");function KRn(e){return"{"+e+"}"}a(KRn,"embrace");function WRn(e){return/^-?0\d/.test(e)}a(WRn,"isPadded");function YRn(e,t){return e<=t}a(YRn,"lte");function XRn(e,t){return e>=t}a(XRn,"gte");function OP(e,t){var r=[];var n=Jxt("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var o=i||s;var u=n.body.indexOf(",")>=0;if(!o&&!u){if(n.post.match(/,.*\}/)){e=n.pre+"{"+n.body+pOe+n.post;return OP(e)}return[e]}var l;if(o){l=n.body.split(/\.\./)}else{l=rRt(n.body);if(l.length===1){l=OP(l[0],false).map(KRn);if(l.length===1){var d=n.post.length?OP(n.post,false):[""];return d.map(function(I){return n.pre+l[0]+I})}}}var c=n.pre;var d=n.post.length?OP(n.post,false):[""];var p;if(o){var f=dOe(l[0]);var m=dOe(l[1]);var h=Math.max(l[0].length,l[1].length);var g=l.length==3?Math.abs(dOe(l[2])):1;var _=YRn;var v=m<f;if(v){g*=-1;_=XRn}var S=l.some(WRn);p=[];for(var E=f;_(E,m);E+=g){var b;if(s){b=String.fromCharCode(E);if(b==="\\")b=""}else{b=String(E);if(S){var A=h-b.length;if(A>0){var C=new Array(A+1).join("0");if(E<0)b="-"+C+b.slice(1);else b=C+b}}}p.push(b)}}else{p=GRn(l,function(R){return OP(R,false)})}for(var T=0;T<p.length;T++){for(var O=0;O<d.length;O++){var P=c+p[T]+d[O];if(!t||o||P)r.push(P)}}return r}a(OP,"expand")});var nQ=y((U5s,lRt)=>{lRt.exports=pp;pp.Minimatch=ul;var KF=function(){try{return require("path")}catch(e){}}()||{sep:"/"};pp.sep=KF.sep;var hOe=pp.GLOBSTAR=ul.GLOBSTAR={};var JRn=iRt();var sRt={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var fOe="[^/]";var mOe=fOe+"*?";var QRn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var ZRn="(?:(?!(?:\\/|^)\\.).)*?";var aRt=eOn("().*{}+?[]^$\\!");function eOn(e){return e.split("").reduce(function(t,r){t[r]=true;return t},{})}a(eOn,"charSet");var oRt=/\/+/;pp.filter=tOn;function tOn(e,t){t=t||{};return function(r,n,i){return pp(r,e,t)}}a(tOn,"filter");function XE(e,t){t=t||{};var r={};Object.keys(e).forEach(function(n){r[n]=e[n]});Object.keys(t).forEach(function(n){r[n]=t[n]});return r}a(XE,"ext");pp.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return pp}var t=pp;var r=a(function n(i,s,o){return t(i,s,XE(e,o))},"minimatch");r.Minimatch=a(function n(i,s){return new t.Minimatch(i,XE(e,s))},"Minimatch");r.Minimatch.defaults=a(function n(i){return t.defaults(XE(e,i)).Minimatch},"defaults");r.filter=a(function n(i,s){return t.filter(i,XE(e,s))},"filter");r.defaults=a(function n(i){return t.defaults(XE(e,i))},"defaults");r.makeRe=a(function n(i,s){return t.makeRe(i,XE(e,s))},"makeRe");r.braceExpand=a(function n(i,s){return t.braceExpand(i,XE(e,s))},"braceExpand");r.match=function(n,i,s){return t.match(n,i,XE(e,s))};return r};ul.defaults=function(e){return pp.defaults(e).Minimatch};function pp(e,t,r){rQ(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new ul(t,r).match(e)}a(pp,"minimatch");function ul(e,t){if(!(this instanceof ul)){return new ul(e,t)}rQ(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&KF.sep!=="/"){e=e.split(KF.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}a(ul,"Minimatch");ul.prototype.debug=function(){};ul.prototype.make=rOn;function rOn(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=a(function n(){console.error.apply(console,arguments)},"debug");this.debug(this.pattern,r);r=this.globParts=r.map(function(n){return n.split(oRt)});this.debug(this.pattern,r);r=r.map(function(n,i,s){return n.map(this.parse,this)},this);this.debug(this.pattern,r);r=r.filter(function(n){return n.indexOf(false)===-1});this.debug(this.pattern,r);this.set=r}a(rOn,"make");ul.prototype.parseNegate=nOn;function nOn(){var e=this.pattern;var t=false;var r=this.options;var n=0;if(r.nonegate)return;for(var i=0,s=e.length;i<s&&e.charAt(i)==="!";i++){t=!t;n++}if(n)this.pattern=e.substr(n);this.negate=t}a(nOn,"parseNegate");pp.braceExpand=function(e,t){return uRt(e,t)};ul.prototype.braceExpand=uRt;function uRt(e,t){if(!t){if(this instanceof ul){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;rQ(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return JRn(e)}a(uRt,"braceExpand");var iOn=1024*64;var rQ=a(function(e){if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>iOn){throw new TypeError("pattern is too long")}},"assertValidPattern");ul.prototype.parse=sOn;var tQ={};function sOn(e,t){rQ(e);var r=this.options;if(e==="**"){if(!r.noglobstar)return hOe;else e="*"}if(e==="")return"";var n="";var i=!!r.nocase;var s=false;var o=[];var u=[];var l;var c=false;var d=-1;var p=-1;var f=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var m=this;function h(){if(l){switch(l){case"*":n+=mOe;i=true;break;case"?":n+=fOe;i=true;break;default:n+="\\"+l;break}m.debug("clearStateChar %j %j",l,n);l=false}}a(h,"clearStateChar");for(var g=0,_=e.length,v;g<_&&(v=e.charAt(g));g++){this.debug("%s %s %s %j",e,g,n,v);if(s&&aRt[v]){n+="\\"+v;s=false;continue}switch(v){case"/":{return false}case"\\":h();s=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",e,g,n,v);if(c){this.debug(" in class");if(v==="!"&&g===p+1)v="^";n+=v;continue}m.debug("call clearStateChar %j",l);h();l=v;if(r.noext)h();continue;case"(":if(c){n+="(";continue}if(!l){n+="\\(";continue}o.push({type:l,start:g-1,reStart:n.length,open:sRt[l].open,close:sRt[l].close});n+=l==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",l,n);l=false;continue;case")":if(c||!o.length){n+="\\)";continue}h();i=true;var S=o.pop();n+=S.close;if(S.type==="!"){u.push(S)}S.reEnd=n.length;continue;case"|":if(c||!o.length||s){n+="\\|";s=false;continue}h();n+="|";continue;case"[":h();if(c){n+="\\"+v;continue}c=true;p=g;d=n.length;n+=v;continue;case"]":if(g===p+1||!c){n+="\\"+v;s=false;continue}var E=e.substring(p+1,g);try{RegExp("["+E+"]")}catch(M){var b=this.parse(E,tQ);n=n.substr(0,d)+"\\["+b[0]+"\\]";i=i||b[1];c=false;continue}i=true;c=false;n+=v;continue;default:h();if(s){s=false}else if(aRt[v]&&!(v==="^"&&c)){n+="\\"}n+=v}}if(c){E=e.substr(p+1);b=this.parse(E,tQ);n=n.substr(0,d)+"\\["+b[0];i=i||b[1]}for(S=o.pop();S;S=o.pop()){var A=n.slice(S.reStart+S.open.length);this.debug("setting tail",n,S);A=A.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(M,Q,fe){if(!fe){fe="\\"}return Q+Q+fe+"|"});this.debug("tail=%j\n %s",A,A,S,n);var C=S.type==="*"?mOe:S.type==="?"?fOe:"\\"+S.type;i=true;n=n.slice(0,S.reStart)+C+"\\("+A}h();if(s){n+="\\\\"}var T=false;switch(n.charAt(0)){case"[":case".":case"(":T=true}for(var O=u.length-1;O>-1;O--){var P=u[O];var R=n.slice(0,P.reStart);var I=n.slice(P.reStart,P.reEnd-8);var D=n.slice(P.reEnd-8,P.reEnd);var U=n.slice(P.reEnd);D+=U;var te=R.split("(").length-1;var ve=U;for(g=0;g<te;g++){ve=ve.replace(/\)[+*?]?/,"")}U=ve;var me="";if(U===""&&t!==tQ){me="$"}var he=R+I+U+me+D;n=he}if(n!==""&&i){n="(?=.)"+n}if(T){n=f+n}if(t===tQ){return[n,i]}if(!i){return oOn(e)}var Fe=r.nocase?"i":"";try{var Oe=new RegExp("^"+n+"$",Fe)}catch(M){return new RegExp("$.")}Oe._glob=e;Oe._src=n;return Oe}a(sOn,"parse");pp.makeRe=function(e,t){return new ul(e,t||{}).makeRe()};ul.prototype.makeRe=aOn;function aOn(){if(this.regexp||this.regexp===false)return this.regexp;var e=this.set;if(!e.length){this.regexp=false;return this.regexp}var t=this.options;var r=t.noglobstar?mOe:t.dot?QRn:ZRn;var n=t.nocase?"i":"";var i=e.map(function(s){return s.map(function(o){return o===hOe?r:typeof o==="string"?uOn(o):o._src}).join("\\/")}).join("|");i="^(?:"+i+")$";if(this.negate)i="^(?!"+i+").*$";try{this.regexp=new RegExp(i,n)}catch(s){this.regexp=false}return this.regexp}a(aOn,"makeRe");pp.match=function(e,t,r){r=r||{};var n=new ul(t,r);e=e.filter(function(i){return n.match(i)});if(n.options.nonull&&!e.length){e.push(t)}return e};ul.prototype.match=a(function e(t,r){if(typeof r==="undefined")r=this.partial;this.debug("match",t,this.pattern);if(this.comment)return false;if(this.empty)return t==="";if(t==="/"&&r)return true;var n=this.options;if(KF.sep!=="/"){t=t.split(KF.sep).join("/")}t=t.split(oRt);this.debug(this.pattern,"split",t);var i=this.set;this.debug(this.pattern,"set",i);var s;var o;for(o=t.length-1;o>=0;o--){s=t[o];if(s)break}for(o=0;o<i.length;o++){var u=i[o];var l=t;if(n.matchBase&&u.length===1){l=[s]}var c=this.matchOne(l,u,r);if(c){if(n.flipNegate)return true;return!this.negate}}if(n.flipNegate)return false;return this.negate},"match");ul.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{"this":this,file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var i=0,s=0,o=e.length,u=t.length;i<o&&s<u;i++,s++){this.debug("matchOne loop");var l=t[s];var c=e[i];this.debug(t,l,c);if(l===false)return false;if(l===hOe){this.debug("GLOBSTAR",[t,l,c]);var d=i;var p=s+1;if(p===u){this.debug("** at the end");for(;i<o;i++){if(e[i]==="."||e[i]===".."||!n.dot&&e[i].charAt(0)===".")return false}return true}while(d<o){var f=e[d];this.debug("\nglobstar while",e,d,t,p,f);if(this.matchOne(e.slice(d),t.slice(p),r)){this.debug("globstar found match!",d,o,f);return true}else{if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue");d++}}if(r){this.debug("\n>>> no match, partial?",e,d,t,p);if(d===o)return true}return false}var m;if(typeof l==="string"){m=c===l;this.debug("string match",l,c,m)}else{m=c.match(l);this.debug("pattern match",l,c,m)}if(!m)return false}if(i===o&&s===u){return true}else if(i===o){return r}else if(s===u){return i===o-1&&e[i]===""}throw new Error("wtf?")};function oOn(e){return e.replace(/\\(.)/g,"$1")}a(oOn,"globUnescape");function uOn(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}a(uOn,"regExpEscape")});var sQ=y((j5s,iQ)=>{"use strict";function cRt(e){return e.charAt(0)==="/"}a(cRt,"posix");function dRt(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var n=r[1]||"";var i=Boolean(n&&n.charAt(1)!==":");return Boolean(r[2]||i)}a(dRt,"win32");iQ.exports=process.platform==="win32"?dRt:cRt;iQ.exports.posix=cRt;iQ.exports.win32=dRt});var yOe=y(JE=>{JE.setopts=mOn;JE.ownProp=pRt;JE.makeAbs=WF;JE.finish=hOn;JE.mark=gOn;JE.isIgnored=mRt;JE.childrenIgnored=yOn;function pRt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}a(pRt,"ownProp");var lOn=require("fs");var PP=require("path");var cOn=nQ();var fRt=sQ();var gOe=cOn.Minimatch;function dOn(e,t){return e.localeCompare(t,"en")}a(dOn,"alphasort");function pOn(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(fOn)}}a(pOn,"setupIgnores");function fOn(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new gOe(r,{dot:true})}return{matcher:new gOe(e,{dot:true}),gmatcher:t}}a(fOn,"ignoreMap");function mOn(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.fs=r.fs||lOn;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);pOn(e,r);e.changedCwd=false;var n=process.cwd();if(!pRt(r,"cwd"))e.cwd=n;else{e.cwd=PP.resolve(r.cwd);e.changedCwd=e.cwd!==n}e.root=r.root||PP.resolve(e.cwd,"/");e.root=PP.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=fRt(e.cwd)?e.cwd:WF(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;r.allowWindowsEscape=false;e.minimatch=new gOe(t,r);e.options=e.minimatch.options}a(mOn,"setopts");function hOn(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var n=0,i=e.matches.length;n<i;n++){var s=e.matches[n];if(!s||Object.keys(s).length===0){if(e.nonull){var o=e.minimatch.globSet[n];if(t)r.push(o);else r[o]=true}}else{var u=Object.keys(s);if(t)r.push.apply(r,u);else u.forEach(function(l){r[l]=true})}}if(!t)r=Object.keys(r);if(!e.nosort)r=r.sort(dOn);if(e.mark){for(var n=0;n<r.length;n++){r[n]=e._mark(r[n])}if(e.nodir){r=r.filter(function(l){var c=!/\/$/.test(l);var d=e.cache[l]||e.cache[WF(e,l)];if(c&&d)c=d!=="DIR"&&!Array.isArray(d);return c})}}if(e.ignore.length)r=r.filter(function(l){return!mRt(e,l)});e.found=r}a(hOn,"finish");function gOn(e,t){var r=WF(e,t);var n=e.cache[r];var i=t;if(n){var s=n==="DIR"||Array.isArray(n);var o=t.slice(-1)==="/";if(s&&!o)i+="/";else if(!s&&o)i=i.slice(0,-1);if(i!==t){var u=WF(e,i);e.statCache[u]=e.statCache[r];e.cache[u]=e.cache[r]}}return i}a(gOn,"mark");function WF(e,t){var r=t;if(t.charAt(0)==="/"){r=PP.join(e.root,t)}else if(fRt(t)||t===""){r=t}else if(e.changedCwd){r=PP.resolve(e.cwd,t)}else{r=PP.resolve(t)}if(process.platform==="win32")r=r.replace(/\\/g,"/");return r}a(WF,"makeAbs");function mRt(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return r.matcher.match(t)||!!(r.gmatcher&&r.gmatcher.match(t))})}a(mRt,"isIgnored");function yOn(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(t))})}a(yOn,"childrenIgnored")});var vRt=y((Y5s,_Rt)=>{_Rt.exports=yRt;yRt.GlobSync=nu;var _On=lOe();var hRt=nQ();var z5s=hRt.Minimatch;var K5s=EOe().Glob;var W5s=require("util");var _Oe=require("path");var gRt=require("assert");var aQ=sQ();var oC=yOe();var vOn=oC.setopts;var vOe=oC.ownProp;var EOn=oC.childrenIgnored;var bOn=oC.isIgnored;function yRt(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new nu(e,t).found}a(yRt,"globSync");function nu(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof nu))return new nu(e,t);vOn(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++){this._process(this.minimatch.set[n],n,false)}this._finish()}a(nu,"GlobSync");nu.prototype._finish=function(){gRt.ok(this instanceof nu);if(this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t){try{i=e._makeAbs(i);var s=_On.realpathSync(i,e.realpathCache);n[s]=true}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=true;else throw o}}})}oC.finish(this)};nu.prototype._process=function(e,t,r){gRt.ok(this instanceof nu);var n=0;while(typeof e[n]==="string"){n++}var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var s=e.slice(n);var o;if(i===null)o=".";else if(aQ(i)||aQ(e.map(function(c){return typeof c==="string"?c:"[*]"}).join("/"))){if(!i||!aQ(i))i="/"+i;o=i}else o=i;var u=this._makeAbs(o);if(EOn(this,o))return;var l=s[0]===hRt.GLOBSTAR;if(l)this._processGlobStar(i,o,u,s,t,r);else this._processReaddir(i,o,u,s,t,r)};nu.prototype._processReaddir=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n[0];var l=!!this.minimatch.negate;var c=u._glob;var d=this.dot||c.charAt(0)===".";var p=[];for(var f=0;f<o.length;f++){var m=o[f];if(m.charAt(0)!=="."||d){var h;if(l&&!e){h=!m.match(u)}else{h=m.match(u)}if(h)p.push(m)}}var g=p.length;if(g===0)return;if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var f=0;f<g;f++){var m=p[f];if(e){if(e.slice(-1)!=="/")m=e+"/"+m;else m=e+m}if(m.charAt(0)==="/"&&!this.nomount){m=_Oe.join(this.root,m)}this._emitMatch(i,m)}return}n.shift();for(var f=0;f<g;f++){var m=p[f];var _;if(e)_=[e,m];else _=[m];this._process(_.concat(n),i,s)}};nu.prototype._emitMatch=function(e,t){if(bOn(this,t))return;var r=this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute){t=r}if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;if(this.stat)this._stat(t)};nu.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,false);var t;var r;var n;try{r=this.fs.lstatSync(e)}catch(s){if(s.code==="ENOENT"){return null}}var i=r&&r.isSymbolicLink();this.symlinks[e]=i;if(!i&&r&&!r.isDirectory())this.cache[e]="FILE";else t=this._readdir(e,false);return t};nu.prototype._readdir=function(e,t){var r;if(t&&!vOe(this.symlinks,e))return this._readdirInGlobStar(e);if(vOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){this._readdirError(e,i);return null}};nu.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat){for(var r=0;r<t.length;r++){var n=t[r];if(e==="/")n=e+n;else n=e+"/"+n;this.cache[n]=true}}this.cache[e]=t;return t};nu.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);this.cache[r]="FILE";if(r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);n.path=this.cwd;n.code=t.code;throw n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict)throw t;if(!this.silent)console.error("glob error",t);break}};nu.prototype._processGlobStar=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n.slice(1);var l=e?[e]:[];var c=l.concat(u);this._process(c,i,false);var d=o.length;var p=this.symlinks[r];if(p&&s)return;for(var f=0;f<d;f++){var m=o[f];if(m.charAt(0)==="."&&!this.dot)continue;var h=l.concat(o[f],u);this._process(h,i,true);var g=l.concat(o[f],n);this._process(g,i,true)}};nu.prototype._processSimple=function(e,t){var r=this._stat(e);if(!this.matches[t])this.matches[t]=Object.create(null);if(!r)return;if(e&&aQ(e)&&!this.nomount){var n=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=_Oe.join(this.root,e)}else{e=_Oe.resolve(this.root,e);if(n)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e)};nu.prototype._stat=function(e){var t=this._makeAbs(e);var r=e.slice(-1)==="/";if(e.length>this.maxLength)return false;if(!this.stat&&vOe(this.cache,t)){var o=this.cache[t];if(Array.isArray(o))o="DIR";if(!r||o==="DIR")return o;if(r&&o==="FILE")return false}var n;var i=this.statCache[t];if(!i){var s;try{s=this.fs.lstatSync(t)}catch(u){if(u&&(u.code==="ENOENT"||u.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(s&&s.isSymbolicLink()){try{i=this.fs.statSync(t)}catch(u){i=s}}else{i=s}}this.statCache[t]=i;var o=true;if(i)o=i.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(r&&o==="FILE")return false;return o};nu.prototype._mark=function(e){return oC.mark(this,e)};nu.prototype._makeAbs=function(e){return oC.makeAbs(this,e)}});var bRt=y((J5s,ERt)=>{var SOn=Q2e();var YF=Object.create(null);var AOn=CW();ERt.exports=SOn(COn);function COn(e,t){if(YF[e]){YF[e].push(t);return null}else{YF[e]=[t];return wOn(e)}}a(COn,"inflight");function wOn(e){return AOn(a(function t(){var r=YF[e];var n=r.length;var i=TOn(arguments);try{for(var s=0;s<n;s++){r[s].apply(null,i)}}finally{if(r.length>n){r.splice(0,n);process.nextTick(function(){t.apply(null,i)})}else{delete YF[e]}}},"RES"))}a(wOn,"makeres");function TOn(e){var t=e.length;var r=[];for(var n=0;n<t;n++)r[n]=e[n];return r}a(TOn,"slice")});var EOe=y((t8s,ARt)=>{ARt.exports=uC;var xOn=lOe();var SRt=nQ();var Z5s=SRt.Minimatch;var ROn=Yv();var OOn=require("events").EventEmitter;var bOe=require("path");var SOe=require("assert");var XF=sQ();var COe=vRt();var lC=yOe();var POn=lC.setopts;var AOe=lC.ownProp;var wOe=bRt();var e8s=require("util");var NOn=lC.childrenIgnored;var IOn=lC.isIgnored;var kOn=CW();function uC(e,t,r){if(typeof t==="function")r=t,t={};if(!t)t={};if(t.sync){if(r)throw new TypeError("callback provided to sync glob");return COe(e,t)}return new Cs(e,t,r)}a(uC,"glob");uC.sync=COe;var DOn=uC.GlobSync=COe.GlobSync;uC.glob=uC;function LOn(e,t){if(t===null||typeof t!=="object"){return e}var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e}a(LOn,"extend");uC.hasMagic=function(e,t){var r=LOn({},t);r.noprocess=true;var n=new Cs(e,r);var i=n.minimatch.set;if(!e)return false;if(i.length>1)return true;for(var s=0;s<i[0].length;s++){if(typeof i[0][s]!=="string")return true}return false};uC.Glob=Cs;ROn(Cs,OOn);function Cs(e,t,r){if(typeof t==="function"){r=t;t=null}if(t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new DOn(e,t)}if(!(this instanceof Cs))return new Cs(e,t,r);POn(this,e,t);this._didRealPath=false;var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof r==="function"){r=kOn(r);this.on("error",r);this.on("end",function(l){r(null,l)})}var i=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return u();var s=true;for(var o=0;o<n;o++){this._process(this.minimatch.set[o],o,false,u)}s=false;function u(){--i._processing;if(i._processing<=0){if(s){process.nextTick(function(){i._finish()})}else{i._finish()}}}a(u,"done")}a(Cs,"Glob");Cs.prototype._finish=function(){SOe(this instanceof Cs);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();lC.finish(this);this.emit("end",this.found)};Cs.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var e=this.matches.length;if(e===0)return this._finish();var t=this;for(var r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){if(--e===0)t._finish()}a(n,"next")};Cs.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r);var i=this;var s=n.length;if(s===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(u,l){u=i._makeAbs(u);xOn.realpath(u,i.realpathCache,function(c,d){if(!c)o[d]=true;else if(c.syscall==="stat")o[u]=true;else i.emit("error",c);if(--s===0){i.matches[e]=o;t()}})})};Cs.prototype._mark=function(e){return lC.mark(this,e)};Cs.prototype._makeAbs=function(e){return lC.makeAbs(this,e)};Cs.prototype.abort=function(){this.aborted=true;this.emit("abort")};Cs.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Cs.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--;this._process(i[0],i[1],i[2],i[3])}}}};Cs.prototype._process=function(e,t,r,n){SOe(this instanceof Cs);SOe(typeof n==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([e,t,r,n]);return}var i=0;while(typeof e[i]==="string"){i++}var s;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:s=null;break;default:s=e.slice(0,i).join("/");break}var o=e.slice(i);var u;if(s===null)u=".";else if(XF(s)||XF(e.map(function(d){return typeof d==="string"?d:"[*]"}).join("/"))){if(!s||!XF(s))s="/"+s;u=s}else u=s;var l=this._makeAbs(u);if(NOn(this,u))return n();var c=o[0]===SRt.GLOBSTAR;if(c)this._processGlobStar(s,u,l,o,t,r,n);else this._processReaddir(s,u,l,o,t,r,n)};Cs.prototype._processReaddir=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){return u._processReaddir2(e,t,r,n,i,s,c,o)})};Cs.prototype._processReaddir2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n[0];var c=!!this.minimatch.negate;var d=l._glob;var p=this.dot||d.charAt(0)===".";var f=[];for(var m=0;m<o.length;m++){var h=o[m];if(h.charAt(0)!=="."||p){var g;if(c&&!e){g=!h.match(l)}else{g=h.match(l)}if(g)f.push(h)}}var _=f.length;if(_===0)return u();if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var m=0;m<_;m++){var h=f[m];if(e){if(e!=="/")h=e+"/"+h;else h=e+h}if(h.charAt(0)==="/"&&!this.nomount){h=bOe.join(this.root,h)}this._emitMatch(i,h)}return u()}n.shift();for(var m=0;m<_;m++){var h=f[m];var v;if(e){if(e!=="/")h=e+"/"+h;else h=e+h}this._process([h].concat(n),i,s,u)}u()};Cs.prototype._emitMatch=function(e,t){if(this.aborted)return;if(IOn(this,t))return;if(this.paused){this._emitQueue.push([e,t]);return}var r=XF(t)?t:this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute)t=r;if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;var i=this.statCache[r];if(i)this.emit("stat",t,i);this.emit("match",t)};Cs.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,false,t);var r="lstat\0"+e;var n=this;var i=wOe(r,s);if(i)n.fs.lstat(e,i);function s(o,u){if(o&&o.code==="ENOENT")return t();var l=u&&u.isSymbolicLink();n.symlinks[e]=l;if(!l&&u&&!u.isDirectory()){n.cache[e]="FILE";t()}else n._readdir(e,false,t)}a(s,"lstatcb_")};Cs.prototype._readdir=function(e,t,r){if(this.aborted)return;r=wOe("readdir\0"+e+"\0"+t,r);if(!r)return;if(t&&!AOe(this.symlinks,e))return this._readdirInGlobStar(e,r);if(AOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,FOn(this,e,r))};function FOn(e,t,r){return function(n,i){if(n)e._readdirError(t,n,r);else e._readdirEntries(t,i,r)}}a(FOn,"readdirCb");Cs.prototype._readdirEntries=function(e,t,r){if(this.aborted)return;if(!this.mark&&!this.stat){for(var n=0;n<t.length;n++){var i=t[n];if(e==="/")i=e+i;else i=e+"/"+i;this.cache[i]=true}}this.cache[e]=t;return r(null,t)};Cs.prototype._readdirError=function(e,t,r){if(this.aborted)return;switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);this.cache[n]="FILE";if(n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd;i.code=t.code;this.emit("error",i);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict){this.emit("error",t);this.abort()}if(!this.silent)console.error("glob error",t);break}return r()};Cs.prototype._processGlobStar=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){u._processGlobStar2(e,t,r,n,i,s,c,o)})};Cs.prototype._processGlobStar2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n.slice(1);var c=e?[e]:[];var d=c.concat(l);this._process(d,i,false,u);var p=this.symlinks[r];var f=o.length;if(p&&s)return u();for(var m=0;m<f;m++){var h=o[m];if(h.charAt(0)==="."&&!this.dot)continue;var g=c.concat(o[m],l);this._process(g,i,true,u);var _=c.concat(o[m],n);this._process(_,i,true,u)}u()};Cs.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,s){n._processSimple2(e,t,i,s,r)})};Cs.prototype._processSimple2=function(e,t,r,n,i){if(!this.matches[t])this.matches[t]=Object.create(null);if(!n)return i();if(e&&XF(e)&&!this.nomount){var s=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=bOe.join(this.root,e)}else{e=bOe.resolve(this.root,e);if(s)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e);i()};Cs.prototype._stat=function(e,t){var r=this._makeAbs(e);var n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&AOe(this.cache,r)){var i=this.cache[r];if(Array.isArray(i))i="DIR";if(!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var s;var o=this.statCache[r];if(o!==void 0){if(o===false)return t(null,o);else{var u=o.isDirectory()?"DIR":"FILE";if(n&&u==="FILE")return t();else return t(null,u,o)}}var l=this;var c=wOe("stat\0"+r,d);if(c)l.fs.lstat(r,c);function d(p,f){if(f&&f.isSymbolicLink()){return l.fs.stat(r,function(m,h){if(m)l._stat2(e,r,null,f,t);else l._stat2(e,r,m,h,t)})}else{l._stat2(e,r,p,f,t)}}a(d,"lstatcb_")};Cs.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var s=e.slice(-1)==="/";this.statCache[t]=n;if(t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,false,n);var o=true;if(n)o=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(s&&o==="FILE")return i();return i(null,o,n)}});var IRt=y((n8s,NRt)=>{NRt.exports=ROe;ROe.sync=PRt;var ds=require("assert");var xRt=require("path");var CRt=require("fs");var lQ=EOe();var RRt=parseInt("666",8);var BOn={nosort:true,silent:true};var TOe=0;var JF=process.platform==="win32";function ORt(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(function(r){e[r]=e[r]||CRt[r];r=r+"Sync";e[r]=e[r]||CRt[r]});e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}e.disableGlob=e.disableGlob||false;e.glob=e.glob||BOn}a(ORt,"defaults");function ROe(e,t,r){if(typeof t==="function"){r=t;t={}}ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds.equal(typeof r,"function","rimraf: callback function required");ds(t,"rimraf: invalid options argument provided");ds.equal(typeof t,"object","rimraf: options should be object");ORt(t);var n=0;var i=null;var s=0;if(t.disableGlob||!lQ.hasMagic(e))return u(null,[e]);t.lstat(e,function(l,c){if(!l)return u(null,[e]);lQ(e,t.glob,u)});function o(l){i=i||l;if(--s===0)r(i)}a(o,"next");function u(l,c){if(l)return r(l);s=c.length;if(s===0)return r();c.forEach(function(d){xOe(d,t,a(function p(f){if(f){if((f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<t.maxBusyTries){n++;var m=n*100;return setTimeout(function(){xOe(d,t,p)},m)}if(f.code==="EMFILE"&&TOe<t.emfileWait){return setTimeout(function(){xOe(d,t,p)},TOe++)}if(f.code==="ENOENT")f=null}TOe=0;o(f)},"CB"))})}a(u,"afterGlob")}a(ROe,"rimraf");function xOe(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.lstat(e,function(n,i){if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&JF)wRt(e,t,n,r);if(i&&i.isDirectory())return oQ(e,t,n,r);t.unlink(e,function(s){if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return JF?wRt(e,t,s,r):oQ(e,t,s,r);if(s.code==="EISDIR")return oQ(e,t,s,r)}return r(s)})})}a(xOe,"rimraf_");function wRt(e,t,r,n){ds(e);ds(t);ds(typeof n==="function");if(r)ds(r instanceof Error);t.chmod(e,RRt,function(i){if(i)n(i.code==="ENOENT"?null:r);else t.stat(e,function(s,o){if(s)n(s.code==="ENOENT"?null:r);else if(o.isDirectory())oQ(e,t,r,n);else t.unlink(e,n)})})}a(wRt,"fixWinEPERM");function TRt(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.chmodSync(e,RRt)}catch(i){if(i.code==="ENOENT")return;else throw r}try{var n=t.statSync(e)}catch(i){if(i.code==="ENOENT")return;else throw r}if(n.isDirectory())uQ(e,t,r);else t.unlinkSync(e)}a(TRt,"fixWinEPERMSync");function oQ(e,t,r,n){ds(e);ds(t);if(r)ds(r instanceof Error);ds(typeof n==="function");t.rmdir(e,function(i){if(i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM"))MOn(e,t,n);else if(i&&i.code==="ENOTDIR")n(r);else n(i)})}a(oQ,"rmdir");function MOn(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.readdir(e,function(n,i){if(n)return r(n);var s=i.length;if(s===0)return t.rmdir(e,r);var o;i.forEach(function(u){ROe(xRt.join(e,u),t,function(l){if(o)return;if(l)return r(o=l);if(--s===0)t.rmdir(e,r)})})})}a(MOn,"rmkids");function PRt(e,t){t=t||{};ORt(t);ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds(t,"rimraf: missing options");ds.equal(typeof t,"object","rimraf: options should be object");var r;if(t.disableGlob||!lQ.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(s){r=lQ.sync(e,t.glob)}}if(!r.length)return;for(var n=0;n<r.length;n++){var e=r[n];try{var i=t.lstatSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM"&&JF)TRt(e,t,o)}try{if(i&&i.isDirectory())uQ(e,t,null);else t.unlinkSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM")return JF?TRt(e,t,o):uQ(e,t,o);if(o.code!=="EISDIR")throw o;uQ(e,t,o)}}}a(PRt,"rimrafSync");function uQ(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")qOn(e,t)}}a(uQ,"rmdirSync");function qOn(e,t){ds(e);ds(t);t.readdirSync(e).forEach(function(o){PRt(xRt.join(e,o),t)});var r=JF?100:1;var n=0;do{var i=true;try{var s=t.rmdirSync(e,t);i=false;return s}finally{if(++n<r&&i)continue}}while(true)}a(qOn,"rmkidsSync")});var FRt=y((s8s,LRt)=>{var QF=require("path");var kRt=require("fs");var DRt=parseInt("0777",8);LRt.exports=NP.mkdirp=NP.mkdirP=NP;function NP(e,t,r,n){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}var i=t.mode;var s=t.fs||kRt;if(i===void 0){i=DRt}if(!n)n=null;var o=r||function(){};e=QF.resolve(e);s.mkdir(e,i,function(u){if(!u){n=n||e;return o(null,n)}switch(u.code){case"ENOENT":if(QF.dirname(e)===e)return o(u);NP(QF.dirname(e),t,function(l,c){if(l)o(l,c);else NP(e,t,o,c)});break;default:s.stat(e,function(l,c){if(l||!c.isDirectory())o(u,n);else o(null,n)});break}})}a(NP,"mkdirP");NP.sync=a(function e(t,r,n){if(!r||typeof r!=="object"){r={mode:r}}var i=r.mode;var s=r.fs||kRt;if(i===void 0){i=DRt}if(!n)n=null;t=QF.resolve(t);try{s.mkdirSync(t,i);n=n||t}catch(u){switch(u.code){case"ENOENT":n=e(QF.dirname(t),r,n);e(t,r,n);break;default:var o;try{o=s.statSync(t)}catch(l){throw u}if(!o.isDirectory())throw u;break}}return n},"sync")});var zRt=y((gh,VRt)=>{var OOe=require("fs");var MRt=require("path");var cQ=require("constants");var UOn=require("os");var POe=IRt();var qRt=FRt();var o8s=require("os").tmpdir();var URt=POe.sync;var $Rt=MRt.resolve(UOn.tmpdir());var NOe=cQ.O_CREAT|cQ.O_TRUNC|cQ.O_RDWR|cQ.O_EXCL;var ZF=a(function(e){if(typeof e==="function"){return[void 0,e]}var t;var r=new Promise(function(n,i){t=a(function(){var s=Array.from(arguments);var o=s.shift();process.nextTick(function(){if(o){i(o)}else if(s.length===1){n(s[0])}else{n(s)}})},"promiseCallback")});return[r,t]},"promisify");var IP=a(function(e,t){var r=$On(e,t);var n=new Date;var i=[r.prefix,n.getFullYear(),n.getMonth(),n.getDate(),"-",process.pid,"-",(Math.random()*4294967296+1).toString(36),r.suffix].join("");return MRt.join(r.dir||$Rt,i)},"generateName");var $On=a(function(e,t){var r={prefix:null,suffix:null};if(e){switch(typeof e){case"string":r.prefix=e;break;case"object":r=e;break;default:throw new Error("Unknown affix declaration: "+r)}}else{r.prefix=t}return r},"parseAffixes");var ag=false;var jOn=a(function(e){ag=e!==false;return VRt.exports},"track");var BRt=false;var dQ=[];var pQ=[];function IOe(e){if(!ag)return false;GRt();dQ.push(e)}a(IOe,"deleteFileOnExit");function jRt(e){if(!ag)return false;GRt();pQ.push(e)}a(jRt,"deleteDirOnExit");function GRt(){if(!ag)return false;if(!BRt){process.addListener("exit",function(){try{HRt()}catch(e){console.warn("Fail to clean temporary files on exit : ",e);throw e}});BRt=true}}a(GRt,"attachExitListener");function GOn(){if(!ag){return false}var e=0;var t;while((t=dQ.shift())!==void 0){URt(t,{maxBusyTries:6});e++}return e}a(GOn,"cleanupFilesSync");function HOn(e){var t=ZF(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=dQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=dQ.shift())!==void 0){POe(s,{maxBusyTries:6},o)}return r}a(HOn,"cleanupFiles");function VOn(){if(!ag){return false}var e=0;var t;while((t=pQ.shift())!==void 0){URt(t,{maxBusyTries:6});e++}return e}a(VOn,"cleanupDirsSync");function zOn(e){var t=ZF(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=pQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u,n);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=pQ.shift())!==void 0){POe(s,{maxBusyTries:6},o)}return r}a(zOn,"cleanupDirs");function HRt(){if(!ag){return false}var e=GOn();var t=VOn();return{files:e,dirs:t}}a(HRt,"cleanupSync");function KOn(e){var t=ZF(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}HOn(function(n,i){if(n){e(n,{files:i})}else{zOn(function(s,o){e(s,{files:i,dirs:o})})}});return r}a(KOn,"cleanup");var WOn=a((e,t)=>{const r=ZF(t);const n=r[0];t=r[1];let i=IP(e,"d-");qRt(i,448,s=>{if(!s){jRt(i)}t(s,i)});return n},"mkdir");var YOn=a(e=>{let t=IP(e,"d-");qRt.sync(t,448);jRt(t);return t},"mkdirSync");var XOn=a((e,t)=>{const r=ZF(t);const n=r[0];t=r[1];const i=IP(e,"f-");OOe.open(i,NOe,384,(s,o)=>{if(!s){IOe(i)}t(s,{path:i,fd:o})});return n},"open");var JOn=a(e=>{const t=IP(e,"f-");let r=OOe.openSync(t,NOe,384);IOe(t);return{path:t,fd:r}},"openSync");var QOn=a(e=>{const t=IP(e,"s-");let r=OOe.createWriteStream(t,{flags:NOe,mode:384});IOe(t);return r},"createWriteStream");gh.dir=$Rt;gh.track=jOn;gh.mkdir=WOn;gh.mkdirSync=YOn;gh.open=XOn;gh.openSync=JOn;gh.path=IP;gh.cleanup=KOn;gh.cleanupSync=HRt;gh.createWriteStream=QOn});var XRt=y(kP=>{"use strict";var YRt=kP&&kP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(kP,"__esModule",{value:true});kP.generateBuildData=void 0;var fQ=hn();var KRt=require("fs/promises");var WRt=YRt(require("path"));var ZOn=Fn();var ePn=YRt(xs());var tPn=a(async function({systemDirectory:e,buildId:t,logger:r,config:n,publicZuploEnvironmentVariables:i}){return ePn.default.timeFn("Generating build data",async()=>{r.debug(`Generating build data`);const s=await(0,KRt.readFile)(WRt.default.resolve(__dirname,"../../../package.json"),"utf-8");const o=JSON.parse(s);const u={BUILD_ID:t??"",GIT_SHA:process.env.GIT_SHA,TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:fQ.env.isProduction(),BUILD_ENV:fQ.env.NODE_ENV,ZUPLO_VERSION:o.version,API_VERSION:process.env.API_VERSION,COMPATIBILITY_DATE:n?.compatibilityDate,ACCOUNT_NAME:i?.ZUPLO_ACCOUNT_NAME,PROJECT_NAME:i?.ZUPLO_PROJECT_NAME,ENVIRONMENT_TYPE:i?.ZUPLO_ENVIRONMENT_TYPE,COMPATIBILITY_FLAGS:fQ.COMPATIBILITY_FLAG_MAPPINGS?fQ.COMPATIBILITY_FLAG_MAPPINGS[n?.compatibilityDate??"none"]:{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false,removeAllVendorHeadersExceptListed:false}};const l=JSON.stringify(u,void 0,2);const c=WRt.default.join(e,ZOn.GENERATED_BUILD_JSON_FILE);try{await(0,KRt.writeFile)(c,l.trimStart(),"utf-8")}catch(d){r.error(d);const p={message:`Error creating file at ${c}`,pluginName:"buildData",severity:"error"};return{warnings:[],errors:[p]}}return{warnings:[],errors:[]}})},"generateBuildData");kP.generateBuildData=tPn});var JRt=y(DP=>{"use strict";var DOe=DP&&DP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(DP,"__esModule",{value:true});DP.generateWorker=void 0;var rPn=DOe(require("fs/promises"));var nPn=DOe(require("path"));var kOe=Fn();var iPn=DOe(xs());var sPn=a(async function({systemDirectory:e,logger:t}){return iPn.default.timeFn("Generating Worker shim",async()=>{t.debug("Generating Worker shim");const r=`import { Handler, ServiceProviderImpl } from "@zuplo/runtime";
|
|
411
411
|
import routeLoader from "../config/routes.json";
|
|
412
412
|
import * as schemaValidations from "./ajv-schema.json";
|
|
413
413
|
import { runtimeInit } from "../modules/zuplo.runtime.ts";
|