@capgo/cli 8.87.2 → 8.88.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/src/sdk.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createRequire as XP0}from"node:module";var module={exports:{}};var aC0=Object.create;var{getPrototypeOf:sC0,defineProperty:D3,getOwnPropertyNames:Fm}=Object;var GR=Object.prototype.hasOwnProperty;function WR($){return this[$]}var M0=($,D,Q)=>{var X=Fm(D);for(let J of X)if(!GR.call($,J)&&J!=="default")D3($,J,{get:WR.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!GR.call(Q,J)&&J!=="default")D3(Q,J,{get:WR.bind(D,J),enumerable:!0});return Q}},eC0,$P0,f$=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?eC0??=new WeakMap:$P0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?aC0(sC0($)):{};let Z=D||!$||!$.__esModule?D3(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Fm($))if(!GR.call(Z,F))D3(Z,F,{get:WR.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var j=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var DP0=($)=>$;function QP0($,D){this[$]=DP0.bind(null,D)}var ND=($,D)=>{for(var Q in D)D3($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:QP0.bind(D,Q)})};var o=($,D)=>()=>($&&(D=$($=0)),D);var X0=XP0(import.meta.url);var J6;var A8=o(()=>{J6={name:"@capgo/cli",type:"module",version:"8.87.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",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test: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: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:supabase-perf":"bun test/test-supabase-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-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-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.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-supabase-client":"bun test/test-create-supabase-client.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-error-gate.mjs && 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","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","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:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.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-flow-contract":"bun test/test-ios-flow-contract.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:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && 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-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-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && 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:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && 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:frame-fit-ios-shared && 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-flow-contract && 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:trial-warning && bun run test:plan-validation","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-analyze-stream":"bun test/test-ai-analyze-stream.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-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.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 && bun test/test-app-list-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:trial-warning":"bun test/test-trial-warning.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"},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","@supabase/supabase-js":"^2.110.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-preview":"7.0.0-dev.20260707.2","@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"}}});var J0;var V$=o(()=>{J0=class J0 extends Error{context;constructor($,D,Q){super($,Q!==void 0?{cause:Q}:void 0);this.name="CliUserError",this.context=D}}});import{platform as YP0}from"node:os";import{version as ZP0}from"node:process";function WP0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Gm($){if($.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 qP0($){if($.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($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function UR($,D){if(D===void 0||D===null){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(!WP0(D)){if(qR.has($.toLowerCase()))throw new J0(qP0($));throw new J0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function t$($){let D={capgo_api:FP0,"x-cli-version":J6.version,"x-cli-command":GP0,"x-cli-node":ZP0,"x-cli-os":YP0()};if($)for(let[Q,X]of Object.entries($))D[Q]=UR(Q,X);return D}var FP0="2025-10-01",GP0="",qR;var L4=o(()=>{A8();V$();qR=new Set(["authorization","capgkey","x-capgo-log-token"])});var Wm,qm=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Um=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var Hm=o(()=>{Wm=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var UP0,HP0,Km,KP0,zm,zP0,OP0,VP0,Om=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?Om(J,VP0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,W=Q.emojiWidth??2,q=2,U=Q.regularWidth??1,H=Q.wideWidth??2,K=[[zP0,U],[UP0,0],[HP0,F],[KP0,G],[zm,W],[Km,H]],z=0,O=0,V=$.length,N=0,w=!1,M=V,L=Math.max(0,X-Y),B=0,R=0,_=0,v=0;$:while(!0){if(R>B||O>=V&&O>z){let E=$.slice(B,R)||$.slice(z,O);N=0;for(let y of E.replaceAll(OP0,"")){let x=y.codePointAt(0)||0;if(qm(x))v=2;else if(Um(x))v=H;else v=U;if(_+v>L)M=Math.min(M,Math.max(B,z)+N);if(_+v>X){w=!0;break $}N+=y.length,_+=v}B=R=0}if(O>=V)break $;for(let E=0,y=K.length;E<y;E++){let[x,d]=K[E];if(x.lastIndex=O,x.test($)){if(N=x===Km?Wm($.slice(O,x.lastIndex)):x===zm?1:x.lastIndex-O,v=N*d,_+v>L)M=Math.min(M,O+Math.floor((L-_)/d));if(_+v>X){w=!0;break $}_+=v,B=z,R=O,O=z=x.lastIndex;continue $}}O+=1}return{width:w?L:_,index:w?M:V,truncated:w,ellipsed:w&&X>=Y}},Vm;var Mm=o(()=>{Hm();UP0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,HP0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Km=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,KP0=/\t{1,1000}/y,zm=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,zP0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,OP0=/\p{M}+/gu,VP0={limit:1/0,ellipsis:""},Vm=Om});var MP0,LP0=($,D={})=>{return Vm($,MP0,D).width},$9;var HR=o(()=>{Mm();MP0={limit:1/0,ellipsis:"",ellipsisWidth:0},$9=LP0});function t5($,D,Q){return String($).normalize().split(jP0).map((X)=>RP0(X,D,Q)).join(`
1
+ import{createRequire as XP0}from"node:module";var module={exports:{}};var aC0=Object.create;var{getPrototypeOf:sC0,defineProperty:D3,getOwnPropertyNames:Fm}=Object;var GR=Object.prototype.hasOwnProperty;function WR($){return this[$]}var M0=($,D,Q)=>{var X=Fm(D);for(let J of X)if(!GR.call($,J)&&J!=="default")D3($,J,{get:WR.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!GR.call(Q,J)&&J!=="default")D3(Q,J,{get:WR.bind(D,J),enumerable:!0});return Q}},eC0,$P0,f$=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?eC0??=new WeakMap:$P0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?aC0(sC0($)):{};let Z=D||!$||!$.__esModule?D3(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Fm($))if(!GR.call(Z,F))D3(Z,F,{get:WR.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var j=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var DP0=($)=>$;function QP0($,D){this[$]=DP0.bind(null,D)}var ND=($,D)=>{for(var Q in D)D3($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:QP0.bind(D,Q)})};var o=($,D)=>()=>($&&(D=$($=0)),D);var X0=XP0(import.meta.url);var J6;var A8=o(()=>{J6={name:"@capgo/cli",type:"module",version:"8.88.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",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test: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: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:supabase-perf":"bun test/test-supabase-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-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-output-text":"bun test/test-app-list-output-text.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-supabase-client":"bun test/test-create-supabase-client.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-error-gate.mjs && 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","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","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:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.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-flow-contract":"bun test/test-ios-flow-contract.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:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && 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-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-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && 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:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && 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:frame-fit-ios-shared && 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-flow-contract && 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:trial-warning && bun run test:plan-validation","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-analyze-stream":"bun test/test-ai-analyze-stream.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-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.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 && bun test/test-app-list-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:trial-warning":"bun test/test-trial-warning.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"},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","@supabase/supabase-js":"^2.110.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-preview":"7.0.0-dev.20260707.2","@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"}}});var J0;var V$=o(()=>{J0=class J0 extends Error{context;constructor($,D,Q){super($,Q!==void 0?{cause:Q}:void 0);this.name="CliUserError",this.context=D}}});import{platform as YP0}from"node:os";import{version as ZP0}from"node:process";function WP0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Gm($){if($.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 qP0($){if($.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($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function UR($,D){if(D===void 0||D===null){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(!WP0(D)){if(qR.has($.toLowerCase()))throw new J0(qP0($));throw new J0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function t$($){let D={capgo_api:FP0,"x-cli-version":J6.version,"x-cli-command":GP0,"x-cli-node":ZP0,"x-cli-os":YP0()};if($)for(let[Q,X]of Object.entries($))D[Q]=UR(Q,X);return D}var FP0="2025-10-01",GP0="",qR;var L4=o(()=>{A8();V$();qR=new Set(["authorization","capgkey","x-capgo-log-token"])});var Wm,qm=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Um=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var Hm=o(()=>{Wm=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var UP0,HP0,Km,KP0,zm,zP0,OP0,VP0,Om=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?Om(J,VP0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,W=Q.emojiWidth??2,q=2,U=Q.regularWidth??1,H=Q.wideWidth??2,K=[[zP0,U],[UP0,0],[HP0,F],[KP0,G],[zm,W],[Km,H]],z=0,O=0,V=$.length,N=0,w=!1,M=V,L=Math.max(0,X-Y),B=0,R=0,_=0,v=0;$:while(!0){if(R>B||O>=V&&O>z){let E=$.slice(B,R)||$.slice(z,O);N=0;for(let y of E.replaceAll(OP0,"")){let x=y.codePointAt(0)||0;if(qm(x))v=2;else if(Um(x))v=H;else v=U;if(_+v>L)M=Math.min(M,Math.max(B,z)+N);if(_+v>X){w=!0;break $}N+=y.length,_+=v}B=R=0}if(O>=V)break $;for(let E=0,y=K.length;E<y;E++){let[x,d]=K[E];if(x.lastIndex=O,x.test($)){if(N=x===Km?Wm($.slice(O,x.lastIndex)):x===zm?1:x.lastIndex-O,v=N*d,_+v>L)M=Math.min(M,O+Math.floor((L-_)/d));if(_+v>X){w=!0;break $}_+=v,B=z,R=O,O=z=x.lastIndex;continue $}}O+=1}return{width:w?L:_,index:w?M:V,truncated:w,ellipsed:w&&X>=Y}},Vm;var Mm=o(()=>{Hm();UP0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,HP0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Km=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,KP0=/\t{1,1000}/y,zm=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,zP0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,OP0=/\p{M}+/gu,VP0={limit:1/0,ellipsis:""},Vm=Om});var MP0,LP0=($,D={})=>{return Vm($,MP0,D).width},$9;var HR=o(()=>{Mm();MP0={limit:1/0,ellipsis:"",ellipsisWidth:0},$9=LP0});function t5($,D,Q){return String($).normalize().split(jP0).map((X)=>RP0(X,D,Q)).join(`
2
2
  `)}var AK="\x1B",Rm="›",NP0=39,zR="\x07",jm="[",BP0="]",Em="m",OR,Lm,Nm=($)=>{if($>=30&&$<=37)return 39;if($>=90&&$<=97)return 39;if($>=40&&$<=47)return 49;if($>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0;return},Bm=($)=>`${AK}${jm}${$}${Em}`,wm=($)=>`${AK}${OR}${$}${zR}`,KR=($,D,Q)=>{let X=D[Symbol.iterator](),J=!1,Y=!1,Z=$.at(-1),F=Z===void 0?0:$9(Z),G=X.next(),W=X.next(),q=0;while(!G.done){let U=G.value,H=$9(U);if(F+H<=Q)$[$.length-1]+=U;else $.push(U),F=0;if(U===AK||U===Rm)J=!0,Y=D.startsWith(OR,q+1);if(J){if(Y){if(U===zR)J=!1,Y=!1}else if(U===Em)J=!1}else if(F+=H,F===Q&&!W.done)$.push(""),F=0;G=W,W=X.next(),q+=U.length}if(Z=$.at(-1),!F&&Z!==void 0&&Z.length&&$.length>1)$[$.length-2]+=$.pop()},wP0=($)=>{let D=$.split(" "),Q=D.length;while(Q){if($9(D[Q-1]))break;Q--}if(Q===D.length)return $;return D.slice(0,Q).join(" ")+D.slice(Q).join("")},RP0=($,D,Q={})=>{if(Q.trim!==!1&&$.trim()==="")return"";let X="",J,Y,Z=$.split(" "),F=[""],G=0;for(let U=0;U<Z.length;U++){let H=Z[U];if(Q.trim!==!1){let z=F.at(-1)??"",O=z.trimStart();if(z.length!==O.length)F[F.length-1]=O,G=$9(O)}if(U!==0){if(G>=D&&(Q.wordWrap===!1||Q.trim===!1))F.push(""),G=0;if(G||Q.trim===!1)F[F.length-1]+=" ",G++}let K=$9(H);if(Q.hard&&K>D){let z=D-G,O=1+Math.floor((K-z-1)/D);if(Math.floor((K-1)/D)<O)F.push("");KR(F,H,D),G=$9(F.at(-1)??"");continue}if(G+K>D&&G&&K){if(Q.wordWrap===!1&&G<D){KR(F,H,D),G=$9(F.at(-1)??"");continue}F.push(""),G=0}if(G+K>D&&Q.wordWrap===!1){KR(F,H,D),G=$9(F.at(-1)??"");continue}F[F.length-1]+=H,G+=K}if(Q.trim!==!1)F=F.map((U)=>wP0(U));let W=F.join(`
3
3
  `),q=!1;for(let U=0;U<W.length;U++){let H=W[U];if(X+=H,!q){if(q=H>="\uD800"&&H<="\uDBFF",q)continue}else q=!1;if(H===AK||H===Rm){Lm.lastIndex=U+1;let z=Lm.exec(W)?.groups;if(z?.code!==void 0){let O=Number.parseFloat(z.code);J=O===NP0?void 0:O}else if(z?.uri!==void 0)Y=z.uri.length===0?void 0:z.uri}if(W[U+1]===`
4
4
  `){if(Y)X+=wm("");let K=J?Nm(J):void 0;if(J&&K)X+=Bm(K)}else if(H===`
@@ -457,7 +457,7 @@ Private-Lines: `+G+`\r
457
457
  Private-MAC: `+w.digest().toHex()+`\r
458
458
  `,Y};xB.publicKeyToOpenSSH=function($,D){var Q="ssh-rsa";D=D||"";var X=R6.util.createBuffer();return BG(X,Q),r9(X,$.e),r9(X,$.n),Q+" "+R6.util.encode64(X.bytes())+" "+D};xB.privateKeyToOpenSSH=function($,D){if(!D)return R6.pki.privateKeyToPem($);return R6.pki.encryptRsaPrivateKey($,D,{legacy:!0,algorithm:"aes128"})};xB.getPublicKeyFingerprint=function($,D){D=D||{};var Q=D.md||R6.md.md5.create(),X="ssh-rsa",J=R6.util.createBuffer();BG(J,X),r9(J,$.e),r9(J,$.n),Q.start(),Q.update(J.getBytes());var Y=Q.digest();if(D.encoding==="hex"){var Z=Y.toHex();if(D.delimiter)return Z.match(/.{2}/g).join(D.delimiter);return Z}else if(D.encoding==="binary")return Y.getBytes();else if(D.encoding)throw Error('Unknown encoding "'+D.encoding+'".');return Y};function r9($,D){var Q=D.toString(16);if(Q[0]>="8")Q="00"+Q;var X=R6.util.hexToBytes(Q);$.putInt32(X.length),$.putBytes(X)}function BG($,D){$.putInt32(D.length),$.putString(D)}function vB(){var $=R6.md.sha1.create(),D=arguments.length;for(var Q=0;Q<D;++Q)$.update(arguments[Q]);return $.digest()}});var xH=j((OQ1,eL0)=>{eL0.exports=v$();KQ();RL0();r8();QB();RH();hL0();FG();cL0();nL0();pL0();Xu();KB();BJ();tb();Zu();tL0();Gu();sb();db();BB();U8();nb();sL0();zu();s$()});function kH($,D){if($.length>10485760){let Q=($.length/1024/1024).toFixed(0);throw Error(`credential blob is ${Q} MB of base64 — not a valid ${D} (limit 10 MB)`)}}import{createHash as jj$}from"node:crypto";function Aj$($){if($.length>=4&&$.readUInt32BE(0)===Ej$)return"jks";if($.length>=1&&$[0]===48)return"pkcs12";return"unknown"}function Ij$($,D){let Q=$.subarray(0,$.length-20),X=$.subarray($.length-20),J=Buffer.from(D,"utf16le").swap16(),Z=jj$("sha1").update(Buffer.concat([J,Buffer.from("Mighty Aphrodite","utf8"),Q])).digest().equals(X),F=[],G=[],W=8,q=$.readUInt32BE(W);W+=4;for(let U=0;U<q&&W<Q.length;U++){let H=$.readUInt32BE(W);W+=4;let K=$.readUInt16BE(W);if(W+=2,F.push($.subarray(W,W+K).toString("utf8")),W+=K,W+=8,H===1){let z=$.readUInt32BE(W);W+=4+z;let O=$.readUInt32BE(W);W+=4;for(let V=0;V<O;V++){let N=$.readUInt16BE(W);W+=2+N;let w=$.readUInt32BE(W);W+=4,G.push($.subarray(W,W+w)),W+=w}}else{let z=$.readUInt16BE(W);W+=2+z;let O=$.readUInt32BE(W);W+=4,G.push($.subarray(W,W+O)),W+=O}}return{passwordOk:Z,aliases:F,certsDer:G}}function DN0($,D){let Q=`${D}\x00${$}`,X=yH.get(Q);if(X){if(X.error!==void 0)throw X.error;return X.value}try{let J=Cj$($,D);return $N0(Q,{value:J}),J}catch(J){throw $N0(Q,{error:J}),J}}function $N0($,D){if(yH.size>=Tj$)yH.delete(yH.keys().next().value);yH.set($,D)}function Cj$($,D){kH($,"keystore");let Q=Buffer.from($,"base64"),X=Aj$(Q);if(X==="jks"){let J=Ij$(Q,D);if(!J.passwordOk)throw Error("JKS integrity check failed — wrong store password");let Y=null;for(let Z of J.certsDer)try{let F=L8.default.pki.certificateFromAsn1(L8.default.asn1.fromDer(L8.default.util.createBuffer(Z.toString("binary"))));if(!Y||F.validity.notAfter<Y)Y=F.validity.notAfter}catch{}return{kind:X,aliases:J.aliases,notAfter:Y}}if(X==="pkcs12"){let Y=L8.default.pkcs12.pkcs12FromAsn1(L8.default.asn1.fromDer(Q.toString("binary")),D).getBags({bagType:L8.default.pki.oids.certBag})[L8.default.pki.oids.certBag]??[],Z=Y.map((G)=>G.attributes?.friendlyName?.[0]??"").filter(Boolean),F=null;for(let G of Y)if(G.cert&&(!F||G.cert.validity.notAfter<F))F=G.cert.validity.notAfter;return{kind:X,aliases:Z,notAfter:F}}throw Error("Unrecognized keystore format (expected JKS or PKCS12)")}var L8,Ej$=4277010157,Tj$=4,yH,QN0=($)=>Boolean($.credentials?.ANDROID_KEYSTORE_FILE),XN0=($)=>$.credentials?.KEYSTORE_STORE_PASSWORD??$.credentials?.KEYSTORE_KEY_PASSWORD??"",JN0,Pj$,YN0;var ZN0=o(()=>{L8=f$(xH(),1);yH=new Map;JN0={id:"android/keystore-opens",platforms:["android"],appliesTo:QN0,async run($){let D;try{D=DN0($.credentials.ANDROID_KEYSTORE_FILE,XN0($))}catch(J){let Y=J instanceof Error?J.message:String(J);return[{id:"android/keystore-opens",severity:"error",title:/password|mac|integrity/i.test(Y)?"The keystore cannot be opened with the saved store password":"The saved keystore is not a valid JKS/PKCS12 file",detail:Y,fix:"Verify the keystore file and --keystore-store-password, then re-run `build credentials save`"}]}let Q=$.credentials?.KEYSTORE_KEY_ALIAS,X=D.kind==="jks"||D.aliases.length>0;if(Q&&X&&!D.aliases.includes(Q))return[{id:"android/keystore-opens",severity:"error",title:`Key alias "${Q}" not found in the keystore`,detail:`available aliases: ${D.aliases.join(", ")||"(none)"}`,fix:"Use one of the existing aliases or the correct keystore file"}];return[]}},Pj$=new Date("2033-10-01"),YN0={id:"android/keystore-expiry",platforms:["android"],appliesTo:QN0,async run($){let D;try{D=DN0($.credentials.ANDROID_KEYSTORE_FILE,XN0($))}catch{return[]}if(D.notAfter&&D.notAfter<Pj$)return[{id:"android/keystore-expiry",severity:"warning",title:`Signing certificate validity ends ${D.notAfter.toISOString().slice(0,10)} — Play requires validity through Oct 2033 for new apps`,fix:"Generate a keystore with ≥25y validity (keytool -validity 10000) for new apps"}];return[]}}});import{join as Sj$}from"node:path";function wG($){let D=R1(Sj$($,"package.json"));if(D===null)return null;let Q;try{let Y=JSON.parse(D);Q={...Y.devDependencies,...Y.dependencies}}catch{return null}let X=Q["@capacitor/core"]??Q["@capacitor/ios"]??Q["@capacitor/android"];if(typeof X!=="string")return null;let J=X.match(/(\d+)/);return J?Number(J[1]):null}var _u=o(()=>{f5()});function fH($){return $.platform==="android"&&Boolean($.credentials?.PLAY_CONFIG_JSON)}function y4($){if($.platform!=="ios")return!1;if(($.distributionMode??"app_store")!=="app_store")return!1;let Q=$.credentials;return Boolean(Q?.APPLE_KEY_ID&&Q?.APPLE_ISSUER_ID&&Q?.APPLE_KEY_CONTENT)}import{existsSync as bH}from"node:fs";import{join as t8}from"node:path";function _j$($){let D=R1(t8($.projectDir,"package.json"));if(!D)return!1;try{return Object.keys(JSON.parse(D).dependencies??{}).some((X)=>X.startsWith("cordova-plugin-")||X.startsWith("@awesome-cordova-plugins/"))}catch{return!1}}function xj$($){let D=$?.match(/-Xmx(\d+)([mMgG])/);if(!D)return null;let Q=Number.parseInt(D[1],10);return/g/i.test(D[2])?Q*1024:Q}function yB($,D){let Q=$.match(new RegExp(`(?:^|[\\s;{}])${D}\\s*\\{`));if(Q?.index===void 0)return null;let X=$.indexOf("{",Q.index+Q[0].length-1),J=0;for(let Y=X;Y<$.length;Y++)if($[Y]==="{")J++;else if($[Y]==="}"){if(J--,J===0)return $.slice(X+1,Y)}return null}function ON0($){let D=[],Q=0,X=0;for(let J=0;J<$.length;J++){let Y=$[J];if(Y==="{"){if(Q===0){let Z=$.slice(X,J),F=Z.match(/(?:create|register)\s*\(\s*["'](\w+)["']\s*\)\s*$/),G=Z.match(/val\s+(\w+)\s+by\s+creating\s*$/),W=Z.match(/(?:^|[\s;}])(\w+)\s*$/),q=F?.[1]??G?.[1]??W?.[1];if(q)D.push(q)}Q++}else if(Y==="}"){if(Q=Math.max(0,Q-1),Q===0)X=J+1}else if(Q===0&&(Y===`
459
459
  `||Y===";"))X=J+1}return D}function uH($){let D=n8($);return D===null?null:qQ(D)}function GN0($){let D=uH($);if(D===null)return null;let Q=yB(D,"productFlavors");if(Q===null)return null;let X=ON0(Q).filter((J)=>J!=="dimension");if(X.length===0)return null;return{gradle:D,block:Q,flavors:X}}function yj$($){let D=uH($);if(D===null)return!1;let Q=D.match(kj$);if(Q?.index===void 0)return!1;let X=0;for(let J=0;J<Q.index;J++)if(D[J]==="{")X++;else if(D[J]==="}")X=Math.max(0,X-1);return X===0}function bj$($){return $.startsWith("/")||/^[A-Za-z]:\\/.test($)}function gj$($){return uj$[$]??hj$}function dj$($){let D=uH($);if(D===null)return{code:!1,name:!1};return{code:/versionCode\s*[=\s]\s*\S/.test(D),name:/versionName\s*[=\s]\s*["']/.test(D)||/versionName\s*[=\s]\s*\w/.test(D)}}function cj$($){let D=R1(t8($,"android","app","src","main","AndroidManifest.xml"));if(D===null)return{code:!1,name:!1};return{code:/android:versionCode\s*=\s*"/.test(D),name:/android:versionName\s*=\s*"/.test(D)}}var HN0,FN0=30,vj$=2048,KN0,zN0,VN0,MN0,LN0,NN0,BN0,wN0,kj$,RN0,fj$,jN0,WN0,EN0,qN0=34,kB=35,UN0="https://developer.android.com/google/play/requirements/target-sdk",AN0,uj$,hj$=24,IN0,mj$,TN0,CN0;var PN0=o(()=>{f5();Ib();_u();HN0={id:"android/cordova-vars-present",platforms:["android"],appliesTo:_j$,async run($){let D=t8($.projectDir,"android","capacitor-cordova-android-plugins","cordova.variables.gradle");if(bH(D))return[];return[{id:"android/cordova-vars-present",severity:"error",title:"cordova.variables.gradle is missing — the cloud build cannot compile your Cordova plugins",detail:"This generated file is gitignored; `cap copy` does not create it, only `cap sync` does",fix:"Run `npx cap sync android` before requesting the build"}]}};KN0={id:"android/gradle-props-heuristics",platforms:["android"],async run($){let D=wV0($.projectDir),Q=BV0($.projectDir),X=[],J=Q["org.gradle.parallel"]==="true";if(D>FN0&&!J)X.push({id:"android/gradle-props-heuristics",severity:"warning",title:`${D} Gradle modules build serially — org.gradle.parallel is not enabled`,fix:"Add `org.gradle.parallel=true` (and `org.gradle.caching=true`) to android/gradle.properties"});if(J&&Q["org.gradle.workers.max"]==="1")X.push({id:"android/gradle-props-heuristics",severity:"warning",title:"org.gradle.workers.max=1 makes org.gradle.parallel=true a no-op",fix:"Remove the workers.max cap (or raise it) so parallel project execution can work"});let Y=xj$(Q["org.gradle.jvmargs"]);if(D>FN0&&Y!==null&&Y<vj$)X.push({id:"android/gradle-props-heuristics",severity:"warning",title:`Gradle heap -Xmx${Y}m is small for ${D} modules — D8/R8 may stall or OOM`,fix:"Raise org.gradle.jvmargs, e.g. `-Xmx4096m -XX:MaxMetaspaceSize=1024m`"});return X}},zN0={id:"android/play-sa-json",platforms:["android"],appliesTo:($)=>Boolean($.credentials?.PLAY_CONFIG_JSON),async run($){let D;try{D=JSON.parse(Buffer.from($.credentials.PLAY_CONFIG_JSON,"base64").toString("utf8"))}catch{D=void 0}if(!D||typeof D!=="object"||Array.isArray(D))return[{id:"android/play-sa-json",severity:"error",title:"PLAY_CONFIG_JSON does not decode to valid JSON",fix:"Base64-encode the raw service-account .json file"}];let Q=D;if(Q.type!=="service_account")return[{id:"android/play-sa-json",severity:"error",title:"PLAY_CONFIG_JSON is not a service-account key",detail:`type: ${String(Q.type)}`,fix:"Create a service-account key in Google Cloud Console (IAM → Service Accounts → Keys)"}];let X=["private_key","client_email"].filter((J)=>!Q[J]);if(X.length>0)return[{id:"android/play-sa-json",severity:"error",title:"Service-account JSON is incomplete",detail:`missing: ${X.join(", ")}`,fix:"Re-download the key file — it must contain private_key and client_email"}];return[]}};VN0={id:"android/flavor-exists",platforms:["android"],appliesTo:($)=>Boolean($.androidFlavor),async run($){let D=n8($.projectDir);if(!D)return[];let Q=yB(D,"productFlavors");if(Q===null)return[{id:"android/flavor-exists",severity:"error",title:`--android-flavor "${$.androidFlavor}" passed but build.gradle declares no productFlavors`,fix:"Drop the flag or add the flavor to android/app/build.gradle"}];let X=ON0(Q).filter((J)=>J!=="dimension");if(X.length===0)return[];if(!X.includes($.androidFlavor))return[{id:"android/flavor-exists",severity:"error",title:`Product flavor "${$.androidFlavor}" not found in build.gradle`,detail:`declared flavors: ${X.join(", ")}`,fix:"Use one of the declared flavors or add the missing one"}];return[]}},MN0={id:"android/agp8-package-attr",platforms:["android"],async run($){let D=LJ($.projectDir),Q=n8($.projectDir);if(!D||!Q)return[];let X=MH(D.raw),J=/<manifest[^>]*\spackage\s*=\s*"/.test(X),Y=/namespace\s*[=( ]\s*["']/.test(qQ(Q));if(J&&Y)return[{id:"android/agp8-package-attr",severity:"error",title:"AndroidManifest.xml still has a package= attribute — AGP 8+ fails the build",detail:"build.gradle declares `namespace`, so the manifest attribute is forbidden",fix:'Delete the package="…" attribute from android/app/src/main/AndroidManifest.xml'}];return[]}};LN0={id:"android/applicationid-present",platforms:["android"],appliesTo:($)=>n8($.projectDir)!==null,async run($){let D=uH($.projectDir);if(D===null)return[];if(/(?:^|[\s;{(])applicationId\s*[=(\s]\s*["'][\w.]+["']/.test(D))return[];let Q=yB(D,"productFlavors");if(Q!==null&&/applicationId(?:Suffix)?/.test(Q))return[];return[{id:"android/applicationid-present",severity:"error",title:"No applicationId is declared in android/app/build.gradle",detail:"Capacitor needs a defaultConfig (or per-flavor) applicationId to assemble the APK/AAB",fix:'Add `applicationId "your.app.id"` to defaultConfig (or per flavor); it must match the Capacitor appId'}]}},NN0={id:"android/capacitor-build-gradle-applied",platforms:["android"],appliesTo:($)=>n8($.projectDir)!==null,async run($){let D=uH($.projectDir);if(D===null)return[];let Q=/apply\s+from:\s*["']capacitor\.build\.gradle["']/.test(D),X=bH(t8($.projectDir,"android","app","capacitor.build.gradle"));if(Q&&X)return[];if(Q&&!X)return[{id:"android/capacitor-build-gradle-applied",severity:"error",title:"app/build.gradle applies capacitor.build.gradle but the file is missing",detail:"This generated file is created by `cap sync`, not `cap copy`",fix:"Run `npx cap sync android` to regenerate android/app/capacitor.build.gradle"}];return[{id:"android/capacitor-build-gradle-applied",severity:"error",title:"app/build.gradle never applies capacitor.build.gradle",detail:'Without `apply from: "capacitor.build.gradle"` the Capacitor plugin dependencies are not wired in',fix:"Run `npx cap sync android`; ensure app/build.gradle has `apply from: 'capacitor.build.gradle'`"}]}},BN0={id:"android/gradle-wrapper-present",platforms:["android"],appliesTo:($)=>bH(t8($.projectDir,"android")),async run($){let D=R1(t8($.projectDir,"android","gradle","wrapper","gradle-wrapper.properties"));if(D===null)return[{id:"android/gradle-wrapper-present",severity:"error",title:"The Gradle wrapper is missing — android/gradle/wrapper/gradle-wrapper.properties not found",detail:"The cloud builder runs `./gradlew`, which needs the committed wrapper",fix:"Restore it: `npx cap sync android` or `gradle wrapper`; commit android/gradle/wrapper/ + android/gradlew"}];if(!/^distributionUrl=\S+/m.test(D))return[{id:"android/gradle-wrapper-present",severity:"error",title:"gradle-wrapper.properties has no distributionUrl — Gradle cannot bootstrap",fix:"Add a distributionUrl line (e.g. via `gradle wrapper`) or re-run `npx cap sync android`"}];return[]}};wN0={id:"android/flavor-dimensions",platforms:["android"],appliesTo:($)=>GN0($.projectDir)!==null,async run($){let D=GN0($.projectDir);if(D===null)return[];if(/flavorDimensions?\s*[=(\s]\s*["']/.test(D.gradle))return[];let Q=D.flavors.filter((X)=>{let J=yB(D.block,X);return J===null||!/(?:^|[\s;{])dimension\s+["']/.test(J)});if(Q.length===0)return[];return[{id:"android/flavor-dimensions",severity:"error",title:"Product flavors are missing a dimension and no top-level flavorDimensions is declared",detail:`flavors without a dimension: ${Q.join(", ")}`,fix:'Add `flavorDimensions "default"` and give every flavor `dimension "default"`'}]}},kj$=/(?:apply\s+plugin:\s*["']com\.google\.gms\.google-services["']|id\s*[("']+com\.google\.gms\.google-services)/;RN0={id:"android/google-services-file",platforms:["android"],appliesTo:($)=>n8($.projectDir)!==null&&yj$($.projectDir),async run($){if(bH(t8($.projectDir,"android","app","google-services.json")))return[];return[{id:"android/google-services-file",severity:"error",title:"com.google.gms.google-services is applied unconditionally but google-services.json is missing",detail:"The unguarded plugin apply fails the build when the config file is absent",fix:"Supply android/app/google-services.json to the cloud build (it is gitignored), or guard/remove the gms apply"}]}},fj$=/^(sdk|ndk)\.dir\s*=\s*(.+)$/gm;jN0={id:"android/local-properties-committed",platforms:["android"],appliesTo:($)=>bH(t8($.projectDir,"android","local.properties")),async run($){let D=R1(t8($.projectDir,"android","local.properties"));if(D===null)return[];let Q=[];for(let X of D.matchAll(fj$)){let J=`${X[1]}.dir`;if(bj$(X[2].trim()))Q.push({id:"android/local-properties-committed",severity:"warning",title:"android/local.properties is committed with a machine-specific SDK path",detail:`local.properties pins an absolute ${J}`,fix:"Remove android/local.properties from VCS and gitignore it; the cloud builder sets its own SDK location"})}return Q}},WN0=[{dim:"compileSdk",label:"compileSdkVersion",floor:34},{dim:"targetSdk",label:"targetSdkVersion",floor:34},{dim:"minSdk",label:"minSdkVersion",floor:23}],EN0={id:"android/sdk-floors",platforms:["android"],appliesTo:($)=>WN0.some(({dim:D})=>q8($.projectDir,D)!==null),async run($){let D=[];for(let{dim:Q,label:X,floor:J}of WN0){let Y=q8($.projectDir,Q);if(Y===null||Y>=J)continue;D.push({id:"android/sdk-floors",severity:"warning",title:`${Q} ${Y} is below the recommended floor (${J})`,fix:`Raise ${X} to at least ${J} in android/variables.gradle`})}return D}},AN0={id:"android/target-sdk-play",platforms:["android"],appliesTo:($)=>q8($.projectDir,"targetSdk")!==null,async run($){let D=q8($.projectDir,"targetSdk");if(D===null||D>=kB)return[];if(D<qN0)return[{id:"android/target-sdk-play",severity:"error",title:`targetSdk ${D} is below Play's minimum (${qN0}) — you cannot publish or stay available`,fix:`Set targetSdkVersion = ${kB} in android/variables.gradle`,docsUrl:UN0}];let Q=fH($);return[{id:"android/target-sdk-play",severity:Q?"error":"warning",title:`targetSdk ${D} is behind Play's submission requirement (${kB})`,detail:Q?"Play rejects new apps and updates below this target":"Approaching enforcement — raise before your next submission",fix:`Set targetSdkVersion = ${kB} in android/variables.gradle`,docsUrl:UN0}]}},uj$={6:22,7:23,8:24};IN0={id:"android/min-sdk-capacitor",platforms:["android"],appliesTo:($)=>wG($.projectDir)!==null&&q8($.projectDir,"minSdk")!==null,async run($){let D=wG($.projectDir),Q=q8($.projectDir,"minSdk");if(D===null||Q===null)return[];let X=gj$(D);if(Q>=X)return[];return[{id:"android/min-sdk-capacitor",severity:"error",title:`minSdk ${Q} is below the Capacitor ${D} floor`,detail:`Capacitor ${D} requires minSdkVersion >= ${X}`,fix:`Raise minSdkVersion to at least ${X} in android/variables.gradle`}]}},mj$=[{pattern:/['"]com\.google\.mlkit:genai-prompt/,minSdk:26,label:"com.google.mlkit:genai-prompt"}],TN0={id:"android/min-sdk-dependencies",platforms:["android"],appliesTo:($)=>q8($.projectDir,"minSdk")!==null&&Rb($.projectDir).length>0,async run($){let D=q8($.projectDir,"minSdk");if(D===null)return[];let Q=new Map;for(let Y of Rb($.projectDir)){let Z=R1(t8(Y,"build.gradle"))??R1(t8(Y,"build.gradle.kts"));if(!Z)continue;let F=qQ(Z);for(let{pattern:G,minSdk:W,label:q}of mj$){if(!G.test(F))continue;let U=Q.get(W)??[];if(!U.includes(q))U.push(q);Q.set(W,U)}}if(Q.size===0)return[];let X=Math.max(...Q.keys());if(D>=X)return[];let J=Q.get(X)??[];return[{id:"android/min-sdk-dependencies",severity:"error",title:`minSdk ${D} is below a plugin dependency requirement (${X})`,detail:`Synced Capacitor plugin(s) depend on ${J.join(", ")} which requires minSdkVersion >= ${X}`,fix:`Raise minSdkVersion to at least ${X} in android/variables.gradle`}]}};CN0={id:"android/version-fields",platforms:["android"],appliesTo:($)=>n8($.projectDir)!==null,async run($){let D=dj$($.projectDir),Q=cj$($.projectDir),X=D.code||Q.code,J=D.name||Q.name,Y=[];if(!X){let Z=fH($);Y.push({id:"android/version-fields",severity:Z?"error":"warning",title:"No versionCode found in app/build.gradle or AndroidManifest.xml",detail:Z?"Google Play rejects an upload without an integer versionCode":"A versionCode is required to assemble a release artifact",fix:"Set versionCode (integer) in android/app/build.gradle defaultConfig (or via the CLI build-number bump)"})}if(!J)Y.push({id:"android/version-fields",severity:"warning",title:"No versionName found in app/build.gradle or AndroidManifest.xml",fix:"Set versionName in android/app/build.gradle defaultConfig"});return Y}}});var lj$,SN0;var _N0=o(()=>{lj$={ios:["BUILD_CERTIFICATE_BASE64","CAPGO_IOS_PROVISIONING_MAP","APP_STORE_CONNECT_TEAM_ID"],android:["ANDROID_KEYSTORE_FILE","KEYSTORE_KEY_ALIAS"]},SN0={id:"shared/credentials-saved",platforms:["ios","android"],async run($){let D=$.credentials;if(!D||Object.keys(D).length===0)return[{id:"shared/credentials-saved",severity:"error",title:`No ${$.platform} build credentials found`,fix:`Save them first: npx @capgo/cli build credentials save --appId ${$.appId} --platform ${$.platform}`}];let Q=lj$[$.platform].filter((X)=>!D[X]);if($.platform==="android"&&!D.KEYSTORE_STORE_PASSWORD&&!D.KEYSTORE_KEY_PASSWORD)Q.push("KEYSTORE_STORE_PASSWORD (or KEYSTORE_KEY_PASSWORD)");if(Q.length>0)return[{id:"shared/credentials-saved",severity:"error",title:`Incomplete ${$.platform} credentials`,detail:`missing: ${Q.join(", ")}`,fix:"Re-run `build credentials save` with the missing values"}];return[]}}});function RG($){return $&&Array.isArray($.value)?$.value:[]}function fB($){if(!$||$.type!==D6.default.asn1.Type.OID||typeof $.value!=="string")return null;try{return D6.default.asn1.derToOid($.value)}catch{return null}}function oj$($){let D=RG($);if(fB(D[0])!==D6.default.pki.oids.pkcs8ShroudedKeyBag)return null;let Q=RG(D[1])[0],X=RG(Q)[0],J=RG(X),Y=fB(J[0]);if(!Y)return null;let Z=RG(J[1]),F=RG(Z[1]);return{algorithmOid:Y,encryptionSchemeOid:fB(F[0])}}function vu($,D,Q=0){if(Q>32)return;let X=oj$($);if(X){D.push(X);return}if(Array.isArray($.value))for(let J of $.value)vu(J,D,Q+1);else if($.type===D6.default.asn1.Type.OCTETSTRING&&$.value.length>0)try{vu(D6.default.asn1.fromDer($.value),D,Q+1)}catch{}}function tj$($){if(!Array.isArray($.value))return null;let D=$.value[2];if(!D||!Array.isArray(D.value))return null;let Q=D.value[0];if(!Q||!Array.isArray(Q.value))return null;let X=Q.value[0];if(!X||!Array.isArray(X.value))return null;return fB(X.value[0])}function aj$($){try{return D6.default.asn1.fromDer(D6.default.util.decode64($))}catch{throw new xu}}function sj$($){kH($,"certificate");let D=aj$($),Q=[];vu(D,Q);let X=new Set,J=tj$(D);if(J!==nj$)X.add(J===D6.default.pki.oids.sha256?"SHA-256 MAC":"non-SHA-1 MAC");if(Q.length===0)X.add("missing PBESv1 SHA-1/3DES private-key encryption");for(let Y of Q){if(Y.algorithmOid===pj$)continue;if(Y.algorithmOid===ij$)X.add(rj$.has(Y.encryptionSchemeOid??"")?"PBES2/AES private-key encryption":"PBES2 private-key encryption");else X.add("unsupported private-key encryption")}return[...X]}function vN0($){let D=$.attributes?.localKeyId?.[0];return typeof D==="string"?D6.default.util.bytesToHex(D):null}function ej$($,D){let Q=[...$.getBags({bagType:D6.default.pki.oids.pkcs8ShroudedKeyBag})[D6.default.pki.oids.pkcs8ShroudedKeyBag]??[],...$.getBags({bagType:D6.default.pki.oids.keyBag})[D6.default.pki.oids.keyBag]??[]],X=new Set(Q.map((Y)=>vN0(Y)).filter((Y)=>Y!==null));if(X.size>0){let Y=D.find((Z)=>{let F=vN0(Z);return F!==null&&X.has(F)});if(Y?.cert)return Y.cert}let J=D.find((Y)=>{if(!Y.cert)return!1;return!Y.cert.getExtension("basicConstraints")?.cA});if(J?.cert)return J.cert;return D[0]?.cert}function bB($,D){let Q=`${D}\x00${$}`,X=hH.get(Q);if(X){if(X.error!==void 0)throw X.error;return X.value}try{let J=DE$($,D);return xN0(Q,{value:J}),J}catch(J){throw xN0(Q,{error:J}),J}}function xN0($,D){if(hH.size>=$E$)hH.delete(hH.keys().next().value);hH.set($,D)}function DE$($,D){kH($,"certificate");let Q=D6.default.util.decode64($),X=D6.default.asn1.fromDer(Q),J=D6.default.pkcs12.pkcs12FromAsn1(X,D),Y=J.getBags({bagType:D6.default.pki.oids.certBag})[D6.default.pki.oids.certBag]??[],Z=ej$(J,Y);if(!Z)throw Error("no certificate inside the P12");let F=D6.default.asn1.toDer(D6.default.pki.certificateToAsn1(Z)).getBytes(),G=D6.default.md.sha1.create();return G.update(F),{cert:Z,sha1:G.digest().toHex().toLowerCase()}}var D6,nj$="1.3.14.3.2.26",ij$="1.2.840.113549.1.5.13",pj$="1.2.840.113549.1.12.1.3",rj$,xu,$E$=4,hH,jG=($,D)=>Boolean($.credentials?.[D]),kN0,yN0,QE$=2592000000,fN0,XE$,JE$,bN0;var ku=o(()=>{D6=f$(xH(),1),rj$=new Set(["2.16.840.1.101.3.4.1.2","2.16.840.1.101.3.4.1.22","2.16.840.1.101.3.4.1.42"]);xu=class xu extends Error{constructor(){super("malformed PKCS12 ASN.1");this.name="MalformedP12Error"}};hH=new Map;kN0={id:"ios/p12-opens",platforms:["ios"],appliesTo:($)=>jG($,"BUILD_CERTIFICATE_BASE64"),async run($){try{return bB($.credentials.BUILD_CERTIFICATE_BASE64,$.credentials.P12_PASSWORD??""),[]}catch(D){let Q=D instanceof Error?D.message:String(D);return[{id:"ios/p12-opens",severity:"error",title:/mac|hmac|password|invalid/i.test(Q)?"The P12 certificate cannot be opened with the saved password":"The saved certificate is not a valid P12 file",detail:Q,fix:"Re-export the .p12 and re-run `build credentials save` with the correct --p12-password"}]}}},yN0={id:"ios/p12-legacy-encryption",platforms:["ios"],appliesTo:($)=>jG($,"BUILD_CERTIFICATE_BASE64"),async run($){let D;try{D=sj$($.credentials.BUILD_CERTIFICATE_BASE64)}catch(Q){if(Q instanceof xu)return[];throw Q}if(D.length===0)return[];return[{id:"ios/p12-legacy-encryption",severity:"error",title:"The P12 certificate uses encryption that the macOS build runner cannot import",detail:`Detected ${D.join(" and ")}. Fastlane security import may report a wrong password even when the password is correct.`,fix:"Re-export the .p12 with PBESv1 SHA-1/3DES encryption and a SHA-1 MAC, then re-run `build credentials save`."}]}},fN0={id:"ios/p12-expiry",platforms:["ios"],appliesTo:($)=>jG($,"BUILD_CERTIFICATE_BASE64"),async run($){let D;try{D=bB($.credentials.BUILD_CERTIFICATE_BASE64,$.credentials.P12_PASSWORD??"")}catch{return[]}let Q=D.cert.validity.notAfter,X=Q.getTime()-Date.now();if(X<=0)return[{id:"ios/p12-expiry",severity:"error",title:`Signing certificate expired on ${Q.toISOString().slice(0,10)}`,fix:"Create a new distribution certificate in the Apple Developer portal and re-save credentials"}];if(X<QE$)return[{id:"ios/p12-expiry",severity:"warning",title:`Signing certificate expires in ${Math.ceil(X/86400000)} day(s) (${Q.toISOString().slice(0,10)})`,fix:"Renew it soon to avoid build interruptions"}];return[]}},XE$=/^[A-Z0-9]{10}$/,JE$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,bN0={id:"ios/asc-key-valid",platforms:["ios"],appliesTo:($)=>jG($,"APPLE_KEY_CONTENT")||jG($,"APPLE_KEY_ID")||jG($,"APPLE_ISSUER_ID"),async run($){let D=[],{APPLE_KEY_ID:Q,APPLE_ISSUER_ID:X,APPLE_KEY_CONTENT:J}=$.credentials??{};if(Q&&!XE$.test(Q))D.push({id:"ios/asc-key-valid",severity:"error",title:"APPLE_KEY_ID is not a 10-char App Store Connect key ID",detail:`got a ${Q.length}-char value (expected 10 uppercase letters/digits)`});if(X&&!JE$.test(X))D.push({id:"ios/asc-key-valid",severity:"error",title:"APPLE_ISSUER_ID is not a UUID",detail:`got a ${X.length}-char value (expected a UUID like 12345678-1234-1234-1234-123456789012)`,fix:"Copy the Issuer ID from App Store Connect → Users and Access → Integrations"});if(J){let Y="";try{Y=D6.default.util.decode64(J)}catch{}if(!Y.includes("-----BEGIN PRIVATE KEY-----"))D.push({id:"ios/asc-key-valid",severity:"error",title:"APPLE_KEY_CONTENT does not decode to a .p8 private key PEM",fix:"Base64-encode the raw AuthKey_XXXX.p8 file content"})}return D}}});function uN0($){return $!==null&&typeof $==="object"&&!Array.isArray($)?$:void 0}function gH($){throw new mH("invalid",$)}function YE$($,D,Q){let X={profile:$,name:D};return Object.defineProperty(X,"bundleId",{value:Q}),X}function yu($){if($===void 0||$===null)throw new mH("missing","No provisioning profile map is saved");if(typeof $!=="string"||$.trim()==="")gH("The saved provisioning profile map is empty or invalid");let D;try{D=JSON.parse($)}catch{throw new mH("malformed","The saved provisioning profile map is not valid JSON")}let Q=uN0(D);if(!Q)gH("The saved provisioning profile map must be a JSON object");if(Object.keys(Q).length===0)throw new mH("empty","The saved provisioning profile map has no profiles");let X=Object.create(null);for(let[J,Y]of Object.entries(Q)){if(!J.trim())gH("The saved provisioning profile map contains an empty bundle ID");let Z=uN0(Y),F=typeof Y==="string"?Y:Z&&Object.hasOwn(Z,"profile")&&typeof Z.profile==="string"?Z.profile:void 0;if(!F)gH(`The saved provisioning profile for ${J} is invalid`);try{let G=SF(F);X[J]=YE$(F,G.name,G.bundleId)}catch{gH(`The saved provisioning profile for ${J} is invalid`)}}return X}function hN0($){let D=$.trim();return D.length>0&&!D.includes("*")&&!D.includes("$(")&&!D.includes("${")}function fu($,D){if($==="*")return!0;if(!$.endsWith(".*"))return!1;let Q=$.slice(0,-2);return Q.length>0&&D.startsWith(`${Q}.`)&&D.length>Q.length+1}function ZE$($){let D=new Map;for(let Q of $){let X=D.get(Q.bundleId);if(X)X.targetNames.push(Q.name);else D.set(Q.bundleId,{bundleId:Q.bundleId,targetNames:[Q.name]})}return[...D.values()]}function bu($,D){let Q=$.filter((H)=>!hN0(H.bundleId)),X=ZE$($.filter((H)=>hN0(H.bundleId))),J=X.filter((H)=>Object.hasOwn(D,H.bundleId)),Y=X.filter((H)=>!Object.hasOwn(D,H.bundleId)),Z=new Map;for(let[H,K]of Object.entries(D)){let z=Y.filter((V)=>fu(K.bundleId,V.bundleId));if(z.length===0)continue;let O=Z.get(K.profile);if(O){O.sourceKeys.push(H);for(let V of z)O.targetBundleIds.add(V.bundleId)}else Z.set(K.profile,{entry:K,sourceKeys:[H],targetBundleIds:new Set(z.map((V)=>V.bundleId))})}let F=[...Z.values()],G=new Set(F.flatMap((H)=>[...H.targetBundleIds])),W=F.length>1?Y.filter((H)=>G.has(H.bundleId)):[],q=F.length===1?F[0]:void 0,U=q?{entry:q.entry,sourceKeys:q.sourceKeys,targets:Y.filter((H)=>q.targetBundleIds.has(H.bundleId))}:null;return{exact:J,missing:Y,unresolved:Q,wildcardReuse:U,wildcardConflict:W,generation:Y.filter((H)=>!G.has(H.bundleId))}}var mH;var gN0=o(()=>{bU();mH=class mH extends Error{code;constructor($,D){super(D);this.code=$;this.name="ProvisioningMapError"}}});function c5($){let D=$.credentials?.CAPGO_IOS_PROVISIONING_MAP;if(!D)return[];try{let Q=JSON.parse(D);if(!Q||typeof Q!=="object"||Array.isArray(Q))return[];let X=[];for(let[J,Y]of Object.entries(Q))if(typeof Y==="string")X.push({bundleId:J,base64:Y});else if(Y&&typeof Y==="object"&&typeof Y.profile==="string"){let Z=Y;X.push({bundleId:J,base64:Z.profile,name:Z.name})}return X}catch{return[]}}function uB($){try{return SF($)}catch{return null}}function GE$($,D){return $===D||fu($,D)}var FE$=2592000000,hB=($)=>c5($).length>0,mN0,dN0,cN0,lN0,nN0,iN0;var gB=o(()=>{gN0();bU();ku();mN0={id:"ios/profile-expiry",platforms:["ios"],appliesTo:hB,async run($){let D=[];for(let{bundleId:Q,base64:X}of c5($)){let J=uB(X);if(!J?.expirationDate)continue;let Y=new Date(J.expirationDate).getTime()-Date.now();if(Y<=0)D.push({id:"ios/profile-expiry",severity:"error",title:`Provisioning profile for "${Q}" expired on ${J.expirationDate.slice(0,10)}`,fix:"Regenerate the profile in the Apple Developer portal and re-save credentials"});else if(Y<FE$)D.push({id:"ios/profile-expiry",severity:"warning",title:`Provisioning profile for "${Q}" expires in ${Math.ceil(Y/86400000)} day(s)`})}return D}};dN0={id:"ios/profile-bundle-match",platforms:["ios"],appliesTo:hB,async run($){let D=[];for(let{bundleId:Q,base64:X}of c5($)){let J=uB(X);if(J?.bundleId&&!GE$(J.bundleId,Q))D.push({id:"ios/profile-bundle-match",severity:"error",title:`Provisioning profile mapped to "${Q}" is for a different bundle id`,detail:`profile: ${J.bundleId} — assigned to: ${Q}`,fix:"Use a profile generated for this bundle id (or a wildcard profile)"})}return D}},cN0={id:"ios/profile-type-vs-mode",platforms:["ios"],appliesTo:($)=>hB($)&&Boolean($.distributionMode),async run($){let D=[];for(let{bundleId:Q,base64:X}of c5($)){let J=uB(X);if(!J||J.profileType==="unknown")continue;if(J.profileType!==$.distributionMode)D.push({id:"ios/profile-type-vs-mode",severity:"error",title:`Profile for "${Q}" is ${J.profileType} but the build requests ${$.distributionMode}`,fix:$.distributionMode==="app_store"?"Generate an App Store distribution profile, or build with --ios-distribution ad_hoc":"Generate an Ad Hoc profile, or switch --ios-distribution"})}return D}},lN0={id:"ios/cert-profile-pairing",platforms:["ios"],appliesTo:($)=>hB($)&&Boolean($.credentials?.BUILD_CERTIFICATE_BASE64),async run($){let D;try{D=bB($.credentials.BUILD_CERTIFICATE_BASE64,$.credentials.P12_PASSWORD??"").sha1}catch{return[]}let Q=[];for(let{bundleId:X,base64:J}of c5($)){let Y=uB(J);if(!Y||Y.certificateSha1s.length===0)continue;if(!Y.certificateSha1s.includes(D))Q.push({id:"ios/cert-profile-pairing",severity:"error",title:`Your signing certificate is not included in the provisioning profile for "${X}"`,detail:`cert sha1 ${D} not in [${Y.certificateSha1s.join(", ")}]`,fix:"Regenerate the profile selecting this distribution certificate, then re-save credentials"})}return Q}},nN0={id:"ios/targets-covered",platforms:["ios"],appliesTo:($)=>$.credentials?.CAPGO_IOS_PROVISIONING_MAP!==void 0,async run($){let D;try{D=yu($.credentials?.CAPGO_IOS_PROVISIONING_MAP)}catch(U){return[{id:"ios/targets-covered",severity:"error",title:"Saved iOS provisioning profile map cannot be used",detail:U instanceof Error?U.message:"The saved provisioning profile map is invalid",fix:"Save or update the iOS provisioning profile map before building"}]}let{findSignableTargets:Q,readPbxproj:X}=await Promise.resolve().then(() => (J8(),hU)),J=X($.projectDir);if(!J)return[];let Y=Q(J),Z=bu(Y,D),F=new Set([...Z.wildcardReuse?.targets??[],...Z.wildcardConflict].map((U)=>U.bundleId)),G=Z.missing.filter((U)=>!F.has(U.bundleId));if(G.length===0)return[];let W=G.reduce((U,H)=>U+H.targetNames.length,0),q=Y.filter((U)=>U.bundleId).length>1;return[{id:"ios/targets-covered",severity:"error",title:`${W} signable target(s) have no provisioning profile mapped`,detail:`uncovered: ${G.flatMap((U)=>U.targetNames.map((H)=>`${H} (${U.bundleId})`)).join(", ")}`,fix:q?"Run npx @capgo/cli@latest build credentials ios-provisioning to set up every target":'Add --ios-provisioning-profile "bundleId=/path/to/profile.mobileprovision" and re-save credentials'}]}},iN0={id:"ios/wildcard-profile-targets",platforms:["ios"],appliesTo:($)=>$.credentials?.CAPGO_IOS_PROVISIONING_MAP!==void 0,async run($){let D;try{D=yu($.credentials?.CAPGO_IOS_PROVISIONING_MAP)}catch{return[]}let{findSignableTargets:Q,readPbxproj:X}=await Promise.resolve().then(() => (J8(),hU)),J=X($.projectDir);if(!J)return[];let Y=bu(Q(J),D);if(Y.wildcardConflict.length>0)return[{id:"ios/wildcard-profile-targets",severity:"error",title:"Sorry, multiple matching wildcard provisioning profiles are not supported",detail:`targets: ${Y.wildcardConflict.map((Z)=>`${Z.targetNames.join("/")} (${Z.bundleId})`).join(", ")}`,fix:"Remove or replace the conflicting wildcard profiles in the saved map, then retry"}];if(!Y.wildcardReuse)return[];return[{id:"ios/wildcard-profile-targets",severity:"error",title:`${Y.wildcardReuse.targets.length} target bundle id(s) can reuse a saved wildcard provisioning profile`,detail:`targets: ${Y.wildcardReuse.targets.map((Z)=>`${Z.targetNames.join("/")} (${Z.bundleId})`).join(", ")}`,fix:"Run npx @capgo/cli@latest build credentials ios-provisioning to confirm and update the map"}]}}});function mB($){return $.config?.server}function uu($){let D=mB($)?.url;return typeof D==="string"&&D!==""?D:null}function HE$($){if(qE$.test($))return"points at localhost / 127.0.0.1";if(WE$.test($))return"points at a private LAN IP (live-reload)";if(UE$.test($))return"points at a dev tunnel host (ngrok / cloudflare / localtunnel)";if(/^http:\/\//i.test($))return"uses cleartext http://";return null}function KE$($){if($==="*")return!0;return/^\*\.[a-z0-9-]+$/i.test($)}function pN0($){let D=mB($)?.allowNavigation;if(!Array.isArray(D))return[];return D.filter((Q)=>typeof Q==="string"&&KE$(Q))}var WE$,qE$,UE$,rN0,oN0,tN0;var aN0=o(()=>{WE$=/^https?:\/\/(?:10\.|172\.(?:1[6-9]|2\d|3[01])\.|192\.168\.)/i,qE$=/^https?:\/\/(?:localhost|127\.0\.0\.1)(?:[:/]|$)/i,UE$=/^https?:\/\/[^/]*\.(?:ngrok\.io|ngrok-free\.app|trycloudflare\.com|loca\.lt)(?:[:/]|$)/i;rN0={id:"ios/capacitor-server-url-shipped",platforms:["ios"],appliesTo:($)=>uu($)!==null,async run($){let D=uu($);if(D===null)return[];let Q=y4($),X=HE$(D),J=X?`server.url ${X} — this ships a live-reload/remote endpoint into the build`:"server.url ships a remote endpoint into the build instead of the bundled web assets";return[{id:"ios/capacitor-server-url-shipped",severity:Q?"error":"warning",title:"capacitor.config server.url is set — the build will load a remote URL instead of bundled assets",detail:J,fix:"Remove the server.url live-reload block before a production build; build web assets and run `npx cap sync`"}]}},oN0={id:"ios/capacitor-server-cleartext",platforms:["ios"],appliesTo:($)=>mB($)?.cleartext===!0,async run($){if(mB($)?.cleartext!==!0)return[];let D=uu($),Q=D!==null&&/^http:\/\//i.test(D);return[{id:"ios/capacitor-server-cleartext",severity:Q?"error":"warning",title:"capacitor.config server.cleartext is enabled — arbitrary cleartext HTTP traffic is allowed",detail:Q?"paired with a cleartext http:// server.url":void 0,fix:"Remove server.cleartext (or set it false) for production; use https or a scoped ATS exception"}]}};tN0={id:"ios/capacitor-allow-navigation-wildcard",platforms:["ios"],appliesTo:($)=>pN0($).length>0,async run($){let D=pN0($);if(D.length===0)return[];return[{id:"ios/capacitor-allow-navigation-wildcard",severity:"warning",title:"capacitor.config server.allowNavigation contains a blanket wildcard",detail:`wildcard entr(y/ies): ${D.join(", ")}`,fix:'Restrict allowNavigation to specific hosts; remove blanket "*" / "*.<tld>" entries'}]}}});function OE$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function VE$($){return $.match(/buildSettings\s*=\s*\{([\s\S]*?)\n\s*\};/)?.[1]??""}function ME$($){let D={};for(let Q of $.split(`
460
- `)){let X=Q.match(/^\s*([A-Z0-9_]+(?:\[[^\]]*\])?)\s*=\s*(.+?);\s*$/i);if(!X)continue;let J=X[1],Y=X[2].trim();if(Y.startsWith("("))continue;if(Y.length>=2&&Y.startsWith('"')&&Y.endsWith('"'))Y=Y.slice(1,-1);D[J]=Y}return D}function hu($){if(!$)return[];let D=/(\w+)\s*\/\*[^*]*\*\/\s*=\s*\{[^{}]*isa\s*=\s*XCBuildConfiguration;(?:[^{}]*\{[^}]*\})*[^}]*\}/g,Q=[];for(let X of $.matchAll(D)){let J=X[0],Y=X[1],Z=J.match(/\bname\s*=\s*("[^"]*"|[^;\s]+)\s*;/),F=Z?Z[1].replace(/^"|"$/g,""):"";Q.push({id:Y,name:F,settings:ME$(VE$(J))})}return Q}function LE$($){let D=$.match(/isa\s*=\s*PBXProject;[\s\S]*?buildConfigurationList\s*=\s*(\w+)/)?.[1];if(!D)return new Set;return sN0($,D)}function sN0($,D){let Q=new RegExp(`${OE$(D)}\\s*\\/\\*[^*]*\\*\\/\\s*=\\s*\\{[^}]*isa\\s*=\\s*XCConfigurationList;[^}]*\\}`),X=$.match(Q)?.[0];if(!X)return new Set;let J=X.match(/buildConfigurations\s*=\s*\(([^)]*)\)/);if(!J)return new Set;return new Set(Array.from(J[1].matchAll(/(\w+)/g),(Y)=>Y[1]))}function gu($){let D=LE$($);return hu($).map((Q)=>({name:Q.name,settings:Q.settings,isProjectLevel:D.has(Q.id)}))}function dH($,D){let Q=null;for(let X of hu($)){let J=X.settings[D];if(J===void 0)continue;if(X.name==="Release")return J;if(Q===null)Q=J}return Q}function cH($,D){let Q=$.match(/^\$\(([A-Z0-9_]+)\)$/i),X=$.match(/^\$\{([A-Z0-9_]+)\}$/i),J=Q?.[1]??X?.[1];if(!J)return $;return dH(D,J)??$}function l5($){if(!$)return[];let D=qJ($);if(D.length===0)return[];let Q=new Map,X=/\w+\s*\/\*[^*]*\*\/\s*=\s*\{[^}]*isa\s*=\s*PBXNativeTarget;[^}]*\}/g;for(let Z of $.matchAll(X)){let F=Z[0],G=F.match(/\bname\s*=\s*("[^"]*"|[^;\s]+)\s*;/),W=F.match(/buildConfigurationList\s*=\s*(\w+)/);if(!G||!W)continue;Q.set(G[1].replace(/^"|"$/g,""),W[1])}let J=hu($),Y=new Map(J.map((Z)=>[Z.id,Z]));return D.map((Z)=>{let F=Q.get(Z.name),G=F?sN0($,F):new Set,W=Array.from(G).map((q)=>Y.get(q)).filter((q)=>q!==void 0).map((q)=>({name:q.name,settings:q.settings}));return{target:Z,configs:W}})}function lH($){let D=[],Q=(X)=>{if(X===void 0)return;let J=Number.parseFloat(X);if(!Number.isNaN(J))D.push(J)};for(let X of gu($))if(X.isProjectLevel)Q(X.settings.IPHONEOS_DEPLOYMENT_TARGET);for(let{target:X,configs:J}of l5($)){if(X.productType!==zE$)continue;for(let Y of J)Q(Y.settings.IPHONEOS_DEPLOYMENT_TARGET)}return D.length>0?Math.min(...D):null}var zE$="com.apple.product-type.application";var EG=o(()=>{J8()});import{existsSync as NE$,readFileSync as $20}from"node:fs";import{dirname as eN0,isAbsolute as BE$,join as wE$,resolve as RE$}from"node:path";function EE$($,D){return $.find((Q)=>Q.name==="Release")?.settings[D]??$.find((Q)=>Q.name==="Debug")?.settings[D]??$.find((Q)=>Q.settings[D]!==void 0)?.settings[D]}function AE$($,D){let Q=s7($);if(!Q)return;let X;try{X=$20(Q,"utf8")}catch{return}let J=l5(X).filter(({target:W})=>W.productType===jE$),Y=J.find(({target:W,configs:q})=>W.bundleId===D||q.some((U)=>U.settings.PRODUCT_BUNDLE_IDENTIFIER===D))??J[0],Z=Y?EE$(Y.configs,"CODE_SIGN_ENTITLEMENTS"):void 0;if(Z===void 0)return;let F=eN0(eN0(Q)),G=Z.replace(/\$\((?:SRCROOT|SOURCE_ROOT|PROJECT_DIR)\)|\$\{(?:SRCROOT|SOURCE_ROOT|PROJECT_DIR)\}/g,F);if(/\$\([^)]+\)|\$\{[^}]+\}/.test(G))return null;return BE$(G)?G:RE$(F,G)}function o9($,D){let Q=AE$($,D);if(Q===null)return null;let X=Q??wE$($,"ios","App","App","App.entitlements");if(!NE$(X))return null;try{return{raw:$20(X,"utf8")}}catch{return null}}function mu($,D){return b5($,D)}function AG($,D){return h9($,D)}function D20($,D){return VH($,D)}var jE$="com.apple.product-type.application";var Q20=o(()=>{J8();EG()});import{existsSync as IE$,readFileSync as TE$}from"node:fs";import{join as W20}from"node:path";function du($){return c5($).find((D)=>D.bundleId===($.nativeAppId??$.appId))}function SE$($){let D=W20($,"ios","App","App","Info.plist");if(!IE$(D))return!1;try{return h9(TE$(D,"utf8"),"UIBackgroundModes").includes("remote-notification")}catch{return!1}}function q20($){try{return SF($).profileEntitlements}catch{return{}}}function vE$($){return _E$.has($)||$.endsWith(".team-identifier")}function xE$($){return $==="*"||$==="$(AppIdentifierPrefix)*"||/^\$\(\w+\)\*$/.test($)||/^[A-Z0-9]{10}\.\*$/.test($)}function Y20($){if(X20.test($))return $.replace(X20,"");if(J20.test($))return $.replace(J20,"");return $}function kE$($){let D=[],Q=/<key>([\s\S]*?)<\/key>\s*<(array|string|true|false|dict|integer|real|data|date)(\/)?\s*>/g,X=Q.exec($);while(X!==null){let J=X[1].trim(),Y=X[2],Z=X[3]==="/";if(D.push({key:J,isArray:Y==="array"}),!Z&&(Y==="dict"||Y==="array")){let F=yE$($,Y,X.index+X[0].length);if(F>Q.lastIndex)Q.lastIndex=F}X=Q.exec($)}return D}function yE$($,D,Q){let X=new RegExp(`<${D}>|</${D}>`,"g");X.lastIndex=Q;let J=1;for(let Y=X.exec($);Y!==null;Y=X.exec($))if(Y[0]===`<${D}>`)J++;else if(--J===0)return X.lastIndex;return $.length}function hE$($,D){let Q=R1(W20($,"package.json"));if(Q===null)return!1;try{let X=JSON.parse(Q);return typeof{...X.devDependencies,...X.dependencies}[D]==="string"}catch{return!1}}var CE$=($)=>du($)!==void 0,PE$=($)=>o9($.projectDir,$.nativeAppId??$.appId)!==null,_E$,X20,J20,U20,H20,fE$,Z20="com.apple.developer.associated-domains",K20,F20="com.apple.security.application-groups",bE$,z20,G20="@capgo/capacitor-age-range",uE$="com.apple.developer.declared-age-range",O20;var V20=o(()=>{bU();f5();Q20();gB();_E$=new Set(["aps-environment","get-task-allow","application-identifier"]);X20=/^\$\((?:AppIdentifierPrefix|TeamIdentifierPrefix)\)/,J20=/^[A-Z0-9]{10}\./;U20={id:"ios/entitlements-vs-profile-capability",platforms:["ios"],appliesTo:($)=>CE$($)&&PE$($),async run($){let D=o9($.projectDir,$.nativeAppId??$.appId),Q=du($);if(!D||!Q)return[];let X=kE$(D.raw).filter((Y)=>!vE$(Y.key));if(X.length===0)return[];let J=[];for(let{bundleId:Y,base64:Z}of[Q]){let F=q20(Z);for(let{key:G,isArray:W}of X)if(W){let q=AG(D.raw,G),U=F[G],H=Array.isArray(U)?U:typeof U==="string"?[U]:[];if(H.some(xE$))continue;let K=new Set(H.map(Y20)),z=q.filter((O)=>!K.has(Y20(O)));if(z.length>0)J.push({id:"ios/entitlements-vs-profile-capability",severity:"error",title:`Entitlement "${G}" is not fully covered by the provisioning profile for "${Y}"`,detail:`uncovered ${G} value(s): ${z.join(", ")}`,fix:"Enable the capability for this App ID in the Apple Developer portal, regenerate the profile, and re-save credentials (or remove the unused entitlement)"})}else if(!(G in F))J.push({id:"ios/entitlements-vs-profile-capability",severity:"error",title:`Entitlement "${G}" is declared by the app but not granted by the provisioning profile for "${Y}"`,detail:`missing capability: ${G}`,fix:"Enable the capability for this App ID in the Apple Developer portal, regenerate the profile, and re-save credentials (or remove the unused entitlement)"})}return J}},H20={id:"ios/entitlements-aps-environment-vs-mode",platforms:["ios"],appliesTo:($)=>{let D=o9($.projectDir,$.nativeAppId??$.appId);return D!==null&&mu(D.raw,"aps-environment")!==null&&Boolean($.distributionMode)},async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(!D)return[];let Q=mu(D.raw,"aps-environment");if(Q===null)return[];let X=du($),J=X?q20(X.base64)["aps-environment"]:void 0,Y=typeof J==="string"&&J!==Q,Z=[];if($.distributionMode==="app_store"&&Q==="development"&&!Y){let F=SE$($.projectDir);Z.push({id:"ios/entitlements-aps-environment-vs-mode",severity:F?"error":"warning",title:'aps-environment is "development" but the build distributes to the App Store / TestFlight',detail:F?"The app declares the remote-notification background mode, so it needs a production push environment for App Store / TestFlight":"App Store and TestFlight push needs a production environment; this is the default Capacitor leftover and is harmless unless the app uses push notifications",fix:"Set aps-environment=production in App.entitlements and use a production push profile (or remove aps-environment if the app does not use push)"})}else if($.distributionMode==="ad_hoc"&&Q==="production"&&!Y)Z.push({id:"ios/entitlements-aps-environment-vs-mode",severity:"warning",title:'aps-environment is "production" for an ad_hoc build',detail:"ad_hoc builds usually use the development push environment (production is valid but uncommon)",fix:"Use aps-environment=development for ad_hoc unless you intend production APNs"});if(X&&Y)Z.push({id:"ios/entitlements-aps-environment-vs-mode",severity:"error",title:`aps-environment differs between App.entitlements and the provisioning profile for "${X.bundleId}"`,detail:`app: ${Q} — profile: ${J}`,fix:"Align aps-environment in App.entitlements with the push profile (or regenerate the profile)"});return Z}},fE$=/^(?:applinks|webcredentials|activitycontinuation|appclips):[a-z0-9.-]+(?:\?mode=(?:developer|managed))?$/i,K20={id:"ios/entitlements-associated-domains-format",platforms:["ios"],appliesTo:($)=>{let D=o9($.projectDir,$.nativeAppId??$.appId);return D!==null&&AG(D.raw,Z20).length>0},async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(!D)return[];let Q=[];for(let X of AG(D.raw,Z20)){if(/^(?:applinks|webcredentials|activitycontinuation|appclips):\*$/i.test(X))continue;if(!fE$.test(X))Q.push(X)}if(Q.length===0)return[];return[{id:"ios/entitlements-associated-domains-format",severity:"warning",title:`${Q.length} associated-domains entr(y/ies) have an invalid format`,detail:`invalid: ${Q.join(", ")}`,fix:'Use the "service:domain" form (e.g. applinks:example.com) — no scheme, path, or trailing slash'}]}},bE$=/^group\.[a-z0-9.-]+$/,z20={id:"ios/entitlements-app-groups-format",platforms:["ios"],appliesTo:($)=>{let D=o9($.projectDir,$.nativeAppId??$.appId);return D!==null&&AG(D.raw,F20).length>0},async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(!D)return[];let Q=AG(D.raw,F20).filter((X)=>!bE$.test(X));if(Q.length===0)return[];return[{id:"ios/entitlements-app-groups-format",severity:"warning",title:`${Q.length} app group identifier(s) have an invalid format`,detail:`invalid: ${Q.join(", ")}`,fix:'Name app groups "group.<reverse-dns>" (lowercase, no whitespace) and register them in the portal'}]}};O20={id:"ios/entitlements-declared-age-range",platforms:["ios"],appliesTo:($)=>hE$($.projectDir,G20)&&y4($),async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(D!==null&&D20(D.raw,uE$)===!0)return[];return[{id:"ios/entitlements-declared-age-range",severity:"warning",title:`${G20} is installed without the Declared Age Range entitlement`,detail:"The plugin calls Apple's Declared Age Range API. Without com.apple.developer.declared-age-range signed into the binary, in-app age-range requests fail.",fix:"Add com.apple.developer.declared-age-range=<true/> to App.entitlements, enable Declared Age Range on the App ID, and set CODE_SIGN_ENTITLEMENTS."}]}}});import{existsSync as gE$,readFileSync as mE$}from"node:fs";import{join as dE$}from"node:path";function M20($){let D=dE$($,...cE$);return gE$(D)?D:null}function O4($){let D=M20($);if(!D)return null;try{return mE$(D,"utf8")}catch{return null}}function nH($){return c8($)??""}function dB($){return $.startsWith("$(")||$.startsWith("${")}function lE$($){let D=$.config?.server;if(D===null||typeof D!=="object")return!1;let Q=D;return Q.cleartext===!0||typeof Q.url==="string"&&Q.url.length>0}function aE$($){let D=h9($,"UIRequiredDeviceCapabilities");if(D.length>0)return D;let Q=jb($,"UIRequiredDeviceCapabilities");if(Q===null)return[];let X=[];for(let J of Q.matchAll(/<key>([\s\S]*?)<\/key>\s*<(true|false)\s*\/>/g))if(J[2]==="true")X.push(J[1].trim());return X}function sE$($){let D=$.credentials?.CAPGO_IOS_XCODE_VERSION?.trim().replace(/^xcode\s*/i,""),Q=D?Number.parseInt(D,10):Number.NaN;return Number.isFinite(Q)?Q:null}var cE$,N8=($)=>M20($.projectDir)!==null,nE$,iE$,pE$,L20,rE$,oE$,N20,B20,w20,R20,j20,E20,A20,I20,T20,tE$,C20,P20,S20;var _20=o(()=>{J8();EG();cE$=["ios","App","App","Info.plist"];nE$=/^\d+\.\d+(?:\.\d+)?$/,iE$=/^\d+(?:\.\d+){0,2}$/,pE$=/^[a-z0-9][a-z0-9-]*(?:\.[a-z0-9-]+)+$/i,L20=["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],rE$=new Set(L20),oE$=new Set(["audio","location","voip","fetch","remote-notification","processing","bluetooth-central","bluetooth-peripheral","external-accessory","newsstand-content"]),N20={id:"ios/plist-bundle-id-format",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=b5(D,"CFBundleIdentifier");if(Q===null)return[{id:"ios/plist-bundle-id-format",severity:"error",title:"Info.plist has no CFBundleIdentifier",fix:"Set a valid reverse-DNS PRODUCT_BUNDLE_IDENTIFIER (no spaces, underscores, or wildcards)."}];let X=cH(Q,nH($.projectDir));if(dB(X))return[];if(!pE$.test(X))return[{id:"ios/plist-bundle-id-format",severity:"error",title:`Invalid bundle identifier "${X}"`,detail:"Bundle ids must be reverse-DNS (≥2 dot-separated segments) with no spaces, underscores, or wildcards.",fix:"Set a valid reverse-DNS PRODUCT_BUNDLE_IDENTIFIER (no spaces, underscores, or wildcards)."}];return[]}},B20={id:"ios/plist-version-short-format",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=b5(D,"CFBundleShortVersionString");if(Q===null)return[];let X=cH(Q,nH($.projectDir));if(dB(X))return[];if(!nE$.test(X))return[{id:"ios/plist-version-short-format",severity:"error",title:`CFBundleShortVersionString "${X}" is not a valid version (ITMS-90060)`,detail:"The marketing version must be two or three dot-separated integers (e.g. 1.4 or 1.4.2) — no letters or pre-release suffixes.",fix:"Set CFBundleShortVersionString or its build setting to two or three dot-separated integers (e.g. 1.4.2)."}];return[]}},w20={id:"ios/plist-version-build-format",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=b5(D,"CFBundleVersion");if(Q===null)return[];let X=cH(Q,nH($.projectDir));if(dB(X))return[];if(!iE$.test(X))return[{id:"ios/plist-version-build-format",severity:"error",title:`CFBundleVersion "${X}" is not a valid build number`,detail:"The build number must be numeric, ≤3 dot-separated integers (e.g. 42 or 1.4.42).",fix:"Set CURRENT_PROJECT_VERSION numeric, ≤3 integers (e.g. 42 or 1.4.42)."}];return[]}},R20={id:"ios/plist-encryption-compliance",platforms:["ios"],appliesTo:($)=>N8($)&&y4($),async run($){let D=O4($.projectDir);if(D===null)return[];if(u5(D,"ITSAppUsesNonExemptEncryption"))return[];return[{id:"ios/plist-encryption-compliance",severity:"warning",title:"Info.plist is missing ITSAppUsesNonExemptEncryption",detail:'Without this key, App Store Connect shows a "Missing Compliance" prompt on every upload.',fix:"Add ITSAppUsesNonExemptEncryption=<false/> (correct for most Capacitor apps) to stop the per-upload Missing Compliance prompt."}]}},j20={id:"ios/plist-ats-arbitrary-loads",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=jb(D,"NSAppTransportSecurity");if(Q===null)return[];if(VH(Q,"NSAllowsArbitraryLoads")!==!0)return[];let X=y4($)&&lE$($);return[{id:"ios/plist-ats-arbitrary-loads",severity:X?"error":"warning",title:"NSAllowsArbitraryLoads is enabled (App Transport Security disabled)",detail:X?"Uploading with arbitrary loads enabled and a dev server (cleartext / server.url) still configured ships an insecure release.":"NSAllowsArbitraryLoads disables App Transport Security for all hosts.",fix:"Remove NSAllowsArbitraryLoads (or set <false/>); use scoped NSExceptionDomains; remove server.url/cleartext before release."}]}},E20={id:"ios/plist-launch-storyboard",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];if(u5(D,"UILaunchStoryboardName")||u5(D,"UILaunchScreen"))return[];return[{id:"ios/plist-launch-storyboard",severity:"error",title:"Info.plist declares no launch screen (ITMS-90475/90096)",detail:"App Store upload requires a launch storyboard or a UILaunchScreen dictionary.",fix:"Add UILaunchStoryboardName=LaunchScreen (Capacitor default) or a UILaunchScreen dict."}]}},A20={id:"ios/plist-orientations-multitasking",platforms:["ios"],appliesTo($){if(!N8($))return!1;let D=O4($.projectDir);if(D===null)return!1;if(VH(D,"UIRequiresFullScreen")===!0)return!1;let Q=dH(nH($.projectDir),"TARGETED_DEVICE_FAMILY");if(Q===null)return!1;return Q.split(",").map((X)=>X.trim()).includes("2")},async run($){let D=O4($.projectDir);if(D===null)return[];let Q=h9(D,"UISupportedInterfaceOrientations~ipad");if(!u5(D,"UISupportedInterfaceOrientations~ipad"))Q=h9(D,"UISupportedInterfaceOrientations");let X=new Set(Q),J=L20.filter((Y)=>!X.has(Y));if(J.length===0)return[];return[{id:"ios/plist-orientations-multitasking",severity:"warning",title:`iPad multitasking requires all four orientations — missing ${J.join(", ")} (ITMS-90474)`,detail:"An iPad-capable app that supports multitasking must declare all four interface orientations for iPad.",fix:"Add all four orientations to UISupportedInterfaceOrientations~ipad, or add UIRequiresFullScreen=<true/>."}]}},I20={id:"ios/plist-orientations-present",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=h9(D,"UISupportedInterfaceOrientations");if(Q.length===0)return[{id:"ios/plist-orientations-present",severity:"warning",title:"Info.plist declares no UISupportedInterfaceOrientations",detail:"Declare at least one supported interface orientation for iPhone.",fix:"Declare ≥1 valid UIInterfaceOrientation* value."}];let X=Q.find((J)=>!rE$.has(J));if(X!==void 0)return[{id:"ios/plist-orientations-present",severity:"warning",title:`Invalid interface orientation "${X}"`,detail:"Each entry must be one of UIInterfaceOrientationPortrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight.",fix:"Declare ≥1 valid UIInterfaceOrientation* value."}];return[]}},T20={id:"ios/plist-display-name",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=nH($.projectDir),X=(J)=>{let Y=b5(D,J);if(Y===null)return null;let Z=cH(Y,Q);if(dB(Z)||Z.trim()==="")return null;return Z};if(X("CFBundleDisplayName")!==null||X("CFBundleName")!==null)return[];return[{id:"ios/plist-display-name",severity:"warning",title:"Info.plist has no resolvable app display name",detail:"Neither CFBundleDisplayName nor CFBundleName resolves to a non-empty value.",fix:"Set CFBundleDisplayName or ensure PRODUCT_NAME resolves."}]}},tE$=["NSLocationWhenInUseUsageDescription","NSLocationAlwaysAndWhenInUseUsageDescription","NSLocationAlwaysUsageDescription","NSLocationUsageDescription"],C20={id:"ios/plist-background-modes-sanity",platforms:["ios"],appliesTo($){if(!N8($))return!1;let D=O4($.projectDir);return D!==null&&u5(D,"UIBackgroundModes")},async run($){let D=O4($.projectDir);if(D===null)return[];let Q=h9(D,"UIBackgroundModes"),X=[],J=Q.filter((Y)=>!oE$.has(Y));if(J.length>0)X.push({id:"ios/plist-background-modes-sanity",severity:"warning",title:`Unknown UIBackgroundModes value(s): ${J.join(", ")}`,detail:"Background modes must be one of Apple's documented UIBackgroundModes tokens.",fix:"Remove unused background modes; add matching usage strings/capabilities."});if(Q.includes("location")&&y4($)){if(!tE$.some((Z)=>u5(D,Z)))X.push({id:"ios/plist-background-modes-sanity",severity:"warning",title:'UIBackgroundModes declares "location" without a location usage description (Guideline 2.5.4)',detail:"App Review rejects background location without an NSLocation*UsageDescription string.",fix:"Add the matching NSLocation*UsageDescription, or remove the location background mode."})}return X}};P20={id:"ios/plist-required-device-arm64",platforms:["ios"],appliesTo:($)=>N8($)&&y4($),async run($){let D=O4($.projectDir);if(D===null)return[];if(!u5(D,"UIRequiredDeviceCapabilities"))return[];let Q=aE$(D);if(Q.includes("arm64")||!Q.includes("armv7"))return[];return[{id:"ios/plist-required-device-arm64",severity:"warning",title:"UIRequiredDeviceCapabilities lists armv7 without arm64",detail:"Requiring only armv7 marks the binary as 32-bit. App Store installs on iOS 26+ can fail with a generic download error.",fix:"Replace armv7 with arm64 in UIRequiredDeviceCapabilities (modern iPhones are 64-bit only)."}]}};S20={id:"ios/plist-scene-lifecycle-xcode27",platforms:["ios"],appliesTo:($)=>N8($)&&(sE$($)??0)>=27,async run($){let D=O4($.projectDir);if(D===null||u5(D,"UIApplicationSceneManifest"))return[];return[{id:"ios/plist-scene-lifecycle-xcode27",severity:"error",title:"App does not adopt the UIScene lifecycle, required when building with Xcode 27",detail:"Apps built with the iOS 27 SDK crash at launch on iOS 27 without a UIApplicationSceneManifest in Info.plist and a scene delegate.",fix:"Add a SceneDelegate and a UIApplicationSceneManifest to ios/App/App/Info.plist (Capacitor supports scenes), or build with --xcode-version 26.",docsUrl:"https://developer.apple.com/documentation/uikit/specifying-the-scenes-your-app-supports"}]}}});import{readFileSync as eE$}from"node:fs";import{join as $A$}from"node:path";function iH($){try{return JSON.parse(eE$($,"utf8"))}catch{return null}}function pH($,D){let Q=(D?dH(D,"ASSETCATALOG_COMPILER_APPICON_NAME"):null)??"AppIcon";return $A$($,"ios","App","App","Assets.xcassets",`${Q}.appiconset`)}function DA$($){return($??"").trim()}function v20($){return($?.images??[]).some((D)=>DA$(D.size)==="1024x1024"||D.role==="marketing")}var x20=o(()=>{EG()});import{existsSync as RQ}from"node:fs";import{join as f4}from"node:path";function k20($){return f4($,"ios","App","Podfile")}function lu($){return f4($,"ios","App","CapApp-SPM","Package.swift")}function y20($){return RQ(k20($.projectDir))}function f20($){return $.hostPlatform==="darwin"&&y20($)}function nu($){return RQ(lu($.projectDir))}function cB($){return c8($.projectDir)}function cu($){if($.platform!=="ios")return!1;if(($.distributionMode??"app_store")!=="app_store")return!1;let Q=$.credentials;return Boolean(Q?.APPLE_KEY_ID&&Q?.APPLE_ISSUER_ID&&Q?.APPLE_KEY_CONTENT)}var b20,u20,h20,g20,m20,d20,c20,l20,QA$,n20;var i20=o(()=>{x20();EG();J8();f5();b20={id:"ios/pods-not-installed",platforms:["ios"],appliesTo:f20,async run($){let D=f4($.projectDir,"ios","App"),Q=RQ(f4(D,"Pods")),X=RQ(f4(D,"App.xcworkspace"));if(Q&&X)return[];let J=[];if(!Q)J.push("ios/App/Pods");if(!X)J.push("ios/App/App.xcworkspace");return[{id:"ios/pods-not-installed",severity:"warning",title:"CocoaPods is not installed (missing Pods/ or App.xcworkspace)",detail:`A Podfile exists but ${J.join(" and ")} ${J.length>1?"are":"is"} missing. The cloud build runs pod install and recovers, but local Xcode builds will fail.`,fix:"Run `npx cap sync ios` (or `pod install`) and commit Pods/ + App.xcworkspace."}]}},u20={id:"ios/pods-lock-missing",platforms:["ios"],appliesTo:f20,async run($){if(R1(f4($.projectDir,"ios","App","Podfile.lock"))!==null)return[];return[{id:"ios/pods-lock-missing",severity:"warning",title:"Podfile.lock is missing - pod versions are not pinned",detail:"Without Podfile.lock the cloud build resolves pod versions fresh, which can drift from your local versions.",fix:"Run `pod install` and commit Podfile.lock."}]}},h20={id:"ios/pods-capacitor-missing",platforms:["ios"],appliesTo:y20,async run($){let D=R1(k20($.projectDir));if(D===null)return[];if(/pod\s+['"]Capacitor['"]/.test(D)||/capacitor_pods/.test(D)||/@capacitor\/ios/.test(D))return[];return[{id:"ios/pods-capacitor-missing",severity:"warning",title:"Podfile does not appear to wire the Capacitor pod",detail:"No `pod 'Capacitor'`, `capacitor_pods` helper, or `@capacitor/ios` reference was found. If this is intentional (custom pod names) you can ignore this.",fix:"Run `npx cap sync ios` then `pod install`."}]}},g20={id:"ios/spm-package-resolved-missing",platforms:["ios"],appliesTo:nu,async run($){let D=f4($.projectDir,"ios","App","App.xcodeproj","project.xcworkspace","xcshareddata","swiftpm","Package.resolved"),Q=f4($.projectDir,"ios","App","CapApp-SPM","Package.resolved");if(RQ(D)||RQ(Q))return[];return[{id:"ios/spm-package-resolved-missing",severity:"warning",title:"Swift Package Manager Package.resolved is missing",detail:"No Package.resolved found under the xcodeproj or CapApp-SPM. The cloud build resolves packages during build_app, but committing Package.resolved pins versions for reproducible builds.",fix:"Run `xcodebuild -resolvePackageDependencies` (or open in Xcode) and commit Package.resolved."}]}},m20={id:"ios/spm-capacitor-dependency-missing",platforms:["ios"],appliesTo:nu,async run($){let D=R1(lu($.projectDir));if(D===null)return[];let Q=/capacitor-swift-pm/.test(D),X=/\.product\(\s*name:\s*['"]Capacitor['"]/.test(D);if(Q&&X)return[];return[{id:"ios/spm-capacitor-dependency-missing",severity:"warning",title:"Package.swift does not declare the Capacitor SPM dependency",detail:'Expected a capacitor-swift-pm package dependency and a `.product(name: "Capacitor", ...)` target dependency. If your project uses a non-standard layout you can ignore this.',fix:"Run `npx cap sync ios` to regenerate Package.swift."}]}},d20={id:"ios/appicon-empty-or-placeholder",platforms:["ios"],async run($){let D=pH($.projectDir,cB($)??void 0);if(!RQ(D))return[{id:"ios/appicon-empty-or-placeholder",severity:"error",title:"AppIcon.appiconset is missing",detail:`Expected an app-icon asset set at ${D.replace($.projectDir,".")} but the directory does not exist.`,fix:"Run `npx @capacitor/assets generate` (or add the icon set in Xcode)."}];let Q=iH(f4(D,"Contents.json"));if(Q===null)return[{id:"ios/appicon-empty-or-placeholder",severity:"error",title:"AppIcon Contents.json is missing or malformed",detail:"The app-icon Contents.json could not be parsed as JSON.",fix:"Regenerate the icon set (`npx @capacitor/assets generate`) or fix the malformed Contents.json."}];if((Q.images??[]).some((J)=>J.filename?.trim()))return[];return[{id:"ios/appicon-empty-or-placeholder",severity:cu($)?"error":"warning",title:"AppIcon.appiconset declares no icon images",detail:cu($)?"The icon set has no images - App Store upload will reject it (ITMS-90704).":"The icon set has no images. The build tolerates this for ad_hoc/development, but App Store upload would reject it.",fix:"Run `npx @capacitor/assets generate` so the set has at least the 1024x1024 icon."}]}},c20={id:"ios/appicon-referenced-file-missing",platforms:["ios"],appliesTo($){let D=pH($.projectDir,c8($.projectDir)??void 0);return iH(f4(D,"Contents.json"))!==null},async run($){let D=pH($.projectDir,cB($)??void 0),Q=iH(f4(D,"Contents.json"));if(Q===null)return[];let X=[];for(let J of Q.images??[]){let Y=J.filename?.trim();if(!Y)continue;if(!RQ(f4(D,Y)))X.push(Y)}if(X.length===0)return[];return[{id:"ios/appicon-referenced-file-missing",severity:"error",title:"AppIcon Contents.json references icon file(s) missing from disk",detail:`actool will fail the build: missing ${X.join(", ")}.`,fix:"Regenerate the icons (`npx @capacitor/assets generate`) or commit the referenced PNG(s)."}]}},l20={id:"ios/appicon-marketing-missing",platforms:["ios"],appliesTo:cu,async run($){let D=pH($.projectDir,cB($)??void 0),Q=iH(f4(D,"Contents.json"));if(Q===null)return[];if(v20(Q))return[];return[{id:"ios/appicon-marketing-missing",severity:"error",title:"App Store marketing icon (1024x1024) is missing",detail:"App Store upload requires a 1024x1024 marketing icon in the AppIcon set (ITMS-90704).",fix:"Add a 1024x1024 PNG (no alpha) marketing icon and reference it in Contents.json."}]}},QA$=/\.iOS\(\.v(\d+)\)/,n20={id:"ios/spm-deployment-target-consistency",platforms:["ios"],appliesTo($){if(!nu($))return!1;let D=c8($.projectDir);if(D===null)return!1;return lH(D)!==null},async run($){let D=cB($);if(D===null)return[];let Q=lH(D);if(Q===null)return[];let X=R1(lu($.projectDir));if(X===null)return[];let J=X.match(QA$);if(!J)return[];let Y=Number.parseFloat(J[1]);if(Number.isNaN(Y)||Q>=Y)return[];return[{id:"ios/spm-deployment-target-consistency",severity:"warning",title:"IPHONEOS_DEPLOYMENT_TARGET is below the Package.swift iOS minimum",detail:`The Xcode app target builds for iOS ${Q} but Package.swift requires iOS ${Y} (.iOS(.v${Y})).`,fix:`Raise IPHONEOS_DEPLOYMENT_TARGET to >= ${Y}, or run \`npx cap sync ios\`.`}]}}});function V4($){return c8($.projectDir)}function iu($){return qJ($).filter((D)=>D.productType===XA$)}function ZA$($){return JA$[$]??YA$}function p20($){return lH($)}function lB($,D){let Q=$.find((J)=>J.name==="Release")?.settings[D];if(Q!==void 0)return Q;let X=$.find((J)=>J.name==="Debug")?.settings[D];if(X!==void 0)return X;for(let J of $)if(J.settings[D]!==void 0)return J.settings[D];return}function o20($){let D=[];for(let{target:Q,configs:X}of l5($)){if(lB(X,"CODE_SIGN_STYLE")===void 0)continue;let Y=lB(X,"DEVELOPMENT_TEAM");if(Y===void 0||Y.trim()==="")D.push(Q.name)}return D}function FA$($){let D=[];for(let{target:Q,configs:X}of l5($)){let J=X.map((Z)=>Z.settings.PRODUCT_BUNDLE_IDENTIFIER).filter((Z)=>Z!==void 0);if(J.length<2)continue;let Y=Array.from(new Set(J));if(Y.length>=2)D.push({name:Q.name,values:Y})}return D}function t20($){return gu($).filter((D)=>D.settings.ENABLE_BITCODE==="YES").map((D)=>D.isProjectLevel?`project ${D.name}`:D.name)}function GA$($){let D=[];for(let{target:Q,configs:X}of l5($)){let J=lB(X,"SWIFT_VERSION");if(J===void 0)continue;let Y=J.match(/^\s*(\d+(?:\.\d+)?)/),Z=Y?Number.parseFloat(Y[1]):Number.NaN;if(Number.isNaN(Z)||Z<5)D.push({name:Q.name,value:J})}return D}var XA$="com.apple.product-type.application",JA$,YA$=14,a20,r20=($)=>c5($).length>0,s20,e20,$B0,DB0,QB0,XB0;var JB0=o(()=>{J8();_u();EG();gB();JA$={5:13,6:13,7:14,8:14};a20={id:"ios/xcode-deployment-target-capacitor",platforms:["ios"],appliesTo:($)=>{if(wG($.projectDir)===null)return!1;let D=V4($);return D!==null&&p20(D)!==null},async run($){let D=V4($);if(!D)return[];let Q=wG($.projectDir),X=p20(D);if(Q===null||X===null)return[];let J=ZA$(Q);if(X>=J)return[];return[{id:"ios/xcode-deployment-target-capacitor",severity:"error",title:`IPHONEOS_DEPLOYMENT_TARGET ${X} is below the Capacitor ${Q} floor (${J})`,detail:`Capacitor ${Q} requires iOS deployment target >= ${J}; the build will fail otherwise.`,fix:`Raise IPHONEOS_DEPLOYMENT_TARGET to >= ${J} (project + app target) and the Podfile platform line if present.`}]}};s20={id:"ios/xcode-signing-team",platforms:["ios"],appliesTo:($)=>{if(r20($))return!1;let D=V4($);return D!==null&&o20(D).length>0},async run($){if(r20($))return[];let D=V4($);if(!D)return[];let Q=o20(D);if(Q.length===0)return[];return[{id:"ios/xcode-signing-team",severity:y4($)?"error":"warning",title:`${Q.length} signable target(s) set a code-signing style but no DEVELOPMENT_TEAM`,detail:`targets without a team: ${Q.join(", ")}`,fix:"Set DEVELOPMENT_TEAM in Xcode (Signing & Capabilities), or supply signing creds/profiles to the cloud build so it switches to managed-manual signing."}]}};e20={id:"ios/xcode-bundle-id-mismatch-across-configs",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&l5(D).some((Q)=>{return Q.configs.map((J)=>J.settings.PRODUCT_BUNDLE_IDENTIFIER).filter((J)=>J!==void 0).length>=2})},async run($){let D=V4($);if(!D)return[];let Q=FA$(D);if(Q.length===0)return[];return[{id:"ios/xcode-bundle-id-mismatch-across-configs",severity:"warning",title:`PRODUCT_BUNDLE_IDENTIFIER differs across build configs in ${Q.length} target(s)`,detail:Q.map((X)=>`${X.name}: ${X.values.join(" vs ")}`).join("; "),fix:"Align PRODUCT_BUNDLE_IDENTIFIER across Debug/Release (or ignore if a Debug suffix is intentional)."}]}};$B0={id:"ios/xcode-enable-bitcode-leftover",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&t20(D).length>0},async run($){let D=V4($);if(!D)return[];let Q=t20(D);if(Q.length===0)return[];return[{id:"ios/xcode-enable-bitcode-leftover",severity:"warning",title:"ENABLE_BITCODE = YES is set (deprecated since Xcode 14)",detail:`present in: ${Q.join(", ")}`,fix:"Set ENABLE_BITCODE = NO or delete it — Xcode 14+ ignores bitcode and Apple no longer accepts it."}]}};DB0={id:"ios/xcode-swift-version-sanity",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&l5(D).some((Q)=>lB(Q.configs,"SWIFT_VERSION")!==void 0)},async run($){let D=V4($);if(!D)return[];let Q=GA$(D);if(Q.length===0)return[];return[{id:"ios/xcode-swift-version-sanity",severity:"warning",title:`SWIFT_VERSION is below 5 (or unparseable) in ${Q.length} target(s)`,detail:Q.map((X)=>`${X.name}: ${X.value}`).join("; "),fix:"Set SWIFT_VERSION = 5.0 (or your intended Swift >= 5) for the affected target(s)."}]}},QB0={id:"ios/xcode-no-app-target",platforms:["ios"],appliesTo:($)=>V4($)!==null,async run($){let D=V4($);if(!D)return[];if(iu(D).length>0)return[];return[{id:"ios/xcode-no-app-target",severity:"error",title:"No application target found in the Xcode project",detail:"The pbxproj parsed but contains no com.apple.product-type.application target — the build has nothing to archive.",fix:"Run `npx cap sync ios`, or restore the application target in Xcode."}]}},XB0={id:"ios/xcode-multiple-app-targets",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&iu(D).length>1},async run($){let D=V4($);if(!D)return[];let Q=iu(D);if(Q.length<=1)return[];return[{id:"ios/xcode-multiple-app-targets",severity:"warning",title:`${Q.length} application targets found — the build may sign/archive the wrong one`,detail:`app targets: ${Q.map((X)=>`${X.name} (${X.bundleId})`).join(", ")}`,fix:"Keep a single application target, remove the duplicate, or pass the intended scheme to the build."}]}}});import{createRequire as WA$}from"node:module";import{existsSync as IG}from"node:fs";import{dirname as qA$,join as t9}from"node:path";function UA$($){let D=R1(t9($,"package.json"));if(!D)return[];let Q;try{Q=JSON.parse(D)}catch{return[]}let X=new Set(["@capacitor/core","@capacitor/cli","@capacitor/ios","@capacitor/android","@capacitor/assets","@capacitor/synapse"]);return Object.keys(Q.dependencies??{}).filter((J)=>J.startsWith("@capacitor/")&&!X.has(J))}function HA$($){return $.replace(/^@/,"").replace(/\//g,"-")}function KA$($,D){try{let X=WA$(t9($,"package.json")).resolve(`${D}/package.json`);return IG(t9(qA$(X),"android"))}catch{return!1}}var YB0,ZB0,FB0;var GB0=o(()=>{f5();YB0={id:"shared/cap-sync-stale",platforms:["ios","android"],async run($){let D=[],Q=$.config?.webDir??"dist";if(!IG(t9($.projectDir,Q)))return D.push({id:"shared/cap-sync-stale",severity:"error",title:`webDir "${Q}" does not exist — web assets were never built`,fix:"Run your web build (e.g. `npm run build`) then `npx cap sync` before requesting a build"}),D;let X=UA$($.projectDir),J=X.filter((Z)=>KA$($.projectDir,Z)),Y=MJ($.config,$.platform);if($.platform==="android"&&J.length>0){let Z=R1(t9($.projectDir,Y,"capacitor.settings.gradle"));if(Z===null)D.push({id:"shared/cap-sync-stale",severity:"error",title:`${Y}/capacitor.settings.gradle is missing — \`npx cap sync android\` was never run`,fix:"Run `npx cap sync android`"});else{let F=J.filter((G)=>!Z.includes(`:${HA$(G)}`));if(F.length>0)D.push({id:"shared/cap-sync-stale",severity:"error",title:`${F.length} Capacitor plugin(s) not synced into the Android project`,detail:`missing from capacitor.settings.gradle: ${F.join(", ")}`,fix:"Run `npx cap sync android` (sync, not copy — copy does not regenerate plugin projects)"})}}if($.platform==="ios"&&X.length>0){let Z=IG(t9($.projectDir,Y,"App","Podfile")),F=IG(t9($.projectDir,Y,"App","CapApp-SPM","Package.swift"));if(!Z&&!F)D.push({id:"shared/cap-sync-stale",severity:"error",title:`${Y}/App sync artifacts are missing — \`npx cap sync ios\` was never run`,detail:`expected ${Y}/App/Podfile (CocoaPods) or ${Y}/App/CapApp-SPM/Package.swift (SPM)`,fix:"Run `npx cap sync ios`"})}return D}},ZB0={id:"shared/node-linker-layout",platforms:["ios","android"],async run($){let D=t9($.projectDir,"node_modules");if(IG(t9(D,".bun")))return[{id:"shared/node-linker-layout",severity:"error",title:'bun isolated node_modules layout detected — Capacitor Gradle/Pod paths will not resolve ("No variants exist")',fix:"Reinstall with `bun install --linker=hoisted`"}];if(IG(t9(D,".pnpm")))return[{id:"shared/node-linker-layout",severity:"warning",title:"pnpm symlinked node_modules layout detected — Capacitor native builds often need a hoisted layout",fix:"If the build fails resolving @capacitor/* paths, set `node-linker=hoisted` in .npmrc and reinstall"}];return[]}},FB0={id:"shared/bundle-id-consistency",platforms:["ios","android"],async run($){let D=$.config?.appId??$.appId;if($.platform==="android"){let Z=OH($.projectDir);if(Z&&Z!==D)return[{id:"shared/bundle-id-consistency",severity:"warning",title:"Gradle applicationId differs from the Capacitor appId",detail:`capacitor.config appId: ${D} — android/app/build.gradle applicationId: ${Z}`,fix:"Align them (or pass the intended appId explicitly to `build request`)"}];return[]}let{findSignableTargets:Q,readPbxproj:X}=await Promise.resolve().then(() => (J8(),hU)),J=X($.projectDir);if(!J)return[];let Y=Q(J);if(Y.length>0&&!Y.some((Z)=>Z.bundleId===D))return[{id:"shared/bundle-id-consistency",severity:"warning",title:"No Xcode target uses the Capacitor appId as its bundle identifier",detail:`capacitor appId: ${D} — targets: ${Y.map((Z)=>`${Z.name}=${Z.bundleId}`).join(", ")}`,fix:"Align PRODUCT_BUNDLE_IDENTIFIER with the appId, or build with the intended appId"}];return[]}}});var WB0,qB0;var UB0=o(()=>{WB0={id:"shared/apikey-permission",platforms:["ios","android"],remote:!0,async run($){let{data:D,error:Q}=await $.supabase.rpc("cli_check_permission",{apikey:$.apikey??"",permission_key:"app.build_native",org_id:null,app_id:$.appId,channel_id:null});if(Q)return[{id:"shared/apikey-permission",severity:"info",title:"Could not verify Capgo build permission (network/API error)",detail:Q.message}];if(D!==!0)return[{id:"shared/apikey-permission",severity:"error",title:`Capgo could not authorize app.build_native for ${$.appId}`,detail:"Capgo could not authorize the requested permission for this API key and app.",fix:"Use a Capgo apikey from the org that owns the app (role with native-build rights), or fix the appId"}];return[]}},qB0={id:"shared/app-exists",platforms:["ios","android"],remote:!0,async run($){let{data:D,error:Q}=await $.supabase.from("apps").select("app_id").eq("app_id",$.appId).maybeSingle();if(Q)return[{id:"shared/app-exists",severity:"info",title:"Could not verify app existence (network/API error)",detail:Q.message}];if(!D)return[{id:"shared/app-exists",severity:"error",title:`Capgo: app ${$.appId} is not visible to this Capgo API key`,detail:"Either the app does not exist in Capgo or it belongs to an org this Capgo key cannot access.",fix:`Create it (npx @capgo/cli@latest app add ${$.appId}) or pass the right appId / Capgo apikey`}];return[]}}});var TG=j((pu,KB0)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var nB=X0("buffer"),a9=nB.Buffer;function HB0($,D){for(var Q in $)D[Q]=$[Q]}if(a9.from&&a9.alloc&&a9.allocUnsafe&&a9.allocUnsafeSlow)KB0.exports=nB;else HB0(nB,pu),pu.Buffer=PJ;function PJ($,D,Q){return a9($,D,Q)}PJ.prototype=Object.create(a9.prototype);HB0(a9,PJ);PJ.from=function($,D,Q){if(typeof $==="number")throw TypeError("Argument must not be a number");return a9($,D,Q)};PJ.alloc=function($,D,Q){if(typeof $!=="number")throw TypeError("Argument must be a number");var X=a9($);if(D!==void 0)if(typeof Q==="string")X.fill(D,Q);else X.fill(D);else X.fill(0);return X};PJ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return a9($)};PJ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return nB.SlowBuffer($)}});var ru=j((fX1,zB0)=>{var iB=TG().Buffer,zA$=X0("stream"),OA$=X0("util");function pB($){if(this.buffer=null,this.writable=!0,this.readable=!0,!$)return this.buffer=iB.alloc(0),this;if(typeof $.pipe==="function")return this.buffer=iB.alloc(0),$.pipe(this),this;if($.length||typeof $==="object")return this.buffer=$,this.writable=!1,process.nextTick(function(){this.emit("end",$),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof $+")")}OA$.inherits(pB,zA$);pB.prototype.write=function(D){this.buffer=iB.concat([this.buffer,iB.from(D)]),this.emit("data",D)};pB.prototype.end=function(D){if(D)this.write(D);this.emit("end",D),this.emit("close"),this.writable=!1,this.readable=!1};zB0.exports=pB});var VB0=j((bX1,OB0)=>{function ou($){var D=($/8|0)+($%8===0?0:1);return D}var VA$={ES256:ou(256),ES384:ou(384),ES512:ou(521)};function MA$($){var D=VA$[$];if(D)return D;throw Error('Unknown algorithm "'+$+'"')}OB0.exports=MA$});var jB0=j((uX1,RB0)=>{var rB=TG().Buffer,LB0=VB0(),oB=128,NB0=0,LA$=32,NA$=16,BA$=2,BB0=NA$|LA$|NB0<<6,tB=BA$|NB0<<6;function wA$($){return $.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function wB0($){if(rB.isBuffer($))return $;else if(typeof $==="string")return rB.from($,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function RA$($,D){$=wB0($);var Q=LB0(D),X=Q+1,J=$.length,Y=0;if($[Y++]!==BB0)throw Error('Could not find expected "seq"');var Z=$[Y++];if(Z===(oB|1))Z=$[Y++];if(J-Y<Z)throw Error('"seq" specified length of "'+Z+'", only "'+(J-Y)+'" remaining');if($[Y++]!==tB)throw Error('Could not find expected "int" for "r"');var F=$[Y++];if(J-Y-2<F)throw Error('"r" specified length of "'+F+'", only "'+(J-Y-2)+'" available');if(X<F)throw Error('"r" specified length of "'+F+'", max of "'+X+'" is acceptable');var G=Y;if(Y+=F,$[Y++]!==tB)throw Error('Could not find expected "int" for "s"');var W=$[Y++];if(J-Y!==W)throw Error('"s" specified length of "'+W+'", expected "'+(J-Y)+'"');if(X<W)throw Error('"s" specified length of "'+W+'", max of "'+X+'" is acceptable');var q=Y;if(Y+=W,Y!==J)throw Error('Expected to consume entire buffer, but "'+(J-Y)+'" bytes remain');var U=Q-F,H=Q-W,K=rB.allocUnsafe(U+F+H+W);for(Y=0;Y<U;++Y)K[Y]=0;$.copy(K,Y,G+Math.max(-U,0),G+F),Y=Q;for(var z=Y;Y<z+H;++Y)K[Y]=0;return $.copy(K,Y,q+Math.max(-H,0),q+W),K=K.toString("base64"),K=wA$(K),K}function MB0($,D,Q){var X=0;while(D+X<Q&&$[D+X]===0)++X;var J=$[D+X]>=oB;if(J)--X;return X}function jA$($,D){$=wB0($);var Q=LB0(D),X=$.length;if(X!==Q*2)throw TypeError('"'+D+'" signatures must be "'+Q*2+'" bytes, saw "'+X+'"');var J=MB0($,0,Q),Y=MB0($,Q,$.length),Z=Q-J,F=Q-Y,G=2+Z+1+1+F,W=G<oB,q=rB.allocUnsafe((W?2:3)+G),U=0;if(q[U++]=BB0,W)q[U++]=G;else q[U++]=oB|1,q[U++]=G&255;if(q[U++]=tB,q[U++]=Z,J<0)q[U++]=0,U+=$.copy(q,U,0,Q);else U+=$.copy(q,U,J,Q);if(q[U++]=tB,q[U++]=F,Y<0)q[U++]=0,$.copy(q,U,Q);else $.copy(q,U,Q+Y);return q}RB0.exports={derToJose:RA$,joseToDer:jA$}});var AB0=j((hX1,EB0)=>{var rH=X0("buffer").Buffer,tu=X0("buffer").SlowBuffer;EB0.exports=aB;function aB($,D){if(!rH.isBuffer($)||!rH.isBuffer(D))return!1;if($.length!==D.length)return!1;var Q=0;for(var X=0;X<$.length;X++)Q|=$[X]^D[X];return Q===0}aB.install=function(){rH.prototype.equal=tu.prototype.equal=function(D){return aB(this,D)}};var EA$=rH.prototype.equal,AA$=tu.prototype.equal;aB.restore=function(){rH.prototype.equal=EA$,tu.prototype.equal=AA$}});var $h=j((gX1,kB0)=>{var PG=TG().Buffer,B8=X0("crypto"),TB0=jB0(),IB0=X0("util"),IA$=`"%s" is not a valid algorithm.
460
+ `)){let X=Q.match(/^\s*([A-Z0-9_]+(?:\[[^\]]*\])?)\s*=\s*(.+?);\s*$/i);if(!X)continue;let J=X[1],Y=X[2].trim();if(Y.startsWith("("))continue;if(Y.length>=2&&Y.startsWith('"')&&Y.endsWith('"'))Y=Y.slice(1,-1);D[J]=Y}return D}function hu($){if(!$)return[];let D=/(\w+)\s*\/\*[^*]*\*\/\s*=\s*\{[^{}]*isa\s*=\s*XCBuildConfiguration;(?:[^{}]*\{[^}]*\})*[^}]*\}/g,Q=[];for(let X of $.matchAll(D)){let J=X[0],Y=X[1],Z=J.match(/\bname\s*=\s*("[^"]*"|[^;\s]+)\s*;/),F=Z?Z[1].replace(/^"|"$/g,""):"";Q.push({id:Y,name:F,settings:ME$(VE$(J))})}return Q}function LE$($){let D=$.match(/isa\s*=\s*PBXProject;[\s\S]*?buildConfigurationList\s*=\s*(\w+)/)?.[1];if(!D)return new Set;return sN0($,D)}function sN0($,D){let Q=new RegExp(`${OE$(D)}\\s*\\/\\*[^*]*\\*\\/\\s*=\\s*\\{[^}]*isa\\s*=\\s*XCConfigurationList;[^}]*\\}`),X=$.match(Q)?.[0];if(!X)return new Set;let J=X.match(/buildConfigurations\s*=\s*\(([^)]*)\)/);if(!J)return new Set;return new Set(Array.from(J[1].matchAll(/(\w+)/g),(Y)=>Y[1]))}function gu($){let D=LE$($);return hu($).map((Q)=>({name:Q.name,settings:Q.settings,isProjectLevel:D.has(Q.id)}))}function dH($,D){let Q=null;for(let X of hu($)){let J=X.settings[D];if(J===void 0)continue;if(X.name==="Release")return J;if(Q===null)Q=J}return Q}function cH($,D){let Q=$.match(/^\$\(([A-Z0-9_]+)\)$/i),X=$.match(/^\$\{([A-Z0-9_]+)\}$/i),J=Q?.[1]??X?.[1];if(!J)return $;return dH(D,J)??$}function l5($){if(!$)return[];let D=qJ($);if(D.length===0)return[];let Q=new Map,X=/\w+\s*\/\*[^*]*\*\/\s*=\s*\{[^}]*isa\s*=\s*PBXNativeTarget;[^}]*\}/g;for(let Z of $.matchAll(X)){let F=Z[0],G=F.match(/\bname\s*=\s*("[^"]*"|[^;\s]+)\s*;/),W=F.match(/buildConfigurationList\s*=\s*(\w+)/);if(!G||!W)continue;Q.set(G[1].replace(/^"|"$/g,""),W[1])}let J=hu($),Y=new Map(J.map((Z)=>[Z.id,Z]));return D.map((Z)=>{let F=Q.get(Z.name),G=F?sN0($,F):new Set,W=Array.from(G).map((q)=>Y.get(q)).filter((q)=>q!==void 0).map((q)=>({name:q.name,settings:q.settings}));return{target:Z,configs:W}})}function lH($){let D=[],Q=(X)=>{if(X===void 0)return;let J=Number.parseFloat(X);if(!Number.isNaN(J))D.push(J)};for(let X of gu($))if(X.isProjectLevel)Q(X.settings.IPHONEOS_DEPLOYMENT_TARGET);for(let{target:X,configs:J}of l5($)){if(X.productType!==zE$)continue;for(let Y of J)Q(Y.settings.IPHONEOS_DEPLOYMENT_TARGET)}return D.length>0?Math.min(...D):null}var zE$="com.apple.product-type.application";var EG=o(()=>{J8()});import{existsSync as NE$,readFileSync as $20}from"node:fs";import{dirname as eN0,isAbsolute as BE$,join as wE$,resolve as RE$}from"node:path";function EE$($,D){return $.find((Q)=>Q.name==="Release")?.settings[D]??$.find((Q)=>Q.name==="Debug")?.settings[D]??$.find((Q)=>Q.settings[D]!==void 0)?.settings[D]}function AE$($,D){let Q=s7($);if(!Q)return;let X;try{X=$20(Q,"utf8")}catch{return}let J=l5(X).filter(({target:W})=>W.productType===jE$),Y=J.find(({target:W,configs:q})=>W.bundleId===D||q.some((U)=>U.settings.PRODUCT_BUNDLE_IDENTIFIER===D))??J[0],Z=Y?EE$(Y.configs,"CODE_SIGN_ENTITLEMENTS"):void 0;if(Z===void 0)return;let F=eN0(eN0(Q)),G=Z.replace(/\$\((?:SRCROOT|SOURCE_ROOT|PROJECT_DIR)\)|\$\{(?:SRCROOT|SOURCE_ROOT|PROJECT_DIR)\}/g,F);if(/\$\([^)]+\)|\$\{[^}]+\}/.test(G))return null;return BE$(G)?G:RE$(F,G)}function o9($,D){let Q=AE$($,D);if(Q===null)return null;let X=Q??wE$($,"ios","App","App","App.entitlements");if(!NE$(X))return null;try{return{raw:$20(X,"utf8")}}catch{return null}}function mu($,D){return b5($,D)}function AG($,D){return h9($,D)}function D20($,D){return VH($,D)}var jE$="com.apple.product-type.application";var Q20=o(()=>{J8();EG()});import{existsSync as IE$,readFileSync as TE$}from"node:fs";import{join as W20}from"node:path";function du($){return c5($).find((D)=>D.bundleId===($.nativeAppId??$.appId))}function SE$($){let D=W20($,"ios","App","App","Info.plist");if(!IE$(D))return!1;try{return h9(TE$(D,"utf8"),"UIBackgroundModes").includes("remote-notification")}catch{return!1}}function q20($){try{return SF($).profileEntitlements}catch{return{}}}function vE$($){return _E$.has($)||$.endsWith(".team-identifier")}function xE$($){return $==="*"||$==="$(AppIdentifierPrefix)*"||/^\$\(\w+\)\*$/.test($)||/^[A-Z0-9]{10}\.\*$/.test($)}function Y20($){if(X20.test($))return $.replace(X20,"");if(J20.test($))return $.replace(J20,"");return $}function kE$($){let D=[],Q=/<key>([\s\S]*?)<\/key>\s*<(array|string|true|false|dict|integer|real|data|date)(\/)?\s*>/g,X=Q.exec($);while(X!==null){let J=X[1].trim(),Y=X[2],Z=X[3]==="/";if(D.push({key:J,isArray:Y==="array"}),!Z&&(Y==="dict"||Y==="array")){let F=yE$($,Y,X.index+X[0].length);if(F>Q.lastIndex)Q.lastIndex=F}X=Q.exec($)}return D}function yE$($,D,Q){let X=new RegExp(`<${D}>|</${D}>`,"g");X.lastIndex=Q;let J=1;for(let Y=X.exec($);Y!==null;Y=X.exec($))if(Y[0]===`<${D}>`)J++;else if(--J===0)return X.lastIndex;return $.length}function hE$($,D){let Q=R1(W20($,"package.json"));if(Q===null)return!1;try{let X=JSON.parse(Q);return typeof{...X.devDependencies,...X.dependencies}[D]==="string"}catch{return!1}}var CE$=($)=>du($)!==void 0,PE$=($)=>o9($.projectDir,$.nativeAppId??$.appId)!==null,_E$,X20,J20,U20,H20,fE$,Z20="com.apple.developer.associated-domains",K20,F20="com.apple.security.application-groups",bE$,z20,G20="@capgo/capacitor-age-range",uE$="com.apple.developer.declared-age-range",O20;var V20=o(()=>{bU();f5();Q20();gB();_E$=new Set(["aps-environment","get-task-allow","application-identifier"]);X20=/^\$\((?:AppIdentifierPrefix|TeamIdentifierPrefix)\)/,J20=/^[A-Z0-9]{10}\./;U20={id:"ios/entitlements-vs-profile-capability",platforms:["ios"],appliesTo:($)=>CE$($)&&PE$($),async run($){let D=o9($.projectDir,$.nativeAppId??$.appId),Q=du($);if(!D||!Q)return[];let X=kE$(D.raw).filter((Y)=>!vE$(Y.key));if(X.length===0)return[];let J=[];for(let{bundleId:Y,base64:Z}of[Q]){let F=q20(Z);for(let{key:G,isArray:W}of X)if(W){let q=AG(D.raw,G),U=F[G],H=Array.isArray(U)?U:typeof U==="string"?[U]:[];if(H.some(xE$))continue;let K=new Set(H.map(Y20)),z=q.filter((O)=>!K.has(Y20(O)));if(z.length>0)J.push({id:"ios/entitlements-vs-profile-capability",severity:"error",title:`Entitlement "${G}" is not fully covered by the provisioning profile for "${Y}"`,detail:`uncovered ${G} value(s): ${z.join(", ")}`,fix:"Enable the capability for this App ID in the Apple Developer portal, regenerate the profile, and re-save credentials (or remove the unused entitlement)"})}else if(!(G in F))J.push({id:"ios/entitlements-vs-profile-capability",severity:"error",title:`Entitlement "${G}" is declared by the app but not granted by the provisioning profile for "${Y}"`,detail:`missing capability: ${G}`,fix:"Enable the capability for this App ID in the Apple Developer portal, regenerate the profile, and re-save credentials (or remove the unused entitlement)"})}return J}},H20={id:"ios/entitlements-aps-environment-vs-mode",platforms:["ios"],appliesTo:($)=>{let D=o9($.projectDir,$.nativeAppId??$.appId);return D!==null&&mu(D.raw,"aps-environment")!==null&&Boolean($.distributionMode)},async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(!D)return[];let Q=mu(D.raw,"aps-environment");if(Q===null)return[];let X=du($),J=X?q20(X.base64)["aps-environment"]:void 0,Y=$.distributionMode==="app_store"&&Q==="development"&&J==="production",Z=typeof J==="string"&&J!==Q&&!Y,F=[];if($.distributionMode==="app_store"&&Q==="development"&&!Z){let G=SE$($.projectDir);F.push({id:"ios/entitlements-aps-environment-vs-mode",severity:"warning",title:'aps-environment is "development" but the build distributes to the App Store / TestFlight',detail:G?"The app declares the remote-notification background mode; the App Store export uses the distribution profile's production push environment, so make sure the App ID has the Push Notifications capability":"This is the default Capacitor leftover; the App Store export uses the distribution profile's push environment, so it is harmless unless push is misconfigured",fix:"Optionally set aps-environment=production in App.entitlements (or remove aps-environment if the app does not use push)"})}else if($.distributionMode==="ad_hoc"&&Q==="production"&&!Z)F.push({id:"ios/entitlements-aps-environment-vs-mode",severity:"warning",title:'aps-environment is "production" for an ad_hoc build',detail:"ad_hoc builds usually use the development push environment (production is valid but uncommon)",fix:"Use aps-environment=development for ad_hoc unless you intend production APNs"});if(X&&Z)F.push({id:"ios/entitlements-aps-environment-vs-mode",severity:"error",title:`aps-environment differs between App.entitlements and the provisioning profile for "${X.bundleId}"`,detail:`app: ${Q} — profile: ${J}`,fix:"Align aps-environment in App.entitlements with the push profile (or regenerate the profile)"});return F}},fE$=/^(?:applinks|webcredentials|activitycontinuation|appclips):[a-z0-9.-]+(?:\?mode=(?:developer|managed))?$/i,K20={id:"ios/entitlements-associated-domains-format",platforms:["ios"],appliesTo:($)=>{let D=o9($.projectDir,$.nativeAppId??$.appId);return D!==null&&AG(D.raw,Z20).length>0},async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(!D)return[];let Q=[];for(let X of AG(D.raw,Z20)){if(/^(?:applinks|webcredentials|activitycontinuation|appclips):\*$/i.test(X))continue;if(!fE$.test(X))Q.push(X)}if(Q.length===0)return[];return[{id:"ios/entitlements-associated-domains-format",severity:"warning",title:`${Q.length} associated-domains entr(y/ies) have an invalid format`,detail:`invalid: ${Q.join(", ")}`,fix:'Use the "service:domain" form (e.g. applinks:example.com) — no scheme, path, or trailing slash'}]}},bE$=/^group\.[a-z0-9.-]+$/,z20={id:"ios/entitlements-app-groups-format",platforms:["ios"],appliesTo:($)=>{let D=o9($.projectDir,$.nativeAppId??$.appId);return D!==null&&AG(D.raw,F20).length>0},async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(!D)return[];let Q=AG(D.raw,F20).filter((X)=>!bE$.test(X));if(Q.length===0)return[];return[{id:"ios/entitlements-app-groups-format",severity:"warning",title:`${Q.length} app group identifier(s) have an invalid format`,detail:`invalid: ${Q.join(", ")}`,fix:'Name app groups "group.<reverse-dns>" (lowercase, no whitespace) and register them in the portal'}]}};O20={id:"ios/entitlements-declared-age-range",platforms:["ios"],appliesTo:($)=>hE$($.projectDir,G20)&&y4($),async run($){let D=o9($.projectDir,$.nativeAppId??$.appId);if(D!==null&&D20(D.raw,uE$)===!0)return[];return[{id:"ios/entitlements-declared-age-range",severity:"warning",title:`${G20} is installed without the Declared Age Range entitlement`,detail:"The plugin calls Apple's Declared Age Range API. Without com.apple.developer.declared-age-range signed into the binary, in-app age-range requests fail.",fix:"Add com.apple.developer.declared-age-range=<true/> to App.entitlements, enable Declared Age Range on the App ID, and set CODE_SIGN_ENTITLEMENTS."}]}}});import{existsSync as gE$,readFileSync as mE$}from"node:fs";import{join as dE$}from"node:path";function M20($){let D=dE$($,...cE$);return gE$(D)?D:null}function O4($){let D=M20($);if(!D)return null;try{return mE$(D,"utf8")}catch{return null}}function nH($){return c8($)??""}function dB($){return $.startsWith("$(")||$.startsWith("${")}function lE$($){let D=$.config?.server;if(D===null||typeof D!=="object")return!1;let Q=D;return Q.cleartext===!0||typeof Q.url==="string"&&Q.url.length>0}function aE$($){let D=h9($,"UIRequiredDeviceCapabilities");if(D.length>0)return D;let Q=jb($,"UIRequiredDeviceCapabilities");if(Q===null)return[];let X=[];for(let J of Q.matchAll(/<key>([\s\S]*?)<\/key>\s*<(true|false)\s*\/>/g))if(J[2]==="true")X.push(J[1].trim());return X}function sE$($){let D=$.credentials?.CAPGO_IOS_XCODE_VERSION?.trim().replace(/^xcode\s*/i,""),Q=D?Number.parseInt(D,10):Number.NaN;return Number.isFinite(Q)?Q:null}var cE$,N8=($)=>M20($.projectDir)!==null,nE$,iE$,pE$,L20,rE$,oE$,N20,B20,w20,R20,j20,E20,A20,I20,T20,tE$,C20,P20,S20;var _20=o(()=>{J8();EG();cE$=["ios","App","App","Info.plist"];nE$=/^\d+\.\d+(?:\.\d+)?$/,iE$=/^\d+(?:\.\d+){0,2}$/,pE$=/^[a-z0-9][a-z0-9-]*(?:\.[a-z0-9-]+)+$/i,L20=["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],rE$=new Set(L20),oE$=new Set(["audio","location","voip","fetch","remote-notification","processing","bluetooth-central","bluetooth-peripheral","external-accessory","newsstand-content"]),N20={id:"ios/plist-bundle-id-format",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=b5(D,"CFBundleIdentifier");if(Q===null)return[{id:"ios/plist-bundle-id-format",severity:"error",title:"Info.plist has no CFBundleIdentifier",fix:"Set a valid reverse-DNS PRODUCT_BUNDLE_IDENTIFIER (no spaces, underscores, or wildcards)."}];let X=cH(Q,nH($.projectDir));if(dB(X))return[];if(!pE$.test(X))return[{id:"ios/plist-bundle-id-format",severity:"error",title:`Invalid bundle identifier "${X}"`,detail:"Bundle ids must be reverse-DNS (≥2 dot-separated segments) with no spaces, underscores, or wildcards.",fix:"Set a valid reverse-DNS PRODUCT_BUNDLE_IDENTIFIER (no spaces, underscores, or wildcards)."}];return[]}},B20={id:"ios/plist-version-short-format",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=b5(D,"CFBundleShortVersionString");if(Q===null)return[];let X=cH(Q,nH($.projectDir));if(dB(X))return[];if(!nE$.test(X))return[{id:"ios/plist-version-short-format",severity:"error",title:`CFBundleShortVersionString "${X}" is not a valid version (ITMS-90060)`,detail:"The marketing version must be two or three dot-separated integers (e.g. 1.4 or 1.4.2) — no letters or pre-release suffixes.",fix:"Set CFBundleShortVersionString or its build setting to two or three dot-separated integers (e.g. 1.4.2)."}];return[]}},w20={id:"ios/plist-version-build-format",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=b5(D,"CFBundleVersion");if(Q===null)return[];let X=cH(Q,nH($.projectDir));if(dB(X))return[];if(!iE$.test(X))return[{id:"ios/plist-version-build-format",severity:"error",title:`CFBundleVersion "${X}" is not a valid build number`,detail:"The build number must be numeric, ≤3 dot-separated integers (e.g. 42 or 1.4.42).",fix:"Set CURRENT_PROJECT_VERSION numeric, ≤3 integers (e.g. 42 or 1.4.42)."}];return[]}},R20={id:"ios/plist-encryption-compliance",platforms:["ios"],appliesTo:($)=>N8($)&&y4($),async run($){let D=O4($.projectDir);if(D===null)return[];if(u5(D,"ITSAppUsesNonExemptEncryption"))return[];return[{id:"ios/plist-encryption-compliance",severity:"warning",title:"Info.plist is missing ITSAppUsesNonExemptEncryption",detail:'Without this key, App Store Connect shows a "Missing Compliance" prompt on every upload.',fix:"Add ITSAppUsesNonExemptEncryption=<false/> (correct for most Capacitor apps) to stop the per-upload Missing Compliance prompt."}]}},j20={id:"ios/plist-ats-arbitrary-loads",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=jb(D,"NSAppTransportSecurity");if(Q===null)return[];if(VH(Q,"NSAllowsArbitraryLoads")!==!0)return[];let X=y4($)&&lE$($);return[{id:"ios/plist-ats-arbitrary-loads",severity:X?"error":"warning",title:"NSAllowsArbitraryLoads is enabled (App Transport Security disabled)",detail:X?"Uploading with arbitrary loads enabled and a dev server (cleartext / server.url) still configured ships an insecure release.":"NSAllowsArbitraryLoads disables App Transport Security for all hosts.",fix:"Remove NSAllowsArbitraryLoads (or set <false/>); use scoped NSExceptionDomains; remove server.url/cleartext before release."}]}},E20={id:"ios/plist-launch-storyboard",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];if(u5(D,"UILaunchStoryboardName")||u5(D,"UILaunchScreen"))return[];return[{id:"ios/plist-launch-storyboard",severity:"error",title:"Info.plist declares no launch screen (ITMS-90475/90096)",detail:"App Store upload requires a launch storyboard or a UILaunchScreen dictionary.",fix:"Add UILaunchStoryboardName=LaunchScreen (Capacitor default) or a UILaunchScreen dict."}]}},A20={id:"ios/plist-orientations-multitasking",platforms:["ios"],appliesTo($){if(!N8($))return!1;let D=O4($.projectDir);if(D===null)return!1;if(VH(D,"UIRequiresFullScreen")===!0)return!1;let Q=dH(nH($.projectDir),"TARGETED_DEVICE_FAMILY");if(Q===null)return!1;return Q.split(",").map((X)=>X.trim()).includes("2")},async run($){let D=O4($.projectDir);if(D===null)return[];let Q=h9(D,"UISupportedInterfaceOrientations~ipad");if(!u5(D,"UISupportedInterfaceOrientations~ipad"))Q=h9(D,"UISupportedInterfaceOrientations");let X=new Set(Q),J=L20.filter((Y)=>!X.has(Y));if(J.length===0)return[];return[{id:"ios/plist-orientations-multitasking",severity:"warning",title:`iPad multitasking requires all four orientations — missing ${J.join(", ")} (ITMS-90474)`,detail:"An iPad-capable app that supports multitasking must declare all four interface orientations for iPad.",fix:"Add all four orientations to UISupportedInterfaceOrientations~ipad, or add UIRequiresFullScreen=<true/>."}]}},I20={id:"ios/plist-orientations-present",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=h9(D,"UISupportedInterfaceOrientations");if(Q.length===0)return[{id:"ios/plist-orientations-present",severity:"warning",title:"Info.plist declares no UISupportedInterfaceOrientations",detail:"Declare at least one supported interface orientation for iPhone.",fix:"Declare ≥1 valid UIInterfaceOrientation* value."}];let X=Q.find((J)=>!rE$.has(J));if(X!==void 0)return[{id:"ios/plist-orientations-present",severity:"warning",title:`Invalid interface orientation "${X}"`,detail:"Each entry must be one of UIInterfaceOrientationPortrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight.",fix:"Declare ≥1 valid UIInterfaceOrientation* value."}];return[]}},T20={id:"ios/plist-display-name",platforms:["ios"],appliesTo:N8,async run($){let D=O4($.projectDir);if(D===null)return[];let Q=nH($.projectDir),X=(J)=>{let Y=b5(D,J);if(Y===null)return null;let Z=cH(Y,Q);if(dB(Z)||Z.trim()==="")return null;return Z};if(X("CFBundleDisplayName")!==null||X("CFBundleName")!==null)return[];return[{id:"ios/plist-display-name",severity:"warning",title:"Info.plist has no resolvable app display name",detail:"Neither CFBundleDisplayName nor CFBundleName resolves to a non-empty value.",fix:"Set CFBundleDisplayName or ensure PRODUCT_NAME resolves."}]}},tE$=["NSLocationWhenInUseUsageDescription","NSLocationAlwaysAndWhenInUseUsageDescription","NSLocationAlwaysUsageDescription","NSLocationUsageDescription"],C20={id:"ios/plist-background-modes-sanity",platforms:["ios"],appliesTo($){if(!N8($))return!1;let D=O4($.projectDir);return D!==null&&u5(D,"UIBackgroundModes")},async run($){let D=O4($.projectDir);if(D===null)return[];let Q=h9(D,"UIBackgroundModes"),X=[],J=Q.filter((Y)=>!oE$.has(Y));if(J.length>0)X.push({id:"ios/plist-background-modes-sanity",severity:"warning",title:`Unknown UIBackgroundModes value(s): ${J.join(", ")}`,detail:"Background modes must be one of Apple's documented UIBackgroundModes tokens.",fix:"Remove unused background modes; add matching usage strings/capabilities."});if(Q.includes("location")&&y4($)){if(!tE$.some((Z)=>u5(D,Z)))X.push({id:"ios/plist-background-modes-sanity",severity:"warning",title:'UIBackgroundModes declares "location" without a location usage description (Guideline 2.5.4)',detail:"App Review rejects background location without an NSLocation*UsageDescription string.",fix:"Add the matching NSLocation*UsageDescription, or remove the location background mode."})}return X}};P20={id:"ios/plist-required-device-arm64",platforms:["ios"],appliesTo:($)=>N8($)&&y4($),async run($){let D=O4($.projectDir);if(D===null)return[];if(!u5(D,"UIRequiredDeviceCapabilities"))return[];let Q=aE$(D);if(Q.includes("arm64")||!Q.includes("armv7"))return[];return[{id:"ios/plist-required-device-arm64",severity:"warning",title:"UIRequiredDeviceCapabilities lists armv7 without arm64",detail:"Requiring only armv7 marks the binary as 32-bit. App Store installs on iOS 26+ can fail with a generic download error.",fix:"Replace armv7 with arm64 in UIRequiredDeviceCapabilities (modern iPhones are 64-bit only)."}]}};S20={id:"ios/plist-scene-lifecycle-xcode27",platforms:["ios"],appliesTo:($)=>N8($)&&(sE$($)??0)>=27,async run($){let D=O4($.projectDir);if(D===null||u5(D,"UIApplicationSceneManifest"))return[];return[{id:"ios/plist-scene-lifecycle-xcode27",severity:"error",title:"App does not adopt the UIScene lifecycle, required when building with Xcode 27",detail:"Apps built with the iOS 27 SDK crash at launch on iOS 27 without a UIApplicationSceneManifest in Info.plist and a scene delegate.",fix:"Add a SceneDelegate and a UIApplicationSceneManifest to ios/App/App/Info.plist (Capacitor supports scenes), or build with --xcode-version 26.",docsUrl:"https://developer.apple.com/documentation/uikit/specifying-the-scenes-your-app-supports"}]}}});import{readFileSync as eE$}from"node:fs";import{join as $A$}from"node:path";function iH($){try{return JSON.parse(eE$($,"utf8"))}catch{return null}}function pH($,D){let Q=(D?dH(D,"ASSETCATALOG_COMPILER_APPICON_NAME"):null)??"AppIcon";return $A$($,"ios","App","App","Assets.xcassets",`${Q}.appiconset`)}function DA$($){return($??"").trim()}function v20($){return($?.images??[]).some((D)=>DA$(D.size)==="1024x1024"||D.role==="marketing")}var x20=o(()=>{EG()});import{existsSync as RQ}from"node:fs";import{join as f4}from"node:path";function k20($){return f4($,"ios","App","Podfile")}function lu($){return f4($,"ios","App","CapApp-SPM","Package.swift")}function y20($){return RQ(k20($.projectDir))}function f20($){return $.hostPlatform==="darwin"&&y20($)}function nu($){return RQ(lu($.projectDir))}function cB($){return c8($.projectDir)}function cu($){if($.platform!=="ios")return!1;if(($.distributionMode??"app_store")!=="app_store")return!1;let Q=$.credentials;return Boolean(Q?.APPLE_KEY_ID&&Q?.APPLE_ISSUER_ID&&Q?.APPLE_KEY_CONTENT)}var b20,u20,h20,g20,m20,d20,c20,l20,QA$,n20;var i20=o(()=>{x20();EG();J8();f5();b20={id:"ios/pods-not-installed",platforms:["ios"],appliesTo:f20,async run($){let D=f4($.projectDir,"ios","App"),Q=RQ(f4(D,"Pods")),X=RQ(f4(D,"App.xcworkspace"));if(Q&&X)return[];let J=[];if(!Q)J.push("ios/App/Pods");if(!X)J.push("ios/App/App.xcworkspace");return[{id:"ios/pods-not-installed",severity:"warning",title:"CocoaPods is not installed (missing Pods/ or App.xcworkspace)",detail:`A Podfile exists but ${J.join(" and ")} ${J.length>1?"are":"is"} missing. The cloud build runs pod install and recovers, but local Xcode builds will fail.`,fix:"Run `npx cap sync ios` (or `pod install`) and commit Pods/ + App.xcworkspace."}]}},u20={id:"ios/pods-lock-missing",platforms:["ios"],appliesTo:f20,async run($){if(R1(f4($.projectDir,"ios","App","Podfile.lock"))!==null)return[];return[{id:"ios/pods-lock-missing",severity:"warning",title:"Podfile.lock is missing - pod versions are not pinned",detail:"Without Podfile.lock the cloud build resolves pod versions fresh, which can drift from your local versions.",fix:"Run `pod install` and commit Podfile.lock."}]}},h20={id:"ios/pods-capacitor-missing",platforms:["ios"],appliesTo:y20,async run($){let D=R1(k20($.projectDir));if(D===null)return[];if(/pod\s+['"]Capacitor['"]/.test(D)||/capacitor_pods/.test(D)||/@capacitor\/ios/.test(D))return[];return[{id:"ios/pods-capacitor-missing",severity:"warning",title:"Podfile does not appear to wire the Capacitor pod",detail:"No `pod 'Capacitor'`, `capacitor_pods` helper, or `@capacitor/ios` reference was found. If this is intentional (custom pod names) you can ignore this.",fix:"Run `npx cap sync ios` then `pod install`."}]}},g20={id:"ios/spm-package-resolved-missing",platforms:["ios"],appliesTo:nu,async run($){let D=f4($.projectDir,"ios","App","App.xcodeproj","project.xcworkspace","xcshareddata","swiftpm","Package.resolved"),Q=f4($.projectDir,"ios","App","CapApp-SPM","Package.resolved");if(RQ(D)||RQ(Q))return[];return[{id:"ios/spm-package-resolved-missing",severity:"warning",title:"Swift Package Manager Package.resolved is missing",detail:"No Package.resolved found under the xcodeproj or CapApp-SPM. The cloud build resolves packages during build_app, but committing Package.resolved pins versions for reproducible builds.",fix:"Run `xcodebuild -resolvePackageDependencies` (or open in Xcode) and commit Package.resolved."}]}},m20={id:"ios/spm-capacitor-dependency-missing",platforms:["ios"],appliesTo:nu,async run($){let D=R1(lu($.projectDir));if(D===null)return[];let Q=/capacitor-swift-pm/.test(D),X=/\.product\(\s*name:\s*['"]Capacitor['"]/.test(D);if(Q&&X)return[];return[{id:"ios/spm-capacitor-dependency-missing",severity:"warning",title:"Package.swift does not declare the Capacitor SPM dependency",detail:'Expected a capacitor-swift-pm package dependency and a `.product(name: "Capacitor", ...)` target dependency. If your project uses a non-standard layout you can ignore this.',fix:"Run `npx cap sync ios` to regenerate Package.swift."}]}},d20={id:"ios/appicon-empty-or-placeholder",platforms:["ios"],async run($){let D=pH($.projectDir,cB($)??void 0);if(!RQ(D))return[{id:"ios/appicon-empty-or-placeholder",severity:"error",title:"AppIcon.appiconset is missing",detail:`Expected an app-icon asset set at ${D.replace($.projectDir,".")} but the directory does not exist.`,fix:"Run `npx @capacitor/assets generate` (or add the icon set in Xcode)."}];let Q=iH(f4(D,"Contents.json"));if(Q===null)return[{id:"ios/appicon-empty-or-placeholder",severity:"error",title:"AppIcon Contents.json is missing or malformed",detail:"The app-icon Contents.json could not be parsed as JSON.",fix:"Regenerate the icon set (`npx @capacitor/assets generate`) or fix the malformed Contents.json."}];if((Q.images??[]).some((J)=>J.filename?.trim()))return[];return[{id:"ios/appicon-empty-or-placeholder",severity:cu($)?"error":"warning",title:"AppIcon.appiconset declares no icon images",detail:cu($)?"The icon set has no images - App Store upload will reject it (ITMS-90704).":"The icon set has no images. The build tolerates this for ad_hoc/development, but App Store upload would reject it.",fix:"Run `npx @capacitor/assets generate` so the set has at least the 1024x1024 icon."}]}},c20={id:"ios/appicon-referenced-file-missing",platforms:["ios"],appliesTo($){let D=pH($.projectDir,c8($.projectDir)??void 0);return iH(f4(D,"Contents.json"))!==null},async run($){let D=pH($.projectDir,cB($)??void 0),Q=iH(f4(D,"Contents.json"));if(Q===null)return[];let X=[];for(let J of Q.images??[]){let Y=J.filename?.trim();if(!Y)continue;if(!RQ(f4(D,Y)))X.push(Y)}if(X.length===0)return[];return[{id:"ios/appicon-referenced-file-missing",severity:"error",title:"AppIcon Contents.json references icon file(s) missing from disk",detail:`actool will fail the build: missing ${X.join(", ")}.`,fix:"Regenerate the icons (`npx @capacitor/assets generate`) or commit the referenced PNG(s)."}]}},l20={id:"ios/appicon-marketing-missing",platforms:["ios"],appliesTo:cu,async run($){let D=pH($.projectDir,cB($)??void 0),Q=iH(f4(D,"Contents.json"));if(Q===null)return[];if(v20(Q))return[];return[{id:"ios/appicon-marketing-missing",severity:"error",title:"App Store marketing icon (1024x1024) is missing",detail:"App Store upload requires a 1024x1024 marketing icon in the AppIcon set (ITMS-90704).",fix:"Add a 1024x1024 PNG (no alpha) marketing icon and reference it in Contents.json."}]}},QA$=/\.iOS\(\.v(\d+)\)/,n20={id:"ios/spm-deployment-target-consistency",platforms:["ios"],appliesTo($){if(!nu($))return!1;let D=c8($.projectDir);if(D===null)return!1;return lH(D)!==null},async run($){let D=cB($);if(D===null)return[];let Q=lH(D);if(Q===null)return[];let X=R1(lu($.projectDir));if(X===null)return[];let J=X.match(QA$);if(!J)return[];let Y=Number.parseFloat(J[1]);if(Number.isNaN(Y)||Q>=Y)return[];return[{id:"ios/spm-deployment-target-consistency",severity:"warning",title:"IPHONEOS_DEPLOYMENT_TARGET is below the Package.swift iOS minimum",detail:`The Xcode app target builds for iOS ${Q} but Package.swift requires iOS ${Y} (.iOS(.v${Y})).`,fix:`Raise IPHONEOS_DEPLOYMENT_TARGET to >= ${Y}, or run \`npx cap sync ios\`.`}]}}});function V4($){return c8($.projectDir)}function iu($){return qJ($).filter((D)=>D.productType===XA$)}function ZA$($){return JA$[$]??YA$}function p20($){return lH($)}function lB($,D){let Q=$.find((J)=>J.name==="Release")?.settings[D];if(Q!==void 0)return Q;let X=$.find((J)=>J.name==="Debug")?.settings[D];if(X!==void 0)return X;for(let J of $)if(J.settings[D]!==void 0)return J.settings[D];return}function o20($){let D=[];for(let{target:Q,configs:X}of l5($)){if(lB(X,"CODE_SIGN_STYLE")===void 0)continue;let Y=lB(X,"DEVELOPMENT_TEAM");if(Y===void 0||Y.trim()==="")D.push(Q.name)}return D}function FA$($){let D=[];for(let{target:Q,configs:X}of l5($)){let J=X.map((Z)=>Z.settings.PRODUCT_BUNDLE_IDENTIFIER).filter((Z)=>Z!==void 0);if(J.length<2)continue;let Y=Array.from(new Set(J));if(Y.length>=2)D.push({name:Q.name,values:Y})}return D}function t20($){return gu($).filter((D)=>D.settings.ENABLE_BITCODE==="YES").map((D)=>D.isProjectLevel?`project ${D.name}`:D.name)}function GA$($){let D=[];for(let{target:Q,configs:X}of l5($)){let J=lB(X,"SWIFT_VERSION");if(J===void 0)continue;let Y=J.match(/^\s*(\d+(?:\.\d+)?)/),Z=Y?Number.parseFloat(Y[1]):Number.NaN;if(Number.isNaN(Z)||Z<5)D.push({name:Q.name,value:J})}return D}var XA$="com.apple.product-type.application",JA$,YA$=14,a20,r20=($)=>c5($).length>0,s20,e20,$B0,DB0,QB0,XB0;var JB0=o(()=>{J8();_u();EG();gB();JA$={5:13,6:13,7:14,8:14};a20={id:"ios/xcode-deployment-target-capacitor",platforms:["ios"],appliesTo:($)=>{if(wG($.projectDir)===null)return!1;let D=V4($);return D!==null&&p20(D)!==null},async run($){let D=V4($);if(!D)return[];let Q=wG($.projectDir),X=p20(D);if(Q===null||X===null)return[];let J=ZA$(Q);if(X>=J)return[];return[{id:"ios/xcode-deployment-target-capacitor",severity:"error",title:`IPHONEOS_DEPLOYMENT_TARGET ${X} is below the Capacitor ${Q} floor (${J})`,detail:`Capacitor ${Q} requires iOS deployment target >= ${J}; the build will fail otherwise.`,fix:`Raise IPHONEOS_DEPLOYMENT_TARGET to >= ${J} (project + app target) and the Podfile platform line if present.`}]}};s20={id:"ios/xcode-signing-team",platforms:["ios"],appliesTo:($)=>{if(r20($))return!1;let D=V4($);return D!==null&&o20(D).length>0},async run($){if(r20($))return[];let D=V4($);if(!D)return[];let Q=o20(D);if(Q.length===0)return[];return[{id:"ios/xcode-signing-team",severity:y4($)?"error":"warning",title:`${Q.length} signable target(s) set a code-signing style but no DEVELOPMENT_TEAM`,detail:`targets without a team: ${Q.join(", ")}`,fix:"Set DEVELOPMENT_TEAM in Xcode (Signing & Capabilities), or supply signing creds/profiles to the cloud build so it switches to managed-manual signing."}]}};e20={id:"ios/xcode-bundle-id-mismatch-across-configs",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&l5(D).some((Q)=>{return Q.configs.map((J)=>J.settings.PRODUCT_BUNDLE_IDENTIFIER).filter((J)=>J!==void 0).length>=2})},async run($){let D=V4($);if(!D)return[];let Q=FA$(D);if(Q.length===0)return[];return[{id:"ios/xcode-bundle-id-mismatch-across-configs",severity:"warning",title:`PRODUCT_BUNDLE_IDENTIFIER differs across build configs in ${Q.length} target(s)`,detail:Q.map((X)=>`${X.name}: ${X.values.join(" vs ")}`).join("; "),fix:"Align PRODUCT_BUNDLE_IDENTIFIER across Debug/Release (or ignore if a Debug suffix is intentional)."}]}};$B0={id:"ios/xcode-enable-bitcode-leftover",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&t20(D).length>0},async run($){let D=V4($);if(!D)return[];let Q=t20(D);if(Q.length===0)return[];return[{id:"ios/xcode-enable-bitcode-leftover",severity:"warning",title:"ENABLE_BITCODE = YES is set (deprecated since Xcode 14)",detail:`present in: ${Q.join(", ")}`,fix:"Set ENABLE_BITCODE = NO or delete it — Xcode 14+ ignores bitcode and Apple no longer accepts it."}]}};DB0={id:"ios/xcode-swift-version-sanity",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&l5(D).some((Q)=>lB(Q.configs,"SWIFT_VERSION")!==void 0)},async run($){let D=V4($);if(!D)return[];let Q=GA$(D);if(Q.length===0)return[];return[{id:"ios/xcode-swift-version-sanity",severity:"warning",title:`SWIFT_VERSION is below 5 (or unparseable) in ${Q.length} target(s)`,detail:Q.map((X)=>`${X.name}: ${X.value}`).join("; "),fix:"Set SWIFT_VERSION = 5.0 (or your intended Swift >= 5) for the affected target(s)."}]}},QB0={id:"ios/xcode-no-app-target",platforms:["ios"],appliesTo:($)=>V4($)!==null,async run($){let D=V4($);if(!D)return[];if(iu(D).length>0)return[];return[{id:"ios/xcode-no-app-target",severity:"error",title:"No application target found in the Xcode project",detail:"The pbxproj parsed but contains no com.apple.product-type.application target — the build has nothing to archive.",fix:"Run `npx cap sync ios`, or restore the application target in Xcode."}]}},XB0={id:"ios/xcode-multiple-app-targets",platforms:["ios"],appliesTo:($)=>{let D=V4($);return D!==null&&iu(D).length>1},async run($){let D=V4($);if(!D)return[];let Q=iu(D);if(Q.length<=1)return[];return[{id:"ios/xcode-multiple-app-targets",severity:"warning",title:`${Q.length} application targets found — the build may sign/archive the wrong one`,detail:`app targets: ${Q.map((X)=>`${X.name} (${X.bundleId})`).join(", ")}`,fix:"Keep a single application target, remove the duplicate, or pass the intended scheme to the build."}]}}});import{createRequire as WA$}from"node:module";import{existsSync as IG}from"node:fs";import{dirname as qA$,join as t9}from"node:path";function UA$($){let D=R1(t9($,"package.json"));if(!D)return[];let Q;try{Q=JSON.parse(D)}catch{return[]}let X=new Set(["@capacitor/core","@capacitor/cli","@capacitor/ios","@capacitor/android","@capacitor/assets","@capacitor/synapse"]);return Object.keys(Q.dependencies??{}).filter((J)=>J.startsWith("@capacitor/")&&!X.has(J))}function HA$($){return $.replace(/^@/,"").replace(/\//g,"-")}function KA$($,D){try{let X=WA$(t9($,"package.json")).resolve(`${D}/package.json`);return IG(t9(qA$(X),"android"))}catch{return!1}}var YB0,ZB0,FB0;var GB0=o(()=>{f5();YB0={id:"shared/cap-sync-stale",platforms:["ios","android"],async run($){let D=[],Q=$.config?.webDir??"dist";if(!IG(t9($.projectDir,Q)))return D.push({id:"shared/cap-sync-stale",severity:"error",title:`webDir "${Q}" does not exist — web assets were never built`,fix:"Run your web build (e.g. `npm run build`) then `npx cap sync` before requesting a build"}),D;let X=UA$($.projectDir),J=X.filter((Z)=>KA$($.projectDir,Z)),Y=MJ($.config,$.platform);if($.platform==="android"&&J.length>0){let Z=R1(t9($.projectDir,Y,"capacitor.settings.gradle"));if(Z===null)D.push({id:"shared/cap-sync-stale",severity:"error",title:`${Y}/capacitor.settings.gradle is missing — \`npx cap sync android\` was never run`,fix:"Run `npx cap sync android`"});else{let F=J.filter((G)=>!Z.includes(`:${HA$(G)}`));if(F.length>0)D.push({id:"shared/cap-sync-stale",severity:"error",title:`${F.length} Capacitor plugin(s) not synced into the Android project`,detail:`missing from capacitor.settings.gradle: ${F.join(", ")}`,fix:"Run `npx cap sync android` (sync, not copy — copy does not regenerate plugin projects)"})}}if($.platform==="ios"&&X.length>0){let Z=IG(t9($.projectDir,Y,"App","Podfile")),F=IG(t9($.projectDir,Y,"App","CapApp-SPM","Package.swift"));if(!Z&&!F)D.push({id:"shared/cap-sync-stale",severity:"error",title:`${Y}/App sync artifacts are missing — \`npx cap sync ios\` was never run`,detail:`expected ${Y}/App/Podfile (CocoaPods) or ${Y}/App/CapApp-SPM/Package.swift (SPM)`,fix:"Run `npx cap sync ios`"})}return D}},ZB0={id:"shared/node-linker-layout",platforms:["ios","android"],async run($){let D=t9($.projectDir,"node_modules");if(IG(t9(D,".bun")))return[{id:"shared/node-linker-layout",severity:"error",title:'bun isolated node_modules layout detected — Capacitor Gradle/Pod paths will not resolve ("No variants exist")',fix:"Reinstall with `bun install --linker=hoisted`"}];if(IG(t9(D,".pnpm")))return[{id:"shared/node-linker-layout",severity:"warning",title:"pnpm symlinked node_modules layout detected — Capacitor native builds often need a hoisted layout",fix:"If the build fails resolving @capacitor/* paths, set `node-linker=hoisted` in .npmrc and reinstall"}];return[]}},FB0={id:"shared/bundle-id-consistency",platforms:["ios","android"],async run($){let D=$.config?.appId??$.appId;if($.platform==="android"){let Z=OH($.projectDir);if(Z&&Z!==D)return[{id:"shared/bundle-id-consistency",severity:"warning",title:"Gradle applicationId differs from the Capacitor appId",detail:`capacitor.config appId: ${D} — android/app/build.gradle applicationId: ${Z}`,fix:"Align them (or pass the intended appId explicitly to `build request`)"}];return[]}let{findSignableTargets:Q,readPbxproj:X}=await Promise.resolve().then(() => (J8(),hU)),J=X($.projectDir);if(!J)return[];let Y=Q(J);if(Y.length>0&&!Y.some((Z)=>Z.bundleId===D))return[{id:"shared/bundle-id-consistency",severity:"warning",title:"No Xcode target uses the Capacitor appId as its bundle identifier",detail:`capacitor appId: ${D} — targets: ${Y.map((Z)=>`${Z.name}=${Z.bundleId}`).join(", ")}`,fix:"Align PRODUCT_BUNDLE_IDENTIFIER with the appId, or build with the intended appId"}];return[]}}});var WB0,qB0;var UB0=o(()=>{WB0={id:"shared/apikey-permission",platforms:["ios","android"],remote:!0,async run($){let{data:D,error:Q}=await $.supabase.rpc("cli_check_permission",{apikey:$.apikey??"",permission_key:"app.build_native",org_id:null,app_id:$.appId,channel_id:null});if(Q)return[{id:"shared/apikey-permission",severity:"info",title:"Could not verify Capgo build permission (network/API error)",detail:Q.message}];if(D!==!0)return[{id:"shared/apikey-permission",severity:"error",title:`Capgo could not authorize app.build_native for ${$.appId}`,detail:"Capgo could not authorize the requested permission for this API key and app.",fix:"Use a Capgo apikey from the org that owns the app (role with native-build rights), or fix the appId"}];return[]}},qB0={id:"shared/app-exists",platforms:["ios","android"],remote:!0,async run($){let{data:D,error:Q}=await $.supabase.from("apps").select("app_id").eq("app_id",$.appId).maybeSingle();if(Q)return[{id:"shared/app-exists",severity:"info",title:"Could not verify app existence (network/API error)",detail:Q.message}];if(!D)return[{id:"shared/app-exists",severity:"error",title:`Capgo: app ${$.appId} is not visible to this Capgo API key`,detail:"Either the app does not exist in Capgo or it belongs to an org this Capgo key cannot access.",fix:`Create it (npx @capgo/cli@latest app add ${$.appId}) or pass the right appId / Capgo apikey`}];return[]}}});var TG=j((pu,KB0)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var nB=X0("buffer"),a9=nB.Buffer;function HB0($,D){for(var Q in $)D[Q]=$[Q]}if(a9.from&&a9.alloc&&a9.allocUnsafe&&a9.allocUnsafeSlow)KB0.exports=nB;else HB0(nB,pu),pu.Buffer=PJ;function PJ($,D,Q){return a9($,D,Q)}PJ.prototype=Object.create(a9.prototype);HB0(a9,PJ);PJ.from=function($,D,Q){if(typeof $==="number")throw TypeError("Argument must not be a number");return a9($,D,Q)};PJ.alloc=function($,D,Q){if(typeof $!=="number")throw TypeError("Argument must be a number");var X=a9($);if(D!==void 0)if(typeof Q==="string")X.fill(D,Q);else X.fill(D);else X.fill(0);return X};PJ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return a9($)};PJ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return nB.SlowBuffer($)}});var ru=j((fX1,zB0)=>{var iB=TG().Buffer,zA$=X0("stream"),OA$=X0("util");function pB($){if(this.buffer=null,this.writable=!0,this.readable=!0,!$)return this.buffer=iB.alloc(0),this;if(typeof $.pipe==="function")return this.buffer=iB.alloc(0),$.pipe(this),this;if($.length||typeof $==="object")return this.buffer=$,this.writable=!1,process.nextTick(function(){this.emit("end",$),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof $+")")}OA$.inherits(pB,zA$);pB.prototype.write=function(D){this.buffer=iB.concat([this.buffer,iB.from(D)]),this.emit("data",D)};pB.prototype.end=function(D){if(D)this.write(D);this.emit("end",D),this.emit("close"),this.writable=!1,this.readable=!1};zB0.exports=pB});var VB0=j((bX1,OB0)=>{function ou($){var D=($/8|0)+($%8===0?0:1);return D}var VA$={ES256:ou(256),ES384:ou(384),ES512:ou(521)};function MA$($){var D=VA$[$];if(D)return D;throw Error('Unknown algorithm "'+$+'"')}OB0.exports=MA$});var jB0=j((uX1,RB0)=>{var rB=TG().Buffer,LB0=VB0(),oB=128,NB0=0,LA$=32,NA$=16,BA$=2,BB0=NA$|LA$|NB0<<6,tB=BA$|NB0<<6;function wA$($){return $.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function wB0($){if(rB.isBuffer($))return $;else if(typeof $==="string")return rB.from($,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function RA$($,D){$=wB0($);var Q=LB0(D),X=Q+1,J=$.length,Y=0;if($[Y++]!==BB0)throw Error('Could not find expected "seq"');var Z=$[Y++];if(Z===(oB|1))Z=$[Y++];if(J-Y<Z)throw Error('"seq" specified length of "'+Z+'", only "'+(J-Y)+'" remaining');if($[Y++]!==tB)throw Error('Could not find expected "int" for "r"');var F=$[Y++];if(J-Y-2<F)throw Error('"r" specified length of "'+F+'", only "'+(J-Y-2)+'" available');if(X<F)throw Error('"r" specified length of "'+F+'", max of "'+X+'" is acceptable');var G=Y;if(Y+=F,$[Y++]!==tB)throw Error('Could not find expected "int" for "s"');var W=$[Y++];if(J-Y!==W)throw Error('"s" specified length of "'+W+'", expected "'+(J-Y)+'"');if(X<W)throw Error('"s" specified length of "'+W+'", max of "'+X+'" is acceptable');var q=Y;if(Y+=W,Y!==J)throw Error('Expected to consume entire buffer, but "'+(J-Y)+'" bytes remain');var U=Q-F,H=Q-W,K=rB.allocUnsafe(U+F+H+W);for(Y=0;Y<U;++Y)K[Y]=0;$.copy(K,Y,G+Math.max(-U,0),G+F),Y=Q;for(var z=Y;Y<z+H;++Y)K[Y]=0;return $.copy(K,Y,q+Math.max(-H,0),q+W),K=K.toString("base64"),K=wA$(K),K}function MB0($,D,Q){var X=0;while(D+X<Q&&$[D+X]===0)++X;var J=$[D+X]>=oB;if(J)--X;return X}function jA$($,D){$=wB0($);var Q=LB0(D),X=$.length;if(X!==Q*2)throw TypeError('"'+D+'" signatures must be "'+Q*2+'" bytes, saw "'+X+'"');var J=MB0($,0,Q),Y=MB0($,Q,$.length),Z=Q-J,F=Q-Y,G=2+Z+1+1+F,W=G<oB,q=rB.allocUnsafe((W?2:3)+G),U=0;if(q[U++]=BB0,W)q[U++]=G;else q[U++]=oB|1,q[U++]=G&255;if(q[U++]=tB,q[U++]=Z,J<0)q[U++]=0,U+=$.copy(q,U,0,Q);else U+=$.copy(q,U,J,Q);if(q[U++]=tB,q[U++]=F,Y<0)q[U++]=0,$.copy(q,U,Q);else $.copy(q,U,Q+Y);return q}RB0.exports={derToJose:RA$,joseToDer:jA$}});var AB0=j((hX1,EB0)=>{var rH=X0("buffer").Buffer,tu=X0("buffer").SlowBuffer;EB0.exports=aB;function aB($,D){if(!rH.isBuffer($)||!rH.isBuffer(D))return!1;if($.length!==D.length)return!1;var Q=0;for(var X=0;X<$.length;X++)Q|=$[X]^D[X];return Q===0}aB.install=function(){rH.prototype.equal=tu.prototype.equal=function(D){return aB(this,D)}};var EA$=rH.prototype.equal,AA$=tu.prototype.equal;aB.restore=function(){rH.prototype.equal=EA$,tu.prototype.equal=AA$}});var $h=j((gX1,kB0)=>{var PG=TG().Buffer,B8=X0("crypto"),TB0=jB0(),IB0=X0("util"),IA$=`"%s" is not a valid algorithm.
461
461
  Supported algorithms are:
462
462
  "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,oH="secret must be a string or buffer",CG="key must be a string or a buffer",TA$="key must be a string, a buffer or an object",su=typeof B8.createPublicKey==="function";if(su)CG+=" or a KeyObject",oH+="or a KeyObject";function CB0($){if(PG.isBuffer($))return;if(typeof $==="string")return;if(!su)throw a8(CG);if(typeof $!=="object")throw a8(CG);if(typeof $.type!=="string")throw a8(CG);if(typeof $.asymmetricKeyType!=="string")throw a8(CG);if(typeof $.export!=="function")throw a8(CG)}function PB0($){if(PG.isBuffer($))return;if(typeof $==="string")return;if(typeof $==="object")return;throw a8(TA$)}function CA$($){if(PG.isBuffer($))return;if(typeof $==="string")return $;if(!su)throw a8(oH);if(typeof $!=="object")throw a8(oH);if($.type!=="secret")throw a8(oH);if(typeof $.export!=="function")throw a8(oH)}function eu($){return $.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function SB0($){$=$.toString();var D=4-$.length%4;if(D!==4)for(var Q=0;Q<D;++Q)$+="=";return $.replace(/\-/g,"+").replace(/_/g,"/")}function a8($){var D=[].slice.call(arguments,1),Q=IB0.format.bind(IB0,$).apply(null,D);return TypeError(Q)}function PA$($){return PG.isBuffer($)||typeof $==="string"}function tH($){if(!PA$($))$=JSON.stringify($);return $}function _B0($){return function(Q,X){CA$(X),Q=tH(Q);var J=B8.createHmac("sha"+$,X),Y=(J.update(Q),J.digest("base64"));return eu(Y)}}var au,SA$="timingSafeEqual"in B8?function(D,Q){if(D.byteLength!==Q.byteLength)return!1;return B8.timingSafeEqual(D,Q)}:function(D,Q){if(!au)au=AB0();return au(D,Q)};function _A$($){return function(Q,X,J){var Y=_B0($)(Q,J);return SA$(PG.from(X),PG.from(Y))}}function vB0($){return function(Q,X){PB0(X),Q=tH(Q);var J=B8.createSign("RSA-SHA"+$),Y=(J.update(Q),J.sign(X,"base64"));return eu(Y)}}function xB0($){return function(Q,X,J){CB0(J),Q=tH(Q),X=SB0(X);var Y=B8.createVerify("RSA-SHA"+$);return Y.update(Q),Y.verify(J,X,"base64")}}function vA$($){return function(Q,X){PB0(X),Q=tH(Q);var J=B8.createSign("RSA-SHA"+$),Y=(J.update(Q),J.sign({key:X,padding:B8.constants.RSA_PKCS1_PSS_PADDING,saltLength:B8.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return eu(Y)}}function xA$($){return function(Q,X,J){CB0(J),Q=tH(Q),X=SB0(X);var Y=B8.createVerify("RSA-SHA"+$);return Y.update(Q),Y.verify({key:J,padding:B8.constants.RSA_PKCS1_PSS_PADDING,saltLength:B8.constants.RSA_PSS_SALTLEN_DIGEST},X,"base64")}}function kA$($){var D=vB0($);return function(){var X=D.apply(null,arguments);return X=TB0.derToJose(X,"ES"+$),X}}function yA$($){var D=xB0($);return function(X,J,Y){J=TB0.joseToDer(J,"ES"+$).toString("base64");var Z=D(X,J,Y);return Z}}function fA$(){return function(){return""}}function bA$(){return function(D,Q){return Q===""}}kB0.exports=function(D){var Q={hs:_B0,rs:vB0,ps:vA$,es:kA$,none:fA$},X={hs:_A$,rs:xB0,ps:xA$,es:yA$,none:bA$},J=D.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!J)throw a8(IA$,D);var Y=(J[1]||J[3]).toLowerCase(),Z=J[2];return{sign:Q[Y](Z),verify:X[Y](Z)}}});var Dh=j((mX1,yB0)=>{var uA$=X0("buffer").Buffer;yB0.exports=function(D){if(typeof D==="string")return D;if(typeof D==="number"||uA$.isBuffer(D))return D.toString();return JSON.stringify(D)}});var mB0=j((dX1,gB0)=>{var hA$=TG().Buffer,fB0=ru(),gA$=$h(),mA$=X0("stream"),bB0=Dh(),Qh=X0("util");function uB0($,D){return hA$.from($,D).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function dA$($,D,Q){Q=Q||"utf8";var X=uB0(bB0($),"binary"),J=uB0(bB0(D),Q);return Qh.format("%s.%s",X,J)}function hB0($){var{header:D,payload:Q}=$,X=$.secret||$.privateKey,J=$.encoding,Y=gA$(D.alg),Z=dA$(D,Q,J),F=Y.sign(Z,X);return Qh.format("%s.%s",Z,F)}function sB($){var D=$.secret;if(D=D==null?$.privateKey:D,D=D==null?$.key:D,/^hs/i.test($.header.alg)===!0&&D==null)throw TypeError("secret must be a string or buffer or a KeyObject");var Q=new fB0(D);this.readable=!0,this.header=$.header,this.encoding=$.encoding,this.secret=this.privateKey=this.key=Q,this.payload=new fB0($.payload),this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this)),this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}Qh.inherits(sB,mA$);sB.prototype.sign=function(){try{var D=hB0({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",D),this.emit("data",D),this.emit("end"),this.readable=!1,D}catch(Q){this.readable=!1,this.emit("error",Q),this.emit("close")}};sB.sign=hB0;gB0.exports=sB});var aB0=j((cX1,tB0)=>{var cB0=TG().Buffer,dB0=ru(),cA$=$h(),lA$=X0("stream"),lB0=Dh(),nA$=X0("util"),iA$=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function pA$($){return Object.prototype.toString.call($)==="[object Object]"}function rA$($){if(pA$($))return $;try{return JSON.parse($)}catch(D){return}}function nB0($){var D=$.split(".",1)[0];return rA$(cB0.from(D,"base64").toString("binary"))}function oA$($){return $.split(".",2).join(".")}function iB0($){return $.split(".")[2]}function tA$($,D){D=D||"utf8";var Q=$.split(".")[1];return cB0.from(Q,"base64").toString(D)}function pB0($){return iA$.test($)&&!!nB0($)}function rB0($,D,Q){if(!D){var X=Error("Missing algorithm parameter for jws.verify");throw X.code="MISSING_ALGORITHM",X}$=lB0($);var J=iB0($),Y=oA$($),Z=cA$(D);return Z.verify(Y,J,Q)}function oB0($,D){if(D=D||{},$=lB0($),!pB0($))return null;var Q=nB0($);if(!Q)return null;var X=tA$($);if(Q.typ==="JWT"||D.json)X=JSON.parse(X,D.encoding);return{header:Q,payload:X,signature:iB0($)}}function SG($){$=$||{};var D=$.secret;if(D=D==null?$.publicKey:D,D=D==null?$.key:D,/^hs/i.test($.algorithm)===!0&&D==null)throw TypeError("secret must be a string or buffer or a KeyObject");var Q=new dB0(D);this.readable=!0,this.algorithm=$.algorithm,this.encoding=$.encoding,this.secret=this.publicKey=this.key=Q,this.signature=new dB0($.signature),this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this)),this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}nA$.inherits(SG,lA$);SG.prototype.verify=function(){try{var D=rB0(this.signature.buffer,this.algorithm,this.key.buffer),Q=oB0(this.signature.buffer,this.encoding);return this.emit("done",D,Q),this.emit("data",D),this.emit("end"),this.readable=!1,D}catch(X){this.readable=!1,this.emit("error",X),this.emit("close")}};SG.decode=oB0;SG.isValid=pB0;SG.verify=rB0;tB0.exports=SG});var $w=j((sA$)=>{var sB0=mB0(),eB=aB0(),aA$=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];sA$.ALGORITHMS=aA$;sA$.sign=sB0.sign;sA$.verify=eB.verify;sA$.decode=eB.decode;sA$.isValid=eB.isValid;sA$.createSign=function(D){return new sB0(D)};sA$.createVerify=function(D){return new eB(D)}});var Xh=j((nX1,eB0)=>{var ZI$=$w();eB0.exports=function($,D){D=D||{};var Q=ZI$.decode($,D);if(!Q)return null;var X=Q.payload;if(typeof X==="string")try{var J=JSON.parse(X);if(J!==null&&typeof J==="object")X=J}catch(Y){}if(D.complete===!0)return{header:Q.header,payload:X,signature:Q.signature};return X}});var aH=j((iX1,$w0)=>{var Dw=function($,D){if(Error.call(this,$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);if(this.name="JsonWebTokenError",this.message=$,D)this.inner=D};Dw.prototype=Object.create(Error.prototype);Dw.prototype.constructor=Dw;$w0.exports=Dw});var Jh=j((pX1,Qw0)=>{var Dw0=aH(),Qw=function($,D){Dw0.call(this,$),this.name="NotBeforeError",this.date=D};Qw.prototype=Object.create(Dw0.prototype);Qw.prototype.constructor=Qw;Qw0.exports=Qw});var Yh=j((rX1,Jw0)=>{var Xw0=aH(),Xw=function($,D){Xw0.call(this,$),this.name="TokenExpiredError",this.expiredAt=D};Xw.prototype=Object.create(Xw0.prototype);Xw.prototype.constructor=Xw;Jw0.exports=Xw});var Zh=j((oX1,Yw0)=>{var FI$=eE();Yw0.exports=function($,D){var Q=D||Math.floor(Date.now()/1000);if(typeof $==="string"){var X=FI$($);if(typeof X>"u")return;return Math.floor(Q+X/1000)}else if(typeof $==="number")return Q+$;else return}});var _G=j((tX1,Zw0)=>{var GI$=Number.MAX_SAFE_INTEGER||9007199254740991,WI$=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Zw0.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:GI$,RELEASE_TYPES:WI$,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var sH=j((aX1,Fw0)=>{var qI$=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};Fw0.exports=qI$});var vG=j((s9,Gw0)=>{var{MAX_SAFE_COMPONENT_LENGTH:Fh,MAX_SAFE_BUILD_LENGTH:UI$,MAX_LENGTH:HI$}=_G(),KI$=sH();s9=Gw0.exports={};var zI$=s9.re=[],OI$=s9.safeRe=[],c0=s9.src=[],VI$=s9.safeSrc=[],l0=s9.t={},MI$=0,Gh="[a-zA-Z0-9-]",LI$=[["\\s",1],["\\d",HI$],[Gh,UI$]],NI$=($)=>{for(let[D,Q]of LI$)$=$.split(`${D}*`).join(`${D}{0,${Q}}`).split(`${D}+`).join(`${D}{1,${Q}}`);return $},E$=($,D,Q)=>{let X=NI$(D),J=MI$++;KI$($,J,D),l0[$]=J,c0[J]=D,VI$[J]=X,zI$[J]=new RegExp(D,Q?"g":void 0),OI$[J]=new RegExp(X,Q?"g":void 0)};E$("NUMERICIDENTIFIER","0|[1-9]\\d*");E$("NUMERICIDENTIFIERLOOSE","\\d+");E$("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Gh}*`);E$("MAINVERSION",`(${c0[l0.NUMERICIDENTIFIER]})\\.(${c0[l0.NUMERICIDENTIFIER]})\\.(${c0[l0.NUMERICIDENTIFIER]})`);E$("MAINVERSIONLOOSE",`(${c0[l0.NUMERICIDENTIFIERLOOSE]})\\.(${c0[l0.NUMERICIDENTIFIERLOOSE]})\\.(${c0[l0.NUMERICIDENTIFIERLOOSE]})`);E$("PRERELEASEIDENTIFIER",`(?:${c0[l0.NONNUMERICIDENTIFIER]}|${c0[l0.NUMERICIDENTIFIER]})`);E$("PRERELEASEIDENTIFIERLOOSE",`(?:${c0[l0.NONNUMERICIDENTIFIER]}|${c0[l0.NUMERICIDENTIFIERLOOSE]})`);E$("PRERELEASE",`(?:-(${c0[l0.PRERELEASEIDENTIFIER]}(?:\\.${c0[l0.PRERELEASEIDENTIFIER]})*))`);E$("PRERELEASELOOSE",`(?:-?(${c0[l0.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c0[l0.PRERELEASEIDENTIFIERLOOSE]})*))`);E$("BUILDIDENTIFIER",`${Gh}+`);E$("BUILD",`(?:\\+(${c0[l0.BUILDIDENTIFIER]}(?:\\.${c0[l0.BUILDIDENTIFIER]})*))`);E$("FULLPLAIN",`v?${c0[l0.MAINVERSION]}${c0[l0.PRERELEASE]}?${c0[l0.BUILD]}?`);E$("FULL",`^${c0[l0.FULLPLAIN]}$`);E$("LOOSEPLAIN",`[v=\\s]*${c0[l0.MAINVERSIONLOOSE]}${c0[l0.PRERELEASELOOSE]}?${c0[l0.BUILD]}?`);E$("LOOSE",`^${c0[l0.LOOSEPLAIN]}$`);E$("GTLT","((?:<|>)?=?)");E$("XRANGEIDENTIFIERLOOSE",`${c0[l0.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E$("XRANGEIDENTIFIER",`${c0[l0.NUMERICIDENTIFIER]}|x|X|\\*`);E$("XRANGEPLAIN",`[v=\\s]*(${c0[l0.XRANGEIDENTIFIER]})(?:\\.(${c0[l0.XRANGEIDENTIFIER]})(?:\\.(${c0[l0.XRANGEIDENTIFIER]})(?:${c0[l0.PRERELEASE]})?${c0[l0.BUILD]}?)?)?`);E$("XRANGEPLAINLOOSE",`[v=\\s]*(${c0[l0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c0[l0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c0[l0.XRANGEIDENTIFIERLOOSE]})(?:${c0[l0.PRERELEASELOOSE]})?${c0[l0.BUILD]}?)?)?`);E$("XRANGE",`^${c0[l0.GTLT]}\\s*${c0[l0.XRANGEPLAIN]}$`);E$("XRANGELOOSE",`^${c0[l0.GTLT]}\\s*${c0[l0.XRANGEPLAINLOOSE]}$`);E$("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Fh}})(?:\\.(\\d{1,${Fh}}))?(?:\\.(\\d{1,${Fh}}))?`);E$("COERCE",`${c0[l0.COERCEPLAIN]}(?:$|[^\\d])`);E$("COERCEFULL",c0[l0.COERCEPLAIN]+`(?:${c0[l0.PRERELEASE]})?(?:${c0[l0.BUILD]})?(?:$|[^\\d])`);E$("COERCERTL",c0[l0.COERCE],!0);E$("COERCERTLFULL",c0[l0.COERCEFULL],!0);E$("LONETILDE","(?:~>?)");E$("TILDETRIM",`(\\s*)${c0[l0.LONETILDE]}\\s+`,!0);s9.tildeTrimReplace="$1~";E$("TILDE",`^${c0[l0.LONETILDE]}${c0[l0.XRANGEPLAIN]}$`);E$("TILDELOOSE",`^${c0[l0.LONETILDE]}${c0[l0.XRANGEPLAINLOOSE]}$`);E$("LONECARET","(?:\\^)");E$("CARETTRIM",`(\\s*)${c0[l0.LONECARET]}\\s+`,!0);s9.caretTrimReplace="$1^";E$("CARET",`^${c0[l0.LONECARET]}${c0[l0.XRANGEPLAIN]}$`);E$("CARETLOOSE",`^${c0[l0.LONECARET]}${c0[l0.XRANGEPLAINLOOSE]}$`);E$("COMPARATORLOOSE",`^${c0[l0.GTLT]}\\s*(${c0[l0.LOOSEPLAIN]})$|^$`);E$("COMPARATOR",`^${c0[l0.GTLT]}\\s*(${c0[l0.FULLPLAIN]})$|^$`);E$("COMPARATORTRIM",`(\\s*)${c0[l0.GTLT]}\\s*(${c0[l0.LOOSEPLAIN]}|${c0[l0.XRANGEPLAIN]})`,!0);s9.comparatorTrimReplace="$1$2$3";E$("HYPHENRANGE",`^\\s*(${c0[l0.XRANGEPLAIN]})\\s+-\\s+(${c0[l0.XRANGEPLAIN]})\\s*$`);E$("HYPHENRANGELOOSE",`^\\s*(${c0[l0.XRANGEPLAINLOOSE]})\\s+-\\s+(${c0[l0.XRANGEPLAINLOOSE]})\\s*$`);E$("STAR","(<|>)?=?\\s*\\*");E$("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E$("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Jw=j((sX1,Ww0)=>{var BI$=Object.freeze({loose:!0}),wI$=Object.freeze({}),RI$=($)=>{if(!$)return wI$;if(typeof $!=="object")return BI$;return $};Ww0.exports=RI$});var Wh=j((eX1,Hw0)=>{var qw0=/^[0-9]+$/,Uw0=($,D)=>{if(typeof $==="number"&&typeof D==="number")return $===D?0:$<D?-1:1;let Q=qw0.test($),X=qw0.test(D);if(Q&&X)$=+$,D=+D;return $===D?0:Q&&!X?-1:X&&!Q?1:$<D?-1:1},jI$=($,D)=>Uw0(D,$);Hw0.exports={compareIdentifiers:Uw0,rcompareIdentifiers:jI$}});var FD=j(($J1,zw0)=>{var Yw=sH(),{MAX_LENGTH:Kw0,MAX_SAFE_INTEGER:Zw}=_G(),{safeRe:Fw,t:Gw}=vG(),EI$=Jw(),{compareIdentifiers:qh}=Wh();class s8{constructor($,D){if(D=EI$(D),$ instanceof s8)if($.loose===!!D.loose&&$.includePrerelease===!!D.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>Kw0)throw TypeError(`version is longer than ${Kw0} characters`);Yw("SemVer",$,D),this.options=D,this.loose=!!D.loose,this.includePrerelease=!!D.includePrerelease;let Q=$.trim().match(D.loose?Fw[Gw.LOOSE]:Fw[Gw.FULL]);if(!Q)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+Q[1],this.minor=+Q[2],this.patch=+Q[3],this.major>Zw||this.major<0)throw TypeError("Invalid major version");if(this.minor>Zw||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Zw||this.patch<0)throw TypeError("Invalid patch version");if(!Q[4])this.prerelease=[];else this.prerelease=Q[4].split(".").map((X)=>{if(/^[0-9]+$/.test(X)){let J=+X;if(J>=0&&J<Zw)return J}return X});this.build=Q[5]?Q[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(Yw("SemVer.compare",this.version,this.options,$),!($ instanceof s8)){if(typeof $==="string"&&$===this.version)return 0;$=new s8($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof s8))$=new s8($,this.options);if(this.major<$.major)return-1;if(this.major>$.major)return 1;if(this.minor<$.minor)return-1;if(this.minor>$.minor)return 1;if(this.patch<$.patch)return-1;if(this.patch>$.patch)return 1;return 0}comparePre($){if(!($ instanceof s8))$=new s8($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let D=0;do{let Q=this.prerelease[D],X=$.prerelease[D];if(Yw("prerelease compare",D,Q,X),Q===void 0&&X===void 0)return 0;else if(X===void 0)return 1;else if(Q===void 0)return-1;else if(Q===X)continue;else return qh(Q,X)}while(++D)}compareBuild($){if(!($ instanceof s8))$=new s8($,this.options);let D=0;do{let Q=this.build[D],X=$.build[D];if(Yw("build compare",D,Q,X),Q===void 0&&X===void 0)return 0;else if(X===void 0)return 1;else if(Q===void 0)return-1;else if(Q===X)continue;else return qh(Q,X)}while(++D)}inc($,D,Q){if($.startsWith("pre")){if(!D&&Q===!1)throw Error("invalid increment argument: identifier is empty");if(D){let X=`-${D}`.match(this.options.loose?Fw[Gw.PRERELEASELOOSE]:Fw[Gw.PRERELEASE]);if(!X||X[1]!==D)throw Error(`invalid identifier: ${D}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",D,Q);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",D,Q);break;case"prepatch":this.prerelease.length=0,this.inc("patch",D,Q),this.inc("pre",D,Q);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",D,Q);this.inc("pre",D,Q);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let X=Number(Q)?1:0;if(this.prerelease.length===0)this.prerelease=[X];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(D===this.prerelease.join(".")&&Q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(X)}}if(D){let J=[D,X];if(Q===!1)J=[D];if(qh(this.prerelease[0],D)===0){if(isNaN(this.prerelease[1]))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}zw0.exports=s8});var jQ=j((DJ1,Vw0)=>{var Ow0=FD(),AI$=($,D,Q=!1)=>{if($ instanceof Ow0)return $;try{return new Ow0($,D)}catch(X){if(!Q)return null;throw X}};Vw0.exports=AI$});var Lw0=j((QJ1,Mw0)=>{var II$=jQ(),TI$=($,D)=>{let Q=II$($,D);return Q?Q.version:null};Mw0.exports=TI$});var Bw0=j((XJ1,Nw0)=>{var CI$=jQ(),PI$=($,D)=>{let Q=CI$($.trim().replace(/^[=v]+/,""),D);return Q?Q.version:null};Nw0.exports=PI$});var jw0=j((JJ1,Rw0)=>{var ww0=FD(),SI$=($,D,Q,X,J)=>{if(typeof Q==="string")J=X,X=Q,Q=void 0;try{return new ww0($ instanceof ww0?$.version:$,Q).inc(D,X,J).version}catch(Y){return null}};Rw0.exports=SI$});var Iw0=j((YJ1,Aw0)=>{var Ew0=jQ(),_I$=($,D)=>{let Q=Ew0($,null,!0),X=Ew0(D,null,!0),J=Q.compare(X);if(J===0)return null;let Y=J>0,Z=Y?Q:X,F=Y?X:Q,G=!!Z.prerelease.length;if(!!F.prerelease.length&&!G){if(!F.patch&&!F.minor)return"major";if(F.compareMain(Z)===0){if(F.minor&&!F.patch)return"minor";return"patch"}}let q=G?"pre":"";if(Q.major!==X.major)return q+"major";if(Q.minor!==X.minor)return q+"minor";if(Q.patch!==X.patch)return q+"patch";return"prerelease"};Aw0.exports=_I$});var Cw0=j((ZJ1,Tw0)=>{var vI$=FD(),xI$=($,D)=>new vI$($,D).major;Tw0.exports=xI$});var Sw0=j((FJ1,Pw0)=>{var kI$=FD(),yI$=($,D)=>new kI$($,D).minor;Pw0.exports=yI$});var vw0=j((GJ1,_w0)=>{var fI$=FD(),bI$=($,D)=>new fI$($,D).patch;_w0.exports=bI$});var kw0=j((WJ1,xw0)=>{var uI$=jQ(),hI$=($,D)=>{let Q=uI$($,D);return Q&&Q.prerelease.length?Q.prerelease:null};xw0.exports=hI$});var w8=j((qJ1,fw0)=>{var yw0=FD(),gI$=($,D,Q)=>new yw0($,Q).compare(new yw0(D,Q));fw0.exports=gI$});var uw0=j((UJ1,bw0)=>{var mI$=w8(),dI$=($,D,Q)=>mI$(D,$,Q);bw0.exports=dI$});var gw0=j((HJ1,hw0)=>{var cI$=w8(),lI$=($,D)=>cI$($,D,!0);hw0.exports=lI$});var Ww=j((KJ1,dw0)=>{var mw0=FD(),nI$=($,D,Q)=>{let X=new mw0($,Q),J=new mw0(D,Q);return X.compare(J)||X.compareBuild(J)};dw0.exports=nI$});var lw0=j((zJ1,cw0)=>{var iI$=Ww(),pI$=($,D)=>$.sort((Q,X)=>iI$(Q,X,D));cw0.exports=pI$});var iw0=j((OJ1,nw0)=>{var rI$=Ww(),oI$=($,D)=>$.sort((Q,X)=>rI$(X,Q,D));nw0.exports=oI$});var eH=j((VJ1,pw0)=>{var tI$=w8(),aI$=($,D,Q)=>tI$($,D,Q)>0;pw0.exports=aI$});var qw=j((MJ1,rw0)=>{var sI$=w8(),eI$=($,D,Q)=>sI$($,D,Q)<0;rw0.exports=eI$});var Uh=j((LJ1,ow0)=>{var $T$=w8(),DT$=($,D,Q)=>$T$($,D,Q)===0;ow0.exports=DT$});var Hh=j((NJ1,tw0)=>{var QT$=w8(),XT$=($,D,Q)=>QT$($,D,Q)!==0;tw0.exports=XT$});var Uw=j((BJ1,aw0)=>{var JT$=w8(),YT$=($,D,Q)=>JT$($,D,Q)>=0;aw0.exports=YT$});var Hw=j((wJ1,sw0)=>{var ZT$=w8(),FT$=($,D,Q)=>ZT$($,D,Q)<=0;sw0.exports=FT$});var Kh=j((RJ1,ew0)=>{var GT$=Uh(),WT$=Hh(),qT$=eH(),UT$=Uw(),HT$=qw(),KT$=Hw(),zT$=($,D,Q,X)=>{switch(D){case"===":if(typeof $==="object")$=$.version;if(typeof Q==="object")Q=Q.version;return $===Q;case"!==":if(typeof $==="object")$=$.version;if(typeof Q==="object")Q=Q.version;return $!==Q;case"":case"=":case"==":return GT$($,Q,X);case"!=":return WT$($,Q,X);case">":return qT$($,Q,X);case">=":return UT$($,Q,X);case"<":return HT$($,Q,X);case"<=":return KT$($,Q,X);default:throw TypeError(`Invalid operator: ${D}`)}};ew0.exports=zT$});var DR0=j((jJ1,$R0)=>{var OT$=FD(),VT$=jQ(),{safeRe:Kw,t:zw}=vG(),MT$=($,D)=>{if($ instanceof OT$)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;D=D||{};let Q=null;if(!D.rtl)Q=$.match(D.includePrerelease?Kw[zw.COERCEFULL]:Kw[zw.COERCE]);else{let G=D.includePrerelease?Kw[zw.COERCERTLFULL]:Kw[zw.COERCERTL],W;while((W=G.exec($))&&(!Q||Q.index+Q[0].length!==$.length)){if(!Q||W.index+W[0].length!==Q.index+Q[0].length)Q=W;G.lastIndex=W.index+W[1].length+W[2].length}G.lastIndex=-1}if(Q===null)return null;let X=Q[2],J=Q[3]||"0",Y=Q[4]||"0",Z=D.includePrerelease&&Q[5]?`-${Q[5]}`:"",F=D.includePrerelease&&Q[6]?`+${Q[6]}`:"";return VT$(`${X}.${J}.${Y}${Z}${F}`,D)};$R0.exports=MT$});var XR0=j((EJ1,QR0)=>{var LT$=jQ(),NT$=_G(),BT$=FD(),wT$=($,D,Q)=>{if(!NT$.RELEASE_TYPES.includes(D))return null;let X=RT$($,Q);return X&&jT$(X,D)},RT$=($,D)=>{let Q=$ instanceof BT$?$.version:$;return LT$(Q,D)},jT$=($,D)=>{if(ET$(D))return $.version;switch($.prerelease=[],D){case"major":$.minor=0,$.patch=0;break;case"minor":$.patch=0;break}return $.format()},ET$=($)=>{return $.startsWith("pre")};QR0.exports=wT$});var ZR0=j((AJ1,YR0)=>{class JR0{constructor(){this.max=1000,this.map=new Map}get($){let D=this.map.get($);if(D===void 0)return;else return this.map.delete($),this.map.set($,D),D}delete($){return this.map.delete($)}set($,D){if(!this.delete($)&&D!==void 0){if(this.map.size>=this.max){let X=this.map.keys().next().value;this.delete(X)}this.map.set($,D)}return this}}YR0.exports=JR0});var R8=j((IJ1,qR0)=>{var AT$=/\s+/g;class $K{constructor($,D){if(D=TT$(D),$ instanceof $K)if($.loose===!!D.loose&&$.includePrerelease===!!D.includePrerelease)return $;else return new $K($.raw,D);if($ instanceof zh)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=D,this.loose=!!D.loose,this.includePrerelease=!!D.includePrerelease,this.raw=$.trim().replace(AT$," "),this.set=this.raw.split("||").map((Q)=>this.parseRange(Q.trim())).filter((Q)=>Q.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let Q=this.set[0];if(this.set=this.set.filter((X)=>!GR0(X[0])),this.set.length===0)this.set=[Q];else if(this.set.length>1){for(let X of this.set)if(X.length===1&&fT$(X[0])){this.set=[X];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let D=this.set[$];for(let Q=0;Q<D.length;Q++){if(Q>0)this.formatted+=" ";this.formatted+=D[Q].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){$=$.replace(yT$,"");let Q=((this.options.includePrerelease&&xT$)|(this.options.loose&&kT$))+":"+$,X=FR0.get(Q);if(X)return X;let J=this.options.loose,Y=J?nD[GD.HYPHENRANGELOOSE]:nD[GD.HYPHENRANGE];$=$.replace(Y,iT$(this.options.includePrerelease)),m1("hyphen replace",$),$=$.replace(nD[GD.COMPARATORTRIM],ST$),m1("comparator trim",$),$=$.replace(nD[GD.TILDETRIM],_T$),m1("tilde trim",$),$=$.replace(nD[GD.CARETTRIM],vT$),m1("caret trim",$);let Z=$.split(" ").map((q)=>bT$(q,this.options)).join(" ").split(/\s+/).map((q)=>nT$(q,this.options));if(J)Z=Z.filter((q)=>{return m1("loose invalid filter",q,this.options),!!q.match(nD[GD.COMPARATORLOOSE])});m1("range list",Z);let F=new Map,G=Z.map((q)=>new zh(q,this.options));for(let q of G){if(GR0(q))return[q];F.set(q.value,q)}if(F.size>1&&F.has(""))F.delete("");let W=[...F.values()];return FR0.set(Q,W),W}intersects($,D){if(!($ instanceof $K))throw TypeError("a Range is required");return this.set.some((Q)=>{return WR0(Q,D)&&$.set.some((X)=>{return WR0(X,D)&&Q.every((J)=>{return X.every((Y)=>{return J.intersects(Y,D)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new CT$($,this.options)}catch(D){return!1}for(let D=0;D<this.set.length;D++)if(pT$(this.set[D],$,this.options))return!0;return!1}}qR0.exports=$K;var IT$=ZR0(),FR0=new IT$,TT$=Jw(),zh=DK(),m1=sH(),CT$=FD(),{safeRe:nD,src:PT$,t:GD,comparatorTrimReplace:ST$,tildeTrimReplace:_T$,caretTrimReplace:vT$}=vG(),{FLAG_INCLUDE_PRERELEASE:xT$,FLAG_LOOSE:kT$}=_G(),yT$=new RegExp(PT$[GD.BUILD],"g"),GR0=($)=>$.value==="<0.0.0-0",fT$=($)=>$.value==="",WR0=($,D)=>{let Q=!0,X=$.slice(),J=X.pop();while(Q&&X.length)Q=X.every((Y)=>{return J.intersects(Y,D)}),J=X.pop();return Q},bT$=($,D)=>{return $=$.replace(nD[GD.BUILD],""),m1("comp",$,D),$=gT$($,D),m1("caret",$),$=uT$($,D),m1("tildes",$),$=dT$($,D),m1("xrange",$),$=lT$($,D),m1("stars",$),$},iD=($)=>!$||$.toLowerCase()==="x"||$==="*",uT$=($,D)=>{return $.trim().split(/\s+/).map((Q)=>hT$(Q,D)).join(" ")},hT$=($,D)=>{let Q=D.loose?nD[GD.TILDELOOSE]:nD[GD.TILDE];return $.replace(Q,(X,J,Y,Z,F)=>{m1("tilde",$,X,J,Y,Z,F);let G;if(iD(J))G="";else if(iD(Y))G=`>=${J}.0.0 <${+J+1}.0.0-0`;else if(iD(Z))G=`>=${J}.${Y}.0 <${J}.${+Y+1}.0-0`;else if(F)m1("replaceTilde pr",F),G=`>=${J}.${Y}.${Z}-${F} <${J}.${+Y+1}.0-0`;else G=`>=${J}.${Y}.${Z} <${J}.${+Y+1}.0-0`;return m1("tilde return",G),G})},gT$=($,D)=>{return $.trim().split(/\s+/).map((Q)=>mT$(Q,D)).join(" ")},mT$=($,D)=>{m1("caret",$,D);let Q=D.loose?nD[GD.CARETLOOSE]:nD[GD.CARET],X=D.includePrerelease?"-0":"";return $.replace(Q,(J,Y,Z,F,G)=>{m1("caret",$,J,Y,Z,F,G);let W;if(iD(Y))W="";else if(iD(Z))W=`>=${Y}.0.0${X} <${+Y+1}.0.0-0`;else if(iD(F))if(Y==="0")W=`>=${Y}.${Z}.0${X} <${Y}.${+Z+1}.0-0`;else W=`>=${Y}.${Z}.0${X} <${+Y+1}.0.0-0`;else if(G)if(m1("replaceCaret pr",G),Y==="0")if(Z==="0")W=`>=${Y}.${Z}.${F}-${G} <${Y}.${Z}.${+F+1}-0`;else W=`>=${Y}.${Z}.${F}-${G} <${Y}.${+Z+1}.0-0`;else W=`>=${Y}.${Z}.${F}-${G} <${+Y+1}.0.0-0`;else if(m1("no pr"),Y==="0")if(Z==="0")W=`>=${Y}.${Z}.${F}${X} <${Y}.${Z}.${+F+1}-0`;else W=`>=${Y}.${Z}.${F}${X} <${Y}.${+Z+1}.0-0`;else W=`>=${Y}.${Z}.${F} <${+Y+1}.0.0-0`;return m1("caret return",W),W})},dT$=($,D)=>{return m1("replaceXRanges",$,D),$.split(/\s+/).map((Q)=>cT$(Q,D)).join(" ")},cT$=($,D)=>{$=$.trim();let Q=D.loose?nD[GD.XRANGELOOSE]:nD[GD.XRANGE];return $.replace(Q,(X,J,Y,Z,F,G)=>{m1("xRange",$,X,J,Y,Z,F,G);let W=iD(Y),q=W||iD(Z),U=q||iD(F),H=U;if(J==="="&&H)J="";if(G=D.includePrerelease?"-0":"",W)if(J===">"||J==="<")X="<0.0.0-0";else X="*";else if(J&&H){if(q)Z=0;if(F=0,J===">")if(J=">=",q)Y=+Y+1,Z=0,F=0;else Z=+Z+1,F=0;else if(J==="<=")if(J="<",q)Y=+Y+1;else Z=+Z+1;if(J==="<")G="-0";X=`${J+Y}.${Z}.${F}${G}`}else if(q)X=`>=${Y}.0.0${G} <${+Y+1}.0.0-0`;else if(U)X=`>=${Y}.${Z}.0${G} <${Y}.${+Z+1}.0-0`;return m1("xRange return",X),X})},lT$=($,D)=>{return m1("replaceStars",$,D),$.trim().replace(nD[GD.STAR],"")},nT$=($,D)=>{return m1("replaceGTE0",$,D),$.trim().replace(nD[D.includePrerelease?GD.GTE0PRE:GD.GTE0],"")},iT$=($)=>(D,Q,X,J,Y,Z,F,G,W,q,U,H)=>{if(iD(X))Q="";else if(iD(J))Q=`>=${X}.0.0${$?"-0":""}`;else if(iD(Y))Q=`>=${X}.${J}.0${$?"-0":""}`;else if(Z)Q=`>=${Q}`;else Q=`>=${Q}${$?"-0":""}`;if(iD(W))G="";else if(iD(q))G=`<${+W+1}.0.0-0`;else if(iD(U))G=`<${W}.${+q+1}.0-0`;else if(H)G=`<=${W}.${q}.${U}-${H}`;else if($)G=`<${W}.${q}.${+U+1}-0`;else G=`<=${G}`;return`${Q} ${G}`.trim()},pT$=($,D,Q)=>{for(let X=0;X<$.length;X++)if(!$[X].test(D))return!1;if(D.prerelease.length&&!Q.includePrerelease){for(let X=0;X<$.length;X++){if(m1($[X].semver),$[X].semver===zh.ANY)continue;if($[X].semver.prerelease.length>0){let J=$[X].semver;if(J.major===D.major&&J.minor===D.minor&&J.patch===D.patch)return!0}}return!1}return!0}});var DK=j((TJ1,VR0)=>{var QK=Symbol("SemVer ANY");class Ow{static get ANY(){return QK}constructor($,D){if(D=UR0(D),$ instanceof Ow)if($.loose===!!D.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),Vh("comparator",$,D),this.options=D,this.loose=!!D.loose,this.parse($),this.semver===QK)this.value="";else this.value=this.operator+this.semver.version;Vh("comp",this)}parse($){let D=this.options.loose?HR0[KR0.COMPARATORLOOSE]:HR0[KR0.COMPARATOR],Q=$.match(D);if(!Q)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=Q[1]!==void 0?Q[1]:"",this.operator==="=")this.operator="";if(!Q[2])this.semver=QK;else this.semver=new zR0(Q[2],this.options.loose)}toString(){return this.value}test($){if(Vh("Comparator.test",$,this.options.loose),this.semver===QK||$===QK)return!0;if(typeof $==="string")try{$=new zR0($,this.options)}catch(D){return!1}return Oh($,this.operator,this.semver,this.options)}intersects($,D){if(!($ instanceof Ow))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new OR0($.value,D).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new OR0(this.value,D).test($.semver)}if(D=UR0(D),D.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!D.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(Oh(this.semver,"<",$.semver,D)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(Oh(this.semver,">",$.semver,D)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}VR0.exports=Ow;var UR0=Jw(),{safeRe:HR0,t:KR0}=vG(),Oh=Kh(),Vh=sH(),zR0=FD(),OR0=R8()});var XK=j((CJ1,MR0)=>{var rT$=R8(),oT$=($,D,Q)=>{try{D=new rT$(D,Q)}catch(X){return!1}return D.test($)};MR0.exports=oT$});var NR0=j((PJ1,LR0)=>{var tT$=R8(),aT$=($,D)=>new tT$($,D).set.map((Q)=>Q.map((X)=>X.value).join(" ").trim().split(" "));LR0.exports=aT$});var wR0=j((SJ1,BR0)=>{var sT$=FD(),eT$=R8(),$C$=($,D,Q)=>{let X=null,J=null,Y=null;try{Y=new eT$(D,Q)}catch(Z){return null}return $.forEach((Z)=>{if(Y.test(Z)){if(!X||J.compare(Z)===-1)X=Z,J=new sT$(X,Q)}}),X};BR0.exports=$C$});var jR0=j((_J1,RR0)=>{var DC$=FD(),QC$=R8(),XC$=($,D,Q)=>{let X=null,J=null,Y=null;try{Y=new QC$(D,Q)}catch(Z){return null}return $.forEach((Z)=>{if(Y.test(Z)){if(!X||J.compare(Z)===1)X=Z,J=new DC$(X,Q)}}),X};RR0.exports=XC$});var IR0=j((vJ1,AR0)=>{var Mh=FD(),JC$=R8(),ER0=eH(),YC$=($,D)=>{$=new JC$($,D);let Q=new Mh("0.0.0");if($.test(Q))return Q;if(Q=new Mh("0.0.0-0"),$.test(Q))return Q;Q=null;for(let X=0;X<$.set.length;++X){let J=$.set[X],Y=null;if(J.forEach((Z)=>{let F=new Mh(Z.semver.version);switch(Z.operator){case">":if(F.prerelease.length===0)F.patch++;else F.prerelease.push(0);F.raw=F.format();case"":case">=":if(!Y||ER0(F,Y))Y=F;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Z.operator}`)}}),Y&&(!Q||ER0(Q,Y)))Q=Y}if(Q&&$.test(Q))return Q;return null};AR0.exports=YC$});var CR0=j((xJ1,TR0)=>{var ZC$=R8(),FC$=($,D)=>{try{return new ZC$($,D).range||"*"}catch(Q){return null}};TR0.exports=FC$});var Vw=j((kJ1,vR0)=>{var GC$=FD(),_R0=DK(),{ANY:WC$}=_R0,qC$=R8(),UC$=XK(),PR0=eH(),SR0=qw(),HC$=Hw(),KC$=Uw(),zC$=($,D,Q,X)=>{$=new GC$($,X),D=new qC$(D,X);let J,Y,Z,F,G;switch(Q){case">":J=PR0,Y=HC$,Z=SR0,F=">",G=">=";break;case"<":J=SR0,Y=KC$,Z=PR0,F="<",G="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(UC$($,D,X))return!1;for(let W=0;W<D.set.length;++W){let q=D.set[W],U=null,H=null;if(q.forEach((K)=>{if(K.semver===WC$)K=new _R0(">=0.0.0");if(U=U||K,H=H||K,J(K.semver,U.semver,X))U=K;else if(Z(K.semver,H.semver,X))H=K}),U.operator===F||U.operator===G)return!1;if((!H.operator||H.operator===F)&&Y($,H.semver))return!1;else if(H.operator===G&&Z($,H.semver))return!1}return!0};vR0.exports=zC$});var kR0=j((yJ1,xR0)=>{var OC$=Vw(),VC$=($,D,Q)=>OC$($,D,">",Q);xR0.exports=VC$});var fR0=j((fJ1,yR0)=>{var MC$=Vw(),LC$=($,D,Q)=>MC$($,D,"<",Q);yR0.exports=LC$});var hR0=j((bJ1,uR0)=>{var bR0=R8(),NC$=($,D,Q)=>{return $=new bR0($,Q),D=new bR0(D,Q),$.intersects(D,Q)};uR0.exports=NC$});var mR0=j((uJ1,gR0)=>{var BC$=XK(),wC$=w8();gR0.exports=($,D,Q)=>{let X=[],J=null,Y=null,Z=$.sort((q,U)=>wC$(q,U,Q));for(let q of Z)if(BC$(q,D,Q)){if(Y=q,!J)J=q}else{if(Y)X.push([J,Y]);Y=null,J=null}if(J)X.push([J,null]);let F=[];for(let[q,U]of X)if(q===U)F.push(q);else if(!U&&q===Z[0])F.push("*");else if(!U)F.push(`>=${q}`);else if(q===Z[0])F.push(`<=${U}`);else F.push(`${q} - ${U}`);let G=F.join(" || "),W=typeof D.raw==="string"?D.raw:String(D);return G.length<W.length?G:D}});var pR0=j((hJ1,iR0)=>{var dR0=R8(),Bh=DK(),{ANY:Lh}=Bh,Nh=XK(),wh=w8(),RC$=($,D,Q={})=>{if($===D)return!0;$=new dR0($,Q),D=new dR0(D,Q);let X=!1;$:for(let J of $.set){for(let Y of D.set){let Z=EC$(J,Y,Q);if(X=X||Z!==null,Z)continue $}if(X)return!1}return!0},jC$=[new Bh(">=0.0.0-0")],cR0=[new Bh(">=0.0.0")],EC$=($,D,Q)=>{if($===D)return!0;if($.length===1&&$[0].semver===Lh)if(D.length===1&&D[0].semver===Lh)return!0;else if(Q.includePrerelease)$=jC$;else $=cR0;if(D.length===1&&D[0].semver===Lh)if(Q.includePrerelease)return!0;else D=cR0;let X=new Set,J,Y;for(let K of $)if(K.operator===">"||K.operator===">=")J=lR0(J,K,Q);else if(K.operator==="<"||K.operator==="<=")Y=nR0(Y,K,Q);else X.add(K.semver);if(X.size>1)return null;let Z;if(J&&Y){if(Z=wh(J.semver,Y.semver,Q),Z>0)return null;else if(Z===0&&(J.operator!==">="||Y.operator!=="<="))return null}for(let K of X){if(J&&!Nh(K,String(J),Q))return null;if(Y&&!Nh(K,String(Y),Q))return null;for(let z of D)if(!Nh(K,String(z),Q))return!1;return!0}let F,G,W,q,U=Y&&!Q.includePrerelease&&Y.semver.prerelease.length?Y.semver:!1,H=J&&!Q.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(U&&U.prerelease.length===1&&Y.operator==="<"&&U.prerelease[0]===0)U=!1;for(let K of D){if(q=q||K.operator===">"||K.operator===">=",W=W||K.operator==="<"||K.operator==="<=",J){if(H){if(K.semver.prerelease&&K.semver.prerelease.length&&K.semver.major===H.major&&K.semver.minor===H.minor&&K.semver.patch===H.patch)H=!1}if(K.operator===">"||K.operator===">="){if(F=lR0(J,K,Q),F===K&&F!==J)return!1}else if(J.operator===">="&&!K.test(J.semver))return!1}if(Y){if(U){if(K.semver.prerelease&&K.semver.prerelease.length&&K.semver.major===U.major&&K.semver.minor===U.minor&&K.semver.patch===U.patch)U=!1}if(K.operator==="<"||K.operator==="<="){if(G=nR0(Y,K,Q),G===K&&G!==Y)return!1}else if(Y.operator==="<="&&!K.test(Y.semver))return!1}if(!K.operator&&(Y||J)&&Z!==0)return!1}if(J&&W&&!Y&&Z!==0)return!1;if(Y&&q&&!J&&Z!==0)return!1;if(H||U)return!1;return!0},lR0=($,D,Q)=>{if(!$)return D;let X=wh($.semver,D.semver,Q);return X>0?$:X<0?D:D.operator===">"&&$.operator===">="?D:$},nR0=($,D,Q)=>{if(!$)return D;let X=wh($.semver,D.semver,Q);return X<0?$:X>0?D:D.operator==="<"&&$.operator==="<="?D:$};iR0.exports=RC$});var Mw=j((gJ1,tR0)=>{var Rh=vG(),rR0=_G(),AC$=FD(),oR0=Wh(),IC$=jQ(),TC$=Lw0(),CC$=Bw0(),PC$=jw0(),SC$=Iw0(),_C$=Cw0(),vC$=Sw0(),xC$=vw0(),kC$=kw0(),yC$=w8(),fC$=uw0(),bC$=gw0(),uC$=Ww(),hC$=lw0(),gC$=iw0(),mC$=eH(),dC$=qw(),cC$=Uh(),lC$=Hh(),nC$=Uw(),iC$=Hw(),pC$=Kh(),rC$=DR0(),oC$=XR0(),tC$=DK(),aC$=R8(),sC$=XK(),eC$=NR0(),$P$=wR0(),DP$=jR0(),QP$=IR0(),XP$=CR0(),JP$=Vw(),YP$=kR0(),ZP$=fR0(),FP$=hR0(),GP$=mR0(),WP$=pR0();tR0.exports={parse:IC$,valid:TC$,clean:CC$,inc:PC$,diff:SC$,major:_C$,minor:vC$,patch:xC$,prerelease:kC$,compare:yC$,rcompare:fC$,compareLoose:bC$,compareBuild:uC$,sort:hC$,rsort:gC$,gt:mC$,lt:dC$,eq:cC$,neq:lC$,gte:nC$,lte:iC$,cmp:pC$,coerce:rC$,truncate:oC$,Comparator:tC$,Range:aC$,satisfies:sC$,toComparators:eC$,maxSatisfying:$P$,minSatisfying:DP$,minVersion:QP$,validRange:XP$,outside:JP$,gtr:YP$,ltr:ZP$,intersects:FP$,simplifyRange:GP$,subset:WP$,SemVer:AC$,re:Rh.re,src:Rh.src,tokens:Rh.t,SEMVER_SPEC_VERSION:rR0.SEMVER_SPEC_VERSION,RELEASE_TYPES:rR0.RELEASE_TYPES,compareIdentifiers:oR0.compareIdentifiers,rcompareIdentifiers:oR0.rcompareIdentifiers}});var sR0=j((mJ1,aR0)=>{var qP$=Mw();aR0.exports=qP$.satisfies(process.version,">=15.7.0")});var $j0=j((dJ1,eR0)=>{var UP$=Mw();eR0.exports=UP$.satisfies(process.version,">=16.9.0")});var jh=j((cJ1,Dj0)=>{var HP$=sR0(),KP$=$j0(),zP$={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},OP$={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Dj0.exports=function($,D){if(!$||!D)return;let Q=D.asymmetricKeyType;if(!Q)return;let X=zP$[Q];if(!X)throw Error(`Unknown key type "${Q}".`);if(!X.includes($))throw Error(`"alg" parameter for "${Q}" key type must be one of: ${X.join(", ")}.`);if(HP$)switch(Q){case"ec":let J=D.asymmetricKeyDetails.namedCurve,Y=OP$[$];if(J!==Y)throw Error(`"alg" parameter "${$}" requires curve "${Y}".`);break;case"rsa-pss":if(KP$){let Z=parseInt($.slice(-3),10),{hashAlgorithm:F,mgf1HashAlgorithm:G,saltLength:W}=D.asymmetricKeyDetails;if(F!==`sha${Z}`||G!==F)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${$}.`);if(W!==void 0&&W>Z>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${$}.`)}break}}});var Eh=j((lJ1,Qj0)=>{var VP$=Mw();Qj0.exports=VP$.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Yj0=j((nJ1,Jj0)=>{var k1=aH(),MP$=Jh(),Xj0=Yh(),LP$=Xh(),NP$=Zh(),BP$=jh(),wP$=Eh(),RP$=$w(),{KeyObject:jP$,createSecretKey:EP$,createPublicKey:AP$}=X0("crypto"),Ah=["RS256","RS384","RS512"],IP$=["ES256","ES384","ES512"],Ih=["RS256","RS384","RS512"],TP$=["HS256","HS384","HS512"];if(wP$)Ah.splice(Ah.length,0,"PS256","PS384","PS512"),Ih.splice(Ih.length,0,"PS256","PS384","PS512");Jj0.exports=function($,D,Q,X){if(typeof Q==="function"&&!X)X=Q,Q={};if(!Q)Q={};Q=Object.assign({},Q);let J;if(X)J=X;else J=function(q,U){if(q)throw q;return U};if(Q.clockTimestamp&&typeof Q.clockTimestamp!=="number")return J(new k1("clockTimestamp must be a number"));if(Q.nonce!==void 0&&(typeof Q.nonce!=="string"||Q.nonce.trim()===""))return J(new k1("nonce must be a non-empty string"));if(Q.allowInvalidAsymmetricKeyTypes!==void 0&&typeof Q.allowInvalidAsymmetricKeyTypes!=="boolean")return J(new k1("allowInvalidAsymmetricKeyTypes must be a boolean"));let Y=Q.clockTimestamp||Math.floor(Date.now()/1000);if(!$)return J(new k1("jwt must be provided"));if(typeof $!=="string")return J(new k1("jwt must be a string"));let Z=$.split(".");if(Z.length!==3)return J(new k1("jwt malformed"));let F;try{F=LP$($,{complete:!0})}catch(q){return J(q)}if(!F)return J(new k1("invalid token"));let G=F.header,W;if(typeof D==="function"){if(!X)return J(new k1("verify must be called asynchronous if secret or public key is provided as a callback"));W=D}else W=function(q,U){return U(null,D)};return W(G,function(q,U){if(q)return J(new k1("error in secret or public key callback: "+q.message));let H=Z[2].trim()!=="";if(!H&&U)return J(new k1("jwt signature is required"));if(H&&!U)return J(new k1("secret or public key must be provided"));if(!H&&!Q.algorithms)return J(new k1('please specify "none" in "algorithms" to verify unsigned tokens'));if(U!=null&&!(U instanceof jP$))try{U=AP$(U)}catch(O){try{U=EP$(typeof U==="string"?Buffer.from(U):U)}catch(V){return J(new k1("secretOrPublicKey is not valid key material"))}}if(!Q.algorithms)if(U.type==="secret")Q.algorithms=TP$;else if(["rsa","rsa-pss"].includes(U.asymmetricKeyType))Q.algorithms=Ih;else if(U.asymmetricKeyType==="ec")Q.algorithms=IP$;else Q.algorithms=Ah;if(Q.algorithms.indexOf(F.header.alg)===-1)return J(new k1("invalid algorithm"));if(G.alg.startsWith("HS")&&U.type!=="secret")return J(new k1(`secretOrPublicKey must be a symmetric key when using ${G.alg}`));else if(/^(?:RS|PS|ES)/.test(G.alg)&&U.type!=="public")return J(new k1(`secretOrPublicKey must be an asymmetric key when using ${G.alg}`));if(!Q.allowInvalidAsymmetricKeyTypes)try{BP$(G.alg,U)}catch(O){return J(O)}let K;try{K=RP$.verify($,F.header.alg,U)}catch(O){return J(O)}if(!K)return J(new k1("invalid signature"));let z=F.payload;if(typeof z.nbf<"u"&&!Q.ignoreNotBefore){if(typeof z.nbf!=="number")return J(new k1("invalid nbf value"));if(z.nbf>Y+(Q.clockTolerance||0))return J(new MP$("jwt not active",new Date(z.nbf*1000)))}if(typeof z.exp<"u"&&!Q.ignoreExpiration){if(typeof z.exp!=="number")return J(new k1("invalid exp value"));if(Y>=z.exp+(Q.clockTolerance||0))return J(new Xj0("jwt expired",new Date(z.exp*1000)))}if(Q.audience){let O=Array.isArray(Q.audience)?Q.audience:[Q.audience];if(!(Array.isArray(z.aud)?z.aud:[z.aud]).some(function(w){return O.some(function(M){return M instanceof RegExp?M.test(w):M===w})}))return J(new k1("jwt audience invalid. expected: "+O.join(" or ")))}if(Q.issuer){if(typeof Q.issuer==="string"&&z.iss!==Q.issuer||Array.isArray(Q.issuer)&&Q.issuer.indexOf(z.iss)===-1)return J(new k1("jwt issuer invalid. expected: "+Q.issuer))}if(Q.subject){if(z.sub!==Q.subject)return J(new k1("jwt subject invalid. expected: "+Q.subject))}if(Q.jwtid){if(z.jti!==Q.jwtid)return J(new k1("jwt jwtid invalid. expected: "+Q.jwtid))}if(Q.nonce){if(z.nonce!==Q.nonce)return J(new k1("jwt nonce invalid. expected: "+Q.nonce))}if(Q.maxAge){if(typeof z.iat!=="number")return J(new k1("iat required when maxAge is specified"));let O=NP$(Q.maxAge,z.iat);if(typeof O>"u")return J(new k1('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(Y>=O+(Q.clockTolerance||0))return J(new Xj0("maxAge exceeded",new Date(O*1000)))}if(Q.complete===!0){let O=F.signature;return J(null,{header:G,payload:z,signature:O})}return J(null,z)})}});var Uj0=j((iJ1,qj0)=>{var Zj0=1/0,Gj0=9007199254740991,CP$=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Fj0=NaN,PP$="[object Arguments]",SP$="[object Function]",_P$="[object GeneratorFunction]",vP$="[object String]",xP$="[object Symbol]",kP$=/^\s+|\s+$/g,yP$=/^[-+]0x[0-9a-f]+$/i,fP$=/^0b[01]+$/i,bP$=/^0o[0-7]+$/i,uP$=/^(?:0|[1-9]\d*)$/,hP$=parseInt;function gP$($,D){var Q=-1,X=$?$.length:0,J=Array(X);while(++Q<X)J[Q]=D($[Q],Q,$);return J}function mP$($,D,Q,X){var J=$.length,Y=Q+(X?1:-1);while(X?Y--:++Y<J)if(D($[Y],Y,$))return Y;return-1}function dP$($,D,Q){if(D!==D)return mP$($,cP$,Q);var X=Q-1,J=$.length;while(++X<J)if($[X]===D)return X;return-1}function cP$($){return $!==$}function lP$($,D){var Q=-1,X=Array($);while(++Q<$)X[Q]=D(Q);return X}function nP$($,D){return gP$(D,function(Q){return $[Q]})}function iP$($,D){return function(Q){return $(D(Q))}}var Lw=Object.prototype,Ch=Lw.hasOwnProperty,Nw=Lw.toString,pP$=Lw.propertyIsEnumerable,rP$=iP$(Object.keys,Object),oP$=Math.max;function tP$($,D){var Q=Wj0($)||DS$($)?lP$($.length,String):[],X=Q.length,J=!!X;for(var Y in $)if((D||Ch.call($,Y))&&!(J&&(Y=="length"||sP$(Y,X))))Q.push(Y);return Q}function aP$($){if(!eP$($))return rP$($);var D=[];for(var Q in Object($))if(Ch.call($,Q)&&Q!="constructor")D.push(Q);return D}function sP$($,D){return D=D==null?Gj0:D,!!D&&(typeof $=="number"||uP$.test($))&&($>-1&&$%1==0&&$<D)}function eP$($){var D=$&&$.constructor,Q=typeof D=="function"&&D.prototype||Lw;return $===Q}function $S$($,D,Q,X){$=Ph($)?$:US$($),Q=Q&&!X?GS$(Q):0;var J=$.length;if(Q<0)Q=oP$(J+Q,0);return YS$($)?Q<=J&&$.indexOf(D,Q)>-1:!!J&&dP$($,D,Q)>-1}function DS$($){return QS$($)&&Ch.call($,"callee")&&(!pP$.call($,"callee")||Nw.call($)==PP$)}var Wj0=Array.isArray;function Ph($){return $!=null&&JS$($.length)&&!XS$($)}function QS$($){return Sh($)&&Ph($)}function XS$($){var D=Th($)?Nw.call($):"";return D==SP$||D==_P$}function JS$($){return typeof $=="number"&&$>-1&&$%1==0&&$<=Gj0}function Th($){var D=typeof $;return!!$&&(D=="object"||D=="function")}function Sh($){return!!$&&typeof $=="object"}function YS$($){return typeof $=="string"||!Wj0($)&&Sh($)&&Nw.call($)==vP$}function ZS$($){return typeof $=="symbol"||Sh($)&&Nw.call($)==xP$}function FS$($){if(!$)return $===0?$:0;if($=WS$($),$===Zj0||$===-Zj0){var D=$<0?-1:1;return D*CP$}return $===$?$:0}function GS$($){var D=FS$($),Q=D%1;return D===D?Q?D-Q:D:0}function WS$($){if(typeof $=="number")return $;if(ZS$($))return Fj0;if(Th($)){var D=typeof $.valueOf=="function"?$.valueOf():$;$=Th(D)?D+"":D}if(typeof $!="string")return $===0?$:+$;$=$.replace(kP$,"");var Q=fP$.test($);return Q||bP$.test($)?hP$($.slice(2),Q?2:8):yP$.test($)?Fj0:+$}function qS$($){return Ph($)?tP$($):aP$($)}function US$($){return $?nP$($,qS$($)):[]}qj0.exports=$S$});var Kj0=j((pJ1,Hj0)=>{var HS$="[object Boolean]",KS$=Object.prototype,zS$=KS$.toString;function OS$($){return $===!0||$===!1||VS$($)&&zS$.call($)==HS$}function VS$($){return!!$&&typeof $=="object"}Hj0.exports=OS$});var Lj0=j((rJ1,Mj0)=>{var zj0=1/0,MS$=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Oj0=NaN,LS$="[object Symbol]",NS$=/^\s+|\s+$/g,BS$=/^[-+]0x[0-9a-f]+$/i,wS$=/^0b[01]+$/i,RS$=/^0o[0-7]+$/i,jS$=parseInt,ES$=Object.prototype,AS$=ES$.toString;function IS$($){return typeof $=="number"&&$==SS$($)}function Vj0($){var D=typeof $;return!!$&&(D=="object"||D=="function")}function TS$($){return!!$&&typeof $=="object"}function CS$($){return typeof $=="symbol"||TS$($)&&AS$.call($)==LS$}function PS$($){if(!$)return $===0?$:0;if($=_S$($),$===zj0||$===-zj0){var D=$<0?-1:1;return D*MS$}return $===$?$:0}function SS$($){var D=PS$($),Q=D%1;return D===D?Q?D-Q:D:0}function _S$($){if(typeof $=="number")return $;if(CS$($))return Oj0;if(Vj0($)){var D=typeof $.valueOf=="function"?$.valueOf():$;$=Vj0(D)?D+"":D}if(typeof $!="string")return $===0?$:+$;$=$.replace(NS$,"");var Q=wS$.test($);return Q||RS$.test($)?jS$($.slice(2),Q?2:8):BS$.test($)?Oj0:+$}Mj0.exports=IS$});var Bj0=j((oJ1,Nj0)=>{var vS$="[object Number]",xS$=Object.prototype,kS$=xS$.toString;function yS$($){return!!$&&typeof $=="object"}function fS$($){return typeof $=="number"||yS$($)&&kS$.call($)==vS$}Nj0.exports=fS$});var Ej0=j((tJ1,jj0)=>{var bS$="[object Object]";function uS$($){var D=!1;if($!=null&&typeof $.toString!="function")try{D=!!($+"")}catch(Q){}return D}function hS$($,D){return function(Q){return $(D(Q))}}var gS$=Function.prototype,wj0=Object.prototype,Rj0=gS$.toString,mS$=wj0.hasOwnProperty,dS$=Rj0.call(Object),cS$=wj0.toString,lS$=hS$(Object.getPrototypeOf,Object);function nS$($){return!!$&&typeof $=="object"}function iS$($){if(!nS$($)||cS$.call($)!=bS$||uS$($))return!1;var D=lS$($);if(D===null)return!0;var Q=mS$.call(D,"constructor")&&D.constructor;return typeof Q=="function"&&Q instanceof Q&&Rj0.call(Q)==dS$}jj0.exports=iS$});var Ij0=j((aJ1,Aj0)=>{var pS$="[object String]",rS$=Object.prototype,oS$=rS$.toString,tS$=Array.isArray;function aS$($){return!!$&&typeof $=="object"}function sS$($){return typeof $=="string"||!tS$($)&&aS$($)&&oS$.call($)==pS$}Aj0.exports=sS$});var _j0=j((sJ1,Sj0)=>{var eS$="Expected a function",Tj0=1/0,$_$=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Cj0=NaN,D_$="[object Symbol]",Q_$=/^\s+|\s+$/g,X_$=/^[-+]0x[0-9a-f]+$/i,J_$=/^0b[01]+$/i,Y_$=/^0o[0-7]+$/i,Z_$=parseInt,F_$=Object.prototype,G_$=F_$.toString;function W_$($,D){var Q;if(typeof D!="function")throw TypeError(eS$);return $=z_$($),function(){if(--$>0)Q=D.apply(this,arguments);if($<=1)D=void 0;return Q}}function q_$($){return W_$(2,$)}function Pj0($){var D=typeof $;return!!$&&(D=="object"||D=="function")}function U_$($){return!!$&&typeof $=="object"}function H_$($){return typeof $=="symbol"||U_$($)&&G_$.call($)==D_$}function K_$($){if(!$)return $===0?$:0;if($=O_$($),$===Tj0||$===-Tj0){var D=$<0?-1:1;return D*$_$}return $===$?$:0}function z_$($){var D=K_$($),Q=D%1;return D===D?Q?D-Q:D:0}function O_$($){if(typeof $=="number")return $;if(H_$($))return Cj0;if(Pj0($)){var D=typeof $.valueOf=="function"?$.valueOf():$;$=Pj0(D)?D+"":D}if(typeof $!="string")return $===0?$:+$;$=$.replace(Q_$,"");var Q=J_$.test($);return Q||Y_$.test($)?Z_$($.slice(2),Q?2:8):X_$.test($)?Cj0:+$}Sj0.exports=q_$});var gj0=j((eJ1,hj0)=>{var vj0=Zh(),V_$=Eh(),M_$=jh(),xj0=$w(),L_$=Uj0(),Bw=Kj0(),kj0=Lj0(),_h=Bj0(),fj0=Ej0(),EQ=Ij0(),N_$=_j0(),{KeyObject:B_$,createSecretKey:w_$,createPrivateKey:R_$}=X0("crypto"),bj0=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(V_$)bj0.splice(3,0,"PS256","PS384","PS512");var j_$={expiresIn:{isValid:function($){return kj0($)||EQ($)&&$},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function($){return kj0($)||EQ($)&&$},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function($){return EQ($)||Array.isArray($)},message:'"audience" must be a string or array'},algorithm:{isValid:L_$.bind(null,bj0),message:'"algorithm" must be a valid string enum value'},header:{isValid:fj0,message:'"header" must be an object'},encoding:{isValid:EQ,message:'"encoding" must be a string'},issuer:{isValid:EQ,message:'"issuer" must be a string'},subject:{isValid:EQ,message:'"subject" must be a string'},jwtid:{isValid:EQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:Bw,message:'"noTimestamp" must be a boolean'},keyid:{isValid:EQ,message:'"keyid" must be a string'},mutatePayload:{isValid:Bw,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Bw,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Bw,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},E_$={iat:{isValid:_h,message:'"iat" should be a number of seconds'},exp:{isValid:_h,message:'"exp" should be a number of seconds'},nbf:{isValid:_h,message:'"nbf" should be a number of seconds'}};function uj0($,D,Q,X){if(!fj0(Q))throw Error('Expected "'+X+'" to be a plain object.');Object.keys(Q).forEach(function(J){let Y=$[J];if(!Y){if(!D)throw Error('"'+J+'" is not allowed in "'+X+'"');return}if(!Y.isValid(Q[J]))throw Error(Y.message)})}function A_$($){return uj0(j_$,!1,$,"options")}function I_$($){return uj0(E_$,!0,$,"payload")}var yj0={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},T_$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];hj0.exports=function($,D,Q,X){if(typeof Q==="function")X=Q,Q={};else Q=Q||{};let J=typeof $==="object"&&!Buffer.isBuffer($),Y=Object.assign({alg:Q.algorithm||"HS256",typ:J?"JWT":void 0,kid:Q.keyid},Q.header);function Z(W){if(X)return X(W);throw W}if(!D&&Q.algorithm!=="none")return Z(Error("secretOrPrivateKey must have a value"));if(D!=null&&!(D instanceof B_$))try{D=R_$(D)}catch(W){try{D=w_$(typeof D==="string"?Buffer.from(D):D)}catch(q){return Z(Error("secretOrPrivateKey is not valid key material"))}}if(Y.alg.startsWith("HS")&&D.type!=="secret")return Z(Error(`secretOrPrivateKey must be a symmetric key when using ${Y.alg}`));else if(/^(?:RS|PS|ES)/.test(Y.alg)){if(D.type!=="private")return Z(Error(`secretOrPrivateKey must be an asymmetric key when using ${Y.alg}`));if(!Q.allowInsecureKeySizes&&!Y.alg.startsWith("ES")&&D.asymmetricKeyDetails!==void 0&&D.asymmetricKeyDetails.modulusLength<2048)return Z(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${Y.alg}`))}if(typeof $>"u")return Z(Error("payload is required"));else if(J){try{I_$($)}catch(W){return Z(W)}if(!Q.mutatePayload)$=Object.assign({},$)}else{let W=T_$.filter(function(q){return typeof Q[q]<"u"});if(W.length>0)return Z(Error("invalid "+W.join(",")+" option for "+typeof $+" payload"))}if(typeof $.exp<"u"&&typeof Q.expiresIn<"u")return Z(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof $.nbf<"u"&&typeof Q.notBefore<"u")return Z(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{A_$(Q)}catch(W){return Z(W)}if(!Q.allowInvalidAsymmetricKeyTypes)try{M_$(Y.alg,D)}catch(W){return Z(W)}let F=$.iat||Math.floor(Date.now()/1000);if(Q.noTimestamp)delete $.iat;else if(J)$.iat=F;if(typeof Q.notBefore<"u"){try{$.nbf=vj0(Q.notBefore,F)}catch(W){return Z(W)}if(typeof $.nbf>"u")return Z(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof Q.expiresIn<"u"&&typeof $==="object"){try{$.exp=vj0(Q.expiresIn,F)}catch(W){return Z(W)}if(typeof $.exp>"u")return Z(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(yj0).forEach(function(W){let q=yj0[W];if(typeof Q[W]<"u"){if(typeof $[q]<"u")return Z(Error('Bad "options.'+W+'" option. The payload already has an "'+q+'" property.'));$[q]=Q[W]}});let G=Q.encoding||"utf8";if(typeof X==="function")X=X&&N_$(X),xj0.createSign({header:Y,privateKey:D,payload:$,encoding:G}).once("error",X).once("done",function(W){if(!Q.allowInsecureKeySizes&&/^(?:RS|PS)/.test(Y.alg)&&W.length<256)return X(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${Y.alg}`));X(null,W)});else{let W=xj0.sign({header:Y,payload:$,secret:D,encoding:G});if(!Q.allowInsecureKeySizes&&/^(?:RS|PS)/.test(Y.alg)&&W.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${Y.alg}`);return W}}});var vh=j(($Y1,mj0)=>{mj0.exports={decode:Xh(),verify:Yj0(),sign:gj0(),JsonWebTokenError:aH(),NotBeforeError:Jh(),TokenExpiredError:Yh()}});function v_$($){let D;try{D=JSON.parse(new TextDecoder().decode($))}catch(J){throw Error(`Service account file is not valid JSON: ${J instanceof Error?J.message:String(J)}`)}if(!D||typeof D!=="object")throw Error("Service account file is not a JSON object.");let Q=D;if(Q.type!=="service_account")throw Error(`Expected "type": "service_account" — found ${JSON.stringify(Q.type)}. This file is not a service account key.`);let X=["client_email","private_key","project_id","token_uri"];for(let J of X){let Y=Q[J];if(typeof Y!=="string"||Y.length===0)throw Error(`Service account JSON is missing required field "${J}".`)}if(!__$.has(Q.token_uri))throw Error("Service account JSON has an unsupported token_uri. Expected a Google OAuth token endpoint.");return{type:"service_account",client_email:Q.client_email,private_key:Q.private_key,project_id:Q.project_id,token_uri:Q.token_uri,private_key_id:typeof Q.private_key_id==="string"?Q.private_key_id:void 0,client_id:typeof Q.client_id==="string"?Q.client_id:void 0}}function x_$($){let D=Math.floor(Date.now()/1000);return cj0.default.sign({iss:$.client_email,scope:C_$,aud:$.token_uri,exp:D+P_$,iat:D},$.private_key,{algorithm:"RS256",header:{alg:"RS256",typ:"JWT",kid:$.private_key_id??""}})}async function k_$($){let D=new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:$.assertion}),Q=await xh({url:$.key.token_uri,init:{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:D.toString()},signal:$.signal,timeoutMs:$.timeoutMs,fetchImpl:$.fetchImpl}),X=await Q.text();if(!Q.ok){let Y=`${Q.status} ${Q.statusText}`;try{let Z=JSON.parse(X);if(Z.error)Y=Z.error_description?`${Z.error}: ${Z.error_description}`:Z.error}catch{}if(Q.status>=500||Q.status<400)throw new JK(`Google's token endpoint returned ${Y}. Try again in a moment.`);throw Error(`Google rejected the service account credentials (${Y}). The private key may be revoked or invalid.`)}let J;try{J=JSON.parse(X)}catch{throw new JK(`Google's token endpoint returned a non-JSON response (${Q.status}).`)}if(typeof J.access_token!=="string"||J.access_token.length===0)throw new JK("Google's token response was missing an access_token field.");return J.access_token}async function xh($){let D=new AbortController,Q=setTimeout(()=>D.abort(),$.timeoutMs),X,J=null;if($.signal){let Y=new AbortController;if(J=()=>Y.abort(),$.signal.addEventListener("abort",J,{once:!0}),D.signal.addEventListener("abort",J,{once:!0}),$.signal.aborted||D.signal.aborted)Y.abort();X=Y.signal}else X=D.signal;try{return await $.fetchImpl($.url,{...$.init,signal:X})}finally{if(clearTimeout(Q),J)$.signal?.removeEventListener("abort",J),D.signal.removeEventListener("abort",J)}}async function y_$($){let D=`${dj0}/applications/${encodeURIComponent($.packageName)}/edits`,Q;try{Q=await xh({url:D,init:{method:"POST",headers:{Authorization:`Bearer ${$.accessToken}`,"Content-Type":"application/json",Accept:"application/json"},body:"{}"},signal:$.signal,timeoutMs:$.timeoutMs,fetchImpl:$.fetchImpl})}catch(Z){return{kind:"network",detail:Z instanceof Error?Z.message:String(Z)}}let X=await Q.text();if(_4(`probeAppAccess: POST ${D} → HTTP ${Q.status} ${Q.statusText}${Q.ok?"":` :: ${X.slice(0,300)}`}`),Q.status===401||Q.status===403||Q.status===404)return{kind:"no-access",detail:f_$(X)??`${Q.status} ${Q.statusText}`};if(!Q.ok)return{kind:"network",detail:`${Q.status} ${Q.statusText}: ${X.slice(0,200)}`};let J;try{J=JSON.parse(X)}catch{return{kind:"network",detail:"Play API returned non-JSON on edits.insert"}}if(typeof J.id!=="string"||J.id.length===0)return{kind:"network",detail:"Play API returned no edit id"};let Y=`${dj0}/applications/${encodeURIComponent($.packageName)}/edits/${encodeURIComponent(J.id)}`;try{await xh({url:Y,init:{method:"DELETE",headers:{Authorization:`Bearer ${$.accessToken}`}},signal:$.signal,timeoutMs:$.timeoutMs,fetchImpl:$.fetchImpl})}catch{}return{kind:"ok"}}function f_$($){try{let D=JSON.parse($);if(D.error?.message)return D.error.status?`${D.error.status}: ${D.error.message}`:D.error.message}catch{}return null}async function lj0($){let D=$.timeoutMs??S_$,Q=$.fetchImpl??globalThis.fetch.bind(globalThis),X;try{X=v_$($.jsonBytes)}catch(Z){return{ok:!1,kind:"shape-error",message:Z instanceof Error?Z.message:String(Z)}}if($.signal?.aborted)return{ok:!1,kind:"network-error",message:"Validation cancelled."};let J;try{let Z=x_$(X);J=await k_$({key:X,assertion:Z,signal:$.signal,timeoutMs:D,fetchImpl:Q})}catch(Z){let F=Z instanceof Error?Z.message:String(Z),G=Z?.name==="AbortError",W=Z instanceof JK,q=/timeout|timed out|network|fetch failed|ENOTFOUND|EAI_AGAIN|ECONNRESET|ECONNREFUSED/i.test(F);if(G||W||q)return{ok:!1,kind:"network-error",message:F};return{ok:!1,kind:"token-error",message:F}}if($.signal?.aborted)return{ok:!1,kind:"network-error",message:"Validation cancelled."};let Y=await y_$({accessToken:J,packageName:$.packageName,signal:$.signal,timeoutMs:D,fetchImpl:Q});if(Y.kind==="ok")return{ok:!0,serviceAccountEmail:X.client_email,projectId:X.project_id};if(Y.kind==="no-access")return{ok:!1,kind:"no-app-access",serviceAccountEmail:X.client_email,message:`Service account "${X.client_email}" cannot access package "${$.packageName}" on Google Play (${Y.detail}). Create the app in Play Console (if it does not exist yet), invite this service account under Users and permissions, and grant release access for this app — or skip Play upload and get the AAB via Capgo with --no-playstore-upload --output-upload.`};return{ok:!1,kind:"network-error",message:Y.detail}}var cj0,C_$="https://www.googleapis.com/auth/androidpublisher",dj0="https://androidpublisher.googleapis.com/androidpublisher/v3",P_$=3600,S_$=30000,__$,JK;var nj0=o(()=>{CF();cj0=f$(vh(),1),__$=new Set(["https://oauth2.googleapis.com/token","https://accounts.google.com/o/oauth2/token","https://www.googleapis.com/oauth2/v4/token"]);JK=class JK extends Error{constructor($){super($);this.name="TokenExchangeTransientError"}}});var b_$;var ij0=o(()=>{b_$=f$(xH(),1)});function rj0($,D,Q){let X=Math.floor(Date.now()/1000);return pj0.default.sign({iss:D,iat:X,exp:X+900,aud:"appstoreconnect-v1"},Q,{algorithm:"ES256",header:{alg:"ES256",kid:$,typ:"JWT"}})}function oj0($){let D=typeof $?.status==="number"?$.status:void 0,Q=typeof $?.code==="string"?$.code:void 0,X=D===401,J=D===403,Y=Boolean(J&&(Q==="FORBIDDEN.REQUIRED_AGREEMENTS_MISSING_OR_EXPIRED"||Q==="FORBIDDEN_ERROR.PLA_NOT_ACCEPTED"||/\bPLA_NOT_ACCEPTED\b|required agreement|program license agreement/i.test($?.message??"")));return{is401or403:Boolean(X||J),isAgreements:Y,status:D,code:Q,message:Y?u_$:h_$}}function tj0($){return($?.data||[]).map((D)=>({id:D?.id||"",bundleId:D?.attributes?.bundleId||"",name:D?.attributes?.name||""}))}var pj0,kh,u_$,h_$=`Apple rejected the App Store Connect API key. Please check:
463
463
  - The .p8 file is correct and hasn't been modified