@capgo/cli 8.90.2 → 8.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ ${Z}
72
72
  `}}}}).prompt();var e0=b(()=>{y3A();y3A();w3A();C3A();gf=rA(P3A(),1);h3A=n00(),o00=W6("◆","*"),niA=W6("■","x"),riA=W6("▲","x"),m3A=W6("◇","o"),oiA=W6("┌","T"),h4=W6("│","|"),t2=W6("└","—"),a00=W6("┐","T"),s00=W6("┘","—"),u3A=W6("●",">"),Ns=W6("○"," "),z_B=W6("◻","[•]"),U_B=W6("◼","[+]"),q_B=W6("◻","[ ]"),t00=W6("▪","•"),e00=W6("─","-"),AB0=W6("╮","+"),D_B=W6("├","+"),QB0=W6("╯","+"),BB0=W6("╰","+"),$B0=W6("╭","+"),JB0=W6("●","•"),YB0=W6("◆","*"),XB0=W6("▲","!"),ZB0=W6("■","x");HB0=[$B0,AB0,BB0,QB0],FB0=[oiA,a00,t2,s00];I_B=[`${f0("dim","↑/↓")} to navigate`,`${f0("dim","Space:")} select`,`${f0("dim","Enter:")} confirm`],g={message:(A=[],{symbol:Q=f0("gray",h4),secondarySymbol:B=f0("gray",h4),output:$=process.stdout,spacing:J=1,withGuide:Y}={})=>{let X=[],Z=Y??w5.withGuide,G=Z?B:"",K=Z?`${Q} `:"",W=Z?`${B} `:"";for(let F=0;F<J;F++)X.push(G);let H=Array.isArray(A)?A:A.split(`
73
73
  `);if(H.length>0){let[F,...D]=H;F.length>0?X.push(`${K}${F}`):X.push(Z?Q:"");for(let q of D)q.length>0?X.push(`${W}${q}`):X.push(Z?B:"")}$.write(`${X.join(`
74
74
  `)}
