@capgo/cli 7.122.0 → 7.122.1
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/dist/index.js +2 -2
- package/dist/package.json +1 -1
- package/dist/src/sdk.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91,7 +91,7 @@ Expecting one of '${B.join("', '")}'`);if(this._lifeCycleHooks[A])this._lifeCycl
|
|
|
91
91
|
`),this.outputHelp({error:!0});let B=Q||{},I=B.exitCode||1,E=B.code||"commander.error";this._exit(I,E,A)}_parseOptionsEnv(){this.options.forEach((A)=>{if(A.envVar&&A.envVar in GI.env){let Q=A.attributeName();if(this.getOptionValue(Q)===void 0||["default","config","env"].includes(this.getOptionValueSource(Q)))if(A.required||A.optional)this.emit(`optionEnv:${A.name()}`,GI.env[A.envVar]);else this.emit(`optionEnv:${A.name()}`)}})}_parseOptionsImplied(){let A=new tmA(this.options),Q=(B)=>{return this.getOptionValue(B)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(B))};this.options.filter((B)=>B.implied!==void 0&&Q(B.attributeName())&&A.valueFromOption(this.getOptionValue(B.attributeName()),B)).forEach((B)=>{Object.keys(B.implied).filter((I)=>!Q(I)).forEach((I)=>{this.setOptionValueWithSource(I,B.implied[I],"implied")})})}missingArgument(A){let Q=`error: missing required argument '${A}'`;this.error(Q,{code:"commander.missingArgument"})}optionMissingArgument(A){let Q=`error: option '${A.flags}' argument missing`;this.error(Q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(A){let Q=`error: required option '${A.flags}' not specified`;this.error(Q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(A,Q){let B=($)=>{let D=$.attributeName(),G=this.getOptionValue(D),Y=this.options.find((X)=>X.negate&&D===X.attributeName()),H=this.options.find((X)=>!X.negate&&D===X.attributeName());if(Y&&(Y.presetArg===void 0&&G===!1||Y.presetArg!==void 0&&G===Y.presetArg))return Y;return H||$},I=($)=>{let D=B($),G=D.attributeName();if(this.getOptionValueSource(G)==="env")return`environment variable '${D.envVar}'`;return`option '${D.flags}'`},E=`error: ${I(A)} cannot be used with ${I(Q)}`;this.error(E,{code:"commander.conflictingOption"})}unknownOption(A){if(this._allowUnknownOption)return;let Q="";if(A.startsWith("--")&&this._showSuggestionAfterError){let I=[],E=this;do{let $=E.createHelp().visibleOptions(E).filter((D)=>D.long).map((D)=>D.long);I=I.concat($),E=E.parent}while(E&&!E._enablePositionalOptions);Q=OIA(A,I)}let B=`error: unknown option '${A}'${Q}`;this.error(B,{code:"commander.unknownOption"})}_excessArguments(A){if(this._allowExcessArguments)return;let Q=this.registeredArguments.length,B=Q===1?"":"s",E=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Q} argument${B} but got ${A.length}.`;this.error(E,{code:"commander.excessArguments"})}unknownCommand(){let A=this.args[0],Q="";if(this._showSuggestionAfterError){let I=[];this.createHelp().visibleCommands(this).forEach((E)=>{if(I.push(E.name()),E.alias())I.push(E.alias())}),Q=OIA(A,I)}let B=`error: unknown command '${A}'${Q}`;this.error(B,{code:"commander.unknownCommand"})}version(A,Q,B){if(A===void 0)return this._version;this._version=A,Q=Q||"-V, --version",B=B||"output the version number";let I=this.createOption(Q,B);return this._versionOptionName=I.attributeName(),this._registerOption(I),this.on("option:"+I.name(),()=>{this._outputConfiguration.writeOut(`${A}
|
|
92
92
|
`),this._exit(0,"commander.version",A)}),this}description(A,Q){if(A===void 0&&Q===void 0)return this._description;if(this._description=A,Q)this._argsDescription=Q;return this}summary(A){if(A===void 0)return this._summary;return this._summary=A,this}alias(A){if(A===void 0)return this._aliases[0];let Q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Q=this.commands[this.commands.length-1];if(A===Q._name)throw Error("Command alias can't be the same as its name");let B=this.parent?._findCommand(A);if(B){let I=[B.name()].concat(B.aliases()).join("|");throw Error(`cannot add alias '${A}' to command '${this.name()}' as already have command '${I}'`)}return Q._aliases.push(A),this}aliases(A){if(A===void 0)return this._aliases;return A.forEach((Q)=>this.alias(Q)),this}usage(A){if(A===void 0){if(this._usage)return this._usage;let Q=this.registeredArguments.map((B)=>{return omA(B)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Q:[]).join(" ")}return this._usage=A,this}name(A){if(A===void 0)return this._name;return this._name=A,this}helpGroup(A){if(A===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=A,this}commandsGroup(A){if(A===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=A,this}optionsGroup(A){if(A===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=A,this}_initOptionGroup(A){if(this._defaultOptionGroup&&!A.helpGroupHeading)A.helpGroup(this._defaultOptionGroup)}_initCommandGroup(A){if(this._defaultCommandGroup&&!A.helpGroup())A.helpGroup(this._defaultCommandGroup)}nameFromFilename(A){return this._name=mJ.basename(A,mJ.extname(A)),this}executableDir(A){if(A===void 0)return this._executableDir;return this._executableDir=A,this}helpInformation(A){let Q=this.createHelp(),B=this._getOutputContext(A);Q.prepareContext({error:B.error,helpWidth:B.helpWidth,outputHasColors:B.hasColors});let I=Q.formatHelp(this,Q);if(B.hasColors)return I;return this._outputConfiguration.stripColor(I)}_getOutputContext(A){A=A||{};let Q=!!A.error,B,I,E;if(Q)B=(D)=>this._outputConfiguration.writeErr(D),I=this._outputConfiguration.getErrHasColors(),E=this._outputConfiguration.getErrHelpWidth();else B=(D)=>this._outputConfiguration.writeOut(D),I=this._outputConfiguration.getOutHasColors(),E=this._outputConfiguration.getOutHelpWidth();return{error:Q,write:(D)=>{if(!I)D=this._outputConfiguration.stripColor(D);return B(D)},hasColors:I,helpWidth:E}}outputHelp(A){let Q;if(typeof A==="function")Q=A,A=void 0;let B=this._getOutputContext(A),I={error:B.error,write:B.write,command:this};this._getCommandAndAncestors().reverse().forEach(($)=>$.emit("beforeAllHelp",I)),this.emit("beforeHelp",I);let E=this.helpInformation({error:B.error});if(Q){if(E=Q(E),typeof E!=="string"&&!Buffer.isBuffer(E))throw Error("outputHelp callback must return a string or a Buffer")}if(B.write(E),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",I),this._getCommandAndAncestors().forEach(($)=>$.emit("afterAllHelp",I))}helpOption(A,Q){if(typeof A==="boolean"){if(A){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(A??"-h, --help",Q??"display help for command"),A||Q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(A){return this._helpOption=A,this._initOptionGroup(A),this}help(A){this.outputHelp(A);let Q=Number(GI.exitCode??0);if(Q===0&&A&&typeof A!=="function"&&A.error)Q=1;this._exit(Q,"commander.help","(outputHelp)")}addHelpText(A,Q){let B=["beforeAll","before","after","afterAll"];if(!B.includes(A))throw Error(`Unexpected value for position to addHelpText.
|
|
93
93
|
Expecting one of '${B.join("', '")}'`);let I=`${A}Help`;return this.on(I,(E)=>{let $;if(typeof Q==="function")$=Q({error:E.error,command:E.command});else $=Q;if($)E.write(`${$}
|
|
94
|
-
`)}),this}_outputHelpIfRequested(A){let Q=this._getHelpOption();if(Q&&A.find((I)=>Q.is(I)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function RIA(A){return A.map((Q)=>{if(!Q.startsWith("--inspect"))return Q;let B,I="127.0.0.1",E="9229",$;if(($=Q.match(/^(--inspect(-brk)?)$/))!==null)B=$[1];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=$[1],/^\d+$/.test($[3]))E=$[3];else I=$[3];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=$[1],I=$[3],E=$[4];if(B&&E!=="0")return`${B}=${I}:${parseInt(E)+1}`;return Q})}function kb(){if(GI.env.NO_COLOR||GI.env.FORCE_COLOR==="0"||GI.env.FORCE_COLOR==="false")return!1;if(GI.env.FORCE_COLOR||GI.env.CLICOLOR_FORCE!==void 0)return!0;return}emA.Command=vb;emA.useColor=kb});var PIA=x((EcA)=>{var{Argument:TIA}=Ew(),{Command:xb}=VIA(),{CommanderError:BcA,InvalidArgumentError:SIA}=hK(),{Help:IcA}=Sb(),{Option:jIA}=jb();EcA.program=new xb;EcA.createCommand=(A)=>new xb(A);EcA.createOption=(A,Q)=>new jIA(A,Q);EcA.createArgument=(A,Q)=>new TIA(A,Q);EcA.Command=xb;EcA.Option=jIA;EcA.Argument=TIA;EcA.Help=IcA;EcA.CommanderError=BcA;EcA.InvalidArgumentError=SIA;EcA.InvalidOptionArgumentError=SIA});var AE;var cJ=jA(()=>{AE={name:"@capgo/cli",type:"module",version:"7.122.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs",test:"bun run build && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-render-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6"},devDependencies:{"@antfu/eslint-config":"^9.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});function qcA(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function ZcA(A){if(A instanceof Error)return A.message;if(typeof A==="string")return A;return""}function uK(A){if(A&&typeof A==="object"&&"code"in A){let I=A.code;if(typeof I==="string"&&I.startsWith("commander."))return"commander"}let Q=qcA(A);if(Q!==void 0){if(Q===401)return"unauthorized";if(Q===403)return"forbidden";if(Q===404)return"not_found";if(Q===413)return"payload_too_large";if(Q>=500)return"server_error"}let B=ZcA(A).toLowerCase();if(/econnrefused|enotfound|fetch failed|network|socket|dns/.test(B))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(B))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(B))return"validation_error";return"unknown"}function kIA(A){if(A===401)return"unauthorized";if(A===403)return"forbidden";if(A===404)return"not_found";if(A===408||A===504)return"timeout";if(A===413)return"payload_too_large";if(A===429)return"rate_limited";if(A===400||A===422)return"validation_error";if(A>=500)return"server_error";return"unknown"}var vIA=x((ucQ,McA)=>{McA.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Alpic",constant:"ALPIC",env:"ALPIC_HOST"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var yb=x((gb)=>{var xIA=vIA(),FE=process.env;Object.defineProperty(gb,"_vendors",{value:xIA.map(function(A){return A.constant})});gb.name=null;gb.isPR=null;gb.id=null;if(FE.CI!=="false")xIA.forEach(function(A){let B=(Array.isArray(A.env)?A.env:[A.env]).every(function(I){return gIA(I)});if(gb[A.constant]=B,!B)return;gb.name=A.name,gb.isPR=NcA(A),gb.id=A.constant});gb.isCI=!!(FE.CI!=="false"&&(FE.BUILD_ID||FE.BUILD_NUMBER||FE.CI||FE.CI_APP_ID||FE.CI_BUILD_ID||FE.CI_BUILD_NUMBER||FE.CI_NAME||FE.CONTINUOUS_INTEGRATION||FE.RUN_ID||gb.name||!1));function gIA(A){if(typeof A==="string")return!!FE[A];if("env"in A)return FE[A.env]&&FE[A.env].includes(A.includes);if("any"in A)return A.any.some(function(Q){return!!FE[Q]});return Object.keys(A).every(function(Q){return FE[Q]===A[Q]})}function NcA(A){switch(typeof A.pr){case"string":return!!FE[A.pr];case"object":if("env"in A.pr)if("any"in A.pr)return A.pr.any.some(function(Q){return FE[A.pr.env]===Q});else return A.pr.env in FE&&FE[A.pr.env]!==A.pr.ne;else if("any"in A.pr)return A.pr.any.some(function(Q){return!!FE[Q]});else return gIA(A.pr);default:return null}}});import{homedir as fIA,platform as LcA,release as wcA}from"node:os";import{arch as OcA,cwd as hIA,env as wU,version as RcA}from"node:process";function mK(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function jcA(){if(mK(wU.CAPGO_DISABLE_TELEMETRY)||mK(wU.CAPGO_DISABLE_POSTHOG))return;return wU.CAPGO_CLI_POSTHOG_API_KEY?.trim()||wU.POSTHOG_API_KEY?.trim()||TcA}function PcA(A){let Q=A.replace(/\/+$/,"");if(Q.endsWith("/i/v0/e"))return`${Q}/`;let B=Q.replace(/\/capture$/,"/");return new URL("i/v0/e/",B.endsWith("/")?B:`${B}/`).toString()}function _cA(A){if(A instanceof Error)return{cause:A.cause,message:A.message,name:A.name||"Error",stack:A.stack};if(typeof A==="string")return{message:A,name:"Error",stack:void 0};try{return{message:JSON.stringify(A)??String(A),name:"Error",stack:void 0}}catch{return{message:String(A),name:"Error",stack:void 0}}}function kcA(A){let Q=A,B=hIA(),I=fIA();if(B)Q=Q.replaceAll(B,"<cwd>");if(I)Q=Q.replaceAll(I,"~");return Q}function vcA(A){let Q=A,B=hIA(),I=fIA();if(B)Q=Q.replaceAll(B,"<cwd>");if(I)Q=Q.replaceAll(I,"~");return Q.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){2,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function xcA(A,Q){let B=A?.split(`
|
|
94
|
+
`)}),this}_outputHelpIfRequested(A){let Q=this._getHelpOption();if(Q&&A.find((I)=>Q.is(I)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function RIA(A){return A.map((Q)=>{if(!Q.startsWith("--inspect"))return Q;let B,I="127.0.0.1",E="9229",$;if(($=Q.match(/^(--inspect(-brk)?)$/))!==null)B=$[1];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=$[1],/^\d+$/.test($[3]))E=$[3];else I=$[3];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=$[1],I=$[3],E=$[4];if(B&&E!=="0")return`${B}=${I}:${parseInt(E)+1}`;return Q})}function kb(){if(GI.env.NO_COLOR||GI.env.FORCE_COLOR==="0"||GI.env.FORCE_COLOR==="false")return!1;if(GI.env.FORCE_COLOR||GI.env.CLICOLOR_FORCE!==void 0)return!0;return}emA.Command=vb;emA.useColor=kb});var PIA=x((EcA)=>{var{Argument:TIA}=Ew(),{Command:xb}=VIA(),{CommanderError:BcA,InvalidArgumentError:SIA}=hK(),{Help:IcA}=Sb(),{Option:jIA}=jb();EcA.program=new xb;EcA.createCommand=(A)=>new xb(A);EcA.createOption=(A,Q)=>new jIA(A,Q);EcA.createArgument=(A,Q)=>new TIA(A,Q);EcA.Command=xb;EcA.Option=jIA;EcA.Argument=TIA;EcA.Help=IcA;EcA.CommanderError=BcA;EcA.InvalidArgumentError=SIA;EcA.InvalidOptionArgumentError=SIA});var AE;var cJ=jA(()=>{AE={name:"@capgo/cli",type:"module",version:"7.122.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs",test:"bun run build && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-render-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6"},devDependencies:{"@antfu/eslint-config":"^9.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});function qcA(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function ZcA(A){if(A instanceof Error)return A.message;if(typeof A==="string")return A;return""}function uK(A){if(A&&typeof A==="object"&&"code"in A){let I=A.code;if(typeof I==="string"&&I.startsWith("commander."))return"commander"}let Q=qcA(A);if(Q!==void 0){if(Q===401)return"unauthorized";if(Q===403)return"forbidden";if(Q===404)return"not_found";if(Q===413)return"payload_too_large";if(Q>=500)return"server_error"}let B=ZcA(A).toLowerCase();if(/econnrefused|enotfound|fetch failed|network|socket|dns/.test(B))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(B))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(B))return"validation_error";return"unknown"}function kIA(A){if(A===401)return"unauthorized";if(A===403)return"forbidden";if(A===404)return"not_found";if(A===408||A===504)return"timeout";if(A===413)return"payload_too_large";if(A===429)return"rate_limited";if(A===400||A===422)return"validation_error";if(A>=500)return"server_error";return"unknown"}var vIA=x((ucQ,McA)=>{McA.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Alpic",constant:"ALPIC",env:"ALPIC_HOST"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var yb=x((gb)=>{var xIA=vIA(),FE=process.env;Object.defineProperty(gb,"_vendors",{value:xIA.map(function(A){return A.constant})});gb.name=null;gb.isPR=null;gb.id=null;if(FE.CI!=="false")xIA.forEach(function(A){let B=(Array.isArray(A.env)?A.env:[A.env]).every(function(I){return gIA(I)});if(gb[A.constant]=B,!B)return;gb.name=A.name,gb.isPR=NcA(A),gb.id=A.constant});gb.isCI=!!(FE.CI!=="false"&&(FE.BUILD_ID||FE.BUILD_NUMBER||FE.CI||FE.CI_APP_ID||FE.CI_BUILD_ID||FE.CI_BUILD_NUMBER||FE.CI_NAME||FE.CONTINUOUS_INTEGRATION||FE.RUN_ID||gb.name||!1));function gIA(A){if(typeof A==="string")return!!FE[A];if("env"in A)return FE[A.env]&&FE[A.env].includes(A.includes);if("any"in A)return A.any.some(function(Q){return!!FE[Q]});return Object.keys(A).every(function(Q){return FE[Q]===A[Q]})}function NcA(A){switch(typeof A.pr){case"string":return!!FE[A.pr];case"object":if("env"in A.pr)if("any"in A.pr)return A.pr.any.some(function(Q){return FE[A.pr.env]===Q});else return A.pr.env in FE&&FE[A.pr.env]!==A.pr.ne;else if("any"in A.pr)return A.pr.any.some(function(Q){return!!FE[Q]});else return gIA(A.pr);default:return null}}});import{homedir as fIA,platform as LcA,release as wcA}from"node:os";import{arch as OcA,cwd as hIA,env as wU,version as RcA}from"node:process";function mK(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function jcA(){if(mK(wU.CAPGO_DISABLE_TELEMETRY)||mK(wU.CAPGO_DISABLE_POSTHOG))return;return wU.CAPGO_CLI_POSTHOG_API_KEY?.trim()||wU.POSTHOG_API_KEY?.trim()||TcA}function PcA(A){let Q=A.replace(/\/+$/,"");if(Q.endsWith("/i/v0/e"))return`${Q}/`;let B=Q.replace(/\/capture$/,"/");return new URL("i/v0/e/",B.endsWith("/")?B:`${B}/`).toString()}function _cA(A){if(A instanceof Error)return{cause:A.cause,message:A.message,name:A.name||"Error",stack:A.stack};if(typeof A==="string")return{message:A,name:"Error",stack:void 0};try{return{message:JSON.stringify(A)??String(A),name:"Error",stack:void 0}}catch{return{message:String(A),name:"Error",stack:void 0}}}function kcA(A){let Q=A,B=hIA(),I=fIA();if(B)Q=Q.replaceAll(B,"<cwd>");if(I)Q=Q.replaceAll(I,"~");return Q}function vcA(A){let Q=A,B=hIA(),I=fIA();if(B)Q=Q.replaceAll(B,"<cwd>");if(I)Q=Q.replaceAll(I,"~");return Q.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){2,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function xcA(A,Q){let B=A?.split(`
|
|
95
95
|
`).slice(1).map((I)=>{let E=I.trim(),$=E.startsWith("at ")?E.slice(3):E,D=Q,G=$,Y=$.lastIndexOf(" (");if(Y!==-1&&$.endsWith(")"))D=$.slice(0,Y).trim()||Q,G=$.slice(Y+2,-1);else{let C=$.lastIndexOf(" "),W=C===-1?"":$.slice(C+1);if(/:\d+:\d+$/.test(W))D=$.slice(0,C).trim()||Q,G=W}let H=G.lastIndexOf(":"),X=H===-1?-1:G.lastIndexOf(":",H-1);if(H===-1||X===-1)return{function:Q,platform:"custom",lang:"javascript"};return{function:D,filename:kcA(G.slice(0,X)),lineno:Number.parseInt(G.slice(X+1,H),10),colno:Number.parseInt(G.slice(H+1),10),platform:"custom",lang:"javascript"}}).filter(Boolean);return B&&B.length>0?B:[{function:Q,platform:"custom",lang:"javascript"}]}function gcA(A){if(!A||typeof A!=="object"||!("code"in A))return;let{code:Q}=A;return typeof Q==="string"?Q:void 0}function uIA(A){return!gcA(A)?.startsWith("commander.")}function fb(A){let Q=[],B=A;while(B?.parent){let I=B.name();if(I)Q.push(I);B=B.parent}return Q.reverse().join(" ")||"unknown"}async function hb(A){let Q=jcA();if(!Q)return!1;let B=wU.CAPGO_CLI_POSTHOG_API_HOST?.trim()||wU.POSTHOG_API_HOST?.trim()||VcA,I;try{I=PcA(B)}catch{return!1}let E=_cA(A.error),$=vcA(E.message),D=`cli:${AE.version}:${A.functionName}`,G=xcA(E.stack,A.functionName),Y=G[0],H=[D,A.kind,E.name||"Error",Y?.function||A.functionName,Y&&"filename"in Y?Y.filename:"unknown",String(A.status??1)].join(":"),X={token:Q,event:"$exception",properties:{distinct_id:D,$exception_list:[{type:E.name||"Error",value:$,mechanism:{handled:!0,synthetic:!1},stacktrace:{type:"raw",frames:G}}],$exception_fingerprint:H,architecture:OcA,cli_version:AE.version,error_kind:A.kind,function_name:A.functionName,is_ci:Boolean(wU.CI),node_version:RcA,os_platform:LcA(),os_release:wcA(),runtime:"cli",status:A.status},timestamp:new Date().toISOString()};try{let C=new AbortController,W=setTimeout(()=>C.abort(),ScA);try{return(await fetch(I,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X),signal:C.signal})).ok}finally{clearTimeout(W)}}catch{return!1}}var VcA="https://eu.i.posthog.com/i/v0/e/",TcA="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",ScA=1500;var ub=jA(()=>{cJ()});import{existsSync as $$}from"fs";var cK=(A=".",Q="unknown")=>{let B=`${A}/bun.lockb`,I=`${A}/bun.lock`,E=`${A}/pnpm-lock.yaml`,$=`${A}/shrinkwrap.yaml`,D=`${A}/yarn.lock`,G=`${A}/package-lock.json`,Y=`${A}/npm-shrinkwrap.json`;if($$(B)||$$(I))return"bun";if($$(E)||$$($))return"pnpm";if($$(D))return"yarn";if($$(G)||$$(Y))return"npm";return Q},Gw=(A=cK(),Q=!1)=>{switch(A){case"bun":return Q?"bun install":"install";case"pnpm":return Q?"pnpm install":"install";case"yarn":return Q?"yarn install":"install";case"npm":return Q?"npm install":"install";case"unknown":return Q?"unknown unknown":"unknown";default:return Q?"npm install":"install"}},mIA=(A=".",Q="npx")=>{let B=`${A}/bun.lockb`,I=`${A}/bun.lock`,E=`${A}/pnpm-lock.yaml`,$=`${A}/shrinkwrap.yaml`,D=`${A}/yarn.lock`,G=`${A}/package-lock.json`,Y=`${A}/npm-shrinkwrap.json`;if($$(B)||$$(I))return"bunx";if($$(E)||$$($))return"pnpm exec";if($$(D))return"yarn dlx";if($$(G)||$$(Y))return"npx";return Q};var cIA=()=>{};function Jw(A,Q){if(isNaN(A)||isNaN(Q))throw Error("Cannot compare against non-numbers");return A===Q?0:A<Q?-1:1}function pIA(A=[],Q=[]){if(A.length&&!Q.length)return-1;if(!A.length&&Q.length)return 1;return 0}function Yw(A=[],Q=[]){let B=Math.max(A.length,Q.length);for(let I=0;I<B;I++){let E=A[I],$=Q[I];if(E===void 0&&$===void 0)return 0;if($===void 0)return 1;if(E===void 0)return-1;if(typeof E==="string"&&typeof $==="number")return 1;if(typeof E==="number"&&typeof $==="string")return-1;if(E<$)return-1;if(E>$)return 1}return 0}function cb(A){return typeof A==="number"&&!Number.isNaN(A)&&(!Number.isFinite(A)||0<=A&&A<=Number.MAX_SAFE_INTEGER)}function D$(A){return A.split(".").filter(Boolean).map((Q)=>{if(hcA.test(Q)){let B=Number(Q);if(cb(B))return B}return Q})}function KG(A){return A.split(".").filter(Boolean)}function Hw(A,Q){let B=Number(A);if(!cb(B))throw TypeError(Q);return B}function lJ(A){return Number.isNaN(A.major)&&Number.isNaN(A.minor)&&Number.isNaN(A.patch)&&(A.prerelease===void 0||A.prerelease.length===0)&&(A.build===void 0||A.build.length===0)}var z7="0|[1-9]\\d*",bcA="\\d*[a-zA-Z-][a-zA-Z0-9-]*",ycA,lIA,nIA,dIA="[0-9A-Za-z-]+",iIA,rIA,oIA,aIA="(?:<|>)?=?",fcA="x|X|\\*",mb,Uw,sIA,tIA,lb=256,hcA;var r$=jA(()=>{ycA=`(?<major>${z7})\\.(?<minor>${z7})\\.(?<patch>${z7})`,lIA=`(?:${z7}|${bcA})`,nIA=`(?:-(?<prerelease>${lIA}(?:\\.${lIA})*))`,iIA=`(?:\\+(?<buildmetadata>${dIA}(?:\\.${dIA})*))`,rIA=`v?${ycA}${nIA}?${iIA}?`,oIA=new RegExp(`^${rIA}$`),mb=`${z7}|${fcA}`,Uw=`[v=\\s]*(?<major>${mb})(?:\\.(?<minor>${mb})(?:\\.(?<patch>${mb})${nIA}?${iIA}?)?)?`,sIA=new RegExp(`^(?<operator>~>?|\\^|${aIA})\\s*${Uw}$`),tIA=new RegExp(`^(?<operator>${aIA})\\s*(${rIA})$|^$`);hcA=new RegExp(`^${z7}$`)});function j4(A,Q){if(A===Q)return 0;return Jw(A.major,Q.major)||Jw(A.minor,Q.minor)||Jw(A.patch,Q.patch)||pIA(A.prerelease,Q.prerelease)||Yw(A.prerelease,Q.prerelease)}var S6=jA(()=>{r$()});function eIA(A,Q){let B=A.prerelease?.length||Q.prerelease?.length;if(A.major!==Q.major)return B?"premajor":"major";if(A.minor!==Q.minor)return B?"preminor":"minor";if(A.patch!==Q.patch)return B?"prepatch":"patch";if(Yw(A.prerelease,Q.prerelease)!==0)return"prerelease"}var A1A=jA(()=>{r$()});function db(A){return A.toFixed(0)}function S8(A){let Q=db(A.major),B=db(A.minor),I=db(A.patch),E=A.prerelease?.join(".")??"",$=A.build?.join(".")??"";return[[`${Q}.${B}.${I}`,E].filter((Y)=>Y).join("-"),$].filter((Y)=>Y).join("+")}function ucA(A,Q){if(lJ(Q))return!0;let B=j4(A,Q);switch(Q.operator){case"=":case void 0:return B===0;case"!=":return B!==0;case">":return B>0;case"<":return B<0;case">=":return B>=0;case"<=":return B<=0}}function Xw(A,Q){for(let B of Q)if(!ucA(A,B))return!1;if(!A.prerelease?.length)return!0;for(let B of Q){if(lJ(B))continue;if(!B.prerelease?.length)continue;let{major:I,minor:E,patch:$}=B;if(A.major===I&&A.minor===E&&A.patch===$)return!0}return!1}var Fw=jA(()=>{r$();S6()});function lK(A,Q){return Q.some((B)=>Xw(A,B))}var dK=jA(()=>{Fw()});function mcA(A=[]){let Q=[...A],B=Q.length;while(B>=0){let I=Q[B];if(typeof I==="number"){Q[B]=I+1;break}B-=1}if(B===-1)Q.push(0);return Q}function pK(A=[],Q){let B=mcA(A);if(!Q)return B;let I=D$(Q);if(I.every((E)=>typeof E==="string")){if(I.every((E,$)=>E===B[$])&&typeof B[I.length]==="number")return B;I=[...I,0]}return I}function UY(A,Q,B={}){let I=B.build!==void 0?KG(B.build):A.build??[];switch(Q){case"premajor":return{major:A.major+1,minor:0,patch:0,prerelease:pK(A.prerelease,B.prerelease),build:I};case"preminor":return{major:A.major,minor:A.minor+1,patch:0,prerelease:pK(A.prerelease,B.prerelease),build:I};case"prepatch":return{major:A.major,minor:A.minor,patch:A.patch+1,prerelease:pK(A.prerelease,B.prerelease),build:I};case"prerelease":{let $=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:$,prerelease:pK(A.prerelease,B.prerelease),build:I}}case"major":return{major:(A.prerelease??[]).length===0||A.minor!==0||A.patch!==0?A.major+1:A.major,minor:0,patch:0,prerelease:[],build:I};case"minor":{let $=(A.prerelease??[]).length===0||A.patch!==0?A.minor+1:A.minor;return{major:A.major,minor:$,patch:0,prerelease:[],build:I}}case"patch":{let $=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:$,prerelease:[],build:I}}case"pre":return{major:A.major,minor:A.minor,patch:A.patch,prerelease:pK(A.prerelease,B.prerelease),build:I};default:throw TypeError(`Cannot increment version: invalid argument ${Q}`)}}var Q1A=jA(()=>{r$()});var Cw,L7;var nK=jA(()=>{Cw={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},L7={operator:void 0,...Cw}});var pb=jA(()=>{nK();r$()});function nb(A,Q){return j4(A,Q)>0}var ib=jA(()=>{S6()});var B1A=jA(()=>{dK();ib()});function o$(A,Q){return j4(A,Q)<0}var rb=jA(()=>{S6()});var I1A=jA(()=>{dK();rb()});function ccA(A){let B=A.match(tIA)?.groups;if(!B)return null;let{operator:I}=B;return{operator:I||void 0,...Cw}}function eI(A){return!A||A.toLowerCase()==="x"||A==="*"}function lcA(A){if(eI(A.major))return;if(eI(A.minor))return{operator:">=",major:+A.major,minor:0,patch:0,prerelease:[],build:[]};if(eI(A.patch))return{operator:">=",major:+A.major,minor:+A.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:A.prerelease?D$(A.prerelease):[],build:[]}}function dcA(A){if(eI(A.major))return;if(eI(A.minor))return{operator:"<",major:+A.major+1,minor:0,patch:0,prerelease:[],build:[]};if(eI(A.patch))return{operator:"<",major:+A.major,minor:+A.minor+1,patch:0,prerelease:[],build:[]};if(A.prerelease)return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:D$(A.prerelease),build:[]};return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:[],build:[]}}function pcA(A){let Q=A.match(new RegExp(`^${Uw}`)),B=Q?.groups;if(!B)return null;let I=Q[0].length,E=A.slice(I).match(/^\s+-\s+/);if(!E)return null;let $=E[0].length,G=A.slice(I+$).match(new RegExp(`^${Uw}\\s*$`))?.groups,Y=lcA(B),H=dcA(G);return[Y,H].filter(Boolean)}function ncA(A){let Q=eI(A.major),B=eI(A.minor),I=eI(A.patch),E=+A.major,$=+A.minor,D=+A.patch;if(Q)return[L7];if(B)return[{operator:">=",major:E,minor:0,patch:0},{operator:"<",major:E+1,minor:0,patch:0}];if(I){if(E===0)return[{operator:">=",major:E,minor:$,patch:0},{operator:"<",major:E,minor:$+1,patch:0}];return[{operator:">=",major:E,minor:$,patch:0},{operator:"<",major:E+1,minor:0,patch:0}]}let G=D$(A.prerelease??"");if(E===0){if($===0)return[{operator:">=",major:E,minor:$,patch:D,prerelease:G},{operator:"<",major:E,minor:$,patch:D+1}];return[{operator:">=",major:E,minor:$,patch:D,prerelease:G},{operator:"<",major:E,minor:$+1,patch:0}]}return[{operator:">=",major:E,minor:$,patch:D,prerelease:G},{operator:"<",major:E+1,minor:0,patch:0}]}function icA(A){let Q=eI(A.major),B=eI(A.minor),I=eI(A.patch),E=+A.major,$=+A.minor,D=+A.patch;if(Q)return[L7];if(B)return[{operator:">=",major:E,minor:0,patch:0},{operator:"<",major:E+1,minor:0,patch:0}];if(I)return[{operator:">=",major:E,minor:$,patch:0},{operator:"<",major:E,minor:$+1,patch:0}];let G=D$(A.prerelease??"");return[{operator:">=",major:E,minor:$,patch:D,prerelease:G},{operator:"<",major:E,minor:$+1,patch:0}]}function rcA(A){let Q=eI(A.major),B=eI(A.minor),I=eI(A.patch),E=+A.major,$=+A.minor,D=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B){if(I)return[{operator:"<",major:E,minor:0,patch:0}];return[{operator:"<",major:E,minor:0,patch:0}]}if(I)return[{operator:"<",major:E,minor:$,patch:0}];let G=D$(A.prerelease??""),Y=KG(A.build??"");return[{operator:"<",major:E,minor:$,patch:D,prerelease:G,build:Y}]}function ocA(A){let Q=eI(A.minor),B=eI(A.patch),I=+A.major,E=+A.minor,$=+A.patch;if(Q)return[{operator:"<",major:I+1,minor:0,patch:0}];if(B)return[{operator:"<",major:I,minor:E+1,patch:0}];let D=D$(A.prerelease??""),G=KG(A.build??"");return[{operator:"<=",major:I,minor:E,patch:$,prerelease:D,build:G}]}function acA(A){let Q=eI(A.major),B=eI(A.minor),I=eI(A.patch),E=+A.major,$=+A.minor,D=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B)return[{operator:">=",major:E+1,minor:0,patch:0}];if(I)return[{operator:">=",major:E,minor:$+1,patch:0}];let G=D$(A.prerelease??""),Y=KG(A.build??"");return[{operator:">",major:E,minor:$,patch:D,prerelease:G,build:Y}]}function scA(A){let Q=eI(A.major),B=eI(A.minor),I=eI(A.patch),E=+A.major,$=+A.minor,D=+A.patch;if(Q)return[L7];if(B)return[{operator:">=",major:E,minor:0,patch:0}];if(I)return[{operator:">=",major:E,minor:$,patch:0}];let G=D$(A.prerelease??""),Y=KG(A.build??"");return[{operator:">=",major:E,minor:$,patch:D,prerelease:G,build:Y}]}function tcA(A){let Q=eI(A.major),B=eI(A.minor),I=eI(A.patch),E=+A.major,$=+A.minor,D=+A.patch;if(Q)return[L7];if(B)return[{operator:">=",major:E,minor:0,patch:0},{operator:"<",major:E+1,minor:0,patch:0}];if(I)return[{operator:">=",major:E,minor:$,patch:0},{operator:"<",major:E,minor:$+1,patch:0}];let G=D$(A.prerelease??""),Y=KG(A.build??"");return[{operator:A.operator==="="?"=":void 0,major:E,minor:$,patch:D,prerelease:G,build:Y}]}function ecA(A){let Q=A.match(sIA)?.groups;if(!Q)return ccA(A);switch(Q.operator){case"^":return ncA(Q);case"~":case"~>":return icA(Q);case"<":return rcA(Q);case"<=":return ocA(Q);case">":return acA(Q);case">=":return scA(Q);default:return tcA(Q)}}function AlA(A){return A.split(/\s+/).flatMap(ecA)}function Ww(A){let Q=A.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((B)=>pcA(B)||AlA(B));if(Q.some((B)=>B.includes(null)))throw TypeError(`Cannot parse version range: range "${A}" is invalid`);return Q}var ob=jA(()=>{r$();nK()});function iB(A){if(typeof A!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof A}`);if(A.length>lb)throw TypeError(`Cannot parse version as version length is too long: length is ${A.length}, max length is ${lb}`);A=A.trim();let Q=A.match(oIA)?.groups;if(!Q)throw TypeError(`Cannot parse version: ${A}`);let B=Hw(Q.major,`Cannot parse version ${A}: invalid major version`),I=Hw(Q.minor,`Cannot parse version ${A}: invalid minor version`),E=Hw(Q.patch,`Cannot parse version ${A}: invalid patch version`),$=Q.prerelease?D$(Q.prerelease):[],D=Q.buildmetadata?KG(Q.buildmetadata):[];return{major:B,minor:I,patch:E,prerelease:$,build:D}}var Kw=jA(()=>{r$();r$()});function E1A(A,Q){let B=A.operator,I=Q.operator;if(B===void 0){if(lJ(A))return!0;return lK(A,[[Q]])}if(I===void 0){if(lJ(Q))return!0;return lK(Q,[[A]])}let E=j4(A,Q);return(B===">="||B===">")&&(I===">="||I===">")||(B==="<="||B==="<")&&(I==="<="||I==="<")||E===0&&((B===">="||B==="<=")&&(I===">="||I==="<="))||E===-1&&(B===">="||B===">")&&(I==="<="||I==="<")||E===1&&(B==="<="||B==="<")&&(I===">="||I===">")}function QlA(A){return A.every((Q)=>{return Q.some((B)=>BlA(B))})}function BlA(A){for(let Q=0;Q<A.length-1;Q++){let B=A[Q];for(let I of A.slice(Q+1))if(!E1A(B,I))return!1}return!0}function $1A(A,Q){return QlA([A,Q])&&A.some((B)=>{return Q.some((I)=>{return B.every((E)=>{return I.every(($)=>E1A(E,$))})})})}var D1A=jA(()=>{r$();S6();dK()});var G1A=jA(()=>{ob()});var J1A=jA(()=>{nK();nK();pb()});function iK(A){try{return iB(A),!0}catch{return!1}}var Y1A=jA(()=>{Kw()});var U1A=jA(()=>{Kw()});var H1A=jA(()=>{r$()});var X1A=jA(()=>{S6()});var F1A=jA(()=>{S6()});var C1A=jA(()=>{Fw();r$();S6()});function W1A(A,Q){return j4(A,Q)>=0}var K1A=jA(()=>{S6()});var q1A=jA(()=>{Fw();r$();S6()});var Z1A=jA(()=>{S6()});var ND=jA(()=>{S6();A1A();dK();Q1A();pb();B1A();I1A();ob();Kw();D1A();G1A();J1A();Y1A();U1A();H1A();X1A();F1A();ib();C1A();K1A();rb();q1A();Z1A()});var G$=x((gdQ,Mw)=>{var M1A,N1A,z1A,L1A,w1A,O1A,R1A,V1A,T1A,S1A,j1A,P1A,_1A,qw,ab,k1A,v1A,x1A,w7,g1A,b1A,y1A,f1A,h1A,u1A,m1A,c1A,l1A,Zw,d1A,p1A,n1A;(function(A){var Q=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(I){A(B(Q,B(I)))});else if(typeof Mw==="object"&&typeof gdQ==="object")A(B(Q,B(gdQ)));else A(B(Q));function B(I,E){if(I!==Q)if(typeof Object.create==="function")Object.defineProperty(I,"__esModule",{value:!0});else I.__esModule=!0;return function($,D){return I[$]=E?E($,D):D}}})(function(A){var Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,D){$.__proto__=D}||function($,D){for(var G in D)if(Object.prototype.hasOwnProperty.call(D,G))$[G]=D[G]};M1A=function($,D){if(typeof D!=="function"&&D!==null)throw TypeError("Class extends value "+String(D)+" is not a constructor or null");Q($,D);function G(){this.constructor=$}$.prototype=D===null?Object.create(D):(G.prototype=D.prototype,new G)},N1A=Object.assign||function($){for(var D,G=1,Y=arguments.length;G<Y;G++){D=arguments[G];for(var H in D)if(Object.prototype.hasOwnProperty.call(D,H))$[H]=D[H]}return $},z1A=function($,D){var G={};for(var Y in $)if(Object.prototype.hasOwnProperty.call($,Y)&&D.indexOf(Y)<0)G[Y]=$[Y];if($!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var H=0,Y=Object.getOwnPropertySymbols($);H<Y.length;H++)if(D.indexOf(Y[H])<0&&Object.prototype.propertyIsEnumerable.call($,Y[H]))G[Y[H]]=$[Y[H]]}return G},L1A=function($,D,G,Y){var H=arguments.length,X=H<3?D:Y===null?Y=Object.getOwnPropertyDescriptor(D,G):Y,C;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")X=Reflect.decorate($,D,G,Y);else for(var W=$.length-1;W>=0;W--)if(C=$[W])X=(H<3?C(X):H>3?C(D,G,X):C(D,G))||X;return H>3&&X&&Object.defineProperty(D,G,X),X},w1A=function($,D){return function(G,Y){D(G,Y,$)}},O1A=function($,D,G,Y,H,X){function C(g){if(g!==void 0&&typeof g!=="function")throw TypeError("Function expected");return g}var W=Y.kind,q=W==="getter"?"get":W==="setter"?"set":"value",Z=!D&&$?Y.static?$:$.prototype:null,M=D||(Z?Object.getOwnPropertyDescriptor(Z,Y.name):{}),w,O=!1;for(var T=G.length-1;T>=0;T--){var R={};for(var S in Y)R[S]=S==="access"?{}:Y[S];for(var S in Y.access)R.access[S]=Y.access[S];R.addInitializer=function(g){if(O)throw TypeError("Cannot add initializers after decoration has completed");X.push(C(g||null))};var j=(0,G[T])(W==="accessor"?{get:M.get,set:M.set}:M[q],R);if(W==="accessor"){if(j===void 0)continue;if(j===null||typeof j!=="object")throw TypeError("Object expected");if(w=C(j.get))M.get=w;if(w=C(j.set))M.set=w;if(w=C(j.init))H.unshift(w)}else if(w=C(j))if(W==="field")H.unshift(w);else M[q]=w}if(Z)Object.defineProperty(Z,Y.name,M);O=!0},R1A=function($,D,G){var Y=arguments.length>2;for(var H=0;H<D.length;H++)G=Y?D[H].call($,G):D[H].call($);return Y?G:void 0},V1A=function($){return typeof $==="symbol"?$:"".concat($)},T1A=function($,D,G){if(typeof D==="symbol")D=D.description?"[".concat(D.description,"]"):"";return Object.defineProperty($,"name",{configurable:!0,value:G?"".concat(G," ",D):D})},S1A=function($,D){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata($,D)},j1A=function($,D,G,Y){function H(X){return X instanceof G?X:new G(function(C){C(X)})}return new(G||(G=Promise))(function(X,C){function W(M){try{Z(Y.next(M))}catch(w){C(w)}}function q(M){try{Z(Y.throw(M))}catch(w){C(w)}}function Z(M){M.done?X(M.value):H(M.value).then(W,q)}Z((Y=Y.apply($,D||[])).next())})},P1A=function($,D){var G={label:0,sent:function(){if(X[0]&1)throw X[1];return X[1]},trys:[],ops:[]},Y,H,X,C=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return C.next=W(0),C.throw=W(1),C.return=W(2),typeof Symbol==="function"&&(C[Symbol.iterator]=function(){return this}),C;function W(Z){return function(M){return q([Z,M])}}function q(Z){if(Y)throw TypeError("Generator is already executing.");while(C&&(C=0,Z[0]&&(G=0)),G)try{if(Y=1,H&&(X=Z[0]&2?H.return:Z[0]?H.throw||((X=H.return)&&X.call(H),0):H.next)&&!(X=X.call(H,Z[1])).done)return X;if(H=0,X)Z=[Z[0]&2,X.value];switch(Z[0]){case 0:case 1:X=Z;break;case 4:return G.label++,{value:Z[1],done:!1};case 5:G.label++,H=Z[1],Z=[0];continue;case 7:Z=G.ops.pop(),G.trys.pop();continue;default:if((X=G.trys,!(X=X.length>0&&X[X.length-1]))&&(Z[0]===6||Z[0]===2)){G=0;continue}if(Z[0]===3&&(!X||Z[1]>X[0]&&Z[1]<X[3])){G.label=Z[1];break}if(Z[0]===6&&G.label<X[1]){G.label=X[1],X=Z;break}if(X&&G.label<X[2]){G.label=X[2],G.ops.push(Z);break}if(X[2])G.ops.pop();G.trys.pop();continue}Z=D.call($,G)}catch(M){Z=[6,M],H=0}finally{Y=X=0}if(Z[0]&5)throw Z[1];return{value:Z[0]?Z[1]:void 0,done:!0}}},_1A=function($,D){for(var G in $)if(G!=="default"&&!Object.prototype.hasOwnProperty.call(D,G))Zw(D,$,G)},Zw=Object.create?function($,D,G,Y){if(Y===void 0)Y=G;var H=Object.getOwnPropertyDescriptor(D,G);if(!H||("get"in H?!D.__esModule:H.writable||H.configurable))H={enumerable:!0,get:function(){return D[G]}};Object.defineProperty($,Y,H)}:function($,D,G,Y){if(Y===void 0)Y=G;$[Y]=D[G]},qw=function($){var D=typeof Symbol==="function"&&Symbol.iterator,G=D&&$[D],Y=0;if(G)return G.call($);if($&&typeof $.length==="number")return{next:function(){if($&&Y>=$.length)$=void 0;return{value:$&&$[Y++],done:!$}}};throw TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")},ab=function($,D){var G=typeof Symbol==="function"&&$[Symbol.iterator];if(!G)return $;var Y=G.call($),H,X=[],C;try{while((D===void 0||D-- >0)&&!(H=Y.next()).done)X.push(H.value)}catch(W){C={error:W}}finally{try{if(H&&!H.done&&(G=Y.return))G.call(Y)}finally{if(C)throw C.error}}return X},k1A=function(){for(var $=[],D=0;D<arguments.length;D++)$=$.concat(ab(arguments[D]));return $},v1A=function(){for(var $=0,D=0,G=arguments.length;D<G;D++)$+=arguments[D].length;for(var Y=Array($),H=0,D=0;D<G;D++)for(var X=arguments[D],C=0,W=X.length;C<W;C++,H++)Y[H]=X[C];return Y},x1A=function($,D,G){if(G||arguments.length===2){for(var Y=0,H=D.length,X;Y<H;Y++)if(X||!(Y in D)){if(!X)X=Array.prototype.slice.call(D,0,Y);X[Y]=D[Y]}}return $.concat(X||Array.prototype.slice.call(D))},w7=function($){return this instanceof w7?(this.v=$,this):new w7($)},g1A=function($,D,G){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var Y=G.apply($,D||[]),H,X=[];return H=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),W("next"),W("throw"),W("return",C),H[Symbol.asyncIterator]=function(){return this},H;function C(T){return function(R){return Promise.resolve(R).then(T,w)}}function W(T,R){if(Y[T]){if(H[T]=function(S){return new Promise(function(j,g){X.push([T,S,j,g])>1||q(T,S)})},R)H[T]=R(H[T])}}function q(T,R){try{Z(Y[T](R))}catch(S){O(X[0][3],S)}}function Z(T){T.value instanceof w7?Promise.resolve(T.value.v).then(M,w):O(X[0][2],T)}function M(T){q("next",T)}function w(T){q("throw",T)}function O(T,R){if(T(R),X.shift(),X.length)q(X[0][0],X[0][1])}},b1A=function($){var D,G;return D={},Y("next"),Y("throw",function(H){throw H}),Y("return"),D[Symbol.iterator]=function(){return this},D;function Y(H,X){D[H]=$[H]?function(C){return(G=!G)?{value:w7($[H](C)),done:!1}:X?X(C):C}:X}},y1A=function($){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var D=$[Symbol.asyncIterator],G;return D?D.call($):($=typeof qw==="function"?qw($):$[Symbol.iterator](),G={},Y("next"),Y("throw"),Y("return"),G[Symbol.asyncIterator]=function(){return this},G);function Y(X){G[X]=$[X]&&function(C){return new Promise(function(W,q){C=$[X](C),H(W,q,C.done,C.value)})}}function H(X,C,W,q){Promise.resolve(q).then(function(Z){X({value:Z,done:W})},C)}},f1A=function($,D){if(Object.defineProperty)Object.defineProperty($,"raw",{value:D});else $.raw=D;return $};var B=Object.create?function($,D){Object.defineProperty($,"default",{enumerable:!0,value:D})}:function($,D){$.default=D},I=function($){return I=Object.getOwnPropertyNames||function(D){var G=[];for(var Y in D)if(Object.prototype.hasOwnProperty.call(D,Y))G[G.length]=Y;return G},I($)};h1A=function($){if($&&$.__esModule)return $;var D={};if($!=null){for(var G=I($),Y=0;Y<G.length;Y++)if(G[Y]!=="default")Zw(D,$,G[Y])}return B(D,$),D},u1A=function($){return $&&$.__esModule?$:{default:$}},m1A=function($,D,G,Y){if(G==="a"&&!Y)throw TypeError("Private accessor was defined without a getter");if(typeof D==="function"?$!==D||!Y:!D.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return G==="m"?Y:G==="a"?Y.call($):Y?Y.value:D.get($)},c1A=function($,D,G,Y,H){if(Y==="m")throw TypeError("Private method is not writable");if(Y==="a"&&!H)throw TypeError("Private accessor was defined without a setter");if(typeof D==="function"?$!==D||!H:!D.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Y==="a"?H.call($,G):H?H.value=G:D.set($,G),G},l1A=function($,D){if(D===null||typeof D!=="object"&&typeof D!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof $==="function"?D===$:$.has(D)},d1A=function($,D,G){if(D!==null&&D!==void 0){if(typeof D!=="object"&&typeof D!=="function")throw TypeError("Object expected.");var Y,H;if(G){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");Y=D[Symbol.asyncDispose]}if(Y===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(Y=D[Symbol.dispose],G)H=Y}if(typeof Y!=="function")throw TypeError("Object not disposable.");if(H)Y=function(){try{H.call(this)}catch(X){return Promise.reject(X)}};$.stack.push({value:D,dispose:Y,async:G})}else if(G)$.stack.push({async:!0});return D};var E=typeof SuppressedError==="function"?SuppressedError:function($,D,G){var Y=Error(G);return Y.name="SuppressedError",Y.error=$,Y.suppressed=D,Y};p1A=function($){function D(X){$.error=$.hasError?new E(X,$.error,"An error was suppressed during disposal."):X,$.hasError=!0}var G,Y=0;function H(){while(G=$.stack.pop())try{if(!G.async&&Y===1)return Y=0,$.stack.push(G),Promise.resolve().then(H);if(G.dispose){var X=G.dispose.call(G.value);if(G.async)return Y|=2,Promise.resolve(X).then(H,function(C){return D(C),H()})}else Y|=1}catch(C){D(C)}if(Y===1)return $.hasError?Promise.reject($.error):Promise.resolve();if($.hasError)throw $.error}return H()},n1A=function($,D){if(typeof $==="string"&&/^\.\.?\//.test($))return $.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(G,Y,H,X,C){return Y?D?".jsx":".js":H&&(!X||!C)?G:H+X+"."+C.toLowerCase()+"js"});return $},A("__extends",M1A),A("__assign",N1A),A("__rest",z1A),A("__decorate",L1A),A("__param",w1A),A("__esDecorate",O1A),A("__runInitializers",R1A),A("__propKey",V1A),A("__setFunctionName",T1A),A("__metadata",S1A),A("__awaiter",j1A),A("__generator",P1A),A("__exportStar",_1A),A("__createBinding",Zw),A("__values",qw),A("__read",ab),A("__spread",k1A),A("__spreadArrays",v1A),A("__spreadArray",x1A),A("__await",w7),A("__asyncGenerator",g1A),A("__asyncDelegator",b1A),A("__asyncValues",y1A),A("__makeTemplateObject",f1A),A("__importStar",h1A),A("__importDefault",u1A),A("__classPrivateFieldGet",m1A),A("__classPrivateFieldSet",c1A),A("__classPrivateFieldIn",l1A),A("__addDisposableResource",d1A),A("__disposeResources",p1A),A("__rewriteRelativeImportExtension",n1A)})});var o1A=x((i1A)=>{Object.defineProperty(i1A,"__esModule",{value:!0});i1A.resolveFetch=void 0;var IlA=(A)=>{if(A)return(...Q)=>A(...Q);return(...Q)=>fetch(...Q)};i1A.resolveFetch=IlA});var sb=x((AEA)=>{Object.defineProperty(AEA,"__esModule",{value:!0});AEA.FunctionRegion=AEA.FunctionsHttpError=AEA.FunctionsRelayError=AEA.FunctionsFetchError=AEA.FunctionsError=void 0;class rK extends Error{constructor(A,Q="FunctionsError",B){super(A);this.name=Q,this.context=B}toJSON(){return{name:this.name,message:this.message,context:this.context}}}AEA.FunctionsError=rK;class s1A extends rK{constructor(A){super("Failed to send a request to the Edge Function","FunctionsFetchError",A)}}AEA.FunctionsFetchError=s1A;class t1A extends rK{constructor(A){super("Relay Error invoking the Edge Function","FunctionsRelayError",A)}}AEA.FunctionsRelayError=t1A;class e1A extends rK{constructor(A){super("Edge Function returned a non-2xx status code","FunctionsHttpError",A)}}AEA.FunctionsHttpError=e1A;var a1A;(function(A){A.Any="any",A.ApNortheast1="ap-northeast-1",A.ApNortheast2="ap-northeast-2",A.ApSouth1="ap-south-1",A.ApSoutheast1="ap-southeast-1",A.ApSoutheast2="ap-southeast-2",A.CaCentral1="ca-central-1",A.EuCentral1="eu-central-1",A.EuWest1="eu-west-1",A.EuWest2="eu-west-2",A.EuWest3="eu-west-3",A.SaEast1="sa-east-1",A.UsEast1="us-east-1",A.UsWest1="us-west-1",A.UsWest2="us-west-2"})(a1A||(AEA.FunctionRegion=a1A={}))});var $EA=x((IEA)=>{Object.defineProperty(IEA,"__esModule",{value:!0});IEA.FunctionsClient=void 0;var JlA=G$(),YlA=o1A(),O7=sb();class BEA{constructor(A,{headers:Q={},customFetch:B,region:I=O7.FunctionRegion.Any}={}){this.url=A,this.headers=Q,this.region=I,this.fetch=(0,YlA.resolveFetch)(B)}setAuth(A){this.headers.Authorization=`Bearer ${A}`}invoke(A){return JlA.__awaiter(this,arguments,void 0,function*(Q,B={}){var I;let E,$;try{let{headers:D,method:G,body:Y,signal:H,timeout:X}=B,C={},{region:W}=B;if(!W)W=this.region;let q=new URL(`${this.url}/${Q}`);if(W&&W!=="any")C["x-region"]=W,q.searchParams.set("forceFunctionRegion",W);let Z;if(Y&&(D&&!Object.prototype.hasOwnProperty.call(D,"Content-Type")||!D))if(typeof Blob<"u"&&Y instanceof Blob||Y instanceof ArrayBuffer)C["Content-Type"]="application/octet-stream",Z=Y;else if(typeof Y==="string")C["Content-Type"]="text/plain",Z=Y;else if(typeof FormData<"u"&&Y instanceof FormData)Z=Y;else C["Content-Type"]="application/json",Z=JSON.stringify(Y);else if(Y&&typeof Y!=="string"&&!(typeof Blob<"u"&&Y instanceof Blob)&&!(Y instanceof ArrayBuffer)&&!(typeof FormData<"u"&&Y instanceof FormData))Z=JSON.stringify(Y);else Z=Y;let M=H;if(X)if($=new AbortController,E=setTimeout(()=>$.abort(),X),H)M=$.signal,H.addEventListener("abort",()=>$.abort());else M=$.signal;let w=yield this.fetch(q.toString(),{method:G||"POST",headers:Object.assign(Object.assign(Object.assign({},C),this.headers),D),body:Z,signal:M}).catch((S)=>{throw new O7.FunctionsFetchError(S)}),O=w.headers.get("x-relay-error");if(O&&O==="true")throw new O7.FunctionsRelayError(w);if(!w.ok)throw new O7.FunctionsHttpError(w);let T=((I=w.headers.get("Content-Type"))!==null&&I!==void 0?I:"text/plain").split(";")[0].trim(),R;if(T==="application/json")R=yield w.json();else if(T==="application/octet-stream"||T==="application/pdf")R=yield w.blob();else if(T==="text/event-stream")R=w;else if(T==="multipart/form-data")R=yield w.formData();else R=yield w.text();return{data:R,error:null,response:w}}catch(D){return{data:null,error:D,response:D instanceof O7.FunctionsHttpError||D instanceof O7.FunctionsRelayError?D.context:void 0}}finally{if(E)clearTimeout(E)}})}}IEA.FunctionsClient=BEA});var DEA=x((HY)=>{Object.defineProperty(HY,"__esModule",{value:!0});HY.FunctionRegion=HY.FunctionsRelayError=HY.FunctionsHttpError=HY.FunctionsFetchError=HY.FunctionsError=HY.FunctionsClient=void 0;var UlA=$EA();Object.defineProperty(HY,"FunctionsClient",{enumerable:!0,get:function(){return UlA.FunctionsClient}});var oK=sb();Object.defineProperty(HY,"FunctionsError",{enumerable:!0,get:function(){return oK.FunctionsError}});Object.defineProperty(HY,"FunctionsFetchError",{enumerable:!0,get:function(){return oK.FunctionsFetchError}});Object.defineProperty(HY,"FunctionsHttpError",{enumerable:!0,get:function(){return oK.FunctionsHttpError}});Object.defineProperty(HY,"FunctionsRelayError",{enumerable:!0,get:function(){return oK.FunctionsRelayError}});Object.defineProperty(HY,"FunctionRegion",{enumerable:!0,get:function(){return oK.FunctionRegion}})});function JEA(A,Q){return new Promise((B)=>{if(Q===null||Q===void 0?void 0:Q.aborted){B();return}let I=setTimeout(()=>{Q===null||Q===void 0||Q.removeEventListener("abort",E),B()},A);function E(){clearTimeout(I),B()}Q===null||Q===void 0||Q.addEventListener("abort",E)})}function FlA(A,Q,B,I){if(!I||B>=3)return!1;if(!HEA.includes(A))return!1;if(!XlA.includes(Q))return!1;return!0}function aK(A){return aK=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},aK(A)}function qlA(A,Q){if(aK(A)!="object"||!A)return A;var B=A[Symbol.toPrimitive];if(B!==void 0){var I=B.call(A,Q||"default");if(aK(I)!="object")return I;throw TypeError("@@toPrimitive must return a primitive value.")}return(Q==="string"?String:Number)(A)}function ZlA(A){var Q=qlA(A,"string");return aK(Q)=="symbol"?Q:Q+""}function MlA(A,Q,B){return(Q=ZlA(Q))in A?Object.defineProperty(A,Q,{value:B,enumerable:!0,configurable:!0,writable:!0}):A[Q]=B,A}function UEA(A,Q){var B=Object.keys(A);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(A);Q&&(I=I.filter(function(E){return Object.getOwnPropertyDescriptor(A,E).enumerable})),B.push.apply(B,I)}return B}function Nw(A){for(var Q=1;Q<arguments.length;Q++){var B=arguments[Q]!=null?arguments[Q]:{};Q%2?UEA(Object(B),!0).forEach(function(I){MlA(A,I,B[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(B)):UEA(Object(B)).forEach(function(I){Object.defineProperty(A,I,Object.getOwnPropertyDescriptor(B,I))})}return A}var GEA=(A)=>Math.min(1000*2**A,30000),XlA,HEA,XEA,ClA=class{constructor(A){var Q,B,I,E,$;if(this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=A.method,this.url=A.url,this.headers=new Headers(A.headers),this.schema=A.schema,this.body=A.body,this.shouldThrowOnError=(Q=A.shouldThrowOnError)!==null&&Q!==void 0?Q:!1,this.signal=A.signal,this.isMaybeSingle=(B=A.isMaybeSingle)!==null&&B!==void 0?B:!1,this.shouldStripNulls=(I=A.shouldStripNulls)!==null&&I!==void 0?I:!1,this.urlLengthLimit=(E=A.urlLengthLimit)!==null&&E!==void 0?E:8000,this.retryEnabled=($=A.retry)!==null&&$!==void 0?$:!0,A.fetch)this.fetch=A.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(A,Q){return this.headers=new Headers(this.headers),this.headers.set(A,Q),this}retry(A){return this.retryEnabled=A,this}then(A,Q){var B=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");if(this.shouldStripNulls){let D=this.headers.get("Accept");if(D==="application/vnd.pgrst.object+json")this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped");else if(!D||D==="application/json")this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let I=this.fetch,$=(async()=>{let D=0;while(!0){let H=new Headers(B.headers);if(D>0)H.set("X-Retry-Count",String(D));let X;try{X=await I(B.url.toString(),{method:B.method,headers:H,body:JSON.stringify(B.body,(C,W)=>typeof W==="bigint"?W.toString():W),signal:B.signal})}catch(C){if((C===null||C===void 0?void 0:C.name)==="AbortError"||(C===null||C===void 0?void 0:C.code)==="ABORT_ERR")throw C;if(!HEA.includes(B.method))throw C;if(B.retryEnabled&&D<3){let W=GEA(D);D++,await JEA(W,B.signal);continue}throw C}if(FlA(B.method,X.status,D,B.retryEnabled)){var G,Y;let C=(G=(Y=X.headers)===null||Y===void 0?void 0:Y.get("Retry-After"))!==null&&G!==void 0?G:null,W=C!==null?Math.max(0,parseInt(C,10)||0)*1000:GEA(D);await X.text(),D++,await JEA(W,B.signal);continue}return await B.processResponse(X)}})();if(!this.shouldThrowOnError)$=$.catch((D)=>{var G;let Y="",H="",X="",C=D===null||D===void 0?void 0:D.cause;if(C){var W,q,Z,M;let T=(W=C===null||C===void 0?void 0:C.message)!==null&&W!==void 0?W:"",R=(q=C===null||C===void 0?void 0:C.code)!==null&&q!==void 0?q:"";if(Y=`${(Z=D===null||D===void 0?void 0:D.name)!==null&&Z!==void 0?Z:"FetchError"}: ${D===null||D===void 0?void 0:D.message}`,Y+=`
|
|
96
96
|
|
|
97
97
|
Caused by: ${(M=C===null||C===void 0?void 0:C.name)!==null&&M!==void 0?M:"Error"}: ${T}`,R)Y+=` (${R})`;if(C===null||C===void 0?void 0:C.stack)Y+=`
|
|
@@ -759,7 +759,7 @@ ${"⚠ AI can make mistakes. Always verify the diagnosis against the full log be
|
|
|
759
759
|
- The .p8 file is correct and hasn't been modified
|
|
760
760
|
- The Key ID matches the key shown in App Store Connect
|
|
761
761
|
- The Issuer ID is correct (shown at the top of the API keys page)
|
|
762
|
-
- The key has "Admin" or "Developer" access`);throw Q}}async function owA(A,Q={}){return((await tG("/certificates?filter[certificateType]=IOS_DISTRIBUTION&limit=10",A)).data||[]).map((I)=>({id:I.id,name:I.attributes.name||I.attributes.displayName||"iOS Distribution",serialNumber:I.attributes.serialNumber||"",expirationDate:I.attributes.expirationDate,...Q.includeContent&&I.attributes.certificateContent?{certificateContent:I.attributes.certificateContent}:{}}))}function szQ(A){let{Buffer:Q}=kA("node:buffer"),{createHash:B}=kA("node:crypto"),I=Q.from(A,"base64");return B("sha1").update(I).digest("hex").toLowerCase()}async function Yo(A,Q){let B=Q.toLowerCase(),I=await owA(A,{includeContent:!0});for(let E of I){if(!E.certificateContent)continue;if(szQ(E.certificateContent)===B)return E.id}return null}async function awA(A,Q){let B=await tG(`/profiles?filter[certificates]=${encodeURIComponent(Q)}&include=bundleId&limit=50`,A),I=B.included||[],E=new Map;for(let $ of I)if($.type==="bundleIds"&&$.attributes?.identifier)E.set($.id,$.attributes.identifier);return(B.data||[]).map(($)=>{let D=$.relationships?.bundleId?.data?.id;return{id:$.id,name:$.attributes.name||"",profileType:$.attributes.profileType||"",profileContent:$.attributes.profileContent||"",expirationDate:$.attributes.expirationDate||"",bundleIdentifier:D?E.get(D)||"":""}})}async function swA(A,Q){await tG(`/certificates/${Q}`,A,{method:"DELETE"})}class bC extends Error{certificates;constructor(A){super(`Certificate limit reached. Found ${A.length} existing iOS distribution certificate(s).`);this.certificates=A;this.name="CertificateLimitError"}}async function twA(A,Q){try{let I=(await tG("/certificates",A,{method:"POST",body:JSON.stringify({data:{type:"certificates",attributes:{certificateType:"IOS_DISTRIBUTION",csrContent:Q}}})})).data,E=Go(I.attributes.certificateContent);return{certificateId:I.id,certificateContent:I.attributes.certificateContent,expirationDate:I.attributes.expirationDate,teamId:E}}catch(B){if(B.message?.includes("ENTITY_ERROR.ATTRIBUTE.INVALID")||B.message?.includes("There is a problem with the request entity")||B.message?.includes("maximum number of certificates")){let I=await owA(A);if(I.length>0)throw new bC(I)}throw B}}async function Uo(A,Q){let B=await tG(`/bundleIds?filter[identifier]=${encodeURIComponent(Q)}&limit=1`,A);if(B.data?.length>0)return{bundleIdResourceId:B.data[0].id};return{bundleIdResourceId:(await tG("/bundleIds",A,{method:"POST",body:JSON.stringify({data:{type:"bundleIds",attributes:{identifier:Q,name:`Capgo ${
|
|
762
|
+
- The key has "Admin" or "Developer" access`);throw Q}}async function owA(A,Q={}){return((await tG("/certificates?filter[certificateType]=IOS_DISTRIBUTION&limit=10",A)).data||[]).map((I)=>({id:I.id,name:I.attributes.name||I.attributes.displayName||"iOS Distribution",serialNumber:I.attributes.serialNumber||"",expirationDate:I.attributes.expirationDate,...Q.includeContent&&I.attributes.certificateContent?{certificateContent:I.attributes.certificateContent}:{}}))}function szQ(A){let{Buffer:Q}=kA("node:buffer"),{createHash:B}=kA("node:crypto"),I=Q.from(A,"base64");return B("sha1").update(I).digest("hex").toLowerCase()}async function Yo(A,Q){let B=Q.toLowerCase(),I=await owA(A,{includeContent:!0});for(let E of I){if(!E.certificateContent)continue;if(szQ(E.certificateContent)===B)return E.id}return null}async function awA(A,Q){let B=await tG(`/profiles?filter[certificates]=${encodeURIComponent(Q)}&include=bundleId&limit=50`,A),I=B.included||[],E=new Map;for(let $ of I)if($.type==="bundleIds"&&$.attributes?.identifier)E.set($.id,$.attributes.identifier);return(B.data||[]).map(($)=>{let D=$.relationships?.bundleId?.data?.id;return{id:$.id,name:$.attributes.name||"",profileType:$.attributes.profileType||"",profileContent:$.attributes.profileContent||"",expirationDate:$.attributes.expirationDate||"",bundleIdentifier:D?E.get(D)||"":""}})}async function swA(A,Q){await tG(`/certificates/${Q}`,A,{method:"DELETE"})}class bC extends Error{certificates;constructor(A){super(`Certificate limit reached. Found ${A.length} existing iOS distribution certificate(s).`);this.certificates=A;this.name="CertificateLimitError"}}async function twA(A,Q){try{let I=(await tG("/certificates",A,{method:"POST",body:JSON.stringify({data:{type:"certificates",attributes:{certificateType:"IOS_DISTRIBUTION",csrContent:Q}}})})).data,E=Go(I.attributes.certificateContent);return{certificateId:I.id,certificateContent:I.attributes.certificateContent,expirationDate:I.attributes.expirationDate,teamId:E}}catch(B){if(B.message?.includes("ENTITY_ERROR.ATTRIBUTE.INVALID")||B.message?.includes("There is a problem with the request entity")||B.message?.includes("maximum number of certificates")){let I=await owA(A);if(I.length>0)throw new bC(I)}throw B}}async function Uo(A,Q){let B=await tG(`/bundleIds?filter[identifier]=${encodeURIComponent(Q)}&limit=1`,A);if(B.data?.length>0)return{bundleIdResourceId:B.data[0].id};let I=Q.replace(/[^a-zA-Z0-9]+/g," ").trim();return{bundleIdResourceId:(await tG("/bundleIds",A,{method:"POST",body:JSON.stringify({data:{type:"bundleIds",attributes:{identifier:Q,name:`Capgo ${I}`,platform:"IOS"}}})})).data.id}}function ewA(A){return`Capgo ${A} AppStore`}async function tzQ(A,Q){let B=ewA(Q);return((await tG(`/profiles?filter[name]=${encodeURIComponent(B)}&limit=10`,A)).data||[]).map((E)=>({id:E.id,name:E.attributes.name,profileType:E.attributes.profileType}))}async function AOA(A,Q){await tG(`/profiles/${Q}`,A,{method:"DELETE"})}class rN extends Error{profiles;constructor(A){super(`Duplicate profiles found: ${A.map((Q)=>Q.name).join(", ")}`);this.profiles=A;this.name="DuplicateProfileError"}}async function Ho(A,Q,B,I){let E=ewA(I);try{let $=await tG("/profiles",A,{method:"POST",body:JSON.stringify({data:{type:"profiles",attributes:{name:E,profileType:"IOS_APP_STORE"},relationships:{bundleId:{data:{type:"bundleIds",id:Q}},certificates:{data:[{type:"certificates",id:B}]}}}})});return{profileId:$.data.id,profileName:$.data.attributes.name,profileContent:$.data.attributes.profileContent,expirationDate:$.data.attributes.expirationDate}}catch($){if($.message?.includes("Multiple profiles found")||$.message?.includes("duplicate")){let D=await tzQ(A,I);if(D.length>0)throw new rN(D)}throw $}}function ezQ(A){if(!A||typeof A!=="object")return;let Q=A.status;return typeof Q==="number"?Q:void 0}function QOA(A){if(!A||typeof A!=="object")return;let Q=A.phase;return typeof Q==="string"?Q:void 0}function G_(A,Q){if(A instanceof bC)return"cert_limit_reached";let B=ezQ(A);if(B===401)return"apple_api_unauthorized";if(B===429)return"apple_api_rate_limited";let I=QOA(A);if(I==="profile")return"profile_creation_failed";if(I==="p8")return"p8_invalid";if(Q==="import-scanning")return"keychain_no_identities";if(Q==="import-compiling-helper")return"keychain_helper_compile_failed";if(Q==="import-exporting")return"keychain_export_failed";if(Q==="import-fetching-profile")return"profile_read_failed";if(Q==="import-pick-profile"||Q==="import-no-match-recovery")return"profile_no_match";return"unknown"}function J_(A){if(A instanceof WC)return"google_oauth_failed";let Q=QOA(A);if(Q==="keystore")return"keystore_invalid";if(Q==="oauth")return"google_oauth_failed";if(Q==="play_account_id")return"play_account_id_invalid";return"unknown"}function BOA(A){switch(A){case"shape-error":return"sa_json_shape_invalid";case"token-error":return"sa_json_token_rejected";case"no-app-access":return"sa_json_no_app_access";case"network-error":return"sa_json_network_error"}}import{chmodSync as A2Q,existsSync as Q2Q,writeFileSync as B2Q}from"node:fs";import{join as I2Q}from"node:path";import{cwd as E2Q}from"node:process";function dD(A,Q){return I2Q(E2Q(),`.env.capgo.${A}.${Q}`)}function yC(A){let Q=Object.values(A.credentials).filter((E)=>typeof E==="string"&&E.length>0).length;if(Q===0)return{kind:"empty"};let B=A.targetPath??dD(A.appId,A.platform);if(Q2Q(B)&&!A.overwrite)return{kind:"exists",path:B};let I=WN({appId:A.appId,local:A.local??!1,platform:A.platform,creds:A.credentials});return B2Q(B,I,{mode:384}),A2Q(B,384),{kind:"written",path:B,fieldCount:Q}}import{execFile as $2Q}from"node:child_process";import{basename as D2Q}from"node:path";import{platform as G2Q}from"node:process";function oN(A){if(!eG())return Promise.resolve(null);return new Promise((Q)=>{$2Q("osascript",["-e",A],{encoding:"utf-8",timeout:120000},(B,I)=>{if(B){Q(null);return}let E=I.trim();Q(E||null)})})}function eG(){return G2Q==="darwin"}function IOA(){return oN('POSIX path of (choose file of type {"p8"} with prompt "Select your .p8 API key file")')}function EOA(){return oN('POSIX path of (choose file with prompt "Select your package.json file")').then((A)=>{if(!A)return null;return D2Q(A).toLowerCase()==="package.json"?A:null})}function $OA(A){let Q=(I)=>I.replace(/\\/g,"\\\\").replace(/"/g,"\\\""),B=`POSIX path of (choose file name with prompt "${Q(A.prompt)}"`;if(A.defaultName)B+=` default name "${Q(A.defaultName)}"`;if(A.defaultLocation)B+=` default location (POSIX file "${Q(A.defaultLocation)}")`;return B+=")",oN(B)}function DOA(){return oN('POSIX path of (choose file of type {"jks", "keystore", "p12"} with prompt "Select your Android keystore")')}function GOA(){return oN('POSIX path of (choose file of type {"public.json"} with prompt "Select your Google Play service account JSON")')}qB();async function fC(A){let Q={step:A.step,platform:A.platform,app_id:A.appId};if(typeof A.durationMs==="number"&&Number.isFinite(A.durationMs))Q.duration_ms=String(Math.round(A.durationMs));if(A.errorCategory!==void 0)Q.error_category=A.errorCategory;else if(A.error!==void 0)Q.error_category=A.platform==="ios"?G_(A.error):J_(A.error);try{await WB(A.apikey,{event:"Builder Onboarding Step",channel:"builder-onboarding",icon:"\uD83E\uDDED",notify:!1,org_id:A.orgId,tracking_version:2,tags:Q})}catch{}}async function Xo(A){let Q={};for(let[B,I]of Object.entries(A.tags??{}))Q[B]=String(I);Q.step=A.step,Q.platform=A.platform,Q.app_id=A.appId,Q.action=A.action;try{await WB(A.apikey,{event:"Builder Onboarding Action",channel:"builder-onboarding",icon:"\uD83E\uDDED",notify:!1,org_id:A.orgId,tracking_version:2,tags:Q})}catch{}}var J2Q=44,Y2Q=16;function JOA(A,Q){return A>=J2Q&&Q>=Y2Q?"cards":"list"}function Y_(A,Q,B){return Math.max(0,A-Q-Pj-B-1)}function YOA(A,Q){if(Q<=0)return{hidden:0,visible:[]};if(A.length<=Q)return{hidden:0,visible:A};let B=Q-1;return{hidden:A.length-B,visible:A.slice(A.length-B)}}var U_=SA(m0(),1),H_=({entries:A,maxRows:Q})=>{if(Q<1||A.length===0)return null;let{hidden:B,visible:I}=YOA(A,Q);if(B===0&&I.length===0)return null;let E=I.length>0?`…and ${B} earlier steps done (resize taller to see all)`:`${B} steps done (resize taller to see all)`,$=(B>0?1:0)+I.length;return U_.jsxDEV(e,{flexDirection:"column",marginTop:$>1?1:0,children:[B>0&&U_.jsxDEV(v,{dimColor:!0,wrap:"truncate-end",children:E},void 0,!1,void 0,this),I.map((D,G)=>U_.jsxDEV(v,{color:D.color,wrap:"truncate-middle",children:D.text},G,!1,void 0,this))]},void 0,!0,void 0,this)};var UOA=80,HOA=38,XOA=49,FOA=Math.max(38,49);function U2Q(A){return A==="ios"?38:49}function aN(A,Q,B="android"){return A>=80&&Q>=U2Q(B)}var Fo=44,Co=11;function COA(A,Q){return A>=Fo&&Q>=Co}var H2Q=/\x1B\[[0-9;?]*[ -/]*[@-~]/g,X2Q=/\x1B[@-Z\\-_]/g,F2Q=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g;function C2Q(A){let Q="",B=0;for(let I of A)if(I==="\t"){let E=8-B%8;Q+=" ".repeat(E),B+=E}else Q+=I,B+=1;return Q}function X_(A){let Q=A.replace(/\r\n?/g,`
|
|
763
763
|
`).split(`
|
|
764
764
|
`);if(Q.length>1&&Q[Q.length-1]==="")Q.pop();return Q.map((B)=>{let I=B.replace(H2Q,"").replace(X2Q,"");return C2Q(I).replace(F2Q,"").replace(/\s+$/,"")})}import WOA from"node:process";var o6=SA(m0(),1),hC=({cols:A,rows:Q,minCols:B=UOA,minRows:I=FOA})=>{q1((D,G)=>{if(G.ctrl&&D==="c")WOA.kill(WOA.pid,"SIGINT")});let E=A<B,$=Q<I;return o6.jsxDEV(e,{flexDirection:"column",minHeight:Q,padding:1,children:[o6.jsxDEV(v,{bold:!0,color:"cyan",children:"\uD83D\uDE80 Capgo Cloud Build · Onboarding"},void 0,!1,void 0,this),o6.jsxDEV(e,{marginTop:1,flexDirection:"column",children:[o6.jsxDEV(v,{color:"yellow",bold:!0,children:`⚠ Terminal too small (${A}×${Q}).`},void 0,!1,void 0,this),o6.jsxDEV(v,{children:`This screen needs at least ${B}×${I} (columns × rows).`},void 0,!1,void 0,this),o6.jsxDEV(e,{marginTop:1,flexDirection:"column",children:[E&&o6.jsxDEV(v,{children:`• Widen to at least ${B} columns (currently ${A}).`},void 0,!1,void 0,this),$&&o6.jsxDEV(v,{children:`• Make it taller — at least ${I} rows (currently ${Q}).`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o6.jsxDEV(e,{marginTop:1,children:o6.jsxDEV(v,{dimColor:!0,children:"Resize this window and onboarding will continue automatically — no need to restart."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{existsSync as M2Q,mkdirSync as N2Q,readFileSync as z2Q,writeFileSync as L2Q}from"node:fs";import{dirname as w2Q,resolve as O2Q}from"node:path";import{cwd as R2Q}from"node:process";var y1=".github/workflows/capgo-build.yml";function uC(A){let Q=[];if(Q.push("name: Capgo native build"),Q.push(""),Q.push("# Generated by `capgo build init`. Safe to edit — see"),Q.push("# https://capgo.app/docs/cli/cloud-build/ for the underlying CLI flags."),Q.push(""),Q.push("on:"),Q.push(" workflow_dispatch:"),Q.push(" inputs:"),Q.push(" platform:"),Q.push(" description: 'Platform to build'"),Q.push(" type: choice"),Q.push(" options:"),Q.push(" - ios"),Q.push(" - android"),Q.push(` default: ${A.defaultPlatform}`),Q.push(" build_mode:"),Q.push(" description: 'Build mode'"),Q.push(" type: choice"),Q.push(" options:"),Q.push(" - release"),Q.push(" - debug"),Q.push(" default: release"),Q.push(""),Q.push("jobs:"),Q.push(" build:"),Q.push(" runs-on: ubuntu-latest"),Q.push(" steps:"),Q.push(" - uses: actions/checkout@v4"),W2Q(Q,A.packageManager),Q.push(""),Q.push(" - name: Install dependencies"),Q.push(` run: ${K2Q(A.packageManager)}`),A.buildScript.type!=="skip")Q.push(""),Q.push(" - name: Build web assets"),q2Q(Q,Z2Q(A.packageManager,A.buildScript));if(Q.push(""),Q.push(" - name: Capgo native build"),Q.push(" run: |"),Q.push(` ${KOA(A.packageManager)} @capgo/cli@latest build request ${A.appId} \\`),Q.push(" --platform ${{ inputs.platform }} \\"),Q.push(" --build-mode ${{ inputs.build_mode }} \\"),Q.push(" --apikey ${{ secrets.CAPGO_TOKEN }} \\"),Q.push(" --output-upload --output-record /tmp/capgo-build.json"),A.secretKeys.length>0){Q.push(" env:");for(let B of A.secretKeys)Q.push(` ${B}: \${{ secrets.${B} }}`)}return Q.push(""),Q.push(" - name: Surface artifact URL"),Q.push(" if: success()"),Q.push(" run: |"),Q.push(` URL=$(${KOA(A.packageManager)} @capgo/cli@latest build last-output --path /tmp/capgo-build.json --field outputUrl)`),Q.push(' if [ -n "$URL" ]; then'),Q.push(" {"),Q.push(' echo "### Capgo build ready"'),Q.push(' echo ""'),Q.push(' echo "- Artifact: $URL"'),Q.push(' } >> "$GITHUB_STEP_SUMMARY"'),Q.push(" fi"),Q.push(""),{path:".github/workflows/capgo-build.yml",content:Q.join(`
|
|
765
765
|
`)}}function W2Q(A,Q){if(Q==="bun"){A.push(""),A.push(" - uses: oven-sh/setup-bun@v2"),A.push(" with:"),A.push(" bun-version: latest"),A.push(" - uses: actions/setup-node@v4"),A.push(" with:"),A.push(" node-version: '20'");return}if(Q==="pnpm"){A.push(""),A.push(" - uses: pnpm/action-setup@v4"),A.push(" with:"),A.push(" version: latest"),A.push(" - uses: actions/setup-node@v4"),A.push(" with:"),A.push(" node-version: '20'"),A.push(" cache: 'pnpm'");return}if(Q==="yarn"){A.push(""),A.push(" - uses: actions/setup-node@v4"),A.push(" with:"),A.push(" node-version: '20'"),A.push(" cache: 'yarn'");return}A.push(""),A.push(" - uses: actions/setup-node@v4"),A.push(" with:"),A.push(" node-version: '20'"),A.push(" cache: 'npm'")}function K2Q(A){switch(A){case"bun":return"bun install --frozen-lockfile";case"npm":return"npm ci";case"pnpm":return"pnpm install --frozen-lockfile";case"yarn":return"yarn install --frozen-lockfile"}}function q2Q(A,Q){A.push(" run: |");for(let B of Q.replace(/\r\n/g,`
|
package/dist/package.json
CHANGED
package/dist/src/sdk.js
CHANGED
|
@@ -124,7 +124,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
124
124
|
`)}),$.__defineSetter__("stack",function(X){return[X].concat($.stack).join(`
|
|
125
125
|
|
|
126
126
|
`)}),$}});var Rv=E((ta0,Ev)=>{var N4=l("constants"),jq0=process.cwd,EF=null,Tq0=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!EF)EF=jq0.call(process);return EF};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(RF=process.chdir,process.chdir=function(D){EF=null,RF.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,RF)}var RF;Ev.exports=Cq0;function Cq0(D){if(N4.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)X(D);if(D.chown=F(D.chown),D.fchown=F(D.fchown),D.lchown=F(D.lchown),D.chmod=J(D.chmod),D.fchmod=J(D.fchmod),D.lchmod=J(D.lchmod),D.chownSync=Q(D.chownSync),D.fchownSync=Q(D.fchownSync),D.lchownSync=Q(D.lchownSync),D.chmodSync=Y(D.chmodSync),D.fchmodSync=Y(D.fchmodSync),D.lchmodSync=Y(D.lchmodSync),D.stat=U(D.stat),D.fstat=U(D.fstat),D.lstat=U(D.lstat),D.statSync=Z(D.statSync),D.fstatSync=Z(D.fstatSync),D.lstatSync=Z(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(G,w,q){if(q)process.nextTick(q)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(G,w,q,W){if(W)process.nextTick(W)},D.lchownSync=function(){};if(Tq0==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(G){function w(q,W,K){var H=Date.now(),L=0;G(q,W,function M(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-H<60000){if(setTimeout(function(){D.stat(W,function(B,N){if(B&&B.code==="ENOENT")G(q,W,M);else K(I)})},L),L<100)L+=10;return}if(K)K(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(w,G);return w}(D.rename);D.read=typeof D.read!=="function"?D.read:function(G){function w(q,W,K,H,L,M){var I;if(M&&typeof M==="function"){var B=0;I=function(N,z,R){if(N&&N.code==="EAGAIN"&&B<10)return B++,G.call(D,q,W,K,H,L,I);M.apply(this,arguments)}}return G.call(D,q,W,K,H,L,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(w,G);return w}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(G){return function(w,q,W,K,H){var L=0;while(!0)try{return G.call(D,w,q,W,K,H)}catch(M){if(M.code==="EAGAIN"&&L<10){L++;continue}throw M}}}(D.readSync);function $(G){G.lchmod=function(w,q,W){G.open(w,N4.O_WRONLY|N4.O_SYMLINK,q,function(K,H){if(K){if(W)W(K);return}G.fchmod(H,q,function(L){G.close(H,function(M){if(W)W(L||M)})})})},G.lchmodSync=function(w,q){var W=G.openSync(w,N4.O_WRONLY|N4.O_SYMLINK,q),K=!0,H;try{H=G.fchmodSync(W,q),K=!1}finally{if(K)try{G.closeSync(W)}catch(L){}else G.closeSync(W)}return H}}function X(G){if(N4.hasOwnProperty("O_SYMLINK")&&G.futimes)G.lutimes=function(w,q,W,K){G.open(w,N4.O_SYMLINK,function(H,L){if(H){if(K)K(H);return}G.futimes(L,q,W,function(M){G.close(L,function(I){if(K)K(M||I)})})})},G.lutimesSync=function(w,q,W){var K=G.openSync(w,N4.O_SYMLINK),H,L=!0;try{H=G.futimesSync(K,q,W),L=!1}finally{if(L)try{G.closeSync(K)}catch(M){}else G.closeSync(K)}return H};else if(G.futimes)G.lutimes=function(w,q,W,K){if(K)process.nextTick(K)},G.lutimesSync=function(){}}function J(G){if(!G)return G;return function(w,q,W){return G.call(D,w,q,function(K){if(O(K))K=null;if(W)W.apply(this,arguments)})}}function Y(G){if(!G)return G;return function(w,q){try{return G.call(D,w,q)}catch(W){if(!O(W))throw W}}}function F(G){if(!G)return G;return function(w,q,W,K){return G.call(D,w,q,W,function(H){if(O(H))H=null;if(K)K.apply(this,arguments)})}}function Q(G){if(!G)return G;return function(w,q,W){try{return G.call(D,w,q,W)}catch(K){if(!O(K))throw K}}}function U(G){if(!G)return G;return function(w,q,W){if(typeof q==="function")W=q,q=null;function K(H,L){if(L){if(L.uid<0)L.uid+=4294967296;if(L.gid<0)L.gid+=4294967296}if(W)W.apply(this,arguments)}return q?G.call(D,w,q,K):G.call(D,w,K)}}function Z(G){if(!G)return G;return function(w,q){var W=q?G.call(D,w,q):G.call(D,w);if(W){if(W.uid<0)W.uid+=4294967296;if(W.gid<0)W.gid+=4294967296}return W}}function O(G){if(!G)return!0;if(G.code==="ENOSYS")return!0;var w=!process.getuid||process.getuid()!==0;if(w){if(G.code==="EINVAL"||G.code==="EPERM")return!0}return!1}}});var Cv=E((oa0,Tv)=>{var jv=l("stream").Stream;Tv.exports=Sq0;function Sq0(D){return{ReadStream:$,WriteStream:X};function $(J,Y){if(!(this instanceof $))return new $(J,Y);jv.call(this);var F=this;this.path=J,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Y=Y||{};var Q=Object.keys(Y);for(var U=0,Z=Q.length;U<Z;U++){var O=Q[U];this[O]=Y[O]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){F._read()});return}D.open(this.path,this.flags,this.mode,function(G,w){if(G){F.emit("error",G),F.readable=!1;return}F.fd=w,F.emit("open",w),F._read()})}function X(J,Y){if(!(this instanceof X))return new X(J,Y);jv.call(this),this.path=J,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Y=Y||{};var F=Object.keys(Y);for(var Q=0,U=F.length;Q<U;Q++){var Z=F[Q];this[Z]=Y[Z]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var Pv=E((aa0,Sv)=>{Sv.exports=uq0;var Pq0=Object.getPrototypeOf||function(D){return D.__proto__};function uq0(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:Pq0(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var hD=E((sa0,sq)=>{var xD=l("fs"),xq0=Rv(),vq0=Cv(),_q0=Pv(),jF=l("util"),Q1,CF;if(typeof Symbol==="function"&&typeof Symbol.for==="function")Q1=Symbol.for("graceful-fs.queue"),CF=Symbol.for("graceful-fs.previous");else Q1="___graceful-fs.queue",CF="___graceful-fs.previous";function fq0(){}function xv(D,$){Object.defineProperty(D,Q1,{get:function(){return $}})}var h8=fq0;if(jF.debuglog)h8=jF.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))h8=function(){var D=jF.format.apply(jF,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
127
|
-
GFS4: `),console.error(D)};if(!xD[Q1]){if(tq=global[Q1]||[],xv(xD,tq),xD.close=function(D){function $(X,J){return D.call(xD,X,function(Y){if(!Y)uv();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,CF,{value:D}),$}(xD.close),xD.closeSync=function(D){function $(X){D.apply(xD,arguments),uv()}return Object.defineProperty($,CF,{value:D}),$}(xD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){h8(xD[Q1]),l("assert").equal(xD[Q1].length,0)})}var tq;if(!global[Q1])xv(global,xD[Q1]);sq.exports=oq(_q0(xD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!xD.__patched)sq.exports=oq(xD),xD.__patched=!0;function oq(D){xq0(D),D.gracefulify=oq,D.createReadStream=z,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(A,u,S){if(typeof u==="function")S=u,u=null;return m(A,u,S);function m(g,r,k,T){return $(g,r,function(P){if(P&&(P.code==="EMFILE"||P.code==="ENFILE"))S5([m,[g,r,k],P,T||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(A,u,S,m){if(typeof S==="function")m=S,S=null;return g(A,u,S,m);function g(r,k,T,P,x){return J(r,k,T,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var F=D.appendFile;if(F)D.appendFile=Q;function Q(A,u,S,m){if(typeof S==="function")m=S,S=null;return g(A,u,S,m);function g(r,k,T,P,x){return F(r,k,T,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var U=D.copyFile;if(U)D.copyFile=Z;function Z(A,u,S,m){if(typeof S==="function")m=S,S=0;return g(A,u,S,m);function g(r,k,T,P,x){return U(r,k,T,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var O=D.readdir;D.readdir=w;var G=/^v[0-5]\./;function w(A,u,S){if(typeof u==="function")S=u,u=null;var m=G.test(process.version)?function(k,T,P,x){return O(k,g(k,T,P,x))}:function(k,T,P,x){return O(k,T,g(k,T,P,x))};return m(A,u,S);function g(r,k,T,P){return function(x,f){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))S5([m,[r,k,T],x,P||Date.now(),Date.now()]);else{if(f&&f.sort)f.sort();if(typeof T==="function")T.call(this,x,f)}}}}if(process.version.substr(0,4)==="v0.8"){var q=vq0(D);M=q.ReadStream,B=q.WriteStream}var W=D.ReadStream;if(W)M.prototype=Object.create(W.prototype),M.prototype.open=I;var K=D.WriteStream;if(K)B.prototype=Object.create(K.prototype),B.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(A){M=A},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return B},set:function(A){B=A},enumerable:!0,configurable:!0});var H=M;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(A){H=A},enumerable:!0,configurable:!0});var L=B;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(A){L=A},enumerable:!0,configurable:!0});function M(A,u){if(this instanceof M)return W.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var A=this;_(A.path,A.flags,A.mode,function(u,S){if(u){if(A.autoClose)A.destroy();A.emit("error",u)}else A.fd=S,A.emit("open",S),A.read()})}function B(A,u){if(this instanceof B)return K.apply(this,arguments),this;else return B.apply(Object.create(B.prototype),arguments)}function N(){var A=this;_(A.path,A.flags,A.mode,function(u,S){if(u)A.destroy(),A.emit("error",u);else A.fd=S,A.emit("open",S)})}function z(A,u){return new D.ReadStream(A,u)}function R(A,u){return new D.WriteStream(A,u)}var v=D.open;D.open=_;function _(A,u,S,m){if(typeof S==="function")m=S,S=null;return g(A,u,S,m);function g(r,k,T,P,x){return v(r,k,T,function(f,h){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}return D}function S5(D){h8("ENQUEUE",D[0].name,D[1]),xD[Q1].push(D),aq()}var TF;function uv(){var D=Date.now();for(var $=0;$<xD[Q1].length;++$)if(xD[Q1][$].length>2)xD[Q1][$][3]=D,xD[Q1][$][4]=D;aq()}function aq(){if(clearTimeout(TF),TF=void 0,xD[Q1].length===0)return;var D=xD[Q1].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],F=D[4];if(Y===void 0)h8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){h8("TIMEOUT",$.name,X);var Q=X.pop();if(typeof Q==="function")Q.call(null,J)}else{var U=Date.now()-F,Z=Math.max(F-Y,1),O=Math.min(Z*1.2,100);if(U>=O)h8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else xD[Q1].push(D)}if(TF===void 0)TF=setTimeout(aq,0)}});var _v=E((ea0,vv)=>{function V$(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}vv.exports=V$;V$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};V$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};V$.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var J=this,Y=setTimeout(function(){if(J._attempts++,J._operationTimeoutCb){if(J._timeout=setTimeout(function(){J._operationTimeoutCb(J._attempts)},J._operationTimeout),J._options.unref)J._timeout.unref()}J._fn(J._attempts)},X);if(this._options.unref)Y.unref();return!0};V$.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};V$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};V$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};V$.prototype.start=V$.prototype.try;V$.prototype.errors=function(){return this._errors};V$.prototype.attempts=function(){return this._attempts};V$.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var J=0;J<this._errors.length;J++){var Y=this._errors[J],F=Y.message,Q=(D[F]||0)+1;if(D[F]=Q,Q>=X)$=Y,X=Q}return $}});var kv=E((yq0)=>{var kq0=_v();yq0.operation=function(D){var $=yq0.timeouts(D);return new kq0($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};yq0.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var J=[];for(var Y=0;Y<$.retries;Y++)J.push(this.createTimeout(Y,$));if(D&&D.forever&&!J.length)J.push(this.createTimeout(Y,$));return J.sort(function(F,Q){return F-Q}),J};yq0.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,J=Math.round(X*$.minTimeout*Math.pow($.factor,D));return J=Math.min(J,$.maxTimeout),J};yq0.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var J in D)if(typeof D[J]==="function")X.push(J)}for(var Y=0;Y<X.length;Y++){var F=X[Y],Q=D[F];D[F]=function(Z){var O=yq0.operation($),G=Array.prototype.slice.call(arguments,1),w=G.pop();G.push(function(q){if(O.retry(q))return;if(q)arguments[0]=O.mainError();w.apply(this,arguments)}),O.attempt(function(){Z.apply(D,G)})}.bind(D,Q),D[F].options=$}}});var yv=E(($s0,SF)=>{SF.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")SF.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")SF.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var xF=E((Xs0,u5)=>{var TD=global.process,g8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!g8(TD))u5.exports=function(){return function(){}};else{if(eq=l("assert"),m8=yv(),DW=/^win/i.test(TD.platform),P5=l("events"),typeof P5!=="function")P5=P5.EventEmitter;if(TD.__signal_exit_emitter__)aD=TD.__signal_exit_emitter__;else aD=TD.__signal_exit_emitter__=new P5,aD.count=0,aD.emitted={};if(!aD.infinite)aD.setMaxListeners(1/0),aD.infinite=!0;u5.exports=function(D,$){if(!g8(global.process))return function(){};if(eq.equal(typeof D,"function","a callback must be provided for exit handler"),c8===!1)PF();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(aD.removeListener(X,D),aD.listeners("exit").length===0&&aD.listeners("afterexit").length===0)M2()};return aD.on(X,D),J},M2=function(){if(!c8||!g8(global.process))return;c8=!1,m8.forEach(function($){try{TD.removeListener($,I2[$])}catch(X){}}),TD.emit=A2,TD.reallyExit=uF,aD.count-=1},u5.exports.unload=M2,z4=function($,X,J){if(aD.emitted[$])return;aD.emitted[$]=!0,aD.emit($,X,J)},I2={},m8.forEach(function(D){I2[D]=function(){if(!g8(global.process))return;var X=TD.listeners(D);if(X.length===aD.count){if(M2(),z4("exit",null,D),z4("afterexit",null,D),DW&&D==="SIGHUP")D="SIGINT";TD.kill(TD.pid,D)}}}),u5.exports.signals=function(){return m8},c8=!1,PF=function(){if(c8||!g8(global.process))return;c8=!0,aD.count+=1,m8=m8.filter(function($){try{return TD.on($,I2[$]),!0}catch(X){return!1}}),TD.emit=XW,TD.reallyExit=$W},u5.exports.load=PF,uF=TD.reallyExit,$W=function($){if(!g8(global.process))return;TD.exitCode=$||0,z4("exit",TD.exitCode,null),z4("afterexit",TD.exitCode,null),uF.call(TD,TD.exitCode)},A2=TD.emit,XW=function($,X){if($==="exit"&&g8(global.process)){if(X!==void 0)TD.exitCode=X;var J=A2.apply(this,arguments);return z4("exit",TD.exitCode,null),z4("afterexit",TD.exitCode,null),J}else return A2.apply(this,arguments)}}var eq,m8,DW,P5,aD,M2,z4,I2,c8,PF,uF,$W,A2,XW});var hv=E((dq0,JW)=>{var bv=Symbol();function mq0(D,$,X){let J=$[bv];if(J)return $.stat(D,(F,Q)=>{if(F)return X(F);X(null,Q.mtime,J)});let Y=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,Y,Y,(F)=>{if(F)return X(F);$.stat(D,(Q,U)=>{if(Q)return X(Q);let Z=U.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,bv,{value:Z}),X(null,U.mtime,Z)})})}function cq0(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}dq0.probe=mq0;dq0.getMtime=cq0});var nv=E((sq0,R2)=>{var iq0=l("path"),QW=hD(),pq0=kv(),rq0=xF(),gv=hv(),y6={};function E2(D,$){return $.lockfilePath||`${D}.lock`}function UW(D,$,X){if(!$.realpath)return X(null,iq0.resolve(D));$.fs.realpath(D,X)}function FW(D,$,X){let J=E2(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return gv.probe(J,$.fs,(F,Q,U)=>{if(F)return $.fs.rmdir(J,()=>{}),X(F);X(null,Q,U)});if(Y.code!=="EEXIST")return X(Y);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(J,(F,Q)=>{if(F){if(F.code==="ENOENT")return FW(D,{...$,stale:0},X);return X(F)}if(!mv(Q,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));cv(D,$,(U)=>{if(U)return X(U);FW(D,{...$,stale:0},X)})})})}function mv(D,$){return D.mtime.getTime()<Date.now()-$.stale}function cv(D,$,X){$.fs.rmdir(E2(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function vF(D,$){let X=y6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(J,Y)=>{let F=X.lastUpdate+$.stale<Date.now();if(J){if(J.code==="ENOENT"||F)return YW(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,vF(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return YW(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let U=gv.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,U,U,(Z)=>{let O=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||O)return YW(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,vF(D,$)}X.mtime=U,X.lastUpdate=Date.now(),X.updateDelay=null,vF(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function YW(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(y6[D]===$)delete y6[D];$.options.onCompromised(X)}function tq0(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:QW,onCompromised:(J)=>{throw J},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),UW(D,$,(J,Y)=>{if(J)return X(J);let F=pq0.operation($.retries);F.attempt(()=>{FW(Y,$,(Q,U,Z)=>{if(F.retry(Q))return;if(Q)return X(F.mainError());let O=y6[Y]={lockfilePath:E2(Y,$),mtime:U,mtimePrecision:Z,options:$,lastUpdate:Date.now()};vF(Y,$),X(null,(G)=>{if(O.released)return G&&G(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dv(Y,{...$,realpath:!1},G)})})})})}function dv(D,$,X){$={fs:QW,realpath:!0,...$},UW(D,$,(J,Y)=>{if(J)return X(J);let F=y6[Y];if(!F)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));F.updateTimeout&&clearTimeout(F.updateTimeout),F.released=!0,delete y6[Y],cv(Y,$,X)})}function oq0(D,$,X){$={stale:1e4,realpath:!0,fs:QW,...$},$.stale=Math.max($.stale||0,2000),UW(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(E2(Y,$),(F,Q)=>{if(F)return F.code==="ENOENT"?X(null,!1):X(F);return X(null,!mv(Q,$))})})}function aq0(){return y6}rq0(()=>{for(let D in y6){let $=y6[D].options;try{$.fs.rmdirSync(E2(D,$))}catch(X){}}});sq0.lock=tq0;sq0.unlock=dv;sq0.check=oq0;sq0.getLocks=aq0});var iv=E((Js0,lv)=>{var JW0=hD();function YW0(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let F=Y.pop(),Q;try{Q=D[`${J}Sync`](...Y)}catch(U){return F(U)}F(null,Q)}}),X}function FW0(D){return(...$)=>new Promise((X,J)=>{$.push((Y,F)=>{if(Y)J(Y);else X(F)}),D(...$)})}function QW0(D){return(...$)=>{let X,J;if($.push((Y,F)=>{X=Y,J=F}),D(...$),X)throw X;return J}}function UW0(D){if(D={...D},D.fs=YW0(D.fs||JW0),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}lv.exports={toPromise:FW0,toSync:QW0,toSyncOptions:UW0}});var rv=E((Ys0,V4)=>{var x5=nv(),{toPromise:_F,toSync:fF,toSyncOptions:ZW}=iv();async function pv(D,$){let X=await _F(x5.lock)(D,$);return _F(X)}function ZW0(D,$){let X=fF(x5.lock)(D,ZW($));return fF(X)}function OW0(D,$){return _F(x5.unlock)(D,$)}function GW0(D,$){return fF(x5.unlock)(D,ZW($))}function wW0(D,$){return _F(x5.check)(D,$)}function qW0(D,$){return fF(x5.check)(D,ZW($))}V4.exports=pv;V4.exports.lock=pv;V4.exports.unlock=OW0;V4.exports.lockSync=ZW0;V4.exports.unlockSync=GW0;V4.exports.check=wW0;V4.exports.checkSync=qW0});var $_=E((ev)=>{Object.defineProperty(ev,"__esModule",{value:!0});ev.canStoreURLs=ev.FileUrlStorage=void 0;var tv=l("fs"),WW0=HW0(Av()),ov=KW0(rv());function sv(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(sv=function(J){return J?X:$})(D)}function KW0(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=sv($);if(X&&X.has(D))return X.get(D);var J={__proto__:null},Y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in D)if(F!=="default"&&{}.hasOwnProperty.call(D,F)){var Q=Y?Object.getOwnPropertyDescriptor(D,F):null;Q&&(Q.get||Q.set)?Object.defineProperty(J,F,Q):J[F]=D[F]}return J.default=D,X&&X.set(D,J),J}function HW0(D){return D&&D.__esModule?D:{default:D}}function j2(D){return j2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},j2(D)}function BW0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function av(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,zW0(J.key),J)}}function NW0(D,$,X){if($)av(D.prototype,$);if(X)av(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function zW0(D){var $=VW0(D,"string");return j2($)=="symbol"?$:$+""}function VW0(D,$){if(j2(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(j2(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var Fs0=ev.canStoreURLs=!0,Qs0=ev.FileUrlStorage=function(){function D($){BW0(this,D),this.path=$}return NW0(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(F,Q){if(F)Y(F);else J(Q)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,F){J._getItems("tus::".concat(X),function(Q,U){if(Q)F(Q);else Y(U)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,F){J._removeItem(X,function(Q){if(Q)F(Q);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,F=Math.round(Math.random()*1000000000000),Q="tus::".concat(X,"::").concat(F);return new Promise(function(U,Z){Y._setItem(Q,J,function(O){if(O)Z(O);else U(Q)})})}},{key:"_setItem",value:function(X,J,Y){var F=this;ov.lock(this.path,this._lockfileOptions()).then(function(Q){Y=F._releaseAndCb(Q,Y),F._getData(function(U,Z){if(U){Y(U);return}Z[X]=J,F._writeData(Z,function(O){return Y(O)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,F){if(Y){J(Y);return}var Q=Object.keys(F).filter(function(U){return U.startsWith(X)}).map(function(U){var Z=F[U];return Z.urlStorageKey=U,Z});J(null,Q)})}},{key:"_removeItem",value:function(X,J){var Y=this;ov.lock(this.path,this._lockfileOptions()).then(function(F){J=Y._releaseAndCb(F,J),Y._getData(function(Q,U){if(Q){J(Q);return}delete U[X],Y._writeData(U,function(Z){return J(Z)})})}).catch(J)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,J){return function(Y){if(Y){X().then(function(){return J(Y)}).catch(function(F){return J((0,WW0.default)([Y,F]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,tv.writeFile)(this.path,JSON.stringify(X),Y,function(F){return J(F)})}},{key:"_getData",value:function(X){(0,tv.readFile)(this.path,"utf8",function(J,Y){if(J){if(J.code==="ENOENT")X(null,{});else X(J);return}try{Y=!Y.trim().length?{}:JSON.parse(Y)}catch(F){X(F);return}X(null,Y)})}}])}()});var yF=E((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});Object.defineProperty(L4,"DefaultHttpStack",{enumerable:!0,get:function(){return F_.default}});Object.defineProperty(L4,"DetailedError",{enumerable:!0,get:function(){return MW0.default}});Object.defineProperty(L4,"FileUrlStorage",{enumerable:!0,get:function(){return Q_.FileUrlStorage}});Object.defineProperty(L4,"StreamSource",{enumerable:!0,get:function(){return jW0.default}});L4.Upload=void 0;Object.defineProperty(L4,"canStoreURLs",{enumerable:!0,get:function(){return Q_.canStoreURLs}});L4.defaultOptions=void 0;Object.defineProperty(L4,"enableDebugLog",{enumerable:!0,get:function(){return IW0.enableDebugLog}});L4.isSupported=void 0;var MW0=d8(Zq()),IW0=Oq(),AW0=d8(rP()),OW=d8(Tu()),EW0=d8(pu()),RW0=d8(su()),F_=d8(Kx()),jW0=d8(Lq()),Q_=$_();function d8(D){return D&&D.__esModule?D:{default:D}}function _5(D){return _5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_5(D)}function TW0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function X_(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,Z_(J.key),J)}}function CW0(D,$,X){if($)X_(D.prototype,$);if(X)X_(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function SW0(D,$,X){return $=kF($),PW0(D,U_()?Reflect.construct($,X||[],kF(D).constructor):$.apply(D,X))}function PW0(D,$){if($&&(_5($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return uW0(D)}function uW0(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function U_(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(U_=function(){return!!D})()}function kF(D){return kF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},kF(D)}function xW0(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)GW(D,$)}function GW(D,$){return GW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},GW(D,$)}function J_(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);$&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor(D,Y).enumerable})),X.push.apply(X,J)}return X}function v5(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?J_(Object(X),!0).forEach(function(J){vW0(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):J_(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function vW0(D,$,X){if($=Z_($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function Z_(D){var $=_W0(D,"string");return _5($)=="symbol"?$:$+""}function _W0(D,$){if(_5(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(_5(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var Y_=L4.defaultOptions=v5(v5({},OW.default.defaultOptions),{},{httpStack:new F_.default,fileReader:new EW0.default,urlStorage:new AW0.default,fingerprint:RW0.default}),Zs0=L4.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return TW0(this,$),J=v5(v5({},Y_),J),SW0(this,$,[X,J])}return xW0($,D),CW0($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=v5(v5({},Y_),Y),OW.default.terminate(J,Y)}}])}(OW.default),Os0=L4.isSupported=!0});var p1;var n8=p(()=>{p1={name:"@capgo/cli",type:"module",version:"7.122.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs",test:"bun run build && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-render-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6"},devDependencies:{"@antfu/eslint-config":"^9.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});async function bF(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,J=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!J.ok)return null;return(await J.json())["dist-tags"]?.latest||null}catch{return null}}async function kW0(){let D=await bF("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:p1.version,latestVersion:D,isOutdated:!!D&&D!==p1.version,majorVersion:$}}async function WD(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await kW0();if(D)V.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
|
|
127
|
+
GFS4: `),console.error(D)};if(!xD[Q1]){if(tq=global[Q1]||[],xv(xD,tq),xD.close=function(D){function $(X,J){return D.call(xD,X,function(Y){if(!Y)uv();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,CF,{value:D}),$}(xD.close),xD.closeSync=function(D){function $(X){D.apply(xD,arguments),uv()}return Object.defineProperty($,CF,{value:D}),$}(xD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){h8(xD[Q1]),l("assert").equal(xD[Q1].length,0)})}var tq;if(!global[Q1])xv(global,xD[Q1]);sq.exports=oq(_q0(xD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!xD.__patched)sq.exports=oq(xD),xD.__patched=!0;function oq(D){xq0(D),D.gracefulify=oq,D.createReadStream=z,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(A,u,S){if(typeof u==="function")S=u,u=null;return m(A,u,S);function m(g,r,k,T){return $(g,r,function(P){if(P&&(P.code==="EMFILE"||P.code==="ENFILE"))S5([m,[g,r,k],P,T||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(A,u,S,m){if(typeof S==="function")m=S,S=null;return g(A,u,S,m);function g(r,k,T,P,x){return J(r,k,T,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var F=D.appendFile;if(F)D.appendFile=Q;function Q(A,u,S,m){if(typeof S==="function")m=S,S=null;return g(A,u,S,m);function g(r,k,T,P,x){return F(r,k,T,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var U=D.copyFile;if(U)D.copyFile=Z;function Z(A,u,S,m){if(typeof S==="function")m=S,S=0;return g(A,u,S,m);function g(r,k,T,P,x){return U(r,k,T,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var O=D.readdir;D.readdir=w;var G=/^v[0-5]\./;function w(A,u,S){if(typeof u==="function")S=u,u=null;var m=G.test(process.version)?function(k,T,P,x){return O(k,g(k,T,P,x))}:function(k,T,P,x){return O(k,T,g(k,T,P,x))};return m(A,u,S);function g(r,k,T,P){return function(x,f){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))S5([m,[r,k,T],x,P||Date.now(),Date.now()]);else{if(f&&f.sort)f.sort();if(typeof T==="function")T.call(this,x,f)}}}}if(process.version.substr(0,4)==="v0.8"){var q=vq0(D);M=q.ReadStream,B=q.WriteStream}var W=D.ReadStream;if(W)M.prototype=Object.create(W.prototype),M.prototype.open=I;var K=D.WriteStream;if(K)B.prototype=Object.create(K.prototype),B.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(A){M=A},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return B},set:function(A){B=A},enumerable:!0,configurable:!0});var H=M;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(A){H=A},enumerable:!0,configurable:!0});var L=B;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(A){L=A},enumerable:!0,configurable:!0});function M(A,u){if(this instanceof M)return W.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var A=this;_(A.path,A.flags,A.mode,function(u,S){if(u){if(A.autoClose)A.destroy();A.emit("error",u)}else A.fd=S,A.emit("open",S),A.read()})}function B(A,u){if(this instanceof B)return K.apply(this,arguments),this;else return B.apply(Object.create(B.prototype),arguments)}function N(){var A=this;_(A.path,A.flags,A.mode,function(u,S){if(u)A.destroy(),A.emit("error",u);else A.fd=S,A.emit("open",S)})}function z(A,u){return new D.ReadStream(A,u)}function R(A,u){return new D.WriteStream(A,u)}var v=D.open;D.open=_;function _(A,u,S,m){if(typeof S==="function")m=S,S=null;return g(A,u,S,m);function g(r,k,T,P,x){return v(r,k,T,function(f,h){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))S5([g,[r,k,T,P],f,x||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}return D}function S5(D){h8("ENQUEUE",D[0].name,D[1]),xD[Q1].push(D),aq()}var TF;function uv(){var D=Date.now();for(var $=0;$<xD[Q1].length;++$)if(xD[Q1][$].length>2)xD[Q1][$][3]=D,xD[Q1][$][4]=D;aq()}function aq(){if(clearTimeout(TF),TF=void 0,xD[Q1].length===0)return;var D=xD[Q1].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],F=D[4];if(Y===void 0)h8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){h8("TIMEOUT",$.name,X);var Q=X.pop();if(typeof Q==="function")Q.call(null,J)}else{var U=Date.now()-F,Z=Math.max(F-Y,1),O=Math.min(Z*1.2,100);if(U>=O)h8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else xD[Q1].push(D)}if(TF===void 0)TF=setTimeout(aq,0)}});var _v=E((ea0,vv)=>{function V$(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}vv.exports=V$;V$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};V$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};V$.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var J=this,Y=setTimeout(function(){if(J._attempts++,J._operationTimeoutCb){if(J._timeout=setTimeout(function(){J._operationTimeoutCb(J._attempts)},J._operationTimeout),J._options.unref)J._timeout.unref()}J._fn(J._attempts)},X);if(this._options.unref)Y.unref();return!0};V$.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};V$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};V$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};V$.prototype.start=V$.prototype.try;V$.prototype.errors=function(){return this._errors};V$.prototype.attempts=function(){return this._attempts};V$.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var J=0;J<this._errors.length;J++){var Y=this._errors[J],F=Y.message,Q=(D[F]||0)+1;if(D[F]=Q,Q>=X)$=Y,X=Q}return $}});var kv=E((yq0)=>{var kq0=_v();yq0.operation=function(D){var $=yq0.timeouts(D);return new kq0($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};yq0.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var J=[];for(var Y=0;Y<$.retries;Y++)J.push(this.createTimeout(Y,$));if(D&&D.forever&&!J.length)J.push(this.createTimeout(Y,$));return J.sort(function(F,Q){return F-Q}),J};yq0.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,J=Math.round(X*$.minTimeout*Math.pow($.factor,D));return J=Math.min(J,$.maxTimeout),J};yq0.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var J in D)if(typeof D[J]==="function")X.push(J)}for(var Y=0;Y<X.length;Y++){var F=X[Y],Q=D[F];D[F]=function(Z){var O=yq0.operation($),G=Array.prototype.slice.call(arguments,1),w=G.pop();G.push(function(q){if(O.retry(q))return;if(q)arguments[0]=O.mainError();w.apply(this,arguments)}),O.attempt(function(){Z.apply(D,G)})}.bind(D,Q),D[F].options=$}}});var yv=E(($s0,SF)=>{SF.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")SF.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")SF.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var xF=E((Xs0,u5)=>{var TD=global.process,g8=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!g8(TD))u5.exports=function(){return function(){}};else{if(eq=l("assert"),m8=yv(),DW=/^win/i.test(TD.platform),P5=l("events"),typeof P5!=="function")P5=P5.EventEmitter;if(TD.__signal_exit_emitter__)aD=TD.__signal_exit_emitter__;else aD=TD.__signal_exit_emitter__=new P5,aD.count=0,aD.emitted={};if(!aD.infinite)aD.setMaxListeners(1/0),aD.infinite=!0;u5.exports=function(D,$){if(!g8(global.process))return function(){};if(eq.equal(typeof D,"function","a callback must be provided for exit handler"),c8===!1)PF();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(aD.removeListener(X,D),aD.listeners("exit").length===0&&aD.listeners("afterexit").length===0)M2()};return aD.on(X,D),J},M2=function(){if(!c8||!g8(global.process))return;c8=!1,m8.forEach(function($){try{TD.removeListener($,I2[$])}catch(X){}}),TD.emit=A2,TD.reallyExit=uF,aD.count-=1},u5.exports.unload=M2,z4=function($,X,J){if(aD.emitted[$])return;aD.emitted[$]=!0,aD.emit($,X,J)},I2={},m8.forEach(function(D){I2[D]=function(){if(!g8(global.process))return;var X=TD.listeners(D);if(X.length===aD.count){if(M2(),z4("exit",null,D),z4("afterexit",null,D),DW&&D==="SIGHUP")D="SIGINT";TD.kill(TD.pid,D)}}}),u5.exports.signals=function(){return m8},c8=!1,PF=function(){if(c8||!g8(global.process))return;c8=!0,aD.count+=1,m8=m8.filter(function($){try{return TD.on($,I2[$]),!0}catch(X){return!1}}),TD.emit=XW,TD.reallyExit=$W},u5.exports.load=PF,uF=TD.reallyExit,$W=function($){if(!g8(global.process))return;TD.exitCode=$||0,z4("exit",TD.exitCode,null),z4("afterexit",TD.exitCode,null),uF.call(TD,TD.exitCode)},A2=TD.emit,XW=function($,X){if($==="exit"&&g8(global.process)){if(X!==void 0)TD.exitCode=X;var J=A2.apply(this,arguments);return z4("exit",TD.exitCode,null),z4("afterexit",TD.exitCode,null),J}else return A2.apply(this,arguments)}}var eq,m8,DW,P5,aD,M2,z4,I2,c8,PF,uF,$W,A2,XW});var hv=E((dq0,JW)=>{var bv=Symbol();function mq0(D,$,X){let J=$[bv];if(J)return $.stat(D,(F,Q)=>{if(F)return X(F);X(null,Q.mtime,J)});let Y=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,Y,Y,(F)=>{if(F)return X(F);$.stat(D,(Q,U)=>{if(Q)return X(Q);let Z=U.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,bv,{value:Z}),X(null,U.mtime,Z)})})}function cq0(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}dq0.probe=mq0;dq0.getMtime=cq0});var nv=E((sq0,R2)=>{var iq0=l("path"),QW=hD(),pq0=kv(),rq0=xF(),gv=hv(),y6={};function E2(D,$){return $.lockfilePath||`${D}.lock`}function UW(D,$,X){if(!$.realpath)return X(null,iq0.resolve(D));$.fs.realpath(D,X)}function FW(D,$,X){let J=E2(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return gv.probe(J,$.fs,(F,Q,U)=>{if(F)return $.fs.rmdir(J,()=>{}),X(F);X(null,Q,U)});if(Y.code!=="EEXIST")return X(Y);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(J,(F,Q)=>{if(F){if(F.code==="ENOENT")return FW(D,{...$,stale:0},X);return X(F)}if(!mv(Q,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));cv(D,$,(U)=>{if(U)return X(U);FW(D,{...$,stale:0},X)})})})}function mv(D,$){return D.mtime.getTime()<Date.now()-$.stale}function cv(D,$,X){$.fs.rmdir(E2(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function vF(D,$){let X=y6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(J,Y)=>{let F=X.lastUpdate+$.stale<Date.now();if(J){if(J.code==="ENOENT"||F)return YW(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,vF(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return YW(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let U=gv.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,U,U,(Z)=>{let O=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||O)return YW(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,vF(D,$)}X.mtime=U,X.lastUpdate=Date.now(),X.updateDelay=null,vF(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function YW(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(y6[D]===$)delete y6[D];$.options.onCompromised(X)}function tq0(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:QW,onCompromised:(J)=>{throw J},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),UW(D,$,(J,Y)=>{if(J)return X(J);let F=pq0.operation($.retries);F.attempt(()=>{FW(Y,$,(Q,U,Z)=>{if(F.retry(Q))return;if(Q)return X(F.mainError());let O=y6[Y]={lockfilePath:E2(Y,$),mtime:U,mtimePrecision:Z,options:$,lastUpdate:Date.now()};vF(Y,$),X(null,(G)=>{if(O.released)return G&&G(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dv(Y,{...$,realpath:!1},G)})})})})}function dv(D,$,X){$={fs:QW,realpath:!0,...$},UW(D,$,(J,Y)=>{if(J)return X(J);let F=y6[Y];if(!F)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));F.updateTimeout&&clearTimeout(F.updateTimeout),F.released=!0,delete y6[Y],cv(Y,$,X)})}function oq0(D,$,X){$={stale:1e4,realpath:!0,fs:QW,...$},$.stale=Math.max($.stale||0,2000),UW(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(E2(Y,$),(F,Q)=>{if(F)return F.code==="ENOENT"?X(null,!1):X(F);return X(null,!mv(Q,$))})})}function aq0(){return y6}rq0(()=>{for(let D in y6){let $=y6[D].options;try{$.fs.rmdirSync(E2(D,$))}catch(X){}}});sq0.lock=tq0;sq0.unlock=dv;sq0.check=oq0;sq0.getLocks=aq0});var iv=E((Js0,lv)=>{var JW0=hD();function YW0(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let F=Y.pop(),Q;try{Q=D[`${J}Sync`](...Y)}catch(U){return F(U)}F(null,Q)}}),X}function FW0(D){return(...$)=>new Promise((X,J)=>{$.push((Y,F)=>{if(Y)J(Y);else X(F)}),D(...$)})}function QW0(D){return(...$)=>{let X,J;if($.push((Y,F)=>{X=Y,J=F}),D(...$),X)throw X;return J}}function UW0(D){if(D={...D},D.fs=YW0(D.fs||JW0),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}lv.exports={toPromise:FW0,toSync:QW0,toSyncOptions:UW0}});var rv=E((Ys0,V4)=>{var x5=nv(),{toPromise:_F,toSync:fF,toSyncOptions:ZW}=iv();async function pv(D,$){let X=await _F(x5.lock)(D,$);return _F(X)}function ZW0(D,$){let X=fF(x5.lock)(D,ZW($));return fF(X)}function OW0(D,$){return _F(x5.unlock)(D,$)}function GW0(D,$){return fF(x5.unlock)(D,ZW($))}function wW0(D,$){return _F(x5.check)(D,$)}function qW0(D,$){return fF(x5.check)(D,ZW($))}V4.exports=pv;V4.exports.lock=pv;V4.exports.unlock=OW0;V4.exports.lockSync=ZW0;V4.exports.unlockSync=GW0;V4.exports.check=wW0;V4.exports.checkSync=qW0});var $_=E((ev)=>{Object.defineProperty(ev,"__esModule",{value:!0});ev.canStoreURLs=ev.FileUrlStorage=void 0;var tv=l("fs"),WW0=HW0(Av()),ov=KW0(rv());function sv(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(sv=function(J){return J?X:$})(D)}function KW0(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=sv($);if(X&&X.has(D))return X.get(D);var J={__proto__:null},Y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in D)if(F!=="default"&&{}.hasOwnProperty.call(D,F)){var Q=Y?Object.getOwnPropertyDescriptor(D,F):null;Q&&(Q.get||Q.set)?Object.defineProperty(J,F,Q):J[F]=D[F]}return J.default=D,X&&X.set(D,J),J}function HW0(D){return D&&D.__esModule?D:{default:D}}function j2(D){return j2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},j2(D)}function BW0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function av(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,zW0(J.key),J)}}function NW0(D,$,X){if($)av(D.prototype,$);if(X)av(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function zW0(D){var $=VW0(D,"string");return j2($)=="symbol"?$:$+""}function VW0(D,$){if(j2(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(j2(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var Fs0=ev.canStoreURLs=!0,Qs0=ev.FileUrlStorage=function(){function D($){BW0(this,D),this.path=$}return NW0(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(F,Q){if(F)Y(F);else J(Q)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,F){J._getItems("tus::".concat(X),function(Q,U){if(Q)F(Q);else Y(U)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,F){J._removeItem(X,function(Q){if(Q)F(Q);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,F=Math.round(Math.random()*1000000000000),Q="tus::".concat(X,"::").concat(F);return new Promise(function(U,Z){Y._setItem(Q,J,function(O){if(O)Z(O);else U(Q)})})}},{key:"_setItem",value:function(X,J,Y){var F=this;ov.lock(this.path,this._lockfileOptions()).then(function(Q){Y=F._releaseAndCb(Q,Y),F._getData(function(U,Z){if(U){Y(U);return}Z[X]=J,F._writeData(Z,function(O){return Y(O)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,F){if(Y){J(Y);return}var Q=Object.keys(F).filter(function(U){return U.startsWith(X)}).map(function(U){var Z=F[U];return Z.urlStorageKey=U,Z});J(null,Q)})}},{key:"_removeItem",value:function(X,J){var Y=this;ov.lock(this.path,this._lockfileOptions()).then(function(F){J=Y._releaseAndCb(F,J),Y._getData(function(Q,U){if(Q){J(Q);return}delete U[X],Y._writeData(U,function(Z){return J(Z)})})}).catch(J)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,J){return function(Y){if(Y){X().then(function(){return J(Y)}).catch(function(F){return J((0,WW0.default)([Y,F]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,tv.writeFile)(this.path,JSON.stringify(X),Y,function(F){return J(F)})}},{key:"_getData",value:function(X){(0,tv.readFile)(this.path,"utf8",function(J,Y){if(J){if(J.code==="ENOENT")X(null,{});else X(J);return}try{Y=!Y.trim().length?{}:JSON.parse(Y)}catch(F){X(F);return}X(null,Y)})}}])}()});var yF=E((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});Object.defineProperty(L4,"DefaultHttpStack",{enumerable:!0,get:function(){return F_.default}});Object.defineProperty(L4,"DetailedError",{enumerable:!0,get:function(){return MW0.default}});Object.defineProperty(L4,"FileUrlStorage",{enumerable:!0,get:function(){return Q_.FileUrlStorage}});Object.defineProperty(L4,"StreamSource",{enumerable:!0,get:function(){return jW0.default}});L4.Upload=void 0;Object.defineProperty(L4,"canStoreURLs",{enumerable:!0,get:function(){return Q_.canStoreURLs}});L4.defaultOptions=void 0;Object.defineProperty(L4,"enableDebugLog",{enumerable:!0,get:function(){return IW0.enableDebugLog}});L4.isSupported=void 0;var MW0=d8(Zq()),IW0=Oq(),AW0=d8(rP()),OW=d8(Tu()),EW0=d8(pu()),RW0=d8(su()),F_=d8(Kx()),jW0=d8(Lq()),Q_=$_();function d8(D){return D&&D.__esModule?D:{default:D}}function _5(D){return _5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_5(D)}function TW0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function X_(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,Z_(J.key),J)}}function CW0(D,$,X){if($)X_(D.prototype,$);if(X)X_(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function SW0(D,$,X){return $=kF($),PW0(D,U_()?Reflect.construct($,X||[],kF(D).constructor):$.apply(D,X))}function PW0(D,$){if($&&(_5($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return uW0(D)}function uW0(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function U_(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(U_=function(){return!!D})()}function kF(D){return kF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},kF(D)}function xW0(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)GW(D,$)}function GW(D,$){return GW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},GW(D,$)}function J_(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);$&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor(D,Y).enumerable})),X.push.apply(X,J)}return X}function v5(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?J_(Object(X),!0).forEach(function(J){vW0(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):J_(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function vW0(D,$,X){if($=Z_($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function Z_(D){var $=_W0(D,"string");return _5($)=="symbol"?$:$+""}function _W0(D,$){if(_5(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(_5(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var Y_=L4.defaultOptions=v5(v5({},OW.default.defaultOptions),{},{httpStack:new F_.default,fileReader:new EW0.default,urlStorage:new AW0.default,fingerprint:RW0.default}),Zs0=L4.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return TW0(this,$),J=v5(v5({},Y_),J),SW0(this,$,[X,J])}return xW0($,D),CW0($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=v5(v5({},Y_),Y),OW.default.terminate(J,Y)}}])}(OW.default),Os0=L4.isSupported=!0});var p1;var n8=p(()=>{p1={name:"@capgo/cli",type:"module",version:"7.122.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs",test:"bun run build && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-render-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6"},devDependencies:{"@antfu/eslint-config":"^9.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});async function bF(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,J=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!J.ok)return null;return(await J.json())["dist-tags"]?.latest||null}catch{return null}}async function kW0(){let D=await bF("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:p1.version,latestVersion:D,isOutdated:!!D&&D!==p1.version,majorVersion:$}}async function WD(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await kW0();if(D)V.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
|
|
128
128
|
Please use @capgo/cli@${X}" or @capgo/cli@${J} to keep up to date with the latest features and bug fixes.`)}var j1=p(()=>{f0();n8()});async function q_(D,$,X,J,Y,F="✅"){await M0(X,{channel:D,event:J,icon:F,org_id:$,tracking_version:2,...Y?{tags:{"app-id":Y}}:{},notify:!1})}var W_=p(()=>{f0();S6();j1();x0()});var H_=E((Is0,K_)=>{var f5=1000,k5=f5*60,y5=k5*60,l8=y5*24,yW0=l8*7,bW0=l8*365.25;K_.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return hW0(D);else if(X==="number"&&isFinite(D))return $.long?mW0(D):gW0(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function hW0(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var X=parseFloat($[1]),J=($[2]||"ms").toLowerCase();switch(J){case"years":case"year":case"yrs":case"yr":case"y":return X*bW0;case"weeks":case"week":case"w":return X*yW0;case"days":case"day":case"d":return X*l8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*y5;case"minutes":case"minute":case"mins":case"min":case"m":return X*k5;case"seconds":case"second":case"secs":case"sec":case"s":return X*f5;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function gW0(D){var $=Math.abs(D);if($>=l8)return Math.round(D/l8)+"d";if($>=y5)return Math.round(D/y5)+"h";if($>=k5)return Math.round(D/k5)+"m";if($>=f5)return Math.round(D/f5)+"s";return D+"ms"}function mW0(D){var $=Math.abs(D);if($>=l8)return hF(D,$,l8,"day");if($>=y5)return hF(D,$,y5,"hour");if($>=k5)return hF(D,$,k5,"minute");if($>=f5)return hF(D,$,f5,"second");return D+" ms"}function hF(D,$,X,J){var Y=$>=X*1.5;return Math.round(D/X)+" "+J+(Y?"s":"")}});var wW=E((As0,B_)=>{function cW0(D){X.debug=X,X.default=X,X.coerce=Z,X.disable=Q,X.enable=Y,X.enabled=U,X.humanize=H_(),X.destroy=O,Object.keys(D).forEach((G)=>{X[G]=D[G]}),X.names=[],X.skips=[],X.formatters={};function $(G){let w=0;for(let q=0;q<G.length;q++)w=(w<<5)-w+G.charCodeAt(q),w|=0;return X.colors[Math.abs(w)%X.colors.length]}X.selectColor=$;function X(G){let w,q=null,W,K;function H(...L){if(!H.enabled)return;let M=H,I=Number(new Date),B=I-(w||I);if(M.diff=B,M.prev=w,M.curr=I,w=I,L[0]=X.coerce(L[0]),typeof L[0]!=="string")L.unshift("%O");let N=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(R,v)=>{if(R==="%%")return"%";N++;let _=X.formatters[v];if(typeof _==="function"){let A=L[N];R=_.call(M,A),L.splice(N,1),N--}return R}),X.formatArgs.call(M,L),(M.log||X.log).apply(M,L)}if(H.namespace=G,H.useColors=X.useColors(),H.color=X.selectColor(G),H.extend=J,H.destroy=X.destroy,Object.defineProperty(H,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(q!==null)return q;if(W!==X.namespaces)W=X.namespaces,K=X.enabled(G);return K},set:(L)=>{q=L}}),typeof X.init==="function")X.init(H);return H}function J(G,w){let q=X(this.namespace+(typeof w>"u"?":":w)+G);return q.log=this.log,q}function Y(G){X.save(G),X.namespaces=G,X.names=[],X.skips=[];let w=(typeof G==="string"?G:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let q of w)if(q[0]==="-")X.skips.push(q.slice(1));else X.names.push(q)}function F(G,w){let q=0,W=0,K=-1,H=0;while(q<G.length)if(W<w.length&&(w[W]===G[q]||w[W]==="*"))if(w[W]==="*")K=W,H=q,W++;else q++,W++;else if(K!==-1)W=K+1,H++,q=H;else return!1;while(W<w.length&&w[W]==="*")W++;return W===w.length}function Q(){let G=[...X.names,...X.skips.map((w)=>"-"+w)].join(",");return X.enable(""),G}function U(G){for(let w of X.skips)if(F(G,w))return!1;for(let w of X.names)if(F(G,w))return!0;return!1}function Z(G){if(G instanceof Error)return G.stack||G.message;return G}function O(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}B_.exports=cW0});var z_=E((N_,gF)=>{N_.formatArgs=nW0;N_.save=lW0;N_.load=iW0;N_.useColors=dW0;N_.storage=pW0();N_.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();N_.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function dW0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function nW0(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+gF.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let X=0,J=0;D[0].replace(/%[a-zA-Z%]/g,(Y)=>{if(Y==="%%")return;if(X++,Y==="%c")J=X}),D.splice(J,0,$)}N_.log=console.debug||console.log||(()=>{});function lW0(D){try{if(D)N_.storage.setItem("debug",D);else N_.storage.removeItem("debug")}catch($){}}function iW0(){let D;try{D=N_.storage.getItem("debug")||N_.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function pW0(){try{return localStorage}catch(D){}}gF.exports=wW()(N_);var{formatters:rW0}=gF.exports;rW0.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var L_=E((Rs0,V_)=>{V_.exports=(D,$=process.argv)=>{let X=D.startsWith("-")?"":D.length===1?"-":"--",J=$.indexOf(X+D),Y=$.indexOf("--");return J!==-1&&(Y===-1||J<Y)}});var A_=E((js0,I_)=>{var XK0=l("os"),M_=l("tty"),L$=L_(),{env:$1}=process,M4;if(L$("no-color")||L$("no-colors")||L$("color=false")||L$("color=never"))M4=0;else if(L$("color")||L$("colors")||L$("color=true")||L$("color=always"))M4=1;if("FORCE_COLOR"in $1)if($1.FORCE_COLOR==="true")M4=1;else if($1.FORCE_COLOR==="false")M4=0;else M4=$1.FORCE_COLOR.length===0?1:Math.min(parseInt($1.FORCE_COLOR,10),3);function qW(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function WW(D,$){if(M4===0)return 0;if(L$("color=16m")||L$("color=full")||L$("color=truecolor"))return 3;if(L$("color=256"))return 2;if(D&&!$&&M4===void 0)return 0;let X=M4||0;if($1.TERM==="dumb")return X;if(process.platform==="win32"){let J=XK0.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in $1){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((J)=>(J in $1))||$1.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in $1)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($1.TEAMCITY_VERSION)?1:0;if($1.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $1){let J=parseInt(($1.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($1.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test($1.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($1.TERM))return 1;if("COLORTERM"in $1)return 1;return X}function JK0(D){let $=WW(D,D&&D.isTTY);return qW($)}I_.exports={supportsColor:JK0,stdout:qW(WW(!0,M_.isatty(1))),stderr:qW(WW(!0,M_.isatty(2)))}});var T_=E((R_,cF)=>{var YK0=l("tty"),mF=l("util");R_.init=wK0;R_.log=ZK0;R_.formatArgs=QK0;R_.save=OK0;R_.load=GK0;R_.useColors=FK0;R_.destroy=mF.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R_.colors=[6,2,3,4,5,1];try{let D=A_();if(D&&(D.stderr||D).level>=2)R_.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}R_.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let X=$.substring(6).toLowerCase().replace(/_([a-z])/g,(Y,F)=>{return F.toUpperCase()}),J=process.env[$];if(/^(yes|on|true|enabled)$/i.test(J))J=!0;else if(/^(no|off|false|disabled)$/i.test(J))J=!1;else if(J==="null")J=null;else J=Number(J);return D[X]=J,D},{});function FK0(){return"colors"in R_.inspectOpts?Boolean(R_.inspectOpts.colors):YK0.isatty(process.stderr.fd)}function QK0(D){let{namespace:$,useColors:X}=this;if(X){let J=this.color,Y="\x1B[3"+(J<8?J:"8;5;"+J),F=` ${Y};1m${$} \x1B[0m`;D[0]=F+D[0].split(`
|
|
129
129
|
`).join(`
|
|
130
130
|
`+F),D.push(Y+"m+"+cF.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=UK0()+$+" "+D[0]}function UK0(){if(R_.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function ZK0(...D){return process.stderr.write(mF.formatWithOptions(R_.inspectOpts,...D)+`
|