75
- `)},info:(A,Q)=>{g.message(A,{...Q,symbol:f0("blue",JB0)})},success:(A,Q)=>{g.message(A,{...Q,symbol:f0("green",YB0)})},step:(A,Q)=>{g.message(A,{...Q,symbol:f0("green",m3A)})},warn:(A,Q)=>{g.message(A,{...Q,symbol:f0("yellow",XB0)})},warning:(A,Q)=>{g.warn(A,Q)},error:(A,Q)=>{g.message(A,{...Q,symbol:f0("red",ZB0)})}},M_B={light:W6("─","-"),heavy:W6("━","="),block:W6("█","#")},qB0=[`${f0("dim","↑/↓")} to navigate`,`${f0("dim","Enter:")} confirm`],O_B=`${f0("gray",h4)} `});var siA=BA((V_B,DB0)=>{DB0.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 tw=BA((d3A)=>{var tiA=siA(),tJ=process.env;Object.defineProperty(d3A,"_vendors",{value:tiA.map(function(A){return A.constant})});d3A.name=null;d3A.isPR=null;d3A.id=null;if(tJ.CI!=="false")tiA.forEach(function(A){let B=(Array.isArray(A.env)?A.env:[A.env]).every(function($){return eiA($)});if(d3A[A.constant]=B,!B)return;d3A.name=A.name,d3A.isPR=IB0(A),d3A.id=A.constant});d3A.isCI=!!(tJ.CI!=="false"&&(tJ.BUILD_ID||tJ.BUILD_NUMBER||tJ.CI||tJ.CI_APP_ID||tJ.CI_BUILD_ID||tJ.CI_BUILD_NUMBER||tJ.CI_NAME||tJ.CONTINUOUS_INTEGRATION||tJ.RUN_ID||d3A.name||!1));function eiA(A){if(typeof A==="string")return!!tJ[A];if("env"in A)return tJ[A.env]&&tJ[A.env].includes(A.includes);if("any"in A)return A.any.some(function(Q){return!!tJ[Q]});return Object.keys(A).every(function(Q){return tJ[Q]===A[Q]})}function IB0(A){switch(typeof A.pr){case"string":return!!tJ[A.pr];case"object":if("env"in A.pr)if("any"in A.pr)return A.pr.any.some(function(Q){return tJ[A.pr.env]===Q});else return A.pr.env in tJ&&tJ[A.pr.env]!==A.pr.ne;else if("any"in A.pr)return A.pr.any.some(function(Q){return!!tJ[Q]});else return eiA(A.pr);default:return null}}});var g8;var HG=b(()=>{g8={name:"@capgo/cli",type:"module",version:"8.90.2",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:"https://github.com/Cap-go/capgo.app",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",typecheck:"tsc --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:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","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:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.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:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:bundle-soft-delete":"bun test/test-bundle-soft-delete.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.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:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:api-perf":"bun test/test-api-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-host-fields":"bun test/test-mcp-host-fields.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.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:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs && bun test/test-auth-session-bad-key.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.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:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs && bun test/test-build-env.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && 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:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-host-fields && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && 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-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-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 && bun run test:support && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.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","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support":"bun test/test-support.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native":"npm:typescript@7.1.0-beta","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});import{AsyncLocalStorage as RB0}from"node:async_hooks";function wB0(){return jB0.getStore()}function yf(){XnA=!0}function ZnA(){return XnA}function KnA(A){GnA=A}function YnA(A){try{GnA?.(A)}catch{}}function HnA(A,Q){let B;try{B=new URL(A).pathname}catch{B=A.split("?")[0]}let $=[];for(let J of B.split("/").filter(Boolean)){if($.length>=4||!/^(?:[a-z_-]+|2fa)$/.test(J))break;$.push(J)}return`${Q} ${$.join("/")||B}`}function _B0(A){let Q=A?.headers;if(!Q)return;let B=Q.get;if(typeof B==="function")return B.call(Q,"capgkey")??void 0;if(Array.isArray(Q))return Q.find(([$])=>$.toLowerCase()==="capgkey")?.[1];return Q.capgkey}function FnA(A){return async(B,$)=>{let J=($?.method??"GET").toUpperCase(),Y=typeof B==="string"?B:B instanceof URL?B.href:B.url,X=wB0(),Z=_B0($),G=Date.now();try{let K=await globalThis.fetch(B,$);return YnA({url:Y,route:A,method:J,status:K.status,ok:K.ok,durationMs:Date.now()-G,source:X,apikey:Z}),K}catch(K){throw YnA({url:Y,route:A,method:J,status:0,ok:!1,durationMs:Date.now()-G,source:X,apikey:Z,error:K}),K}}}var jB0,XnA=!1,GnA,WnA=5000;var hf=b(()=>{jB0=new RB0});var mA;var L1=b(()=>{mA=class mA extends Error{context;constructor(A,Q,B){super(A,B!==void 0?{cause:B}:void 0);this.name="CliUserError",this.context=Q}}});import{platform as PB0}from"node:os";import{version as TB0}from"node:process";function qnA(A){UnA=A}function kB0(A){for(let Q=0;Q<A.length;Q++)if(A.charCodeAt(Q)>255)return!1;return!0}function znA(A){if(A.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function bB0(A){if(A.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(A.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function o3A(A,Q){if(Q===void 0||Q===null){if(r3A.has(A.toLowerCase()))throw new mA(znA(A));throw new mA(`HTTP header "${A}" is missing or invalid.`)}if(typeof Q!=="string"){if(r3A.has(A.toLowerCase()))throw new mA(znA(A));throw new mA(`HTTP header "${A}" is missing or invalid.`)}if(!kB0(Q)){if(r3A.has(A.toLowerCase()))throw new mA(bB0(A));throw new mA(`HTTP header "${A}" contains invalid characters (only ASCII is allowed).`)}return Q}function b$(A){let Q={capgo_api:SB0,"x-cli-version":g8.version,"x-cli-command":UnA,"x-cli-node":TB0,"x-cli-os":PB0()};if(A)for(let[B,$]of Object.entries(A))Q[B]=o3A(B,$);return Q}var SB0="2025-10-01",UnA="",r3A;var JX=b(()=>{HG();L1();r3A=new Set(["authorization","capgkey","x-capgo-log-token"])});function DnA(A){let Q=A;if(typeof Q.status==="number")return Q.status;let B=Q.context&&typeof Q.context==="object"?Q.context.status:void 0;return typeof B==="number"?B:void 0}function xB0(A){if(!A||typeof A!=="object")return;let Q=DnA(A);if(Q!==void 0)return Q;let B=A.cause;if(B&&typeof B==="object")return DnA(B);return}function vB0(A){let Q=[],B=new Set,$=A;if(typeof A==="string")return A;while($){if(typeof $==="string"){Q.push($);break}if(typeof $!=="object")break;if(B.has($))break;if(B.add($),$ instanceof Error){Q.push($.message),$=$.cause;continue}let J=$;if(typeof J.message==="string")Q.push(J.message);$=J.cause}return Q.join(" ")}function fB0(A){return vB0(A)}function bV(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=xB0(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===429)return"rate_limited";if(Q>=500)return"server_error"}let B=fB0(A).toLowerCase();if(/econnrefused|econnreset|enotfound|eai_again|fetch failed|failed to fetch|connect timeout|und_err/.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 InA(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"}function FG(A){let Q=A.length;while(Q>0&&A[Q-1]==="/")Q-=1;return A.slice(0,Q)}import{randomUUID as OnA}from"node:crypto";import{existsSync as yB0,mkdirSync as hB0,readFileSync as uB0,writeFileSync as mB0}from"node:fs";import{homedir as s3A,platform as cB0,release as dB0}from"node:os";import{join as LnA}from"node:path";import{arch as lB0,cwd as NnA,env as xV,version as pB0}from"node:process";function UH(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function aB0(){if(UH(xV.CAPGO_DISABLE_TELEMETRY)||UH(xV.CAPGO_DISABLE_POSTHOG))return;return xV.CAPGO_CLI_POSTHOG_API_KEY?.trim()||xV.POSTHOG_API_KEY?.trim()||nB0}function sB0(A){let Q=FG(A);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 tB0(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 eB0(A){let Q=A,B=NnA(),$=s3A();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function A10(A){let Q=A,B=NnA(),$=s3A();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");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-]+){1,}\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 Q10(A,Q){let B=A?.split(`
75
+ `)},info:(A,Q)=>{g.message(A,{...Q,symbol:f0("blue",JB0)})},success:(A,Q)=>{g.message(A,{...Q,symbol:f0("green",YB0)})},step:(A,Q)=>{g.message(A,{...Q,symbol:f0("green",m3A)})},warn:(A,Q)=>{g.message(A,{...Q,symbol:f0("yellow",XB0)})},warning:(A,Q)=>{g.warn(A,Q)},error:(A,Q)=>{g.message(A,{...Q,symbol:f0("red",ZB0)})}},M_B={light:W6("─","-"),heavy:W6("━","="),block:W6("█","#")},qB0=[`${f0("dim","↑/↓")} to navigate`,`${f0("dim","Enter:")} confirm`],O_B=`${f0("gray",h4)} `});var siA=BA((V_B,DB0)=>{DB0.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 tw=BA((d3A)=>{var tiA=siA(),tJ=process.env;Object.defineProperty(d3A,"_vendors",{value:tiA.map(function(A){return A.constant})});d3A.name=null;d3A.isPR=null;d3A.id=null;if(tJ.CI!=="false")tiA.forEach(function(A){let B=(Array.isArray(A.env)?A.env:[A.env]).every(function($){return eiA($)});if(d3A[A.constant]=B,!B)return;d3A.name=A.name,d3A.isPR=IB0(A),d3A.id=A.constant});d3A.isCI=!!(tJ.CI!=="false"&&(tJ.BUILD_ID||tJ.BUILD_NUMBER||tJ.CI||tJ.CI_APP_ID||tJ.CI_BUILD_ID||tJ.CI_BUILD_NUMBER||tJ.CI_NAME||tJ.CONTINUOUS_INTEGRATION||tJ.RUN_ID||d3A.name||!1));function eiA(A){if(typeof A==="string")return!!tJ[A];if("env"in A)return tJ[A.env]&&tJ[A.env].includes(A.includes);if("any"in A)return A.any.some(function(Q){return!!tJ[Q]});return Object.keys(A).every(function(Q){return tJ[Q]===A[Q]})}function IB0(A){switch(typeof A.pr){case"string":return!!tJ[A.pr];case"object":if("env"in A.pr)if("any"in A.pr)return A.pr.any.some(function(Q){return tJ[A.pr.env]===Q});else return A.pr.env in tJ&&tJ[A.pr.env]!==A.pr.ne;else if("any"in A.pr)return A.pr.any.some(function(Q){return!!tJ[Q]});else return eiA(A.pr);default:return null}}});var g8;var HG=b(()=>{g8={name:"@capgo/cli",type:"module",version:"8.91.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:"https://github.com/Cap-go/capgo.app",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",typecheck:"tsc --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:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","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:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.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:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:bundle-soft-delete":"bun test/test-bundle-soft-delete.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.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:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:api-perf":"bun test/test-api-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-host-fields":"bun test/test-mcp-host-fields.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.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:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs && bun test/test-auth-session-bad-key.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.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:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs && bun test/test-build-env.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && 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:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-host-fields && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && 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-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-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 && bun run test:support && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.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","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support":"bun test/test-support.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native":"npm:typescript@7.1.0-beta","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});import{AsyncLocalStorage as RB0}from"node:async_hooks";function wB0(){return jB0.getStore()}function yf(){XnA=!0}function ZnA(){return XnA}function KnA(A){GnA=A}function YnA(A){try{GnA?.(A)}catch{}}function HnA(A,Q){let B;try{B=new URL(A).pathname}catch{B=A.split("?")[0]}let $=[];for(let J of B.split("/").filter(Boolean)){if($.length>=4||!/^(?:[a-z_-]+|2fa)$/.test(J))break;$.push(J)}return`${Q} ${$.join("/")||B}`}function _B0(A){let Q=A?.headers;if(!Q)return;let B=Q.get;if(typeof B==="function")return B.call(Q,"capgkey")??void 0;if(Array.isArray(Q))return Q.find(([$])=>$.toLowerCase()==="capgkey")?.[1];return Q.capgkey}function FnA(A){return async(B,$)=>{let J=($?.method??"GET").toUpperCase(),Y=typeof B==="string"?B:B instanceof URL?B.href:B.url,X=wB0(),Z=_B0($),G=Date.now();try{let K=await globalThis.fetch(B,$);return YnA({url:Y,route:A,method:J,status:K.status,ok:K.ok,durationMs:Date.now()-G,source:X,apikey:Z}),K}catch(K){throw YnA({url:Y,route:A,method:J,status:0,ok:!1,durationMs:Date.now()-G,source:X,apikey:Z,error:K}),K}}}var jB0,XnA=!1,GnA,WnA=5000;var hf=b(()=>{jB0=new RB0});var mA;var L1=b(()=>{mA=class mA extends Error{context;constructor(A,Q,B){super(A,B!==void 0?{cause:B}:void 0);this.name="CliUserError",this.context=Q}}});import{platform as PB0}from"node:os";import{version as TB0}from"node:process";function qnA(A){UnA=A}function kB0(A){for(let Q=0;Q<A.length;Q++)if(A.charCodeAt(Q)>255)return!1;return!0}function znA(A){if(A.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function bB0(A){if(A.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(A.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function o3A(A,Q){if(Q===void 0||Q===null){if(r3A.has(A.toLowerCase()))throw new mA(znA(A));throw new mA(`HTTP header "${A}" is missing or invalid.`)}if(typeof Q!=="string"){if(r3A.has(A.toLowerCase()))throw new mA(znA(A));throw new mA(`HTTP header "${A}" is missing or invalid.`)}if(!kB0(Q)){if(r3A.has(A.toLowerCase()))throw new mA(bB0(A));throw new mA(`HTTP header "${A}" contains invalid characters (only ASCII is allowed).`)}return Q}function b$(A){let Q={capgo_api:SB0,"x-cli-version":g8.version,"x-cli-command":UnA,"x-cli-node":TB0,"x-cli-os":PB0()};if(A)for(let[B,$]of Object.entries(A))Q[B]=o3A(B,$);return Q}var SB0="2025-10-01",UnA="",r3A;var JX=b(()=>{HG();L1();r3A=new Set(["authorization","capgkey","x-capgo-log-token"])});function DnA(A){let Q=A;if(typeof Q.status==="number")return Q.status;let B=Q.context&&typeof Q.context==="object"?Q.context.status:void 0;return typeof B==="number"?B:void 0}function xB0(A){if(!A||typeof A!=="object")return;let Q=DnA(A);if(Q!==void 0)return Q;let B=A.cause;if(B&&typeof B==="object")return DnA(B);return}function vB0(A){let Q=[],B=new Set,$=A;if(typeof A==="string")return A;while($){if(typeof $==="string"){Q.push($);break}if(typeof $!=="object")break;if(B.has($))break;if(B.add($),$ instanceof Error){Q.push($.message),$=$.cause;continue}let J=$;if(typeof J.message==="string")Q.push(J.message);$=J.cause}return Q.join(" ")}function fB0(A){return vB0(A)}function bV(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=xB0(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===429)return"rate_limited";if(Q>=500)return"server_error"}let B=fB0(A).toLowerCase();if(/econnrefused|econnreset|enotfound|eai_again|fetch failed|failed to fetch|connect timeout|und_err/.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 InA(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"}function FG(A){let Q=A.length;while(Q>0&&A[Q-1]==="/")Q-=1;return A.slice(0,Q)}import{randomUUID as OnA}from"node:crypto";import{existsSync as yB0,mkdirSync as hB0,readFileSync as uB0,writeFileSync as mB0}from"node:fs";import{homedir as s3A,platform as cB0,release as dB0}from"node:os";import{join as LnA}from"node:path";import{arch as lB0,cwd as NnA,env as xV,version as pB0}from"node:process";function UH(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function aB0(){if(UH(xV.CAPGO_DISABLE_TELEMETRY)||UH(xV.CAPGO_DISABLE_POSTHOG))return;return xV.CAPGO_CLI_POSTHOG_API_KEY?.trim()||xV.POSTHOG_API_KEY?.trim()||nB0}function sB0(A){let Q=FG(A);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 tB0(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 eB0(A){let Q=A,B=NnA(),$=s3A();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function A10(A){let Q=A,B=NnA(),$=s3A();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");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-]+){1,}\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 Q10(A,Q){let B=A?.split(`
76
76
  `).slice(1).map(($)=>{let J=$.trim(),Y=J.startsWith("at ")?J.slice(3):J,X=Q,Z=Y,G=Y.lastIndexOf(" (");if(G!==-1&&Y.endsWith(")"))X=Y.slice(0,G).trim()||Q,Z=Y.slice(G+2,-1);else{let H=Y.lastIndexOf(" "),F=H===-1?"":Y.slice(H+1);if(/:\d+:\d+$/.test(F))X=Y.slice(0,H).trim()||Q,Z=F}let K=Z.lastIndexOf(":"),W=K===-1?-1:Z.lastIndexOf(":",K-1);if(K===-1||W===-1)return{function:Q,platform:"custom",lang:"javascript"};return{function:X,filename:eB0(Z.slice(0,W)),lineno:Number.parseInt(Z.slice(W+1,K),10),colno:Number.parseInt(Z.slice(K+1),10),platform:"custom",lang:"javascript"}}).filter(Boolean);return B&&B.length>0?B:[{function:Q,platform:"custom",lang:"javascript"}]}function B10(A){if(!A||typeof A!=="object"||!("code"in A))return;let{code:Q}=A;return typeof Q==="string"?Q:void 0}function J10(A){if(!A||typeof A!=="object")return;let Q=A;if(typeof Q.status==="number")return Q.status;if(typeof Q.statusCode==="number")return Q.statusCode;let B=Q.context&&typeof Q.context==="object"?Q.context.status:void 0;return typeof B==="number"?B:void 0}function Y10(A){let Q=(A instanceof Error?A.message:typeof A==="string"?A:"").toLowerCase();if($10.some((B)=>Q.includes(B)))return!0;return J10(A)===401}function uf(A){if(A instanceof mA){if(oB0.has(A.message))return!0;return!1}if(Y10(A))return!1;return!B10(A)?.startsWith("commander.")}function Ts(A){let Q=[],B=A;while(B?.parent){let $=B.name();if($)Q.push($);B=B.parent}return Q.reverse().join(" ")||"unknown"}function X10(A=LnA(s3A(),".capgo-credentials")){if(a3A)return a3A;let Q=LnA(A,"install-id"),B;try{let $=yB0(Q)?uB0(Q,"utf8").trim():"";if($)B=$;else B=OnA(),hB0(A,{recursive:!0}),mB0(Q,B,{encoding:"utf8",mode:384})}catch{B=OnA()}return a3A=B,B}async function mf(A){let Q=aB0();if(!Q)return!1;let B=xV.CAPGO_CLI_POSTHOG_API_HOST?.trim()||xV.POSTHOG_API_HOST?.trim()||iB0,$;try{$=sB0(B)}catch{return!1}let J=tB0(A.error),Y=A10(J.message),X=X10(),Z=Q10(J.stack,A.functionName),G=[A.functionName,A.kind,J.name||"Error",String(A.status??1)].join(":"),K={token:Q,event:"$exception",properties:{distinct_id:X,$exception_list:[{type:J.name||"Error",value:Y,mechanism:{handled:!0,synthetic:!1},stacktrace:{type:"raw",frames:Z}}],$exception_fingerprint:G,architecture:lB0,cli_version:g8.version,error_kind:A.kind,function_name:A.functionName,is_ci:Boolean(xV.CI),node_version:pB0,os_platform:cB0(),os_release:dB0(),runtime:"cli",status:A.status},timestamp:new Date().toISOString()};try{let W=new AbortController,H=setTimeout(()=>W.abort(),rB0);try{return(await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K),signal:W.signal})).ok}finally{clearTimeout(H)}}catch{return!1}}var iB0="https://eu.i.posthog.com/i/v0/e/",nB0="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",rB0=1500,t3A="iOS sync validation failed. Delete your iOS folder, then rerun the add and sync commands above and retry.",oB0,$10,a3A;var ew=b(()=>{HG();L1();oB0=new Set([t3A]);$10=["invalid_apikey","invalid apikey","no_key_provided","no key provided","invalid api key or insufficient permissions","does not exist, run first"]});import{existsSync as zG}from"fs";var e2=(A=".",Q="unknown")=>{let B=`${A}/bun.lockb`,$=`${A}/bun.lock`,J=`${A}/pnpm-lock.yaml`,Y=`${A}/shrinkwrap.yaml`,X=`${A}/yarn.lock`,Z=`${A}/package-lock.json`,G=`${A}/npm-shrinkwrap.json`;if(zG(B)||zG($))return"bun";if(zG(J)||zG(Y))return"pnpm";if(zG(X))return"yarn";if(zG(Z)||zG(G))return"npm";return Q},YM=(A=e2(),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"}},Ss=(A=".",Q="npx")=>{let B=`${A}/bun.lockb`,$=`${A}/bun.lock`,J=`${A}/pnpm-lock.yaml`,Y=`${A}/shrinkwrap.yaml`,X=`${A}/yarn.lock`,Z=`${A}/package-lock.json`,G=`${A}/npm-shrinkwrap.json`;if(zG(B)||zG($))return"bunx";if(zG(J)||zG(Y))return"pnpm exec";if(zG(X))return"yarn dlx";if(zG(Z)||zG(G))return"npx";return Q};var cf=()=>{};function ks(A,Q){if(isNaN(A)||isNaN(Q))throw Error("Cannot compare against non-numbers");return A===Q?0:A<Q?-1:1}function EnA(A=[],Q=[]){if(A.length&&!Q.length)return-1;if(!A.length&&Q.length)return 1;return 0}function bs(A=[],Q=[]){let B=Math.max(A.length,Q.length);for(let $=0;$<B;$++){let J=A[$],Y=Q[$];if(J===void 0&&Y===void 0)return 0;if(Y===void 0)return 1;if(J===void 0)return-1;if(typeof J==="string"&&typeof Y==="number")return 1;if(typeof J==="number"&&typeof Y==="string")return-1;if(J<Y)return-1;if(J>Y)return 1}return 0}function AHA(A){return typeof A==="number"&&!Number.isNaN(A)&&(!Number.isFinite(A)||0<=A&&A<=Number.MAX_SAFE_INTEGER)}function UG(A){return A.split(".").filter(Boolean).map((Q)=>{if(W10.test(Q)){let B=Number(Q);if(AHA(B))return B}return Q})}function AF(A){return A.split(".").filter(Boolean)}function vs(A,Q){let B=Number(A);if(!AHA(B))throw TypeError(Q);return B}function nU(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 A_="0|[1-9]\\d*",Z10="\\d*[a-zA-Z-][a-zA-Z0-9-]*",G10,VnA,RnA,CnA="[0-9A-Za-z-]+",jnA,wnA,_nA,PnA="(?:<|>)?=?",K10="x|X|\\*",e3A,xs,TnA,SnA,QHA=256,W10;var IK=b(()=>{G10=`(?<major>${A_})\\.(?<minor>${A_})\\.(?<patch>${A_})`,VnA=`(?:${A_}|${Z10})`,RnA=`(?:-(?<prerelease>${VnA}(?:\\.${VnA})*))`,jnA=`(?:\\+(?<buildmetadata>${CnA}(?:\\.${CnA})*))`,wnA=`v?${G10}${RnA}?${jnA}?`,_nA=new RegExp(`^${wnA}$`),e3A=`${A_}|${K10}`,xs=`[v=\\s]*(?<major>${e3A})(?:\\.(?<minor>${e3A})(?:\\.(?<patch>${e3A})${RnA}?${jnA}?)?)?`,TnA=new RegExp(`^(?<operator>~>?|\\^|${PnA})\\s*${xs}$`),SnA=new RegExp(`^(?<operator>${PnA})\\s*(${wnA})$|^$`);W10=new RegExp(`^${A_}$`)});function tX(A,Q){if(A===Q)return 0;return ks(A.major,Q.major)||ks(A.minor,Q.minor)||ks(A.patch,Q.patch)||EnA(A.prerelease,Q.prerelease)||bs(A.prerelease,Q.prerelease)}var _W=b(()=>{IK()});function knA(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(bs(A.prerelease,Q.prerelease)!==0)return"prerelease"}var bnA=b(()=>{IK()});function BHA(A){return A.toFixed(0)}function H7(A){let Q=BHA(A.major),B=BHA(A.minor),$=BHA(A.patch),J=A.prerelease?.join(".")??"",Y=A.build?.join(".")??"";return[[`${Q}.${B}.${$}`,J].filter((G)=>G).join("-"),Y].filter((G)=>G).join("+")}function H10(A,Q){if(nU(Q))return!0;let B=tX(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 fs(A,Q){for(let B of Q)if(!H10(A,B))return!1;if(!A.prerelease?.length)return!0;for(let B of Q){if(nU(B))continue;if(!B.prerelease?.length)continue;let{major:$,minor:J,patch:Y}=B;if(A.major===$&&A.minor===J&&A.patch===Y)return!0}return!1}var gs=b(()=>{IK();_W()});function df(A,Q){return Q.some((B)=>fs(A,B))}var lf=b(()=>{gs()});function F10(A=[]){let Q=[...A],B=Q.length;while(B>=0){let $=Q[B];if(typeof $==="number"){Q[B]=$+1;break}B-=1}if(B===-1)Q.push(0);return Q}function pf(A=[],Q){let B=F10(A);if(!Q)return B;let $=UG(Q);if($.every((J)=>typeof J==="string")){if($.every((J,Y)=>J===B[Y])&&typeof B[$.length]==="number")return B;$=[...$,0]}return $}function XM(A,Q,B={}){let $=B.build!==void 0?AF(B.build):A.build??[];switch(Q){case"premajor":return{major:A.major+1,minor:0,patch:0,prerelease:pf(A.prerelease,B.prerelease),build:$};case"preminor":return{major:A.major,minor:A.minor+1,patch:0,prerelease:pf(A.prerelease,B.prerelease),build:$};case"prepatch":return{major:A.major,minor:A.minor,patch:A.patch+1,prerelease:pf(A.prerelease,B.prerelease),build:$};case"prerelease":{let Y=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:Y,prerelease:pf(A.prerelease,B.prerelease),build:$}}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:$};case"minor":{let Y=(A.prerelease??[]).length===0||A.patch!==0?A.minor+1:A.minor;return{major:A.major,minor:Y,patch:0,prerelease:[],build:$}}case"patch":{let Y=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:Y,prerelease:[],build:$}}case"pre":return{major:A.major,minor:A.minor,patch:A.patch,prerelease:pf(A.prerelease,B.prerelease),build:$};default:throw TypeError(`Cannot increment version: invalid argument ${Q}`)}}var xnA=b(()=>{IK()});var ys,Q_;var nf=b(()=>{ys={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},Q_={operator:void 0,...ys}});var $HA=b(()=>{nf();IK()});function JHA(A,Q){return tX(A,Q)>0}var YHA=b(()=>{_W()});var vnA=b(()=>{lf();YHA()});function YX(A,Q){return tX(A,Q)<0}var XHA=b(()=>{_W()});var fnA=b(()=>{lf();XHA()});function z10(A){let B=A.match(SnA)?.groups;if(!B)return null;let{operator:$}=B;return{operator:$||void 0,...ys}}function u6(A){return!A||A.toLowerCase()==="x"||A==="*"}function U10(A){if(u6(A.major))return;if(u6(A.minor))return{operator:">=",major:+A.major,minor:0,patch:0,prerelease:[],build:[]};if(u6(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?UG(A.prerelease):[],build:[]}}function q10(A){if(u6(A.major))return;if(u6(A.minor))return{operator:"<",major:+A.major+1,minor:0,patch:0,prerelease:[],build:[]};if(u6(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:UG(A.prerelease),build:[]};return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:[],build:[]}}function D10(A){let Q=A.match(new RegExp(`^${xs}`)),B=Q?.groups;if(!B)return null;let $=Q[0].length,J=A.slice($).match(/^\s+-\s+/);if(!J)return null;let Y=J[0].length,Z=A.slice($+Y).match(new RegExp(`^${xs}\\s*$`))?.groups,G=U10(B),K=q10(Z);return[G,K].filter(Boolean)}function I10(A){let Q=u6(A.major),B=u6(A.minor),$=u6(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[Q_];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($){if(J===0)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J+1,minor:0,patch:0}]}let Z=UG(A.prerelease??"");if(J===0){if(Y===0)return[{operator:">=",major:J,minor:Y,patch:X,prerelease:Z},{operator:"<",major:J,minor:Y,patch:X+1}];return[{operator:">=",major:J,minor:Y,patch:X,prerelease:Z},{operator:"<",major:J,minor:Y+1,patch:0}]}return[{operator:">=",major:J,minor:Y,patch:X,prerelease:Z},{operator:"<",major:J+1,minor:0,patch:0}]}function M10(A){let Q=u6(A.major),B=u6(A.minor),$=u6(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[Q_];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];let Z=UG(A.prerelease??"");return[{operator:">=",major:J,minor:Y,patch:X,prerelease:Z},{operator:"<",major:J,minor:Y+1,patch:0}]}function O10(A){let Q=u6(A.major),B=u6(A.minor),$=u6(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B){if($)return[{operator:"<",major:J,minor:0,patch:0}];return[{operator:"<",major:J,minor:0,patch:0}]}if($)return[{operator:"<",major:J,minor:Y,patch:0}];let Z=UG(A.prerelease??""),G=AF(A.build??"");return[{operator:"<",major:J,minor:Y,patch:X,prerelease:Z,build:G}]}function L10(A){let Q=u6(A.minor),B=u6(A.patch),$=+A.major,J=+A.minor,Y=+A.patch;if(Q)return[{operator:"<",major:$+1,minor:0,patch:0}];if(B)return[{operator:"<",major:$,minor:J+1,patch:0}];let X=UG(A.prerelease??""),Z=AF(A.build??"");return[{operator:"<=",major:$,minor:J,patch:Y,prerelease:X,build:Z}]}function N10(A){let Q=u6(A.major),B=u6(A.minor),$=u6(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B)return[{operator:">=",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y+1,patch:0}];let Z=UG(A.prerelease??""),G=AF(A.build??"");return[{operator:">",major:J,minor:Y,patch:X,prerelease:Z,build:G}]}function V10(A){let Q=u6(A.major),B=u6(A.minor),$=u6(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[Q_];if(B)return[{operator:">=",major:J,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0}];let Z=UG(A.prerelease??""),G=AF(A.build??"");return[{operator:">=",major:J,minor:Y,patch:X,prerelease:Z,build:G}]}function C10(A){let Q=u6(A.major),B=u6(A.minor),$=u6(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[Q_];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];let Z=UG(A.prerelease??""),G=AF(A.build??"");return[{operator:A.operator==="="?"=":void 0,major:J,minor:Y,patch:X,prerelease:Z,build:G}]}function E10(A){let Q=A.match(TnA)?.groups;if(!Q)return z10(A);switch(Q.operator){case"^":return I10(Q);case"~":case"~>":return M10(Q);case"<":return O10(Q);case"<=":return L10(Q);case">":return N10(Q);case">=":return V10(Q);default:return C10(Q)}}function R10(A){return A.split(/\s+/).flatMap(E10)}function hs(A){let Q=A.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((B)=>D10(B)||R10(B));if(Q.some((B)=>B.includes(null)))throw TypeError(`Cannot parse version range: range "${A}" is invalid`);return Q}var ZHA=b(()=>{IK();nf()});function W1(A){if(typeof A!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof A}`);if(A.length>QHA)throw TypeError(`Cannot parse version as version length is too long: length is ${A.length}, max length is ${QHA}`);A=A.trim();let Q=A.match(_nA)?.groups;if(!Q)throw TypeError(`Cannot parse version: ${A}`);let B=vs(Q.major,`Cannot parse version ${A}: invalid major version`),$=vs(Q.minor,`Cannot parse version ${A}: invalid minor version`),J=vs(Q.patch,`Cannot parse version ${A}: invalid patch version`),Y=Q.prerelease?UG(Q.prerelease):[],X=Q.buildmetadata?AF(Q.buildmetadata):[];return{major:B,minor:$,patch:J,prerelease:Y,build:X}}var us=b(()=>{IK();IK()});function gnA(A,Q){let B=A.operator,$=Q.operator;if(B===void 0){if(nU(A))return!0;return df(A,[[Q]])}if($===void 0){if(nU(Q))return!0;return df(Q,[[A]])}let J=tX(A,Q);return(B===">="||B===">")&&($===">="||$===">")||(B==="<="||B==="<")&&($==="<="||$==="<")||J===0&&((B===">="||B==="<=")&&($===">="||$==="<="))||J===-1&&(B===">="||B===">")&&($==="<="||$==="<")||J===1&&(B==="<="||B==="<")&&($===">="||$===">")}function j10(A){return A.every((Q)=>{return Q.some((B)=>w10(B))})}function w10(A){for(let Q=0;Q<A.length-1;Q++){let B=A[Q];for(let $ of A.slice(Q+1))if(!gnA(B,$))return!1}return!0}function ynA(A,Q){return j10([A,Q])&&A.some((B)=>{return Q.some(($)=>{return B.every((J)=>{return $.every((Y)=>gnA(J,Y))})})})}var hnA=b(()=>{IK();_W();lf()});var unA=b(()=>{ZHA()});var mnA=b(()=>{nf();nf();$HA()});function ZM(A){try{return W1(A),!0}catch{return!1}}var cnA=b(()=>{us()});var dnA=b(()=>{us()});var lnA=b(()=>{IK()});var pnA=b(()=>{_W()});var inA=b(()=>{_W()});var nnA=b(()=>{gs();IK();_W()});function GHA(A,Q){return tX(A,Q)>=0}var rnA=b(()=>{_W()});var onA=b(()=>{gs();IK();_W()});var anA=b(()=>{_W()});var PW=b(()=>{_W();bnA();lf();xnA();$HA();vnA();fnA();ZHA();us();hnA();unA();mnA();cnA();dnA();lnA();pnA();inA();YHA();nnA();rnA();XHA();onA();anA()});var KHA=BA((ZSB,snA)=>{snA.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var ms=BA((enA)=>{var tnA={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function _10(A){return function(...Q){if(Q.length)A=A.replace(/\{(\d)\}/g,(B,$)=>Q[$]||"");return Error("ADM-ZIP: "+A)}}for(let A of Object.keys(tnA))enA[A]=_10(tnA[A])});var JrA=BA((KSB,$rA)=>{var P10=OQ("fs"),P5=OQ("path"),ArA=KHA(),T10=ms(),S10=typeof process==="object"&&process.platform==="win32",QrA=(A)=>typeof A==="object"&&A!==null,BrA=new Uint32Array(256).map((A,Q)=>{for(let B=0;B<8;B++)if((Q&1)!==0)Q=3988292384^Q>>>1;else Q>>>=1;return Q>>>0});function XJ(A){if(this.sep=P5.sep,this.fs=P10,QrA(A)){if(QrA(A.fs)&&typeof A.fs.statSync==="function")this.fs=A.fs}}$rA.exports=XJ;XJ.prototype.makeDir=function(A){let Q=this;function B($){let J=$.split(Q.sep)[0];$.split(Q.sep).forEach(function(Y){if(!Y||Y.substr(-1,1)===":")return;J+=Q.sep+Y;var X;try{X=Q.fs.statSync(J)}catch(Z){if(Z.message&&Z.message.startsWith("ENOENT"))Q.fs.mkdirSync(J);else throw Z}if(X&&X.isFile())throw T10.FILE_IN_THE_WAY(`"${J}"`)})}B(A)};XJ.prototype.writeFileTo=function(A,Q,B,$){let J=this;if(J.fs.existsSync(A)){if(!B)return!1;var Y=J.fs.statSync(A);if(Y.isDirectory())return!1}var X=P5.dirname(A);if(!J.fs.existsSync(X))J.makeDir(X);var Z;try{Z=J.fs.openSync(A,"w",438)}catch(G){J.fs.chmodSync(A,438),Z=J.fs.openSync(A,"w",438)}if(Z)try{J.fs.writeSync(Z,Q,0,Q.length,0)}finally{J.fs.closeSync(Z)}return J.fs.chmodSync(A,$||438),!0};XJ.prototype.writeFileToAsync=function(A,Q,B,$,J){if(typeof $==="function")J=$,$=void 0;let Y=this;Y.fs.exists(A,function(X){if(X&&!B)return J(!1);Y.fs.stat(A,function(Z,G){if(X&&G&&G.isDirectory())return J(!1);var K=P5.dirname(A);Y.fs.exists(K,function(W){if(!W)try{Y.makeDir(K)}catch(F){return J(!1)}let H=function(F){Y.fs.write(F,Q,0,Q.length,0,function(D){Y.fs.close(F,function(){if(D)return J(!1);Y.fs.chmod(A,$||438,function(){J(!0)})})})};Y.fs.open(A,"w",438,function(F,D){if(F)Y.fs.chmod(A,438,function(){Y.fs.open(A,"w",438,function(q,I){if(q||!I)return J(!1);H(I)})});else if(D)H(D);else J(!1)})})})})};XJ.prototype.findFiles=function(A){let Q=this;function B($,J,Y,X){if(typeof J==="boolean")Y=J,J=void 0;let Z=[];return Q.fs.readdirSync($).forEach(function(G){let K=P5.join($,G),W=Q.fs.statSync(K);if(!J||J.test(K))Z.push(P5.normalize(K)+(W.isDirectory()?Q.sep:""));if(W.isDirectory()&&Y){let H=Q.fs.realpathSync(K);if(!X.has(H))X.add(H),Z=Z.concat(B(K,J,Y,X))}}),Z}return B(A,void 0,!0,new Set([Q.fs.realpathSync(A)]))};XJ.prototype.findFilesAsync=function(A,Q){let B=this,$=[],J=!1,Y=function(Z){if(J)return;J=!0,Q(Z,Z?void 0:$)},X=function(Z,G,K){B.fs.readdir(Z,function(W,H){if(W)return K(W);let F=H.length;if(!F)return K();H.forEach(function(D){let q=P5.join(Z,D);B.fs.stat(q,function(I,M){if(I)return K(I);if(!M){if(!--F)K();return}if($.push(P5.normalize(q)+(M.isDirectory()?B.sep:"")),!M.isDirectory()){if(!--F)K();return}B.fs.realpath(q,function(V,C){if(V)return K(V);if(G.has(C)){if(!--F)K();return}G.add(C),X(q,G,function(L){if(L)return K(L);if(!--F)K()})})})})})};B.fs.realpath(A,function(Z,G){if(Z)return Y(Z);X(A,new Set([G]),Y)})};XJ.prototype.getAttributes=function(){};XJ.prototype.setAttributes=function(){};XJ.crc32update=function(A,Q){return BrA[(A^Q)&255]^A>>>8};XJ.crc32=function(A){if(typeof A==="string")A=Buffer.from(A,"utf8");let Q=A.length,B=-1;for(let $=0;$<Q;)B=XJ.crc32update(B,A[$++]);return~B>>>0};XJ.methodToString=function(A){switch(A){case ArA.STORED:return"STORED ("+A+")";case ArA.DEFLATED:return"DEFLATED ("+A+")";default:return"UNSUPPORTED ("+A+")"}};XJ.canonical=function(A){if(!A)return"";let Q=P5.posix.normalize("/"+A.split("\\").join("/"));return P5.join(".",Q)};XJ.zipnamefix=function(A){if(!A)return"";let Q=P5.posix.normalize("/"+A.split("\\").join("/"));return P5.posix.join(".",Q)};XJ.findLast=function(A,Q){if(!Array.isArray(A))throw TypeError("arr is not array");let B=A.length>>>0;for(let $=B-1;$>=0;$--)if(Q(A[$],$,A))return A[$];return};XJ.sanitize=function(A,Q){A=P5.resolve(P5.normalize(A));var B=Q.split("/");for(var $=0,J=B.length;$<J;$++){var Y=P5.normalize(P5.join(A,B.slice($,J).join(P5.sep)));if(Y===A||Y.startsWith(A+P5.sep))return Y}return P5.normalize(P5.join(A,P5.basename(Q)))};XJ.toBuffer=function(Q,B){if(Buffer.isBuffer(Q))return Q;else if(Q instanceof Uint8Array)return Buffer.from(Q);else return typeof Q==="string"?B(Q):Buffer.alloc(0)};XJ.readBigUInt64LE=function(A,Q){let B=A.readUInt32LE(Q);return A.readUInt32LE(Q+4)*4294967296+B};XJ.writeBigUInt64LE=function(A,Q,B){let $=Q>>>0,J=Math.floor(Q/4294967296)>>>0;A.writeUInt32LE($,B),A.writeUInt32LE(J,B+4)};XJ.fromDOS2Date=function(A){return new Date((A>>25&127)+1980,Math.max((A>>21&15)-1,0),Math.max(A>>16&31,1),A>>11&31,A>>5&63,(A&31)<<1)};XJ.fromDate2DOS=function(A){let Q=0,B=0;if(A.getFullYear()>1979)Q=(A.getFullYear()-1980&127)<<9|A.getMonth()+1<<5|A.getDate(),B=A.getHours()<<11|A.getMinutes()<<5|A.getSeconds()>>1;return Q<<16|B};XJ.isWin=S10;XJ.crcTable=BrA});var XrA=BA((WSB,YrA)=>{var k10=OQ("path");YrA.exports=function(A,{fs:Q}){var B=A||"",$=Y(),J=null;function Y(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}if(B&&Q.existsSync(B))J=Q.statSync(B),$.directory=J.isDirectory(),$.mtime=J.mtime,$.atime=J.atime,$.executable=(73&J.mode)!==0,$.readonly=(128&J.mode)===0,$.hidden=k10.basename(B)[0]===".";else console.warn("Invalid path: "+B);return{get directory(){return $.directory},get readOnly(){return $.readonly},get hidden(){return $.hidden},get mtime(){return $.mtime},get atime(){return $.atime},get executable(){return $.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:B,isDirectory:$.directory,isReadOnly:$.readonly,isHidden:$.hidden,isExecutable:$.executable,mTime:$.mtime,aTime:$.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var GrA=BA((HSB,ZrA)=>{ZrA.exports={efs:!0,encode:(A)=>Buffer.from(A,"utf8"),decode:(A)=>A.toString("utf8")}});var $_=BA((FSB,B_)=>{B_.exports=JrA();B_.exports.Constants=KHA();B_.exports.Errors=ms();B_.exports.FileAttr=XrA();B_.exports.decoder=GrA()});var WrA=BA((zSB,KrA)=>{var GM=$_(),qB=GM.Constants;KrA.exports=function(){var A=20,Q=10,B=0,$=0,J=0,Y=0,X=0,Z=0,G=0,K=0,W=0,H=0,F=0,D=0,q=0;A|=GM.isWin?2560:768,B|=qB.FLG_EFS;let I={extraLen:0},M=(L)=>Math.max(0,L)>>>0,V=(L)=>Math.max(0,L)&65535,C=(L)=>Math.max(0,L)&255;return J=GM.fromDate2DOS(new Date),{get made(){return A},set made(L){A=L},get version(){return Q},set version(L){Q=L},get flags(){return B},set flags(L){B=L},get flags_efs(){return(B&qB.FLG_EFS)>0},set flags_efs(L){if(L)B|=qB.FLG_EFS;else B&=~qB.FLG_EFS},get flags_desc(){return(B&qB.FLG_DESC)>0},set flags_desc(L){if(L)B|=qB.FLG_DESC;else B&=~qB.FLG_DESC},get method(){return $},set method(L){switch(L){case qB.STORED:this.version=10;break;case qB.DEFLATED:default:this.version=20}$=L},get time(){return GM.fromDOS2Date(this.timeval)},set time(L){L=new Date(L),this.timeval=GM.fromDate2DOS(L)},get timeval(){return J},set timeval(L){J=M(L)},get timeHighByte(){return C(J>>>8)},get crc(){return Y},set crc(L){Y=M(L)},get compressedSize(){return X},set compressedSize(L){X=M(L)},get size(){return Z},set size(L){Z=M(L)},get fileNameLength(){return G},set fileNameLength(L){G=L},get extraLength(){return K},set extraLength(L){K=L},get extraLocalLength(){return I.extraLen},set extraLocalLength(L){I.extraLen=L},get commentLength(){return W},set commentLength(L){W=L},get diskNumStart(){return H},set diskNumStart(L){H=M(L)},get inAttr(){return F},set inAttr(L){F=M(L)},get attr(){return D},set attr(L){D=M(L)},get fileAttr(){return(D||0)>>16&4095},get offset(){return q},set offset(L){q=M(L)},get encrypted(){return(B&qB.FLG_ENC)===qB.FLG_ENC},get centralHeaderSize(){return qB.CENHDR+G+K+W},get realDataOffset(){return q+qB.LOCHDR+I.fnameLen+I.extraLen},get localHeader(){return I},loadLocalHeaderFromBinary:function(L){var N=L.slice(q,q+qB.LOCHDR);if(N.readUInt32LE(0)!==qB.LOCSIG)throw GM.Errors.INVALID_LOC();I.version=N.readUInt16LE(qB.LOCVER),I.flags=N.readUInt16LE(qB.LOCFLG),I.flags_desc=(I.flags&qB.FLG_DESC)>0,I.method=N.readUInt16LE(qB.LOCHOW),I.time=N.readUInt32LE(qB.LOCTIM),I.crc=N.readUInt32LE(qB.LOCCRC),I.compressedSize=N.readUInt32LE(qB.LOCSIZ),I.size=N.readUInt32LE(qB.LOCLEN),I.fnameLen=N.readUInt16LE(qB.LOCNAM),I.extraLen=N.readUInt16LE(qB.LOCEXT);let E=q+qB.LOCHDR+I.fnameLen,R=E+I.extraLen;return L.slice(E,R)},loadFromBinary:function(L){if(L.length!==qB.CENHDR||L.readUInt32LE(0)!==qB.CENSIG)throw GM.Errors.INVALID_CEN();A=L.readUInt16LE(qB.CENVEM),Q=L.readUInt16LE(qB.CENVER),B=L.readUInt16LE(qB.CENFLG),$=L.readUInt16LE(qB.CENHOW),J=L.readUInt32LE(qB.CENTIM),Y=L.readUInt32LE(qB.CENCRC),X=L.readUInt32LE(qB.CENSIZ),Z=L.readUInt32LE(qB.CENLEN),G=L.readUInt16LE(qB.CENNAM),K=L.readUInt16LE(qB.CENEXT),W=L.readUInt16LE(qB.CENCOM),H=L.readUInt16LE(qB.CENDSK),F=L.readUInt16LE(qB.CENATT),D=L.readUInt32LE(qB.CENATX),q=L.readUInt32LE(qB.CENOFF)},localHeaderToBinary:function(){var L=Buffer.alloc(qB.LOCHDR);return L.writeUInt32LE(qB.LOCSIG,0),L.writeUInt16LE(Q,qB.LOCVER),L.writeUInt16LE(B&~qB.FLG_DESC,qB.LOCFLG),L.writeUInt16LE($,qB.LOCHOW),L.writeUInt32LE(J,qB.LOCTIM),L.writeUInt32LE(Y,qB.LOCCRC),L.writeUInt32LE(X,qB.LOCSIZ),L.writeUInt32LE(Z,qB.LOCLEN),L.writeUInt16LE(G,qB.LOCNAM),L.writeUInt16LE(I.extraLen,qB.LOCEXT),L},centralHeaderToBinary:function(){var L=Buffer.alloc(qB.CENHDR+G+K+W);return L.writeUInt32LE(qB.CENSIG,0),L.writeUInt16LE(A,qB.CENVEM),L.writeUInt16LE(Q,qB.CENVER),L.writeUInt16LE(B&~qB.FLG_DESC,qB.CENFLG),L.writeUInt16LE($,qB.CENHOW),L.writeUInt32LE(J,qB.CENTIM),L.writeUInt32LE(Y,qB.CENCRC),L.writeUInt32LE(X,qB.CENSIZ),L.writeUInt32LE(Z,qB.CENLEN),L.writeUInt16LE(G,qB.CENNAM),L.writeUInt16LE(K,qB.CENEXT),L.writeUInt16LE(W,qB.CENCOM),L.writeUInt16LE(H,qB.CENDSK),L.writeUInt16LE(F,qB.CENATT),L.writeUInt32LE(D,qB.CENATX),L.writeUInt32LE(q,qB.CENOFF),L},toJSON:function(){let L=function(N){return N+" bytes"};return{made:A,version:Q,flags:B,method:GM.methodToString($),time:this.time,crc:"0x"+Y.toString(16).toUpperCase(),compressedSize:L(X),size:L(Z),fileNameLength:L(G),extraLength:L(K),commentLength:L(W),diskNumStart:H,inAttr:F,attr:D,offset:q,centralHeaderSize:L(qB.CENHDR+G+K+W)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var FrA=BA((USB,HrA)=>{var TW=$_(),B1=TW.Constants;HrA.exports=function(){var A=0,Q=0,B=0,$=0,J=0;let Y=()=>A>B1.EF_ZIP64_OR_16||Q>B1.EF_ZIP64_OR_16||B>B1.EF_ZIP64_OR_32||$>B1.EF_ZIP64_OR_32;return{get diskEntries(){return A},set diskEntries(X){A=Q=X},get totalEntries(){return Q},set totalEntries(X){Q=A=X},get size(){return B},set size(X){B=X},get offset(){return $},set offset(X){$=X},get commentLength(){return J},set commentLength(X){J=X},get mainHeaderSize(){return(Y()?B1.ZIP64HDR+B1.END64HDR:0)+B1.ENDHDR+J},loadFromBinary:function(X){if((X.length!==B1.ENDHDR||X.readUInt32LE(0)!==B1.ENDSIG)&&(X.length<B1.ZIP64HDR||X.readUInt32LE(0)!==B1.ZIP64SIG))throw TW.Errors.INVALID_END();if(X.readUInt32LE(0)===B1.ENDSIG)A=X.readUInt16LE(B1.ENDSUB),Q=X.readUInt16LE(B1.ENDTOT),B=X.readUInt32LE(B1.ENDSIZ),$=X.readUInt32LE(B1.ENDOFF),J=X.readUInt16LE(B1.ENDCOM);else A=TW.readBigUInt64LE(X,B1.ZIP64SUB),Q=TW.readBigUInt64LE(X,B1.ZIP64TOT),B=TW.readBigUInt64LE(X,B1.ZIP64SIZB),$=TW.readBigUInt64LE(X,B1.ZIP64OFF),J=0},toBinary:function(){if(!Y()){var X=Buffer.alloc(B1.ENDHDR+J);return X.writeUInt32LE(B1.ENDSIG,0),X.writeUInt32LE(0,4),X.writeUInt16LE(A,B1.ENDSUB),X.writeUInt16LE(Q,B1.ENDTOT),X.writeUInt32LE(B,B1.ENDSIZ),X.writeUInt32LE($,B1.ENDOFF),X.writeUInt16LE(J,B1.ENDCOM),X.fill(" ",B1.ENDHDR),X}var X=Buffer.alloc(this.mainHeaderSize);let Z=0;X.writeUInt32LE(B1.ZIP64SIG,Z),TW.writeBigUInt64LE(X,B1.ZIP64HDR-B1.ZIP64LEAD,Z+B1.ZIP64SIZE),X.writeUInt16LE(45,Z+B1.ZIP64VEM),X.writeUInt16LE(45,Z+B1.ZIP64VER),X.writeUInt32LE(0,Z+B1.ZIP64DSK),X.writeUInt32LE(0,Z+B1.ZIP64DSKDIR),TW.writeBigUInt64LE(X,A,Z+B1.ZIP64SUB),TW.writeBigUInt64LE(X,Q,Z+B1.ZIP64TOT),TW.writeBigUInt64LE(X,B,Z+B1.ZIP64SIZB),TW.writeBigUInt64LE(X,$,Z+B1.ZIP64OFF);let G=$+B;return Z+=B1.ZIP64HDR,X.writeUInt32LE(B1.END64SIG,Z),X.writeUInt32LE(0,Z+B1.END64START),TW.writeBigUInt64LE(X,G,Z+B1.END64OFF),X.writeUInt32LE(1,Z+B1.END64NUMDISKS),Z+=B1.END64HDR,X.writeUInt32LE(B1.ENDSIG,Z),X.writeUInt32LE(0,Z+4),X.writeUInt16LE(Math.min(A,B1.EF_ZIP64_OR_16),Z+B1.ENDSUB),X.writeUInt16LE(Math.min(Q,B1.EF_ZIP64_OR_16),Z+B1.ENDTOT),X.writeUInt32LE(Math.min(B,B1.EF_ZIP64_OR_32),Z+B1.ENDSIZ),X.writeUInt32LE(Math.min($,B1.EF_ZIP64_OR_32),Z+B1.ENDOFF),X.writeUInt16LE(J,Z+B1.ENDCOM),X.fill(" ",Z+B1.ENDHDR),X},toJSON:function(){let X=function(Z,G){let K=Z.toString(16).toUpperCase();while(K.length<G)K="0"+K;return"0x"+K};return{diskEntries:A,totalEntries:Q,size:B+" bytes",offset:X($,4),commentLength:J}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var WHA=BA((b10)=>{b10.EntryHeader=WrA();b10.MainHeader=FrA()});var UrA=BA((DSB,zrA)=>{zrA.exports=function(A){var Q=OQ("zlib"),B={chunkSize:(parseInt(A.length/1024)+1)*1024};return{deflate:function(){return Q.deflateRawSync(A,B)},deflateAsync:function($){var J=Q.createDeflateRaw(B),Y=[],X=0;J.on("data",function(Z){Y.push(Z),X+=Z.length}),J.on("end",function(){var Z=Buffer.alloc(X),G=0;Z.fill(0);for(var K=0;K<Y.length;K++){var W=Y[K];W.copy(Z,G),G+=W.length}$&&$(Z)}),J.end(A)}}}});var DrA=BA((ISB,qrA)=>{var f10=+(process?.versions?.node??"").split(".")[0]||0;qrA.exports=function(A,Q){var B=OQ("zlib");let $=f10>=15&&Q>0?{maxOutputLength:Q}:{};return{inflate:function(){return B.inflateRawSync(A,$)},inflateAsync:function(J){var Y=B.createInflateRaw($),X=[],Z=0;Y.on("data",function(G){X.push(G),Z+=G.length}),Y.on("end",function(){var G=Buffer.alloc(Z),K=0;G.fill(0);for(var W=0;W<X.length;W++){var H=X[W];H.copy(G,K),K+=H.length}J&&J(G)}),Y.end(A)}}}});var NrA=BA((MSB,LrA)=>{var{randomFillSync:IrA}=OQ("crypto"),g10=ms(),y10=new Uint32Array(256).map((A,Q)=>{for(let B=0;B<8;B++)if((Q&1)!==0)Q=Q>>>1^3988292384;else Q>>>=1;return Q>>>0}),OrA=(A,Q)=>Math.imul(A,Q)>>>0,MrA=(A,Q)=>{return y10[(A^Q)&255]^A>>>8},rf=()=>{if(typeof IrA==="function")return IrA(Buffer.alloc(12));else return rf.node()};rf.node=()=>{let A=Buffer.alloc(12),Q=A.length;for(let B=0;B<Q;B++)A[B]=Math.random()*256&255;return A};var cs={genSalt:rf};function ds(A){let Q=Buffer.isBuffer(A)?A:Buffer.from(A);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let B=0;B<Q.length;B++)this.updateKeys(Q[B])}ds.prototype.updateKeys=function(A){let Q=this.keys;return Q[0]=MrA(Q[0],A),Q[1]+=Q[0]&255,Q[1]=OrA(Q[1],134775813)+1,Q[2]=MrA(Q[2],Q[1]>>>24),A};ds.prototype.next=function(){let A=(this.keys[2]|2)>>>0;return OrA(A,A^1)>>8&255};function h10(A){let Q=new ds(A);return function(B){let $=Buffer.alloc(B.length),J=0;for(let Y of B)$[J++]=Q.updateKeys(Y^Q.next());return $}}function u10(A){let Q=new ds(A);return function(B,$,J=0){if(!$)$=Buffer.alloc(B.length);for(let Y of B){let X=Q.next();$[J++]=Y^X,Q.updateKeys(Y)}return $}}function m10(A,Q,B){if(!A||!Buffer.isBuffer(A)||A.length<12)return Buffer.alloc(0);let $=h10(B),J=$(A.slice(0,12)),Y=(Q.flags&8)===8?Q.timeHighByte:Q.crc>>>24;if(J[11]!==Y)throw g10.WRONG_PASSWORD();return $(A.slice(12))}function c10(A){if(Buffer.isBuffer(A)&&A.length>=12)cs.genSalt=function(){return A.slice(0,12)};else if(A==="node")cs.genSalt=rf.node;else cs.genSalt=rf}function d10(A,Q,B,$=!1){if(A==null)A=Buffer.alloc(0);if(!Buffer.isBuffer(A))A=Buffer.from(A.toString());let J=u10(B),Y=cs.genSalt();if(Y[11]=Q.crc>>>24&255,$)Y[10]=Q.crc>>>16&255;let X=Buffer.alloc(A.length+12);return J(Y,X),J(A,X,12)}LrA.exports={decrypt:m10,encrypt:d10,_salter:c10}});var VrA=BA((l10)=>{l10.Deflater=UrA();l10.Inflater=DrA();l10.ZipCrypto=NrA()});var FHA=BA((LSB,CrA)=>{var m6=$_(),r10=WHA(),MK=m6.Constants,HHA=VrA();CrA.exports=function(A,Q){var B=new r10.EntryHeader,$=Buffer.alloc(0),J=Buffer.alloc(0),Y=!1,X=null,Z=Buffer.alloc(0),G=Buffer.alloc(0),K=!0;let W=A,H=typeof W.decoder==="object"?W.decoder:m6.decoder;K=H.hasOwnProperty("efs")?H.efs:!1;function F(){if(!Q||!(Q instanceof Uint8Array))return Buffer.alloc(0);return G=B.loadLocalHeaderFromBinary(Q),Q.slice(B.realDataOffset,B.realDataOffset+B.compressedSize)}function D(L){let N=B.flags_desc||B.localHeader.flags_desc?B.crc:B.localHeader.crc;return m6.crc32(L)===N}function q(L,N,E){if(typeof N>"u"&&typeof L==="string")E=L,L=void 0;if(Y){if(L&&N)N(Buffer.alloc(0),m6.Errors.DIRECTORY_CONTENT_ERROR());return Buffer.alloc(0)}var R=F();if(R.length===0){if(L&&N)N(R);return R}if(B.encrypted){if(typeof E!=="string"&&!Buffer.isBuffer(E))throw m6.Errors.INVALID_PASS_PARAM();R=HHA.ZipCrypto.decrypt(R,B,E)}var w;switch(B.method){case m6.Constants.STORED:if(w=Buffer.alloc(R.length),R.copy(w),!D(w)){if(L&&N)N(w,m6.Errors.BAD_CRC());throw m6.Errors.BAD_CRC()}else{if(L&&N)N(w);return w}case m6.Constants.DEFLATED:var T=new HHA.Inflater(R,B.size);if(!L){if(w=T.inflate(),!D(w))throw m6.Errors.BAD_CRC(`"${H.decode($)}"`);return w}else T.inflateAsync(function(y){if(N)if(!D(y))N(y,m6.Errors.BAD_CRC());else N(y)});break;default:if(L&&N)N(Buffer.alloc(0),m6.Errors.UNKNOWN_METHOD());throw m6.Errors.UNKNOWN_METHOD()}}function I(L,N){if((!X||!X.length)&&Buffer.isBuffer(Q)){if(L&&N)N(F());return F()}if(X.length&&!Y){var E;switch(B.method){case m6.Constants.STORED:if(B.compressedSize=B.size,E=Buffer.alloc(X.length),X.copy(E),L&&N)N(E);return E;default:case m6.Constants.DEFLATED:var R=new HHA.Deflater(X);if(!L){var w=R.deflate();return B.compressedSize=w.length,w}else R.deflateAsync(function(T){E=Buffer.alloc(T.length),B.compressedSize=T.length,T.copy(E),N&&N(E)});R=null;break}}else if(L&&N)N(Buffer.alloc(0));else return Buffer.alloc(0)}function M(L,N){return m6.readBigUInt64LE(L,N)}function V(L){try{var N=0,E,R,w;while(N+4<L.length)if(E=L.readUInt16LE(N),N+=2,R=L.readUInt16LE(N),N+=2,w=L.slice(N,N+R),N+=R,MK.ID_ZIP64===E)C(w)}catch(T){throw m6.Errors.EXTRA_FIELD_PARSE_ERROR()}}function C(L){var N,E,R,w;if(L.length>=MK.EF_ZIP64_SCOMP){if(N=M(L,MK.EF_ZIP64_SUNCOMP),B.size===MK.EF_ZIP64_OR_32)B.size=N}if(L.length>=MK.EF_ZIP64_RHO){if(E=M(L,MK.EF_ZIP64_SCOMP),B.compressedSize===MK.EF_ZIP64_OR_32)B.compressedSize=E}if(L.length>=MK.EF_ZIP64_DSN){if(R=M(L,MK.EF_ZIP64_RHO),B.offset===MK.EF_ZIP64_OR_32)B.offset=R}if(L.length>=MK.EF_ZIP64_DSN+4){if(w=L.readUInt32LE(MK.EF_ZIP64_DSN),B.diskNumStart===MK.EF_ZIP64_OR_16)B.diskNumStart=w}}return{get entryName(){return H.decode($)},get rawEntryName(){return $},set entryName(L){$=m6.toBuffer(L,H.encode);var N=$[$.length-1];Y=N===47||N===92,B.fileNameLength=$.length},get efs(){if(typeof K==="function")return K(this.entryName);else return K},get extra(){return Z},set extra(L){Z=L,B.extraLength=L.length,V(L)},get comment(){return H.decode(J)},set comment(L){if(J=m6.toBuffer(L,H.encode),B.commentLength=J.length,J.length>65535)throw m6.Errors.COMMENT_TOO_LONG()},get name(){let L=H.decode($);return Y?L.replace(/[/\\]$/,"").split("/").pop():L.split("/").pop()},get isDirectory(){return Y},getCompressedData:function(){return I(!1,null)},getCompressedDataAsync:function(L){I(!0,L)},setData:function(L){if(X=m6.toBuffer(L,m6.decoder.encode),!Y&&X.length)B.size=X.length,B.method=m6.Constants.DEFLATED,B.crc=m6.crc32(L),B.changed=!0;else B.method=m6.Constants.STORED},getData:function(L){if(B.changed)return X;else return q(!1,null,L)},getDataAsync:function(L,N){if(B.changed)L(X);else q(!0,L,N)},set attr(L){B.attr=L},get attr(){return B.attr},set header(L){B.loadFromBinary(L)},get header(){return B},packCentralHeader:function(){B.flags_efs=this.efs,B.extraLength=Z.length;var L=B.centralHeaderToBinary(),N=m6.Constants.CENHDR;return $.copy(L,N),N+=$.length,Z.copy(L,N),N+=B.extraLength,J.copy(L,N),L},packLocalHeader:function(){let L=0;B.flags_efs=this.efs,B.extraLocalLength=G.length;let N=B.localHeaderToBinary(),E=Buffer.alloc(N.length+$.length+B.extraLocalLength);return N.copy(E,L),L+=N.length,$.copy(E,L),L+=$.length,G.copy(E,L),L+=G.length,E},toJSON:function(){let L=function(N){return"<"+(N&&N.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:B.toJSON(),compressedData:L(Q),data:L(X)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}});var jrA=BA((NSB,RrA)=>{var ErA=FHA(),o10=WHA(),eX=$_();RrA.exports=function(A,Q){var B=[],$=Object.create(null),J=Buffer.alloc(0),Y=new o10.MainHeader,X=!1,Z=null;let G=new Set,K=Q,{noSort:W,decoder:H}=K;if(A)q(K.readEntries);else X=!0;function F(){let M=new Set;for(let V of Object.keys($)){let C=V.split("/");if(C.pop(),!C.length)continue;for(let L=0;L<C.length;L++){let N=C.slice(0,L+1).join("/")+"/";M.add(N)}}for(let V of M)if(!(V in $)){let C=new ErA(K);C.entryName=V,C.attr=16,C.temporary=!0,B.push(C),$[C.entryName]=C,G.add(C)}}function D(){if(X=!0,$=Object.create(null),Y.diskEntries>(A.length-Y.offset)/eX.Constants.CENHDR)throw eX.Errors.DISK_ENTRY_TOO_LARGE();B=Array(Y.diskEntries);var M=Y.offset;for(var V=0;V<B.length;V++){var C=M,L=new ErA(K,A);if(L.header=A.slice(C,C+=eX.Constants.CENHDR),L.entryName=A.slice(C,C+=L.header.fileNameLength),L.header.extraLength)L.extra=A.slice(C,C+=L.header.extraLength);if(L.header.commentLength)L.comment=A.slice(C,C+L.header.commentLength);M+=L.header.centralHeaderSize,B[V]=L,$[L.entryName]=L}G.clear(),F()}function q(M){var V=A.length-eX.Constants.ENDHDR,C=Math.max(0,V-65535),L=C,N=A.length,E=-1,R=0;if(typeof K.trailingSpace==="boolean"?K.trailingSpace:!1)C=0;for(V;V>=L;V--){if(A[V]!==80)continue;if(A.readUInt32LE(V)===eX.Constants.ENDSIG){E=V,R=V,N=V+eX.Constants.ENDHDR,L=V-eX.Constants.END64HDR;continue}if(A.readUInt32LE(V)===eX.Constants.END64SIG){L=C;continue}if(A.readUInt32LE(V)===eX.Constants.ZIP64SIG){E=V,N=V+eX.readBigUInt64LE(A,V+eX.Constants.ZIP64SIZE)+eX.Constants.ZIP64LEAD;break}}if(E==-1)throw eX.Errors.INVALID_FORMAT();if(Y.loadFromBinary(A.slice(E,N)),Y.commentLength)J=A.slice(R+eX.Constants.ENDHDR);if(M)D()}function I(){if(B.length>1&&!W)B=B.map((M)=>({entry:M,key:M.entryName.toLowerCase()})).sort((M,V)=>M.key.localeCompare(V.key)).map((M)=>M.entry)}return{get entries(){if(!X)D();return B.filter((M)=>!G.has(M))},get comment(){return H.decode(J)},set comment(M){J=eX.toBuffer(M,H.encode),Y.commentLength=J.length},getEntryCount:function(){if(!X)return Y.diskEntries;return B.length},forEach:function(M){this.entries.forEach(M)},getEntry:function(M){if(!X)D();return $[M]||null},setEntry:function(M){if(!X)D();B.push(M),$[M.entryName]=M,Y.totalEntries=B.length},deleteFile:function(M,V=!0){if(!X)D();let C=$[M];this.getEntryChildren(C,V).map((N)=>N.entryName).forEach(this.deleteEntry)},deleteEntry:function(M){if(!X)D();let V=$[M],C=B.indexOf(V);if(C>=0)B.splice(C,1),delete $[M],Y.totalEntries=B.length},getEntryChildren:function(M,V=!0){if(!X)D();if(typeof M==="object")if(M.isDirectory&&V){let C=[],L=M.entryName;for(let N of B)if(N.entryName.startsWith(L))C.push(N);return C}else return[M];return[]},getChildCount:function(M){if(M&&M.isDirectory){let V=this.getEntryChildren(M);return V.includes(M)?V.length-1:V.length}return 0},compressToBuffer:function(){if(!X)D();I();let M=[],V=[],C=0,L=0;Y.size=0,Y.offset=0;let N=0;for(let w of this.entries){let T=w.getCompressedData();w.header.offset=L;let y=w.packLocalHeader(),S=y.length+T.length;L+=S,M.push(y),M.push(T);let f=w.packCentralHeader();V.push(f),Y.size+=f.length,C+=S+f.length,N++}C+=Y.mainHeaderSize,Y.offset=L,Y.totalEntries=N,L=0;let E=Buffer.alloc(C);for(let w of M)w.copy(E,L),L+=w.length;for(let w of V)w.copy(E,L),L+=w.length;let R=Y.toBinary();if(J)J.copy(R,R.length-J.length);return R.copy(E,L),A=E,X=!1,E},toAsyncBuffer:function(M,V,C,L){try{if(!X)D();I();let N=[],E=[],R=0,w=0,T=0;Y.size=0,Y.offset=0;let y=function(S){if(S.length>0){let f=S.shift(),c=f.entryName+f.extra.toString();if(C)C(c);f.getCompressedDataAsync(function(a){if(L)L(c);f.header.offset=w;let e=f.packLocalHeader(),r=e.length+a.length;w+=r,N.push(e),N.push(a);let p=f.packCentralHeader();E.push(p),Y.size+=p.length,R+=r+p.length,T++,y(S)})}else{R+=Y.mainHeaderSize,Y.offset=w,Y.totalEntries=T,w=0;let f=Buffer.alloc(R);N.forEach(function(a){a.copy(f,w),w+=a.length}),E.forEach(function(a){a.copy(f,w),w+=a.length});let c=Y.toBinary();if(J)J.copy(c,c.length-J.length);c.copy(f,w),A=f,X=!1,M(f)}};y(Array.from(this.entries))}catch(N){V(N)}}}}});var zHA=BA((VSB,_rA)=>{var CJ=$_(),VJ=OQ("path"),a10=FHA(),s10=jrA(),vV=(...A)=>CJ.findLast(A,(Q)=>typeof Q==="boolean"),wrA=(...A)=>CJ.findLast(A,(Q)=>typeof Q==="string"),t10=(...A)=>CJ.findLast(A,(Q)=>typeof Q==="function"),e10={noSort:!1,readEntries:!1,method:CJ.Constants.NONE,fs:null};_rA.exports=function(A,Q){let B=null,$=Object.assign(Object.create(null),e10);if(A&&typeof A==="object"){if(!(A instanceof Uint8Array)){if(Object.assign($,A),A=$.input?$.input:void 0,$.input)delete $.input}if(Buffer.isBuffer(A))B=A,$.method=CJ.Constants.BUFFER,A=void 0}Object.assign($,Q);let J=new CJ($),Y=(q)=>{q.filter((I)=>I.attr).sort((I,M)=>M.path.length-I.path.length).forEach((I)=>J.fs.chmodSync(I.path,I.attr))};if(typeof $.decoder!=="object"||typeof $.decoder.encode!=="function"||typeof $.decoder.decode!=="function")$.decoder=CJ.decoder;if(A&&typeof A==="string")if(J.fs.existsSync(A))$.method=CJ.Constants.FILE,$.filename=A,B=J.fs.readFileSync(A);else throw CJ.Errors.INVALID_FILENAME();let X=new s10(B,$),{canonical:Z,sanitize:G,zipnamefix:K}=CJ;function W(q){if(q&&X){var I;if(typeof q==="string")I=X.getEntry(VJ.posix.normalize(q));if(typeof q==="object"&&typeof q.entryName<"u"&&typeof q.header<"u")I=X.getEntry(q.entryName);if(I)return I}return null}function H(q){let{join:I,normalize:M,sep:V}=VJ.posix;return I(VJ.isAbsolute(q)?"/":".",M(V+q.split("\\").join(V)+V))}function F(q){if(q instanceof RegExp)return function(I){return function(M){return I.test(M)}}(q);else if(typeof q!=="function")return()=>!0;return q}let D=(q,I)=>{let M=I.slice(-1);return M=M===J.sep?J.sep:"",VJ.relative(q,I)+M};return{readFile:function(q,I){var M=W(q);return M&&M.getData(I)||null},childCount:function(q){let I=W(q);if(I)return X.getChildCount(I)},readFileAsync:function(q,I){var M=W(q);if(M)M.getDataAsync(I);else I(null,"getEntry failed for:"+q)},readAsText:function(q,I){var M=W(q);if(M){var V=M.getData();if(V&&V.length)return V.toString(I||"utf8")}return""},readAsTextAsync:function(q,I,M){var V=W(q);if(V)V.getDataAsync(function(C,L){if(L){I(C,L);return}if(C&&C.length)I(C.toString(M||"utf8"));else I("")});else I("")},deleteFile:function(q,I=!0){var M=W(q);if(M)X.deleteFile(M.entryName,I)},deleteEntry:function(q){var I=W(q);if(I)X.deleteEntry(I.entryName)},addZipComment:function(q){X.comment=q},getZipComment:function(){return X.comment||""},addZipEntryComment:function(q,I){var M=W(q);if(M)M.comment=I},getZipEntryComment:function(q){var I=W(q);if(I)return I.comment||"";return""},updateFile:function(q,I){var M=W(q);if(M)M.setData(I)},addLocalFile:function(q,I,M,V){if(J.fs.existsSync(q)){I=I?H(I):"";let C=VJ.win32.basename(VJ.win32.normalize(q));I+=M?M:C;let L=J.fs.statSync(q),N=L.isFile()?J.fs.readFileSync(q):Buffer.alloc(0);if(L.isDirectory())I+=J.sep;this.addFile(I,N,V,L)}else throw CJ.Errors.FILE_NOT_FOUND(q)},addLocalFileAsync:function(q,I){q=typeof q==="object"?q:{localPath:q};let M=VJ.resolve(q.localPath),{comment:V}=q,{zipPath:C,zipName:L}=q,N=this;J.fs.stat(M,function(E,R){if(E)return I(E,!1);C=C?H(C):"";let w=VJ.win32.basename(VJ.win32.normalize(M));if(C+=L?L:w,R.isFile())J.fs.readFile(M,function(T,y){if(T)return I(T,!1);return N.addFile(C,y,V,R),setImmediate(I,void 0,!0)});else if(R.isDirectory())return C+=J.sep,N.addFile(C,Buffer.alloc(0),V,R),setImmediate(I,void 0,!0)})},addLocalFolder:function(q,I,M){if(M=F(M),I=I?H(I):"",q=VJ.normalize(q),J.fs.existsSync(q)){let V=J.findFiles(q),C=this;if(V.length)for(let L of V){let N=VJ.join(I,D(q,L));if(M(N))C.addLocalFile(L,VJ.dirname(N))}}else throw CJ.Errors.FILE_NOT_FOUND(q)},addLocalFolderAsync:function(q,I,M,V){V=F(V),M=M?H(M):"",q=VJ.normalize(q);var C=this;J.fs.open(q,"r",function(L){if(L&&L.code==="ENOENT")I(void 0,CJ.Errors.FILE_NOT_FOUND(q));else if(L)I(void 0,L);else{var N=J.findFiles(q),E=-1,R=function(){if(E+=1,E<N.length){var w=N[E],T=D(q,w).split("\\").join("/");if(T=T.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),V(T))J.fs.stat(w,function(y,S){if(y)I(void 0,y);if(S.isFile())J.fs.readFile(w,function(f,c){if(f)I(void 0,f);else C.addFile(M+T,c,"",S),R()});else C.addFile(M+T+"/",Buffer.alloc(0),"",S),R()});else process.nextTick(()=>{R()})}else I(!0,void 0)};R()}})},addLocalFolderAsync2:function(q,I){let M=this;q=typeof q==="object"?q:{localPath:q};let V=VJ.resolve(H(q.localPath)),{zipPath:C,filter:L,namefix:N}=q;if(L instanceof RegExp)L=function(w){return function(T){return w.test(T)}}(L);else if(typeof L!=="function")L=function(){return!0};if(C=C?H(C):"",N==="latin1")N=(w)=>w.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"");if(typeof N!=="function")N=(w)=>w;let E=(w)=>VJ.join(C,N(D(V,w))),R=(w)=>VJ.win32.basename(VJ.win32.normalize(N(w)));J.fs.open(V,"r",function(w){if(w&&w.code==="ENOENT")I(void 0,CJ.Errors.FILE_NOT_FOUND(V));else if(w)I(void 0,w);else J.findFilesAsync(V,function(T,y){if(T)return I(T);if(y=y.filter((S)=>L(E(S))),!y.length)I(void 0,!1);setImmediate(y.reverse().reduce(function(S,f){return function(c,a){if(c||a===!1)return setImmediate(S,c,!1);M.addLocalFileAsync({localPath:f,zipPath:VJ.dirname(E(f)),zipName:R(f)},S)}},I))})})},addLocalFolderPromise:function(q,I){return new Promise((M,V)=>{this.addLocalFolderAsync2(Object.assign({localPath:q},I),(C,L)=>{if(C)V(C);if(L)M(this)})})},addFile:function(q,I,M,V){q=K(q);let C=W(q),L=C!=null;if(!L)C=new a10($),C.entryName=q;C.comment=M||"";let N=typeof V==="object"&&V instanceof J.fs.Stats;if(N)C.header.time=V.mtime;var E=C.isDirectory?16:0;let R=C.isDirectory?16384:32768;if(N)R|=4095&V.mode;else if(typeof V==="number")R|=4095&V;else R|=C.isDirectory?493:420;if(E=(E|R<<16)>>>0,C.attr=E,C.setData(I),!L)X.setEntry(C);return C},getEntries:function(q){return X.password=q,X?X.entries:[]},getEntry:function(q){return W(q)},getEntryCount:function(){return X.getEntryCount()},forEach:function(q){return X.forEach(q)},extractEntryTo:function(q,I,M,V,C,L){V=vV(!1,V),C=vV(!1,C),M=vV(!0,M),L=wrA(C,L);var N=W(q);if(!N)throw CJ.Errors.NO_ENTRY();var E=Z(N.entryName),R=G(I,L&&!N.isDirectory?Z(L):M?E:VJ.basename(E));if(N.isDirectory){var w=X.getEntryChildren(N);return w.forEach(function(S){if(S.isDirectory)return;var f=S.getData();if(!f)throw CJ.Errors.CANT_EXTRACT_FILE();var c=Z(M?S.entryName:S.entryName.substring(N.entryName.length)),a=G(I,c);let e=C?S.header.fileAttr:void 0;J.writeFileTo(a,f,V,e)}),!0}var T=N.getData(X.password);if(!T)throw CJ.Errors.CANT_EXTRACT_FILE();if(J.fs.existsSync(R)&&!V)throw CJ.Errors.CANT_OVERRIDE();let y=C?q.header.fileAttr:void 0;return J.writeFileTo(R,T,V,y),!0},test:function(q){if(!X)return!1;for(var I of X.entries)try{if(I.isDirectory)continue;var M=I.getData(q);if(!M)return!1}catch(V){return!1}return!0},extractAllTo:function(q,I,M,V){if(M=vV(!1,M),V=wrA(M,V),I=vV(!1,I),!X)throw CJ.Errors.NO_ZIP();let C=[];X.entries.forEach(function(L){var N=G(q,Z(L.entryName));if(L.isDirectory){if(J.makeDir(N),M)C.push({path:N,attr:L.header.fileAttr});return}var E=L.getData(V);if(!E)throw CJ.Errors.CANT_EXTRACT_FILE();let R=M?L.header.fileAttr:void 0;J.writeFileTo(N,E,I,R);try{J.fs.utimesSync(N,L.header.time,L.header.time)}catch(w){}}),Y(C)},extractAllToAsync:function(q,I,M,V){if(V=t10(I,M,V),M=vV(!1,M),I=vV(!1,I),!V)return new Promise((T,y)=>{this.extractAllToAsync(q,I,M,function(S){if(S)y(S);else T(this)})});if(!X){V(CJ.Errors.NO_ZIP());return}q=VJ.resolve(q);let C=(T)=>G(q,VJ.normalize(Z(T.entryName))),L=(T,y)=>Error(T+': "'+y+'"'),N=[],E=[];X.entries.forEach((T)=>{if(T.isDirectory)N.push(T);else E.push(T)});let R=[];for(let T of N){let y=C(T),S=M?T.header.fileAttr:void 0;try{J.makeDir(y)}catch(f){V(L("Unable to create folder",y));continue}if(S)R.push({path:y,attr:S});try{J.fs.utimesSync(y,T.header.time,T.header.time)}catch(f){}}let w=(T)=>{if(!T)try{Y(R)}catch(y){return V(L("Unable to set folder permissions",y.path||""))}V(T)};E.reverse().reduce(function(T,y){return function(S){if(S)T(S);else{let f=VJ.normalize(Z(y.entryName)),c=G(q,f);y.getDataAsync(function(a,e){if(e)T(e);else if(!a)T(CJ.Errors.CANT_EXTRACT_FILE());else{let r=M?y.header.fileAttr:void 0;J.writeFileToAsync(c,a,I,r,function(p){if(!p)return T(L("Unable to write file",c));J.fs.utimes(c,y.header.time,y.header.time,function(){T()})})}})}}},w)()},writeZip:function(q,I){if(arguments.length===1){if(typeof q==="function")I=q,q=""}if(!q&&$.filename)q=$.filename;if(!q)return;var M=X.compressToBuffer();if(M){var V=J.writeFileTo(q,M,!0);if(typeof I==="function")I(!V?Error("failed"):null,"")}},writeZipPromise:function(q,I){let{overwrite:M,perm:V}=Object.assign({overwrite:!0},I);return new Promise((C,L)=>{if(!q&&$.filename)q=$.filename;if(!q)L("ADM-ZIP: ZIP File Name Missing");this.toBufferPromise().then((N)=>{let E=(R)=>R?C(R):L("ADM-ZIP: Wasn't able to write zip file");J.writeFileToAsync(q,N,M,V,E)},L)})},toBufferPromise:function(){return new Promise((q,I)=>{X.toAsyncBuffer(q,I)})},toBuffer:function(q,I,M,V){if(typeof q==="function")return X.toAsyncBuffer(q,I,M,V),null;return X.compressToBuffer()}}}});var krA=BA((CSB,SrA)=>{var TrA={};SrA.exports=TrA;var PrA={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(PrA).forEach(function(A){var Q=PrA[A],B=TrA[A]=[];B.open="\x1B["+Q[0]+"m",B.close="\x1B["+Q[1]+"m"})});var xrA=BA((ESB,brA)=>{brA.exports=function(A,Q){Q=Q||process.argv;var B=Q.indexOf("--"),$=/^-{1,2}/.test(A)?"":"--",J=Q.indexOf($+A);return J!==-1&&(B===-1?!0:J<B)}});var frA=BA((RSB,vrA)=>{var A$0=OQ("os"),qH=xrA(),AZ=process.env,J_=void 0;if(qH("no-color")||qH("no-colors")||qH("color=false"))J_=!1;else if(qH("color")||qH("colors")||qH("color=true")||qH("color=always"))J_=!0;if("FORCE_COLOR"in AZ)J_=AZ.FORCE_COLOR.length===0||parseInt(AZ.FORCE_COLOR,10)!==0;function Q$0(A){if(A===0)return!1;return{level:A,hasBasic:!0,has256:A>=2,has16m:A>=3}}function B$0(A){if(J_===!1)return 0;if(qH("color=16m")||qH("color=full")||qH("color=truecolor"))return 3;if(qH("color=256"))return 2;if(A&&!A.isTTY&&J_!==!0)return 0;var Q=J_?1:0;if(process.platform==="win32"){var B=A$0.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(B[0])>=10&&Number(B[2])>=10586)return Number(B[2])>=14931?3:2;return 1}if("CI"in AZ){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(J){return J in AZ})||AZ.CI_NAME==="codeship")return 1;return Q}if("TEAMCITY_VERSION"in AZ)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(AZ.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in AZ){var $=parseInt((AZ.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(AZ.TERM_PROGRAM){case"iTerm.app":return $>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(AZ.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(AZ.TERM))return 1;if("COLORTERM"in AZ)return 1;if(AZ.TERM==="dumb")return Q;return Q}function UHA(A){var Q=B$0(A);return Q$0(Q)}vrA.exports={supportsColor:UHA,stdout:UHA(process.stdout),stderr:UHA(process.stderr)}});var yrA=BA((jSB,grA)=>{grA.exports=function(Q,B){var $="";Q=Q||"Run the trap, drop the bass",Q=Q.split("");var J={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return Q.forEach(function(Y){Y=Y.toLowerCase();var X=J[Y]||[" "],Z=Math.floor(Math.random()*X.length);if(typeof J[Y]<"u")$+=J[Y][Z];else $+=Y}),$}});var urA=BA((wSB,hrA)=>{hrA.exports=function(Q,B){Q=Q||" he is here ";var $={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},J=[].concat($.up,$.down,$.mid);function Y(G){var K=Math.floor(Math.random()*G);return K}function X(G){var K=!1;return J.filter(function(W){K=W===G}),K}function Z(G,K){var W="",H,F;K=K||{},K.up=typeof K.up<"u"?K.up:!0,K.mid=typeof K.mid<"u"?K.mid:!0,K.down=typeof K.down<"u"?K.down:!0,K.size=typeof K.size<"u"?K.size:"maxi",G=G.split("");for(F in G){if(X(F))continue;switch(W=W+G[F],H={up:0,down:0,mid:0},K.size){case"mini":H.up=Y(8),H.mid=Y(2),H.down=Y(8);break;case"maxi":H.up=Y(16)+3,H.mid=Y(4)+1,H.down=Y(64)+3;break;default:H.up=Y(8)+1,H.mid=Y(6)/2,H.down=Y(8)+1;break}var D=["up","mid","down"];for(var q in D){var I=D[q];for(var M=0;M<=H[I];M++)if(K[I])W=W+$[I][Y($[I].length)]}}return W}return Z(Q,B)}});var crA=BA((_SB,mrA)=>{mrA.exports=function(A){return function(Q,B,$){if(Q===" ")return Q;switch(B%3){case 0:return A.red(Q);case 1:return A.white(Q);case 2:return A.blue(Q)}}}});var lrA=BA((PSB,drA)=>{drA.exports=function(A){return function(Q,B,$){return B%2===0?Q:A.inverse(Q)}}});var irA=BA((TSB,prA)=>{prA.exports=function(A){var Q=["red","yellow","green","blue","magenta"];return function(B,$,J){if(B===" ")return B;else return A[Q[$++%Q.length]](B)}}});var rrA=BA((SSB,nrA)=>{nrA.exports=function(A){var Q=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(B,$,J){return B===" "?B:A[Q[Math.round(Math.random()*(Q.length-2))]](B)}}});var erA=BA((bSB,trA)=>{var N4={};trA.exports=N4;N4.themes={};var $$0=OQ("util"),fV=N4.styles=krA(),orA=Object.defineProperties,J$0=new RegExp(/[\r\n]+/g);N4.supportsColor=frA().supportsColor;if(typeof N4.enabled>"u")N4.enabled=N4.supportsColor()!==!1;N4.enable=function(){N4.enabled=!0};N4.disable=function(){N4.enabled=!1};N4.stripColors=N4.strip=function(A){return(""+A).replace(/\x1B\[\d+m/g,"")};var kSB=N4.stylize=function(Q,B){if(!N4.enabled)return Q+"";var $=fV[B];if(!$&&B in N4)return N4[B](Q);return $.open+Q+$.close},Y$0=/[|\\{}()[\]^$+*?.]/g,X$0=function(A){if(typeof A!=="string")throw TypeError("Expected a string");return A.replace(Y$0,"\\$&")};function arA(A){var Q=function B(){return G$0.apply(B,arguments)};return Q._styles=A,Q.__proto__=Z$0,Q}var srA=function(){var A={};return fV.grey=fV.gray,Object.keys(fV).forEach(function(Q){fV[Q].closeRe=new RegExp(X$0(fV[Q].close),"g"),A[Q]={get:function(){return arA(this._styles.concat(Q))}}}),A}(),Z$0=orA(function(){},srA);function G$0(){var A=Array.prototype.slice.call(arguments),Q=A.map(function(X){if(X!=null&&X.constructor===String)return X;else return $$0.inspect(X)}).join(" ");if(!N4.enabled||!Q)return Q;var B=Q.indexOf(`
77
77
  `)!=-1,$=this._styles,J=$.length;while(J--){var Y=fV[$[J]];if(Q=Y.open+Q.replace(Y.closeRe,Y.open)+Y.close,B)Q=Q.replace(J$0,function(X){return Y.close+X+Y.open})}return Q}N4.setTheme=function(A){if(typeof A==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var Q in A)(function(B){N4[B]=function($){if(typeof A[B]==="object"){var J=$;for(var Y in A[B])J=N4[A[B][Y]](J);return J}return N4[A[B]]($)}})(Q)};function K$0(){var A={};return Object.keys(srA).forEach(function(Q){A[Q]={get:function(){return arA([Q])}}}),A}var W$0=function(Q,B){var $=B.split("");return $=$.map(Q),$.join("")};N4.trap=yrA();N4.zalgo=urA();N4.maps={};N4.maps.america=crA()(N4);N4.maps.zebra=lrA()(N4);N4.maps.rainbow=irA()(N4);N4.maps.random=rrA()(N4);for(qHA in N4.maps)(function(A){N4[A]=function(Q){return W$0(N4.maps[A],Q)}})(qHA);var qHA;orA(N4,K$0())});var QoA=BA((xSB,AoA)=>{var H$0=erA();AoA.exports=H$0});var BoA=BA((F$0)=>{F$0.indent=function(Q){return Array(Q+1).join(" ")};F$0.getMaxIndexLength=function(A){var Q=0;return Object.getOwnPropertyNames(A).forEach(function(B){if(A[B]===void 0)return;Q=Math.max(Q,B.length)}),Q}});var $oA=BA((fSB,q$0)=>{q$0.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var YoA=BA((O$0)=>{var QF=QoA(),KM=BoA(),D$0=/[^\w\s\n\r\v\t\.,]/i;O$0.version=$oA().version;var DHA=function(A,Q){return A!==void 0||Q.renderUndefined},ls=function(A,Q,B){if(typeof A==="boolean"||typeof A==="number"||typeof A==="function"||A===null||A===void 0||A instanceof Date)return!0;if(typeof A==="string"&&A.indexOf(`
78
78
  `)===-1)return!0;if(B.inlineArrays&&!Q){if(Array.isArray(A)&&ls(A[0],!0,B))return!0}return!1},I$0=function(A,Q){if(Q.noColor)return A;if(typeof A==="string")return Q.stringColor?QF[Q.stringColor](A):A;var B=A+"";if(A===!0)return QF.green(B);if(A===!1)return QF.red(B);if(A===null||A===void 0)return QF.grey(B);if(typeof A==="number")if(A>=0)return QF[Q.positiveNumberColor](B);else return QF[Q.negativeNumberColor](B);if(typeof A==="function")return"function() {}";if(Array.isArray(A))return A.join(", ");return B},IHA=function(A,Q){if(A.multilineStringColor===null||A.noColor)return Q;else return QF[A.multilineStringColor](Q)},M$0=function(A,Q,B){var $=A.split(`
@@ -1439,7 +1439,7 @@ PS: You can ignore this check with "--ignore-checksum-check"`),Error("Cannot upl
1439
1439
  `);H=l}let S=Math.floor((H?.byteLength??0)/1024/1024),f=Math.floor(Y/1024/1024);if(H?.byteLength>Y)CB(`The bundle size is ${S} Mb, this is greater than the maximum upload length ${f} Mb, please reduce the size of your bundle`);else if(H?.byteLength>X)if(!GUB(Q)){if(Q.verbose)SA.info("[Verbose] Skipping 'App Too Large' event (zip is not sent)")}else{if(SA.warn(`WARNING !!
1440
1440
  The bundle size is ${S} Mb, this may take a while to download for users
1441
1441
  `),SA.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
1442
- `),Q.verbose)SA.info("[Verbose] Bundle size details:"),SA.info(` - Actual size: ${S} MB (${H?.byteLength} bytes)`),SA.info(` - Alert threshold: ${Math.floor(X/1024/1024)} MB`),SA.info(` - Maximum allowed: ${f} MB`),SA.info("[Verbose] Sending 'App Too Large' event to analytics...");if(await xB(B,{channel:"app-error",event:"App Too Large",org_id:$,tracking_version:2,tags:{"app-id":J,size_mb:S}},Q.verbose),Q.verbose)SA.info("[Verbose] Event sent successfully")}else if(Q.verbose)SA.info(`[Verbose] Bundle size OK: ${S} MB (under ${Math.floor(X/1024/1024)} MB alert threshold)`);if(Q.verbose)SA.info("[Verbose] Bundle preparation complete, returning bundle data");return{zipped:H,ivSessionKey:G,sessionKey:K,checksum:W,encryptionMethod:F,finalKeyData:D,keyId:q}}async function FUB(A,Q,B,$,J,Y,X,Z){let G=GJ().spinner();G.start("Uploading Bundle");let K=performance.now(),W=!1;if(X.verbose)SA.info("[Verbose] uploadBundleToCapgoCloud called:"),SA.info(` - Bundle size: ${Math.floor(Y.byteLength/1024)} KB`),SA.info(` - App ID: ${B}`),SA.info(` - Bundle version: ${$}`),SA.info(` - Chunk size: ${Math.floor(Z/1024/1024)} MB`);if(X.dryUpload){if(G.stop(`Dry run, bundle not uploaded
1442
+ `),Q.verbose)SA.info("[Verbose] Bundle size details:"),SA.info(` - Actual size: ${S} MB (${H?.byteLength} bytes)`),SA.info(` - Alert threshold: ${Math.floor(X/1024/1024)} MB`),SA.info(` - Maximum allowed: ${f} MB`),SA.info("[Verbose] Sending 'App Too Large' event to analytics...");if(await xB(B,{channel:"app-error",event:"App Too Large",org_id:$,tracking_version:2,tags:{"app-id":J,size_mb:S,recommended_size_mb:Math.floor(X/1024/1024)}},Q.verbose),Q.verbose)SA.info("[Verbose] Event sent successfully")}else if(Q.verbose)SA.info(`[Verbose] Bundle size OK: ${S} MB (under ${Math.floor(X/1024/1024)} MB alert threshold)`);if(Q.verbose)SA.info("[Verbose] Bundle preparation complete, returning bundle data");return{zipped:H,ivSessionKey:G,sessionKey:K,checksum:W,encryptionMethod:F,finalKeyData:D,keyId:q}}async function FUB(A,Q,B,$,J,Y,X,Z){let G=GJ().spinner();G.start("Uploading Bundle");let K=performance.now(),W=!1;if(X.verbose)SA.info("[Verbose] uploadBundleToCapgoCloud called:"),SA.info(` - Bundle size: ${Math.floor(Y.byteLength/1024)} KB`),SA.info(` - App ID: ${B}`),SA.info(` - Bundle version: ${$}`),SA.info(` - Chunk size: ${Math.floor(Z/1024/1024)} MB`);if(X.dryUpload){if(G.stop(`Dry run, bundle not uploaded
1443
1443
  Bundle uploaded \uD83D\uDCAA in 0 seconds`),X.verbose)SA.info("[Verbose] Dry upload mode - skipping actual upload");return}try{let D=await wY();if(X.verbose)SA.info("[Verbose] Local config retrieved for upload");if(X.multipart!==void 0&&X.multipart||X.tus!==void 0&&X.tus){if(X.multipart)SA.info("Uploading bundle with multipart is deprecated, we upload with TUS instead");else SA.info("Uploading bundle with TUS protocol");if(X.verbose)SA.info("[Verbose] Starting TUS resumable upload..."),SA.info(` - Host: ${D.hostWeb}`),SA.info(` - Chunk size: ${Math.floor(Z/1024/1024)} MB`);if(await f9Q(A,Y,J,B,$,G,D,Z),W=!0,X.verbose)SA.info("[Verbose] TUS upload completed, updating database with R2 path...");let q=`orgs/${J}/apps/${B}/${$}.zip`;try{await bQA(A,{app_id:B,name:$,r2_path:q},{apikey:A,apiHost:X.apiHost})}catch(I){if(SA.error(`Cannot finish TUS upload ${fA(I)}`),X.verbose)SA.info(`[Verbose] Bundle record update failed: ${fA(I)}`);throw Error("Cannot finish TUS upload")}if(X.verbose)SA.info(`[Verbose] Bundle record updated with R2 path: ${q}`)}else{if(X.verbose)SA.info("[Verbose] Using standard upload (non-TUS), getting presigned URL...");let q=await x9Q(A,B,$,X);if(!q){if(SA.error("Cannot get upload url"),X.verbose)SA.info("[Verbose] Failed to retrieve presigned upload URL from database");throw Error("Cannot get upload url")}let I=X.timeout||O9Q;if(X.verbose)SA.info("[Verbose] Presigned URL obtained, uploading via HTTP PUT..."),SA.info(` - Timeout: ${I}ms`),SA.info(" - Retry attempts: 0 (standard upload does not retry, use --tus for resumable retries)"),SA.info(" - Content-Type: application/zip");let M=new AbortController,V=setTimeout(()=>M.abort(),I);try{let C=await fetch(q,{method:"PUT",body:Y,headers:{"Content-Type":"application/zip"},signal:M.signal});if(!C.ok)throw Error(`HTTP error! status: ${C.status}`)}catch(C){if(M.signal.aborted||C?.name==="AbortError"){let L=Error(L9Q(I));throw L.name=MLA,L}throw C}finally{clearTimeout(V)}if(X.verbose)SA.info("[Verbose] HTTP PUT upload completed successfully")}}catch(D){let I=((performance.now()-K)/1000).toFixed(2);if(G.error(`Failed to upload bundle ( after ${I} seconds)`),X.verbose)SA.info(`[Verbose] Upload failed after ${I} seconds`),SA.info(`[Verbose] Error type: ${D instanceof Error?"Error":typeof D}`);if(D instanceof Error&&D.name===MLA)SA.error(D.message);else if(D instanceof Error&&D.message.includes("HTTP error"))try{let M=D.message.match(/status: (\d+)/),V=M?M[1]:"unknown";SA.error(`Upload failed with status ${V}: ${D.message}`)}catch{SA.error(`Upload failed: ${D.message}`)}else{if(X.verbose)SA.info(`[Verbose] Non-HTTP error: ${fA(D)}`);if(!X.tus)SA.error(`Cannot upload bundle ( try again with --tus option) ${fA(D)}`);else SA.error(`Cannot upload bundle please contact support if the issue persists ${fA(D)}`)}if(X.verbose)SA.info("[Verbose] Cleaning up failed version from database...");try{if(await rP(A,B,$,X),X.verbose)SA.info("[Verbose] Failed version cleaned up")}catch(M){SA.error(`Cleanup of the incomplete version failed (${fA(M)}); delete bundle ${$} manually before retrying.`)}throw D instanceof Error?D:Error(String(D))}let F=((performance.now()-K)/1000).toFixed(2);if(G.stop(`Bundle uploaded \uD83D\uDCAA in (${F} seconds)`),X.verbose)SA.info("[Verbose] Upload successful:"),SA.info(` - Upload time: ${F} seconds`),SA.info(` - Upload method: ${W?"TUS (resumable)":"Standard HTTP PUT"}`),SA.info(` - Bundle size: ${Math.floor(Y.byteLength/1024)} KB`),SA.info("[Verbose] Sending performance event...");if(await xB(A,{channel:"performance",event:W?"TUS upload zip performance":"Upload zip performance",org_id:J,tracking_version:2,tags:{"app-id":B,time:F}},X.verbose),X.verbose)SA.info("[Verbose] Performance event sent successfully")}function zUB(A){if(A.rollout==null&&A.rolloutPercentageBps==null)return;if(A.rolloutPercentageBps!=null)return A.rolloutPercentageBps;return Math.round((A.rollout??0)*100)}function iyQ(A){return`${Number((A/100).toFixed(2))}%`}async function syQ(A,Q,B,$){let J=await Qh(A,Q,B,{...$,includeDeleted:!0});if(!J?.id)CB("Cannot get version id, cannot set channel");return J.id}async function UUB(A,Q,B,$){return!!await Qh(A,Q,B,{...$,includeDeleted:!0})}async function qUB(A,Q,B){try{return(await SQA({apikey:A,apiHost:B?.apiHost},Q))?.name??null}catch($){return SA.warn(`Cannot fetch latest remote version ${fA($)}`),null}}async function nyQ(A,Q,B,$,J,Y){let X=B;for(let Z=0;Z<100;Z++){if(!await UUB(A,Q,X,Y)){if(X!==J)SA.info(`\uD83D\uDD22 Auto-bumped (${$}) version from ${J} to ${X}`);return X}X=W7A(X,$)}CB(`Could not find a free ${$}-bumped version after 100 attempts (started from ${J})`)}async function DUB(A,Q,B,$,J,Y){let X=B[0],G=(await tyQ(A,Q,X,Y))?.name??null;if(G)SA.info(`\uD83D\uDCE6 Auto-bump base from channel ${X}: ${G}`);else if(G=await qUB(A,Q,Y),G)SA.info(`\uD83D\uDCE6 Auto-bump base from latest remote app version: ${G}`);if(!G)return SA.info(`ℹ️ No remote versions found for auto-bump, keeping local version ${$}`),nyQ(A,Q,$,J,$,Y);let K=W7A(G,J);return nyQ(A,Q,K,J,G,Y)}async function tyQ(A,Q,B,$){let J=new URLSearchParams({app_id:Q,channel:B,page:"0"}),{data:Y,error:X}=await _0(`channel?${J.toString()}`,{apikey:A,method:"GET",body:void 0,apiHost:$?.apiHost});if(X)return SA.error(`Cannot delete linked bundle on upload ${fA(X)}`),null;let G=(Array.isArray(Y)?Y[0]:Y)?.version;if(!G?.id||!G.name)return SA.warn("No linked bundle found in the channel you are trying to upload to"),null;if(G.deleted)return SA.warn("The linked bundle is already deleted"),null;return{id:G.id,name:G.name,deleted:G.deleted??!1}}async function IUB(A,Q,B,$){if(!Q)return;let{error:J}=await _0("bundle",{apikey:A,method:"DELETE",body:{app_id:B,version:Q.name},apiHost:$?.apiHost});if(J){SA.error(`Cannot delete linked bundle on upload ${fA(J)}`);return}SA.info(`Linked bundle ${Q.name} deleted`)}async function BgA(A,Q,B,$=!0,J){let Y;try{Y=await NG({apikey:A,apiHost:J?.apiHost},Q,B)}catch(G){if($)CB(`Cannot check channel ${B}: ${fA(G)}`);return null}let X=Y.find((G)=>G.name===B);if(!X?.id)return null;let Z=X.version??null;return{id:X.id,public:X.public??!1,version:Z,rollout_version:X.rollout_version??null,rollout_enabled:X.rollout_enabled??!1,rollout_percentage_bps:X.rollout_percentage_bps??null}}async function MUB(A,Q,B,$,J=!1,Y,X=!1,Z){let G=new Map,K=Y!=null||X;for(let W of new Set($)){let H=await BgA(Q,B,W,!0,Z);if(H){if(G.set(W,H),!await zZ(A,Q,"channel.promote_bundle",{appId:B,channelId:H.id}))CB("Cannot set channel because this API key lacks channel.promote_bundle for the target channel");if(J||K){if(!await zZ(A,Q,"channel.update_settings",{appId:B,channelId:H.id}))CB(J?"Cannot enable device self-assign because this API key lacks channel.update_settings":"Cannot set rollout because this API key lacks channel.update_settings for the target channel")}if(K&&!H.version)CB(`Cannot set rollout, channel ${W} needs a stable bundle before using progressive rollout`);if(X&&H.rollout_version==null)CB(`Cannot advance rollout, channel ${W} has no rollout target to promote to stable`);if(X&&Y==null&&!((H.rollout_percentage_bps??0)>0))CB(`Cannot advance rollout, channel ${W} has no rollout percentage to reuse. Pass --rollout or --rollout-percentage-bps`);continue}if(K)CB(`Cannot set rollout, channel ${W} must already exist with a stable bundle`);if(!await zZ(A,Q,"app.create_channel",{appId:B}))CB("Cannot create target channel because this API key lacks app.create_channel");G.set(W,null)}return G}async function $gA(A){let Q=A?.context;if(Q?.json)try{return JSON.stringify(await Q.json())}catch{}return fA(A)}async function ryQ(A,Q,B,$,J,Y,X){let{error:Z}=await _0("bundle",{apikey:A,method:"PUT",body:{app_id:Q,version_id:B,channel_id:$.id},apiHost:X?.apiHost});if(Z)await I7A(Z,async()=>`Cannot set channel because this API key does not have the required RBAC permission. ${await $gA(Z)}`);let G=`${J.hostWeb}/app/${Q}/channel/${$.id}`;if($.rollout_enabled&&$.rollout_version!=null)SA.warn("This channel has an active progressive rollout. Linking this bundle as the stable version resets that rollout, so devices receive the new bundle instead of the previous rollout target.");else if($.public)SA.info("Your update is now available in your public channel \uD83C\uDF89");else SA.info(`Link device to this bundle to try it: ${G}`);if(Y)SA.info(`Bundle url: ${G}`);return!0}async function OUB(A,Q,B,$,J,Y,X,Z,G,K,W=!1,H,F){let D=K!==null&&await zZ(A,Q,"channel.promote_bundle",{appId:Z,channelId:K.id}),q=K===null&&await zZ(A,Q,"app.create_channel",{appId:Z});if(K&&!D){if(W)CB("Cannot set channel because this API key lacks channel.promote_bundle for the target channel");return SA.warn("Cannot set channel because this API key lacks channel.promote_bundle for the target channel"),!1}if(K&&D){let M=await syQ(Q,Z,$,F);if(H){if(!await zZ(A,Q,"channel.update_settings",{appId:Z,channelId:K.id}))return SA.warn("Cannot enable device self-assign because this API key lacks channel.update_settings"),ryQ(Q,Z,M,K,G,B,F)}if(!H)return ryQ(Q,Z,M,K,G,B,F);let{error:V,data:C}=await _0("channel",{apikey:Q,method:"POST",body:{app_id:Z,channel:J,version:$,allow_device_self_set:!0},apiHost:F?.apiHost});if(V)await I7A(V,()=>`Cannot set channel because this API key does not have the required RBAC permission. ${fA(V)}`);let L=Number(C?.id??K.id);if(Number.isSafeInteger(L)){let N=`${G.hostWeb}/app/${Z}/channel/${L}`;if(K.rollout_enabled&&K.rollout_version!=null)SA.warn("This channel has an active progressive rollout. Linking this bundle as the stable version resets that rollout, so devices receive the new bundle instead of the previous rollout target.");else if(C?.public??K.public)SA.info("Your update is now available in your public channel \uD83C\uDF89");else SA.info(`Link device to this bundle to try it: ${N}`);if(B)SA.info(`Bundle url: ${N}`)}return!0}if(q){let{error:M,data:V}=await _0("channel",{apikey:Q,method:"POST",body:{app_id:Z,channel:J,version:$,...H?{allow_device_self_set:!0}:{}},apiHost:F?.apiHost});if(M)await I7A(M,async()=>`Cannot create channel and set its bundle because this API key does not have the required RBAC permission. ${await $gA(M)}`);let C=V,L=Number(C?.id),N=C?.public===!0;if(!Number.isSafeInteger(L)||typeof C?.public!=="boolean"){let R=await BgA(Q,Z,J,!1,F),w=Number(R?.id);if(!Number.isSafeInteger(w)){if(!Number.isSafeInteger(L))return SA.info("Your update is now available \uD83C\uDF89"),!0}else L=w,N=R?.public===!0}let E=`${G.hostWeb}/app/${Z}/channel/${L}`;if(N)SA.info("Your update is now available in your public channel \uD83C\uDF89");else SA.info(`Link device to this bundle to try it: ${E}`);if(B)SA.info(`Bundle url: ${E}`);return!0}let I="Cannot create target channel because this API key lacks app.create_channel";if(W)CB(I);return SA.warn(I),!1}async function LUB(A,Q,B,$,J,Y,X,Z,G,K,W,H,F=!1){if(!Z)CB(`Cannot set rollout, channel ${J} must already exist with a stable bundle`);if(!Z.version)CB(`Cannot set rollout, channel ${J} needs a stable bundle before using progressive rollout`);if(F&&Z.rollout_version==null)CB(`Cannot advance rollout, channel ${J} has no rollout target to promote to stable`);let D=await syQ(Q,Y,$,H),[q,I]=await Promise.all([zZ(A,Q,"channel.promote_bundle",{appId:Y,channelId:Z.id}),zZ(A,Q,"channel.update_settings",{appId:Y,channelId:Z.id})]);if(!q)CB("Cannot set rollout because this API key lacks channel.promote_bundle for the target channel");if(!I)CB("Cannot set rollout because this API key lacks channel.update_settings for the target channel");let M=Z.rollout_version===D&&G>0,{error:V}=await _0("channel",{apikey:Q,method:"POST",body:{app_id:Y,channel:J,rolloutVersion:$,rolloutPercentageBps:G,rolloutEnabled:G>0,...F?{advanceRollout:!0}:{},...M?{rolloutPaused:!1}:{},...K!=null?{rolloutCacheTtlSeconds:K}:{},...W?{allow_device_self_set:!0}:{}},apiHost:H?.apiHost});if(V)await I7A(V,async()=>`Cannot set rollout in channel ${await $gA(V)}`);let C=`${X.hostWeb}/app/${Y}/channel/${Z.id}`;if(F)SA.info(`Promoted the previous rollout to stable on ${J} and set @${$} as the new rollout target (${iyQ(G)})`);else SA.info(`Set ${Y} channel ${J} rollout target to @${$} (${iyQ(G)})`);if(B)SA.info(`Bundle url: ${C}`);return!0}async function NUB(A,Q,B,$){let{error:J,data:Y}=await _0(`app/${encodeURIComponent(A)}`,{apikey:Q,method:"GET",body:void 0,apiHost:$?.apiHost});if(J||!Y?.default_upload_channel)throw Error(`Cannot find default upload channel: ${fA(J)}. You can set it here: ${B}/app/${A}/info`);return Y.default_upload_channel}async function CN(A,Q,B=!1,$){return _2A($,()=>VUB(A,Q,B))}async function VUB(A,Q,B){if(!B)GJ().intro(`Uploading with CLI version ${g8.version}`);let $,J=c$(),Y=oyQ(Q);if(await x$(GJ()),Q.verbose)SA.info("[Verbose] Starting upload process with options:"),SA.info(` - API key: ${Q.apikey?"provided":"from saved key"}`),SA.info(` - Path: ${Q.path||"from capacitor config"}`),SA.info(` - Channel: ${Q.channel||"from default upload channel"}`),SA.info(` - Bundle: ${Q.bundle||"auto-detected"}`),SA.info(` - External: ${Q.external||"false"}`),SA.info(` - Encryption: ${Q.keyV2||Q.keyDataV2?"v2":Q.key===!1?"disabled":"auto"}`),SA.info(` - Upload method: ${Q.tus?"TUS":Q.zip?"ZIP":"auto"}`),SA.info(` - Delta updates: ${Q.delta||Q.partial?"enabled":"disabled"}`);let X=ezB(Q);if(Q.verbose)SA.info("[Verbose] API key retrieved successfully");let Z=await pyQ(Q,{appId:A});if(Q.verbose)SA.info(tz(Q.mode)?`[Verbose] Cordova project config resolved (webDir: ${Z.config.webDir})`:"[Verbose] Capacitor config loaded successfully");Q.userRequestedDelta??=!!(Q.partial||Q.delta||Q.partialOnly||Q.deltaOnly);let G=GgQ(Z?.config?.plugins?.CapacitorUpdater),K=z6({silent:B});if(G&&Q.delta===void 0){if(K){SA.info("\uD83D\uDCA1 Instant updates are enabled in your config"),SA.info(" Delta updates send only changed files instead of the full bundle");let vQ=await o1({message:"Enable delta updates for this upload? (Recommended with instant updates)",initialValue:!0});if(!MB(vQ)&&vQ){if(Q.delta=!0,Q.verbose)SA.info("[Verbose] Delta updates auto-enabled due to instant update configuration")}}else if(!B){if(Q.delta!==!1){if(Q.delta=!0,Q.verbose)SA.info("[Verbose] Delta updates auto-enabled in CI/CD mode due to instant update configuration")}}}let W=await S9Q(X);if(Q.verbose)SA.info("[Verbose] Remote file config retrieved:"),SA.info(` - Max upload length: ${Math.floor(W.maxUploadLength/1024/1024)} MB`),SA.info(` - Alert upload size: ${Math.floor(W.alertUploadSize/1024/1024)} MB`),SA.info(` - TUS upload: ${W.TUSUpload?"enabled":"disabled"}`),SA.info(` - TUS upload forced: ${W.TUSUploadForced?"yes":"no"}`),SA.info(` - Delta upload: ${W.partialUpload?"enabled":"disabled"}`),SA.info(` - Max chunk size: ${Math.floor(W.maxChunkSize/1024/1024)} MB`);let{appid:H,path:F}=await AUB(A,Q,Z.config,K);if(Q.verbose)SA.info(`[Verbose] App ID: ${H}, Build path: ${F}`);if(xj(Q.autoBump)&&Q.bundle)CB("Cannot use --bundle (-b) and --auto-bump together. Omit --bundle to auto-increment from the latest remote version.");let D=await tzB(Z.config,Q);if(Q.verbose)SA.info(`[Verbose] Bundle version: ${D}`);let q=Q.external?"external":"r2-direct",I="none";if(await QUB(Q,F,K),Q.verbose)SA.info("[Verbose] Code check passed (notifyAppReady found and index.html present)");let M=await wY();if(Q.verbose)SA.info(`[Verbose] Local config loaded: host=${M.hostWeb}`);let V=await vB(X,Q.apiHost,!1,void 0,Q.filesHost);if(Q.verbose)SA.info("[Verbose] Capgo API client created successfully");let C=await EH(V,{appId:H,permission:"app.upload_bundle",plan:"upload",cliVersion:g8.version},{silent:B,permissionDeniedMessage:`Insufficient permissions for app ${H}. Required RBAC permission for this action: app.upload_bundle.`});if(Q.verbose)SA.info("[Verbose] Preflight passed: app exists, app.upload_bundle granted, storage plan valid");let L=C?.userId??await P6(V,X);if(Q.verbose)SA.info(`[Verbose] User verified successfully, user_id: ${L}`);let N=ofA(Q.channel);if(Q.channel!==void 0&&N.length===0)CB("Missing channel name, pass one channel or a comma-separated list with --channel");let E=N.length>0?null:await NUB(H,X,M.hostWeb,Q),R=N.length>0?N:ofA(E||"production");if(R.length===0)CB("Cannot resolve target channel");let w=mx(R),T=R,y=zUB(Q);if(Q.verbose)SA.info(`[Verbose] Target channel${R.length>1?"s":""}: ${w}`);let S=C?.orgId??await v9(X,H,{apiHost:Q.apiHost});if(Q.verbose)SA.info(`[Verbose] Organization ID: ${S}`);let f=xj(Q.autoBump);if(f){let vQ;if(f==="ai"){let J0=await FgQ({client:V,appid:H,channels:R,path:F,apikey:X,options:{apiHost:Q.apiHost}});SA.info(`\uD83E\uDD16 AI auto-bump chose ${J0.level}: ${J0.reason}`),vQ=J0.level}else vQ=f;if(Q.verbose)SA.info(`[Verbose] Resolving auto-bump (${vQ}) version from channel/app remote versions...`);if(D=await DUB(X,H,R,D,vQ,Q),Q.verbose)SA.info(`[Verbose] Bundle version after auto-bump: ${D}`)}if(Q.autoSetBundle){if(tz(Q.mode))SA.warn("--auto-set-bundle is not supported in Cordova mode (no capacitor.config to update)");else if(await nM({version:D}),Q.verbose)SA.info(`[Verbose] Auto-set bundle version in ${Z.path}`)}if(SA.info(`Upload ${H}@${D} started from path "${F}" to Capgo cloud`),Q.verbose)SA.info(`[Verbose] Checking if version ${D} already exists...`);let c=await $UB(X,H,D,Q.versionExistsOk,K,Q);if(Q.verbose)SA.info(`[Verbose] Version exists check: ${c?typeof c==="string"?`retry with ${c}`:"yes (skipping)":"no (continuing)"}`);if(c===!0)return{success:!0,appId:H,skipped:!0,reason:"VERSION_EXISTS",bundle:D,checksum:null,encryptionMethod:I,storageProvider:q};if(typeof c==="string")return SA.info(`Retrying upload with new version: ${c}`),CN(A,{...Q,bundle:c,autoBump:void 0},B);if(Q.external&&!Q.external.startsWith("https://"))CB(`External link should should start with "https://" current is "${Q.external}"`);let a=null,e="",r;if(!Q.external){if(Q.verbose)SA.info(`[Verbose] Preparing bundle file from path: ${F}`);let vQ=Z.config?.plugins?.CapacitorUpdater?.publicKey;if(r=await HUB(F,Q,X,S,H,W.maxUploadLength,W.alertUploadSize,vQ),$=r.sessionKey,a=r.zipped,I=r.encryptionMethod,e=r.finalKeyData,Q.verbose)SA.info("[Verbose] Bundle prepared:"),SA.info(` - Size: ${Math.floor((r.zipped?.byteLength??0)/1024)} KB`),SA.info(` - Checksum: ${r.checksum}`),SA.info(` - Encryption: ${r.encryptionMethod}`),SA.info(` - IV Session Key: ${r.ivSessionKey?"present":"none"}`),SA.info(` - Key ID: ${r.keyId||"none"}`);if(!Q.ignoreChecksumCheck&&y==null&&!Q.rolloutAdvance){if(Q.verbose)SA.info("[Verbose] Checking for duplicate checksum...");if(T=await YUB(X,H,R,r.checksum,Q),Q.verbose)SA.info("[Verbose] Checksum is unique or already satisfied across target channels")}}let p=mx(T);if(Q.verbose)SA.info(`[Verbose] Checking compatibility with channel${T.length>1?"s":""} ${p}...`);let l=[];for(let vQ of T){let J0=await BUB(X,J,Q,vQ,H,D,S);l.push({channel:vQ,...J0})}let x=l.find((vQ)=>vQ.nativePackages)?.nativePackages,i=JUB(l),v=l.filter((vQ)=>vQ.compatibility.result==="incompatible"),h=v.length>0,QA=v.reduce((vQ,J0)=>Math.max(vQ,J0.incompatibleCount),0),d=mx(v.map((vQ)=>vQ.channel)),t=()=>{let vQ=d||p;L0({channel:"bundle",event:"Bundle Upload Blocked",apikey:Q.apikey,appId:H,orgId:S,tags:{reason:"incompatible",channel:vQ,channel_name:vQ,channel_names:vQ,channel_count:v.length||T.length,incompatible_count:QA,interactive:K}});let IB=`Upload aborted: bundle is incompatible with ${v.length===1?"channel":"channels"} "${vQ}" (${QA} native package(s) changed). A native build / app-store update is required. Run a native build with Capgo Builder (https://capgo.app/docs/cli/cloud-build/), or remove --fail-on-incompatible to upload anyway.`;throw SA.error(IB),new QgA(IB)};if(h&&!B&&!Q.acceptIncompatible){if(Q.failOnIncompatible&&!K)t();let vQ=await e$(H)!==null,J0=await qgQ({incompatible:h,interactive:K,hasCredentials:vQ,appId:H,orgId:S,apikey:X,incompatibleCount:QA});if(J0==="abort")efA();if(J0!=="continue")return{success:!0,appId:H,skipped:!0,reason:"NATIVE_BUILD",builderAction:J0,bundle:D,checksum:null,encryptionMethod:I,storageProvider:q};if(zgQ({incompatible:h,failOnIncompatible:!!Q.failOnIncompatible,interactive:K,builderAction:J0}))t()}else if(h&&Q.acceptIncompatible&&!B)SA.warn("Proceeding because --accept-incompatible was set. The incompatible-bundle crash warning will not be emailed.");if(Q.verbose)SA.info("[Verbose] Compatibility check completed:"),SA.info(` - Native packages: ${x?x.length:0}`),SA.info(` - Min update version: ${i||"none"}`);if(Q.deleteLinkedBundleOnUpload)SA.warn(`Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the target channel${T.length>1?"s":""}: ${p}.`),SA.warn("Please make sure you want to do this, if you are not sure, please do not use this option.");let $A=T.length>0,FA=$A?await MUB(V,X,H,T,!!Q.selfAssign,y,!!Q.rolloutAdvance,Q):new Map,JA={name:D,app_id:H,session_key:Q.external?Q.ivSessionKey:r?.ivSessionKey,external_url:Q.external,storage_provider:q,min_update_version:i,native_packages:x,owner_org:S,user_id:L,checksum:Q.external?Q.encryptedChecksum:r?.checksum,link:Q.link||null,comment:Q.comment||null,key_id:r?.keyId||void 0,cli_version:g8.version};if(Q.external){if(Q.verbose)SA.info(`[Verbose] Using external URL: ${Q.external}`);if(await xB(X,{channel:"app",event:"App external",org_id:S,tracking_version:2,tags:{"app-id":H}},Q.verbose),Q.verbose)SA.info("[Verbose] External bundle configured:"),SA.info(` - URL: ${Q.external}`),SA.info(` - IV Session Key: ${Q.ivSessionKey?"provided":"none"}`),SA.info(` - Encrypted Checksum: ${Q.encryptedChecksum?"provided":"none"}`)}if(Q.zip){if(Q.tus=!1,Q.verbose)SA.info("[Verbose] Upload method: ZIP (explicitly set via --zip)")}else if(!W.TUSUpload||Q.external){if(Q.tus=!1,Q.verbose)SA.info("[Verbose] Upload method: Standard (TUS not available or external URL)")}else if(Q.tus=Q.tus||W.TUSUploadForced,Q.verbose)SA.info(`[Verbose] Upload method: ${Q.tus?"TUS (resumable)":"Standard"}`);if(!W.partialUpload||Q.external){if(Q.delta=!1,Q.verbose&&Q.external)SA.info("[Verbose] Delta updates disabled (not available with external URLs)")}else if(Q.delta=Q.delta||Q.partial||Q.deltaOnly||Q.partialOnly||W.partialUploadForced,Q.verbose)SA.info(`[Verbose] Delta updates: ${Q.delta?"enabled":"disabled"}`);if(Q.encryptDelta=Q.encryptDelta||Q.encryptPartial,Q.encryptDelta&&I!=="v2")CB("You cannot encrypt the delta update if you are not using the v2 encryption method");let NA="5.30.0",ZA="6.30.0",DA="7.30.0",VA=!1;if(Q.delta&&I==="v2"&&!Q.encryptDelta){let vQ=R1(sfA()),J0=await HZ("@capgo/capacitor-updater",vQ,Q.packageJson),IB;try{IB=J0?W1(J0):void 0}catch{IB=void 0}if(J0&&IB&&GHA(IB,W1("6.14.4"))){if(SA.info(`Auto-enabling delta update encryption for updater version ${IB} (>= 6.14.4)`),Q.verbose)SA.info("[Verbose] Delta encryption auto-enabled for updater >= 6.14.4");Q.encryptDelta=!0}}if(Q.delta&&(Q.encryptDelta||I==="v2")){let vQ=R1(sfA()),J0=await HZ("@capgo/capacitor-updater",vQ,Q.packageJson),IB;try{IB=J0?W1(J0):void 0}catch{IB=void 0}if(J0&&IB){if(VA=!hW(IB,NA,ZA,DA),Q.verbose&&VA)SA.info(`[Verbose] Using hex checksum format for updater version ${IB}`)}}if(Q.verbose&&Q.delta)SA.info("[Verbose] Preparing delta update manifest...");let GA=Q.delta?await hyQ(F,X,S,H,Q.encryptDelta?I:"none",e,VA):[],LA=JA.session_key&&Q.encryptDelta&&$?{sessionKey:$,ivSessionKey:JA.session_key}:void 0,PA=!!(Q.delta&&!Q.dryUpload&&!Y),dA=NgQ(!!Q.userRequestedDelta,AgA(Q));if(PA&&GA.length===0){if(Q.userRequestedDelta)CB("Cannot request a manifest upload for an empty manifest");SA.warn("Delta upload was auto-enabled, but the generated manifest is empty; continuing with ZIP-only upload"),Q.delta=!1}let SQ;if(PA&&Q.delta)try{SQ=await cyQ(GA,F,LA,Q)}catch(vQ){if(!dA||!(vQ instanceof ux))throw vQ;SA.warn(`${vQ.message} Continuing with ZIP-only upload.`),Q.delta=!1}if(Q.verbose&&Q.delta)SA.info(`[Verbose] Delta manifest prepared with ${GA.length} files`);if(Q.delta&&GA.length>Yh)CB(mQA(GA.length));if(Q.verbose)SA.info("[Verbose] Creating version record in database...");let w0=await afA(X,JA,"add",Q);if(Q.verbose)SA.info("[Verbose] Version record created successfully");let Q0;if(SQ){let vQ=LgQ(!!LA,VA);try{Q0=await EgQ(X,{protocol_version:OgQ,version_id:w0,delta_encryption:{enabled:!!LA},manifest_upload_auto_enabled:dA,file_hash_format:vQ,entries:SQ},Q)}catch(J0){if(dA)SA.warn(`Cannot authorize manifest upload; continuing with ZIP-only upload. ${fA(J0)}`),Q.delta=!1;else{try{await rP(X,H,D,Q)}catch(IB){CB(`Cannot authorize manifest upload ${fA(J0)}. Cleanup of the incomplete version also failed (${fA(IB)}); delete bundle ${D} manually before retrying.`)}CB(`Cannot authorize manifest upload ${fA(J0)}`)}}}if(Q.dryUpload){if(Q.verbose)SA.info("[Verbose] Dry upload mode: skipping bundle publishing and channel assignment");if(!B)GJ().outro("Dry upload saved bundle metadata without uploading files or updating channels");return{success:!0,appId:H,bundle:D,checksum:JA.checksum??null,encryptionMethod:I,sessionKey:$?$.toString("base64"):void 0,ivSessionKey:typeof JA.session_key==="string"?JA.session_key:void 0,storageProvider:JA.storage_provider,reason:"DRY_UPLOAD"}}if(Q.tusChunkSize&&Q.tusChunkSize>W.maxChunkSize)SA.error(`Chunk size ${Q.tusChunkSize} is greater than the maximum chunk size ${W.maxChunkSize}, using the maximum chunk size`),Q.tusChunkSize=W.maxChunkSize;else if(!Q.tusChunkSize)Q.tusChunkSize=W.maxChunkSize;if(Q.verbose)SA.info(`[Verbose] TUS chunk size: ${Math.floor(Q.tusChunkSize/1024/1024)} MB`);if(a&&Y){let{s3Region:vQ,s3Apikey:J0,s3Apisecret:IB,s3BucketName:K1,s3Endpoint:K4,s3Port:n0,s3SSL:A0}=Y;if(SA.info("Uploading to S3"),Q.verbose)SA.info("[Verbose] S3 configuration:"),SA.info(` - Endpoint: ${K4}`),SA.info(` - Region: ${vQ}`),SA.info(` - Bucket: ${K1}`),SA.info(` - Port: ${n0}`),SA.info(` - SSL: ${A0?"enabled":"disabled"}`);let x0=`${A0?"https":"http"}://${K4}${n0?`:${n0}`:""}`,h0=new sYA({endPoint:K4,region:vQ,port:n0,pathStyle:!0,bucket:K1,accessKey:J0,secretKey:IB}),iB=`${H}-${D}`,Z1=encodeURIComponent(iB);if(Q.verbose)SA.info(`[Verbose] Uploading to S3 as: ${iB}`);try{await h0.putObject(iB,Uint8Array.from(a)),JA.external_url=`${x0}/${Z1}`,JA.storage_provider="external",await afA(X,JA,"update",Q)}catch(XA){try{await rP(X,H,D,Q)}catch(cA){CB(`Cannot upload bundle to S3 ${fA(XA)}. Cleanup of the incomplete version also failed (${fA(cA)}); delete bundle ${D} manually before retrying.`)}CB(`Cannot upload bundle to S3 ${fA(XA)}`)}if(Q.verbose)SA.info(`[Verbose] S3 upload complete, external URL: ${JA.external_url}`)}else if(a){if(AgA(Q)){if(Q.verbose)SA.info("[Verbose] Starting full bundle upload to Capgo Cloud...");await FUB(X,V,H,D,S,a,Q,Q.tusChunkSize)}else if(Q.verbose)SA.info("[Verbose] Skipping full bundle upload (delta-only mode)");let vQ=null;try{if(Q.dryUpload){if(Q.delta=!1,Q.verbose)SA.info("[Verbose] Dry upload mode: skipping delta upload")}if(Q.verbose&&Q.delta)SA.info("[Verbose] Starting delta file upload..."),SA.info(` - Manifest entries: ${GA.length}`),SA.info(` - Encryption: ${LA?"enabled":"disabled"}`);if(Q.delta){if(!Q0)CB("Cannot upload delta files without manifest upload authorization");vQ=await dyQ(X,GA,F,H,S,LA,Q,Q0)}if(Q.verbose&&vQ)SA.info(`[Verbose] Delta upload complete with ${vQ.length} files`)}catch(J0){if(J0 instanceof BI)if(xyQ(J0,dA)==="manifest")SA.warn(J0.message),vQ=null;else{let K1=J0.scope==="all"?J0:new BI("all",J0.backendMessage,J0.requestId);try{await rP(X,H,D,Q)}catch(K4){SA.error(`Cleanup of the incomplete version failed (${fA(K4)}); delete bundle ${D} manually before retrying.`)}throw K1}else if(Q.userRequestedDelta)throw J0;else if(SA.info(`Failed to upload delta files to capgo cloud. Error: ${fA(J0)}. This is not a critical error, the bundle has been uploaded without the delta files`),Q.verbose)SA.info(`[Verbose] Delta upload error details: ${fA(J0)}`)}if(vQ?.length){if(Q.verbose)SA.info(`[Verbose] Writing ${vQ.length} manifest rows via set_manifest...`);try{await g9Q(X,H,D,vQ,Q)}catch(J0){try{await rP(X,H,D,Q)}catch(IB){CB(`Cannot set bundle manifest ${fA(J0)}. Cleanup of the incomplete version also failed (${fA(IB)}); delete bundle ${D} manually before retrying.`)}CB(`Cannot set bundle manifest ${fA(J0)}`)}if(Q.verbose)SA.info("[Verbose] Manifest rows written (sizes filled by backend from R2)")}if(JA.storage_provider="r2",JA.manifest=null,Q.verbose)SA.info("[Verbose] Updating version record with storage provider...");if(await DgQ({apikey:X,appId:H,bundle:D,apiHost:Q.apiHost,reporter:GJ()},async()=>{await afA(X,JA,"update",Q)}),Q.verbose)SA.info("[Verbose] Version record updated successfully")}let XQ=await zZ(V,X,"bundle.delete",{appId:H});if(Q.verbose)SA.info("[Verbose] Permissions:"),SA.info(" - app.upload_bundle: yes"),SA.info(` - bundle.delete: ${XQ?"yes":"no"}`),SA.info(" - channel permissions: checked per target channel");let BB=Q.deleteLinkedBundleOnUpload&&XQ,t0=BB?await Promise.all(T.map(async(vQ)=>({channel:vQ,version:await tyQ(X,H,vQ,Q)}))):[];if(Q.deleteLinkedBundleOnUpload&&!BB)SA.warn("Cannot delete linked bundle on upload because this API key lacks bundle.delete");let X1=new Set(T).size,fB=new Set;for(let vQ of T){if(Q.verbose)SA.info(`[Verbose] Setting bundle ${D} to channel ${vQ}...`);let J0=FA.has(vQ)?FA.get(vQ)??null:await BgA(X,H,vQ,!0,Q),IB=Q.rolloutAdvance||y!=null,K1=J0?.rollout_percentage_bps,K4=y??K1??0;if(Q.rolloutAdvance&&y==null&&!((K1??0)>0))CB(`Cannot advance rollout, channel ${vQ} has no rollout percentage to reuse. Pass --rollout or --rollout-percentage-bps`);let n0=IB?await LUB(V,X,!!Q.bundleUrl,D,vQ,H,M,J0,K4,Q.rolloutCacheTtlSeconds,Q.selfAssign,Q,!!Q.rolloutAdvance):await OUB(V,X,!!Q.bundleUrl,D,vQ,L,S,H,M,J0,$A,Q.selfAssign,Q);if(n0)fB.add(vQ);if(Q.verbose)SA.info(`[Verbose] Channel ${vQ} ${n0?"updated successfully":"was not updated"}`)}if(BB){let vQ=new Set;for(let J0 of t0){if(!fB.has(J0.channel))continue;if(!J0.version||vQ.has(J0.version.id))continue;if(Q.verbose)SA.info(`[Verbose] Deleting previously linked bundle in channel ${J0.channel}...`);await IUB(X,J0.version,H,Q),vQ.add(J0.version.id)}}if(fB.size===0)SA.warn("Cannot set channel because this API key lacks the required RBAC permission");if($A&&fB.size!==X1)CB("Cannot complete upload because one or more target channels were not updated");if(Q.verbose)SA.info("[Verbose] Sending upload event...");await xB(X,{channel:"app",event:"App Uploaded",org_id:S,tracking_version:2,tags:{"app-id":H,bundle:D}},Q.verbose),await xB(X,{channel:"app",event:"Bundle Uploaded",org_id:S,tracking_version:2,tags:{"app-id":H,bundle:D},notifyConsole:!0}).catch(()=>{});for(let vQ of l){if(vQ.compatibility.result!=="incompatible")continue;L0({channel:"bundle",event:"Bundle Incompatible",apikey:X,appId:H,orgId:S,tags:{source:"upload",channel:vQ.channel,channel_name:vQ.channel,channel_overwritten:fB.has(vQ.channel),version_new_name:D,...vQ.compatibility.versionOldId?{version_old_id:vQ.compatibility.versionOldId}:{},...vQ.compatibility.versionOldName?{version_old_name:vQ.compatibility.versionOldName}:{},...Q.acceptIncompatible?{incompatibility_accepted:!0}:{}}})}let pQ={success:!0,appId:H,bundle:D,updatedChannels:Array.from(fB),checksum:JA.checksum??null,encryptionMethod:I,sessionKey:$?$.toString("base64"):void 0,ivSessionKey:typeof JA.session_key==="string"?JA.session_key:void 0,storageProvider:JA.storage_provider};if(Q.verbose)SA.info("[Verbose] Upload completed successfully:"),SA.info(` - Bundle: ${pQ.bundle}`),SA.info(` - Checksum: ${pQ.checksum}`),SA.info(` - Encryption: ${pQ.encryptionMethod}`),SA.info(` - Storage: ${pQ.storageProvider}`);if(K&&!pQ.skipped){let vQ=Q.showReplicationProgress;if(vQ===void 0)vQ=await LfA({preferenceKey:"uploadShowReplicationProgress",message:"Show Capgo global replication progress for this upload so you can confirm rollout in all regions?",initialValue:!1,rememberMessage:"Remember this replication progress preference for future uploads on this machine?"});if(vQ)await K7A({title:"Replicating your bundle in all regions to guarantee fast updates.",completeMessage:"Replication complete. Your update is now globally available.",interactive:K})}if(!B&&!pQ.skipped)GJ().outro("Time to share your update to the world \uD83C\uDF0D");return pQ}function CUB(A){let Q=A.key===!1,B=A.rollout!=null||A.rolloutPercentageBps!=null||A.rolloutAdvance===!0,$=A.forceCrc32Checksum===!0,J=A.keyV2||A.keyDataV2||Zr($Y);if(A.ivSessionKey&&!A.external)CB("You need to provide an external url if you want to use the --iv-session-key option");if(A.encryptedChecksum&&!A.external)CB("You need to provide an external url if you want to use the --encrypted-checksum option");if((A.partial||A.delta||A.partialOnly||A.deltaOnly)&&A.external)CB("You cannot use delta upload options (--delta/--delta-only, or deprecated --partial/--partial-only) with an external url");if(A.tus&&A.external)CB("You cannot use the --tus option with an external url");if(A.dryUpload&&A.external)CB("You cannot use the --dry-upload option with an external url");if(A.multipart&&A.external)CB("You cannot use the --multipart option with an external url");if(A.external&&(A.keyV2||A.keyDataV2))CB("You cannot set a key if you are uploading to an external url");if(A.keyV2&&A.keyDataV2)CB("You cannot set both key-v2 and key-data-v2");if(A.external&&(A.s3Region||A.s3Apikey||A.s3Apisecret||A.s3Endpoint||A.s3BucketName||A.s3Port||A.s3SSL))CB("You cannot set S3 options if you are uploading to an external url, it's automatically handled");if(oyQ(A),A.encryptedChecksum&&!A.external)CB("You cannot set the --encrypted-checksum option if you are not uploading to an external url");if(A.minUpdateVersion&&A.autoMinUpdateVersion)CB("You cannot set both min-update-version and auto-min-update-version, use only one of them");if(A.rollout!=null&&(!Number.isFinite(A.rollout)||A.rollout<0||A.rollout>100))CB("Rollout percentage must be between 0 and 100");if(A.rolloutPercentageBps!=null&&(!Number.isInteger(A.rolloutPercentageBps)||A.rolloutPercentageBps<0||A.rolloutPercentageBps>1e4))CB("Rollout percentage basis points must be between 0 and 10000");if(A.rolloutCacheTtlSeconds!=null&&(!Number.isInteger(A.rolloutCacheTtlSeconds)||A.rolloutCacheTtlSeconds<60||A.rolloutCacheTtlSeconds>31536000))CB("Rollout cache TTL seconds must be between 60 and 31536000");if(B&&A.dryUpload)CB("You cannot use --rollout or --rollout-advance with --dry-upload because dry upload does not update channels");if(B&&A.deleteLinkedBundleOnUpload)CB("You cannot use --rollout or --rollout-advance with --delete-linked-bundle-on-upload because rollout needs the stable channel bundle as fallback");if($&&J&&!Q)CB("You cannot use --force-crc32-checksum when encryption is enabled. Remove the flag or disable encryption.");if(A.failOnIncompatible&&A.ignoreMetadataCheck)CB("You cannot use --fail-on-incompatible together with --ignore-metadata-check — the metadata check is exactly what --fail-on-incompatible enforces. Remove one of them.");if(A.acceptIncompatible&&A.failOnIncompatible)CB("You cannot use --accept-incompatible together with --fail-on-incompatible — one continues despite a mismatch, the other refuses it. Remove one of them.");if(A.acceptIncompatible&&A.ignoreMetadataCheck)CB("You cannot use --accept-incompatible together with --ignore-metadata-check — accepting a mismatch requires running the compatibility check. Remove one of them.")}async function EUB(){if(!z6())return;let A=bx();if(kx(A.repository)||!A.ghInstalled||!A.ghLoggedIn||!A.repositoryExists||A.starred)return;if(!await LfA({preferenceKey:"uploadStarCapgoRepo",message:`Would you like to star ${A.repository} on GitHub to support Capgo?`,rememberMessage:"Remember this GitHub support preference for future uploads on this machine?"}))return;try{let B=QI(A.repository);if(B.alreadyStarred)SA.info(`\uD83E\uDEF6 ${B.repository} is already starred`);else SA.success(`\uD83D\uDE4F Thanks for starring ${B.repository} \uD83C\uDF89`)}catch(B){SA.warn(`Cannot star ${A.repository} right now: ${fA(B)}`)}}async function M7A(A,Q){return _2A(ut,()=>RUB(A,Q))}async function RUB(A,Q){try{CUB(Q);let B=await CN(A,Q);if(!B.skipped)await EUB();return B}catch(B){if(B instanceof BI)throw SA.error(B.message),B;let $=B instanceof Error?B.message:String(B),J=Xh(B);if($===tfA)throw B instanceof Error?B:Error(String(B));if(Q.verbose)SA.error(`uploadBundle failed:${J}`);else SA.error(`uploadBundle failed: ${$}`);if(B instanceof QgA)throw B;let Y=$.includes("Cannot upload the same bundle content"),X=z6();if(!Q.versionExistsOk&&X)try{if(Y){let Z=await w8({message:"Would you like to retry the upload?",options:[{value:"ignore",label:"Retry with --ignore-checksum-check (force upload same content)"},{value:"cancel",label:"Cancel upload"}]});if(MB(Z)||Z==="cancel")throw B instanceof Error?B:Error(String(B));if(Z==="ignore")return SA.info("\uD83D\uDD04 Retrying upload with --ignore-checksum-check..."),M7A(A,{...Q,ignoreChecksumCheck:!0})}else{let Z=await o1({message:"Would you like to retry the upload?"});if(MB(Z))throw B instanceof Error?B:Error(String(B));if(Z)return SA.info("\uD83D\uDD04 Retrying upload..."),M7A(A,Q)}}catch{throw B instanceof Error?B:Error(String(B))}throw B instanceof Error?B:Error(String(B))}}function eyQ(A,Q){return{apikey:A.apikey,bundle:Q,apiHost:A.apiHost}}async function AhQ(A,Q){let B=await M7A(A,Q),$=B?.appId||A;if(Q.qrPreview&&B?.bundle&&B.reason!=="DRY_UPLOAD"&&!B.builderAction)await nYA($,void 0,eyQ(Q,B.bundle));if(Q.sendUpdateNotification&&B?.success&&!B.skipped&&B.updatedChannels?.length&&!B.builderAction)try{await pYA({appId:$,apikey:Q.apikey,channels:B.updatedChannels,verbose:Q.verbose})}catch{}if(!B?.builderAction)return;if(B.builderAction==="launch-onboarding")await Cj({apikey:Q.apikey});else await oJA($,{apikey:Q.apikey,apiHost:Q.apiHost})}e0();PW();P$();EJ();dg();W0();import{randomUUID as yUB}from"node:crypto";import{existsSync as KhQ,writeFileSync as hUB}from"node:fs";import{cwd as uUB}from"node:process";import{existsSync as QhQ,readFileSync as JgA}from"node:fs";import{createRequire as jUB}from"node:module";import{dirname as YgA,join as wUB}from"node:path";import _UB from"node:process";var tG="@capgo/capacitor-updater",AU="@capacitor/splash-screen";function PUB(A){if(!QhQ(A))return null;try{return JSON.parse(JgA(A,"utf-8"))}catch{return null}}function TUB(A,Q){let B=PUB(A);if(!B)return{version:null,section:null};let $=["dependencies","devDependencies","optionalDependencies"];for(let J of $){let Y=B[J];if(!Y||!Object.hasOwn(Y,Q))continue;let X=Y[Q];return{version:typeof X==="string"?X:String(X),section:J}}return{version:null,section:null}}function SUB(A,Q){let $=YgA(A);while(!0){let J=wUB($,"node_modules",Q,"package.json");if(QhQ(J))try{let X=JSON.parse(JgA(J,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}let Y=YgA($);if(Y===$)break;$=Y}if(!_UB.versions.pnp)return null;try{let Y=jUB(A).resolve(`${Q}/package.json`),X=JSON.parse(JgA(Y,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}return null}function BhQ(A,Q){let B=YgA(A),$=TUB(A,Q),J=SUB(A,Q),Y=[];if(!$.version)Y.push(`Missing ${Q} in ${A}`);if(!J)Y.push(`Cannot resolve ${Q} from ${B}/node_modules`);return{packageJsonPath:A,projectDir:B,declaredVersion:$.version,declaredIn:$.section,installedVersion:J,ready:Y.length===0,details:Y}}function YW(A){return BhQ(A,tG)}function XgA(A){return BhQ(A,AU)}e0();import{spawnSync as kUB}from"node:child_process";import{existsSync as JhQ,statSync as bUB}from"node:fs";import{dirname as xUB,join as vUB,resolve as YhQ}from"node:path";import{cwd as $hQ}from"node:process";W0();function ZgA(A){return`0.0.1-beta.local-${A}`}function GgA(A){let Q=R1($hQ()),B=Tx(A);if(B?.length)for(let $ of B)for(let J of[$hQ(),Q]){let Y=YhQ(J,$);if(JhQ(Y))return Y}return vUB(Q,"package.json")}function fUB(A){return A?.trim()||"latest"}function gUB(A,Q,B){let $=`${tG}@${Q}`,J=A.installCommand.split(/\s+/).filter(Boolean),Y=J[0];if(!Y)return null;if(!B?.trim())switch(A.pm){case"yarn":return{command:"yarn",args:["add",$]};case"bun":return{command:"bun",args:["add",$]};case"pnpm":return{command:"pnpm",args:["add",$]};default:return{command:Y,args:[...J.slice(1),$]}}if(A.pm==="yarn"||A.pm==="bun")return{command:Y,args:J.slice(1)};return{command:Y,args:[...J.slice(1),"--force",$]}}async function XhQ(A,Q){g.warn(`Bundle version "${A}" is not valid semver (https://semver.org/).`);let B=await o1({message:`Use local fallback version ${Q} instead?`,initialValue:!0});if(MB(B)||!B)return null;return g.info(`Using bundle version ${Q}`),Q}async function ZhQ(A){let Q=await sX({message:A,validate:(B)=>{let $=B?.trim();if(!$)return"Value is required";let J=YhQ($);if(!JhQ(J))return`Path does not exist: ${J}`;if(!bUB(J).isDirectory())return`Path is not a directory: ${J}`}});if(MB(Q))return null;return Q.trim()}async function GhQ(A){let Q=GgA(A),B=YW(Q);if(B.ready)return!0;g.warn(`Cannot find ${tG} in node_modules.`);let $=await o1({message:`Install ${tG} now?`,initialValue:!0});if(MB($)||!$)return!1;let J=c$(),Y=fUB(B.declaredVersion),X=gUB(J,Y,B.declaredVersion);if(!X)return!1;if(kUB(X.command,X.args,{cwd:xUB(Q),stdio:"inherit",shell:!1}).status!==0)return!1;return YW(Q).ready}L1();var mUB=20;function cUB(A){console.log(JSON.stringify(A,null,2))}function cx(A){console.error(fA(A))}function dUB(A){if(A.context?.message)cx({error:A.message,message:A.context.message});else cx({error:A.message})}async function KgA(A,Q,B=!1){let{json:$}=Q,{bundle:J,path:Y}=Q,X=!$&&!B;try{if(X)await x$();let Z=await c0(),G=z6({silent:$||B}),K=await tYA({explicitAppId:A,config:Z?.config,packageJsonPaths:Tx(Q.packageJson),interactive:G,json:$}),W=yUB().split("-")[0],H=CG("",Q.packageJson);if(J=J||H||ZgA(W),X)u0(`Zipping ${K??"app"}@${J}`);if(J&&!mC.test(J)){if(G){let y=await XhQ(J,ZgA(W));if(y)J=y}if(!mC.test(J)){let y=`Your bundle name ${J}, is not valid it should follow semver convention : https://semver.org/`;if(!B)if($)cx({error:"invalid_semver"});else g.error(y);throw Error("Invalid bundle version format")}}if(Y=Y||Z?.config?.webDir,!Y&&G){let y=await ZhQ("Enter the path to your built web assets (webDir):");if(y)Y=y}if(!K||!J||!Y){if(!B)if($)cx({error:"missing_argument"});else g.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project");throw Error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project")}if(!KhQ(Y)){let y=`Path ${Y} does not exist, build your app first, or provide a valid path`;throw $?new mA("path_not_found",{message:y}):new mA(y)}if(X)g.info(`Started from path "${Y}"`);if(Q.codeCheck!==!1&&!Q.ignoreNotifyAppReady){if(!d3(Y,"notifyAppReady"))if(G){if(await G7A({webDir:Y,interactive:G,json:$})!=="skipped"&&!d3(Y,"notifyAppReady"))throw new mA("notifyAppReady() is missing in build folder")}else throw $?new mA("notifyAppReady_not_in_source_code",{message:Z7A(Y)}):new mA(Z7A(Y));if(!vx(Y)){if(!B)if($)cx({error:"index_html_not_found"});else g.error(`index.html is missing in the root folder of ${Y}`);throw Error("index.html is missing in root folder")}}let D=await aQA(Y);if(X)g.info(`Zipped ${D.byteLength} bytes`);let q=X?D8():null;if(q)q.start("Calculating checksum");let I=R1(uUB()),M=GgA(Q.packageJson),V=YW(M);if(!V.ready&&G&&await GhQ(Q.packageJson))V=YW(M);if(!V.ready){if(!B)g.warn("Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager");throw Error("Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager")}let C=await HZ("@capgo/capacitor-updater",I,Q.packageJson),L=!1,N;try{N=C?W1(C):void 0}catch{N=void 0}if(N)L=!hW(N,void 0,void 0,"7.0.0");else if(C==="link:@capgo/capacitor-updater"){if(!B)g.warn("Using local @capgo/capacitor-updater. Assuming v7");L=!0}let E=await RM(D,Q.keyV2||KhQ($Y)||L?"sha256":"crc32");if(q)q.stop(`Checksum ${L?"SHA256":"CRC32"}: ${E}`);let R=Math.floor(D.byteLength/1024/1024);if(R>mUB&&X)g.warn(`WARNING !!
1444
1444
  The bundle size is ${R} Mb, this may take a while to download for users
1445
1445
  `),g.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/