@capgo/cli 8.98.0 → 8.98.2

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.
@@ -1,4 +1,4 @@
1
- import{createRequire as Qm}from"node:module";var Dm=Object.create;var{getPrototypeOf:$m,defineProperty:C3,getOwnPropertyNames:jj,getOwnPropertyDescriptor:Jm}=Object,Vj=Object.prototype.hasOwnProperty;function Lj(D){return this[D]}var Fm,Um,g0=(D,$,J)=>{var F=D!=null&&typeof D==="object";if(F){var U=$?Fm??=new WeakMap:Um??=new WeakMap,X=U.get(D);if(X)return X}J=D!=null?Dm($m(D)):{};let Y=$||!D||!D.__esModule?C3(J,"default",{value:D,enumerable:!0}):J;for(let Q of jj(D))if(!Vj.call(Y,Q))C3(Y,Q,{get:Lj.bind(D,Q),enumerable:!0});if(F)U.set(D,Y);return Y},e6=(D)=>{var $=(Nj??=new WeakMap).get(D),J;if($)return $;if($=C3({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var F of jj(D))if(!Vj.call($,F))C3($,F,{get:Lj.bind(D,F),enumerable:!(J=Jm(D,F))||J.enumerable})}return Nj.set(D,$),$},Nj,k=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var Xm=(D)=>D;function Ym(D,$){this[D]=Xm.bind(null,$)}var M$=(D,$)=>{for(var J in $)C3(D,J,{get:$[J],enumerable:!0,configurable:!0,set:Ym.bind($,J)})};var S=(D,$)=>()=>(D&&($=D(D=0)),$);var pzD=(D)=>Promise.all(D),FD=Qm(import.meta.url);var p0;var j2=S(()=>{p0={name:"@capgo/cli",type:"module",version:"8.98.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",typecheck:"tsc --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:key-create-mode":"bun test/test-key-create-mode.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:offline-packers":"bun test/test-offline-packers.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:bundle-soft-delete":"bun test/test-bundle-soft-delete.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:api-perf":"bun test/test-api-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:bundle-single-requests":"bun test test/test-bundle-single-requests.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-host-fields":"bun test/test-mcp-host-fields.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-command-execution":"bun test/test-init-command-execution.mjs","test:init-upload-recovery":"bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-ota-checklist":"bun test/test-init-ota-checklist.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs && bun test/test-auth-session-bad-key.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs && bun test/test-build-env.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:key-create-mode && 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:offline-packers && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:bundle-single-requests && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-host-fields && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-command-execution && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:init-ota-checklist && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:support && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:retryable-capgo-api-error && bun run test:organization-set-api-host && bun run test:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support":"bun test/test-support.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:retryable-capgo-api-error":"bun test/test-retryable-capgo-api-error.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:plan-validation":"bun test/test-plan-validation.mjs && bun test ./test/test-direct-offer-plan.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.mjs ./test/test-init-completion-notice.mjs && bun test ./test/test-builder-setup-notice.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/cross-spawn":"^6.0.6","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native":"npm:typescript@7.1.0-beta","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0","cross-spawn":"^7.0.6",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 MD;var A6=S(()=>{MD=class MD extends Error{context;constructor(D,$,J){super(D,J!==void 0?{cause:J}:void 0);this.name="CliUserError",this.context=$}}});import{platform as Km}from"node:os";import{version as Wm}from"node:process";function Mj(D){Rj=D}function Im(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function wj(D){if(D.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 zm(D){if(D.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(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function kY(D,$){if($===void 0||$===null){if(_Y.has(D.toLowerCase()))throw new MD(wj(D));throw new MD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(_Y.has(D.toLowerCase()))throw new MD(wj(D));throw new MD(`HTTP header "${D}" is missing or invalid.`)}if(!Im($)){if(_Y.has(D.toLowerCase()))throw new MD(zm(D));throw new MD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function Q6(D){let $={capgo_api:Gm,"x-cli-version":p0.version,"x-cli-command":Rj,"x-cli-node":Wm,"x-cli-os":Km()};if(D)for(let[J,F]of Object.entries(D))$[J]=kY(J,F);return $}var Gm="2025-10-01",Rj="",_Y;var B7=S(()=>{j2();A6();_Y=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as W0}from"fs";var u3=(D=".",$="unknown")=>{let J=`${D}/bun.lockb`,F=`${D}/bun.lock`,U=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Y=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,q=`${D}/npm-shrinkwrap.json`;if(W0(J)||W0(F))return"bun";if(W0(U)||W0(X))return"pnpm";if(W0(Y))return"yarn";if(W0(Q)||W0(q))return"npm";return $},O7=(D=u3(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},Ej=(D=".",$="npx")=>{let J=`${D}/bun.lockb`,F=`${D}/bun.lock`,U=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Y=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,q=`${D}/npm-shrinkwrap.json`;if(W0(J)||W0(F))return"bunx";if(W0(U)||W0(X))return"pnpm exec";if(W0(Y))return"yarn dlx";if(W0(Q)||W0(q))return"npx";return $};var Aj=()=>{};var vj,Tj=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},bj=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var Pj=S(()=>{vj=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let J=0;D.lastIndex=0;while(D.test($))J+=1;return $.length-J}})()});var Zm,Hm,Sj,Bm,_j,Om,Nm,jm,kj=(D,$={},J={})=>{let F=$.limit??1/0,U=$.ellipsis??"",X=$?.ellipsisWidth??(U?kj(U,jm,J).width:0),Y=0,Q=J.controlWidth??0,q=J.tabWidth??8,K=J.emojiWidth??2,W=2,G=J.regularWidth??1,I=J.wideWidth??2,z=[[Om,G],[Zm,0],[Hm,Q],[Bm,q],[_j,K],[Sj,I]],Z=0,H=0,B=D.length,N=0,j=!1,O=B,L=Math.max(0,F-X),A=0,E=0,C=0,u=0;D:while(!0){if(E>A||H>=B&&H>Z){let _=D.slice(A,E)||D.slice(Z,H);N=0;for(let y of _.replaceAll(Nm,"")){let v=y.codePointAt(0)||0;if(Tj(v))u=2;else if(bj(v))u=I;else u=G;if(C+u>L)O=Math.min(O,Math.max(A,Z)+N);if(C+u>F){j=!0;break D}N+=y.length,C+=u}A=E=0}if(H>=B)break D;for(let _=0,y=z.length;_<y;_++){let[v,i]=z[_];if(v.lastIndex=H,v.test(D)){if(N=v===Sj?vj(D.slice(H,v.lastIndex)):v===_j?1:v.lastIndex-H,u=N*i,C+u>L)O=Math.min(O,H+Math.floor((L-C)/i));if(C+u>F){j=!0;break D}C+=u,A=Z,E=H,H=Z=v.lastIndex;continue D}}H+=1}return{width:j?L:C,index:j?O:B,truncated:j,ellipsed:j&&F>=X}},Cj;var uj=S(()=>{Pj();Zm=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Hm=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Sj=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Bm=/\t{1,1000}/y,_j=/[\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,Om=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Nm=/\p{M}+/gu,jm={limit:1/0,ellipsis:""},Cj=kj});var Vm,Lm=(D,$={})=>{return Cj(D,Vm,$).width},p$;var CY=S(()=>{uj();Vm={limit:1/0,ellipsis:"",ellipsisWidth:0},p$=Lm});function v6(D,$,J){return String(D).normalize().split(Am).map((F)=>Em(F,$,J)).join(`
1
+ import{createRequire as Qm}from"node:module";var Dm=Object.create;var{getPrototypeOf:$m,defineProperty:C3,getOwnPropertyNames:jj,getOwnPropertyDescriptor:Jm}=Object,Vj=Object.prototype.hasOwnProperty;function Lj(D){return this[D]}var Fm,Um,g0=(D,$,J)=>{var F=D!=null&&typeof D==="object";if(F){var U=$?Fm??=new WeakMap:Um??=new WeakMap,X=U.get(D);if(X)return X}J=D!=null?Dm($m(D)):{};let Y=$||!D||!D.__esModule?C3(J,"default",{value:D,enumerable:!0}):J;for(let Q of jj(D))if(!Vj.call(Y,Q))C3(Y,Q,{get:Lj.bind(D,Q),enumerable:!0});if(F)U.set(D,Y);return Y},e6=(D)=>{var $=(Nj??=new WeakMap).get(D),J;if($)return $;if($=C3({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var F of jj(D))if(!Vj.call($,F))C3($,F,{get:Lj.bind(D,F),enumerable:!(J=Jm(D,F))||J.enumerable})}return Nj.set(D,$),$},Nj,k=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var Xm=(D)=>D;function Ym(D,$){this[D]=Xm.bind(null,$)}var M$=(D,$)=>{for(var J in $)C3(D,J,{get:$[J],enumerable:!0,configurable:!0,set:Ym.bind($,J)})};var S=(D,$)=>()=>(D&&($=D(D=0)),$);var pzD=(D)=>Promise.all(D),FD=Qm(import.meta.url);var p0;var j2=S(()=>{p0={name:"@capgo/cli",type:"module",version:"8.98.2",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",typecheck:"tsc --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:key-create-mode":"bun test/test-key-create-mode.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:offline-packers":"bun test/test-offline-packers.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:bundle-soft-delete":"bun test/test-bundle-soft-delete.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:api-perf":"bun test/test-api-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:bundle-single-requests":"bun test test/test-bundle-single-requests.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-host-fields":"bun test/test-mcp-host-fields.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.mjs","test:no-redirect-error":"bun test/test-no-redirect-error.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-command-execution":"bun test/test-init-command-execution.mjs","test:init-upload-recovery":"bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-ota-checklist":"bun test/test-init-ota-checklist.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs && bun test/test-auth-session-bad-key.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs && bun test/test-build-env.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:key-create-mode && 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:offline-packers && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:bundle-single-requests && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-host-fields && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && bun run test:no-redirect-error && 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-command-execution && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:init-ota-checklist && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:support && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:retryable-capgo-api-error && bun run test:organization-set-api-host && bun run test:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support":"bun test/test-support.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:retryable-capgo-api-error":"bun test/test-retryable-capgo-api-error.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:plan-validation":"bun test/test-plan-validation.mjs && bun test ./test/test-direct-offer-plan.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.mjs ./test/test-init-completion-notice.mjs && bun test ./test/test-builder-setup-notice.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":"^21.0.4",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/cross-spawn":"^6.0.6","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native":"npm:typescript@7.1.0-beta","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0","cross-spawn":"^7.0.6",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 MD;var A6=S(()=>{MD=class MD extends Error{context;constructor(D,$,J){super(D,J!==void 0?{cause:J}:void 0);this.name="CliUserError",this.context=$}}});import{platform as Km}from"node:os";import{version as Wm}from"node:process";function Mj(D){Rj=D}function Im(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function wj(D){if(D.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 zm(D){if(D.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(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function kY(D,$){if($===void 0||$===null){if(_Y.has(D.toLowerCase()))throw new MD(wj(D));throw new MD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(_Y.has(D.toLowerCase()))throw new MD(wj(D));throw new MD(`HTTP header "${D}" is missing or invalid.`)}if(!Im($)){if(_Y.has(D.toLowerCase()))throw new MD(zm(D));throw new MD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function Q6(D){let $={capgo_api:Gm,"x-cli-version":p0.version,"x-cli-command":Rj,"x-cli-node":Wm,"x-cli-os":Km()};if(D)for(let[J,F]of Object.entries(D))$[J]=kY(J,F);return $}var Gm="2025-10-01",Rj="",_Y;var B7=S(()=>{j2();A6();_Y=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as W0}from"fs";var u3=(D=".",$="unknown")=>{let J=`${D}/bun.lockb`,F=`${D}/bun.lock`,U=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Y=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,q=`${D}/npm-shrinkwrap.json`;if(W0(J)||W0(F))return"bun";if(W0(U)||W0(X))return"pnpm";if(W0(Y))return"yarn";if(W0(Q)||W0(q))return"npm";return $},O7=(D=u3(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},Ej=(D=".",$="npx")=>{let J=`${D}/bun.lockb`,F=`${D}/bun.lock`,U=`${D}/pnpm-lock.yaml`,X=`${D}/shrinkwrap.yaml`,Y=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,q=`${D}/npm-shrinkwrap.json`;if(W0(J)||W0(F))return"bunx";if(W0(U)||W0(X))return"pnpm exec";if(W0(Y))return"yarn dlx";if(W0(Q)||W0(q))return"npx";return $};var Aj=()=>{};var vj,Tj=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},bj=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var Pj=S(()=>{vj=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let J=0;D.lastIndex=0;while(D.test($))J+=1;return $.length-J}})()});var Zm,Hm,Sj,Bm,_j,Om,Nm,jm,kj=(D,$={},J={})=>{let F=$.limit??1/0,U=$.ellipsis??"",X=$?.ellipsisWidth??(U?kj(U,jm,J).width:0),Y=0,Q=J.controlWidth??0,q=J.tabWidth??8,K=J.emojiWidth??2,W=2,G=J.regularWidth??1,I=J.wideWidth??2,z=[[Om,G],[Zm,0],[Hm,Q],[Bm,q],[_j,K],[Sj,I]],Z=0,H=0,B=D.length,N=0,j=!1,O=B,L=Math.max(0,F-X),A=0,E=0,C=0,u=0;D:while(!0){if(E>A||H>=B&&H>Z){let _=D.slice(A,E)||D.slice(Z,H);N=0;for(let y of _.replaceAll(Nm,"")){let v=y.codePointAt(0)||0;if(Tj(v))u=2;else if(bj(v))u=I;else u=G;if(C+u>L)O=Math.min(O,Math.max(A,Z)+N);if(C+u>F){j=!0;break D}N+=y.length,C+=u}A=E=0}if(H>=B)break D;for(let _=0,y=z.length;_<y;_++){let[v,i]=z[_];if(v.lastIndex=H,v.test(D)){if(N=v===Sj?vj(D.slice(H,v.lastIndex)):v===_j?1:v.lastIndex-H,u=N*i,C+u>L)O=Math.min(O,H+Math.floor((L-C)/i));if(C+u>F){j=!0;break D}C+=u,A=Z,E=H,H=Z=v.lastIndex;continue D}}H+=1}return{width:j?L:C,index:j?O:B,truncated:j,ellipsed:j&&F>=X}},Cj;var uj=S(()=>{Pj();Zm=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Hm=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Sj=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Bm=/\t{1,1000}/y,_j=/[\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,Om=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Nm=/\p{M}+/gu,jm={limit:1/0,ellipsis:""},Cj=kj});var Vm,Lm=(D,$={})=>{return Cj(D,Vm,$).width},p$;var CY=S(()=>{uj();Vm={limit:1/0,ellipsis:"",ellipsisWidth:0},p$=Lm});function v6(D,$,J){return String(D).normalize().split(Am).map((F)=>Em(F,$,J)).join(`
2
2
  `)}var N7="\x1B",hj="›",wm=39,gY="\x07",mj="[",Rm="]",lj="m",fY,gj,fj=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},xj=(D)=>`${N7}${mj}${D}${lj}`,yj=(D)=>`${N7}${fY}${D}${gY}`,uY=(D,$,J)=>{let F=$[Symbol.iterator](),U=!1,X=!1,Y=D.at(-1),Q=Y===void 0?0:p$(Y),q=F.next(),K=F.next(),W=0;while(!q.done){let G=q.value,I=p$(G);if(Q+I<=J)D[D.length-1]+=G;else D.push(G),Q=0;if(G===N7||G===hj)U=!0,X=$.startsWith(fY,W+1);if(U){if(X){if(G===gY)U=!1,X=!1}else if(G===lj)U=!1}else if(Q+=I,Q===J&&!K.done)D.push(""),Q=0;q=K,K=F.next(),W+=G.length}if(Y=D.at(-1),!Q&&Y!==void 0&&Y.length&&D.length>1)D[D.length-2]+=D.pop()},Mm=(D)=>{let $=D.split(" "),J=$.length;while(J){if(p$($[J-1]))break;J--}if(J===$.length)return D;return $.slice(0,J).join(" ")+$.slice(J).join("")},Em=(D,$,J={})=>{if(J.trim!==!1&&D.trim()==="")return"";let F="",U,X,Y=D.split(" "),Q=[""],q=0;for(let G=0;G<Y.length;G++){let I=Y[G];if(J.trim!==!1){let Z=Q.at(-1)??"",H=Z.trimStart();if(Z.length!==H.length)Q[Q.length-1]=H,q=p$(H)}if(G!==0){if(q>=$&&(J.wordWrap===!1||J.trim===!1))Q.push(""),q=0;if(q||J.trim===!1)Q[Q.length-1]+=" ",q++}let z=p$(I);if(J.hard&&z>$){let Z=$-q,H=1+Math.floor((z-Z-1)/$);if(Math.floor((z-1)/$)<H)Q.push("");uY(Q,I,$),q=p$(Q.at(-1)??"");continue}if(q+z>$&&q&&z){if(J.wordWrap===!1&&q<$){uY(Q,I,$),q=p$(Q.at(-1)??"");continue}Q.push(""),q=0}if(q+z>$&&J.wordWrap===!1){uY(Q,I,$),q=p$(Q.at(-1)??"");continue}Q[Q.length-1]+=I,q+=z}if(J.trim!==!1)Q=Q.map((G)=>Mm(G));let K=Q.join(`
3
3
  `),W=!1;for(let G=0;G<K.length;G++){let I=K[G];if(F+=I,!W){if(W=I>="\uD800"&&I<="\uDBFF",W)continue}else W=!1;if(I===N7||I===hj){gj.lastIndex=G+1;let Z=gj.exec(K)?.groups;if(Z?.code!==void 0){let H=Number.parseFloat(Z.code);U=H===wm?void 0:H}else if(Z?.uri!==void 0)X=Z.uri.length===0?void 0:Z.uri}if(K[G+1]===`
4
4
  `){if(X)F+=yj("");let z=U?fj(U):void 0;if(U&&z)F+=xj(z)}else if(I===`
@@ -256,8 +256,8 @@ tell application "System Events" to get value of property list item "CFBundleNam
256
256
  `)}function LvD(D){return[`Bundle upload timed out after ${Math.round(D/1000)}s.`,"The standard upload has to finish the whole transfer within this window and does not retry, so a large bundle or a slow connection can trip it.","What you can do:","1. Retry with the resumable upload, which uploads in chunks and retries automatically: npx @capgo/cli@latest bundle upload --tus","2. Or raise the limit for the standard upload: npx @capgo/cli@latest bundle upload --timeout <milliseconds>"].join(`
257
257
  `)}function Q$(D){if(!D)return"Unknown error";if(lB(D).isSecurityPolicyError)return eu(D);let J=D;if(typeof D==="string")return D;if(D instanceof Error){let F=J.message||J.cause?.message||J.stack||D.name,U=J.cause?.name,X=F.toLowerCase();if(X.includes("fetch failed")||X.includes("failed to fetch")||X.includes("connect timeout")||X.includes("network")||U?.startsWith("UND_ERR"))return`Network error: ${F}${J.code?` (code ${J.code})`:""}. Check your network connection and API endpoint availability.`;let Y=J.status||J.statusCode;return[F,J.code?`Code: ${J.code}`:void 0,Y?`Status: ${Y}`:void 0].filter(Boolean).join(" | ")||D.name}if(J.message){let F=[J.message,J.code?`Code: ${J.code}`:void 0,J.status||J.statusCode?`Status: ${J.status||J.statusCode}`:void 0].filter(Boolean).join(" | "),U=J.message.toLowerCase();if(U.includes("fetch failed")||U.includes("failed to fetch")||J.error==="Failed to fetch")return`Network error: ${F}. Check your network connection and API endpoint availability.`;if(J.details||J.hint||J.error)return`${F}${F?" | ":""}${J.error?typeof J.error==="string"?J.error:J.error.message??"":""}${J.details?`Details: ${J.details}`:""}${J.hint?`Hint: ${J.hint}`:""}`.trim();return F}if(typeof J.error==="string"&&J.error.length>0)return J.error;if(J.error&&typeof J.error==="object"&&typeof J.error.message==="string"&&J.error.message.length>0)return J.error.message;return`
258
258
  ${ag.default.render(D)}`}function IO(D){if(typeof D!=="string"&&typeof D!=="number")return;return OX(String(D)).slice(0,sg)}function GJD(D){if(typeof D==="string")return OX(D).slice(0,sg);if(!D||typeof D!=="object")return String(D);let $=D,J=IO($.name),F=IO($.message),U=J&&F?`${J}: ${F}`:F||J||Object.prototype.toString.call(D),X=[["code",$.code],["errno",$.errno],["syscall",$.syscall],["address",$.address],["port",$.port]].map(([Y,Q])=>{let q=IO(Q);return q?`${Y}=${q}`:void 0}).filter(Boolean);return`${U}${X.length>0?` (${X.join(", ")})`:""}`}function RvD(D){let $=[],J=new Set,F=0,U=(X,Y,Q)=>{if(F>=WJD)return;if(X&&typeof X==="object"){if(J.has(X))return;J.add(X)}F++;let q=" ".repeat(Q);if($.push(`${q}${Y}${GJD(X)}`),!X||typeof X!=="object")return;let K=X,W=[K.causingError,K.cause].filter((G,I,z)=>G!==void 0&&G!==null&&z.indexOf(G)===I);for(let G of W)U(G,"Caused by: ",Q+1);if(Array.isArray(K.errors))K.errors.forEach((G,I)=>{U(G,`Contained error ${I+1}: `,Q+1)})};return U(D,"",0),OX($.join(`
259
- `))}function MvD({silent:D=!1,stdinIsTTY:$=!!tg.isTTY,stdoutIsTTY:J=!!og.isTTY,ci:F=wO.isCI}={}){return!D&&$&&J&&!F}function IJD(D={}){let $=D.ci??wO.isCI,J=D.stdinIsTTY??!!tg.isTTY,F=D.stdoutIsTTY??!!og.isTTY,U=D.platform??ng(),X="display"in D?D.display:x1.DISPLAY;if($||!J||!F)return!1;if(U==="linux"&&!X)return!1;return!0}async function EvD(D){if(!IJD())return;try{await(await Promise.resolve().then(() => (vg(),Ag))).default(D)}catch($){if($?.code==="ENOENT")return}}function AvD(D){return gK(D)||fK(D)}function i6(D){if(gK(D))return HS(D);else if(fK(D))return BS(D);return D}function eg(D=i6(b$()),$=void 0){let J=$?.split(",")[0],F=J??wD(D,N0);if(!HD(F)){let X=J?`Package.json at ${F} does not exist`:`No package.json found at ${F}. Run this command from your project root (the folder that contains package.json), or pass --package-json <path> to point at it (for example in a monorepo).`;throw DD.error(X),Error(X)}let U=Z$(F);return JSON.parse(U)}function vvD(D=i6(b$()),$=void 0){return eg(D,$).scripts}function TvD(D=i6(b$()),$=void 0){return eg(D,$).version??""}function zJD(D){let $=D.replace("^","").replace("~","");if(i3($))try{let J=t0($);return FQ(J)}catch{return $}return $}async function bvD(D,$=b$(),J){let F=J?J.split(",").map((Y)=>Y.trim()).filter(Boolean):[],U=[],X=(Y)=>{let Q=eD(Y);if(!U.includes(Q))U.push(Q)};for(let Y of F){let Q=eD($,Y);if(HD(Q))X(l6(Q))}X(eD($)),X(b$());for(let Y of U)try{let Q=`${D}/package.json`,{createRequire:q}=await import("node:module"),W=q(wD(Y,"package.json")).resolve(Q),G=JSON.parse(Z$(W,"utf-8"));if(G.version)return G.version}catch{}for(let Y of U){let Q=Y,q=J2.parse(Q).root;while(Q!==q){let K=wD(Q,"node_modules",D,N0);if(HD(K))try{let G=JSON.parse(Z$(K,"utf-8"));if(G.version)return G.version}catch{}let W=l6(Q);if(W===Q)break;Q=W}}if(D==="@capgo/capacitor-updater"){let Y=null,Q=wD($,"ios","App","Podfile");if(HD(Q))try{let K=Z$(Q,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(K?.[1])Y=eD(wD($,"ios","App",K[1]))}catch{}if(!Y){let q=wD($,"android","capacitor.settings.gradle");if(HD(q))try{let W=Z$(q,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(W?.[1])Y=eD(wD($,"android",W[1])).replace(/\/android$/,"")}catch{}}if(Y){let q=wD(Y,N0);if(HD(q))try{let K=JSON.parse(Z$(q,"utf-8"));if(K.version)return K.version}catch{}}}try{let Y=J?J.split(",").map((K)=>K.trim()).filter(Boolean).join(","):J,q=(await SX($,Y)).get(D);if(q)return q}catch{}return null}async function SX(D=i6(b$()),$=void 0){let J=$?.split(",").map((X)=>X.trim()).filter(Boolean);if(J??=[wD(D,N0)],J){for(let X of J)if(!HD(X)){let Y=`Package.json at ${X} does not exist`;throw DD.error(Y),Error(Y)}}let F=new Map,{createRequire:U}=await import("node:module");for(let X of J){let Y=Z$(X),Q=JSON.parse(Y),q=l6(X),K=(W,G)=>{try{let H=U(wD(q,"package.json")).resolve(`${W}/package.json`),B=JSON.parse(Z$(H,"utf-8"));if(B.version)return B.version}catch{}let I=q,z=J2.parse(I).root;while(I!==z){let Z=wD(I,"node_modules",W,N0);if(HD(Z))try{let B=JSON.parse(Z$(Z,"utf-8"));if(B.version)return B.version}catch{}let H=l6(I);if(H===I)break;I=H}return zJD(G)};for(let W in Q.dependencies)F.set(W,K(W,Q.dependencies[W]));for(let W in Q.devDependencies)F.set(W,K(W,Q.devDependencies[W]))}return F}async function ZJD(D=i6(b$()),$=void 0){let J=$?.split(",").map((U)=>U.trim()).filter(Boolean);if(J??=[wD(D,N0)],J){for(let U of J)if(!HD(U)){let X=`Package.json at ${U} does not exist`;throw DD.error(X),Error(X)}}let F=new Map;for(let U of J){let X=Z$(U),Y=JSON.parse(X);for(let Q in Y.dependencies??{})if(typeof Y.dependencies[Q]==="string")F.set(Q,Y.dependencies[Q]);for(let Q in Y.devDependencies??{})if(typeof Y.devDependencies[Q]==="string")F.set(Q,Y.devDependencies[Q])}return F}function HJD(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&HD(D.path)}async function Df(D,$=!1){let J=BJD;try{let F=await D();if(!HJD(F)){if(!$)DD.error(J);throw new MD(J)}return F}catch(F){if(F instanceof MD)throw F;let U=Q$(F);if(!$)DD.error(`${J}: ${U}`);throw new MD(J,{cause:U})}}function _q(D=!1){return Df(cK,D)}function OJD(D=!1){return Df(nK,D)}async function NJD(D,$){let J=await OJD();if(J?.config)J.config.plugins??={},J.config.plugins.extConfig??={},J.config.plugins[D]??={},J.config.plugins[D]={...J.config.plugins[D],...$},await pK(D,J);return J}async function PvD(D){return NJD("CapacitorUpdater",D)}function hg(D,$){if(typeof $!=="string"||!$.trim())return;try{return $2($)}catch(J){throw new MD(`Invalid ${D} in capacitor config: ${J instanceof Error?J.message:String(J)}`)}}async function F8(D=!1){let $;try{$=await _q(D)}catch{return mg({host:yg,hostWeb:TX,hostFilesApi:HO,hostApi:BO})}let J=hg("localApi",$?.config?.plugins?.CapacitorUpdater?.localApi),F=hg("localApiFiles",$?.config?.plugins?.CapacitorUpdater?.localApiFiles),U={host:$?.config?.plugins?.CapacitorUpdater?.localHost||yg,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||TX,hostFilesApi:F??J??HO,hostApi:J??BO};if(!J&&$?.config?.plugins?.CapacitorUpdater?.localSupa&&!RO().apiHost&&!OO("CAPGO_API_HOST"))throw new MD("`localSupa` in capacitor.config is no longer supported. Set `localApi` to your Capgo API URL instead.");return mg(U)}function Ff(D){return{apiHost:D.apiHost?$2(D.apiHost):void 0,filesHost:D.filesHost?$2(D.filesHost):void 0}}function RO(){return Jf.getStore()??$f}function SvD(D){$f=Ff(D)}function jJD(D,$){return Jf.run(Ff(D),$)}function OO(D){let $=x1[D]?.trim();return $?$2($):void 0}function mg(D){let $=RO(),J=$.apiHost??OO("CAPGO_API_HOST"),F=$.filesHost??($.apiHost?void 0:OO("CAPGO_FILES_HOST"));if(J)D.hostApi=J,D.hostFilesApi=J;if(F)D.hostFilesApi=F;return D}function lg(D){return typeof D==="object"&&D!==null}function VJD(D){if(!lg(D))return!1;let $=D.capacitor;if(lg($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function LJD(D){if(HD(wD(D,"plugin.xml")))return!0;let $=wD(D,N0);if(!HD($))return!1;try{return VJD(JSON.parse(Z$($,"utf-8")))}catch{return!1}}function Xf(D,$){if($)return $;return D===BO||D===HO?RJD():void 0}async function Yf(D=!1,$,J){let F=(K)=>{let W={...K};return mE(W,void 0,D),W},U=await F8(D),X=U.hostApi,Y=ig.get(X);if(Y)return F(Y);let Q=zO.get(X);if(!$&&Q)return Q.then(F);let q=(async()=>{try{let K=Xf(X,J),W=await fetch(`${X}/private/config`,{...$?{signal:$}:{},redirect:"error",headers:Q6(K?{capgkey:K}:void 0)});if(!W.ok)throw Error(`HTTP error! status: ${W.status}`);let I={...await W.json(),...U};return ig.set(X,I),{...I}}catch{if(!D)DD.info(`Local config ${Q$(U)}`);return{...U}}finally{if(!$)zO.delete(X)}})();if(!$)zO.set(X,q);return q.then(F)}async function _vD(D){let $=await F8();try{let J=Xf($.hostFilesApi,D),F=await fetch(`${$.hostFilesApi}/files/config`,{redirect:"error",headers:Q6(J?{capgkey:J}:void 0)});if(!F.ok)throw Error(`HTTP error! status: ${F.status}`);return await F.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:YJD,maxChunkSize:QJD,alertUploadSize:XJD}}}function wJD(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function dg(D,$){let J=D.indexOf($);if(J<0)return D;return D.slice(J+$.length).replace(/^:\s*/,"").split(`
260
- `)[0].trim()}async function kvD(D){let $=await m$(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let J=D instanceof Error?D.message:String(D??"");if(J.includes("CHANNEL_ZIP_REQUIRED"))return dg(J,"CHANNEL_ZIP_REQUIRED");if(J.includes("CHANNEL_DELTA_REQUIRED"))return dg(J,"CHANNEL_DELTA_REQUIRED");return null}function $2(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw new MD("Capgo API host must use HTTPS");let J=$.hostname==="localhost"||$.hostname==="127.0.0.1"||$.hostname==="[::1]";if($.protocol==="http:"&&!J)throw new MD("Capgo API host must use HTTPS (HTTP is only allowed for localhost)");if($.username||$.password)throw new MD("Capgo API host must not include credentials");if($.search||$.hash)throw new MD("Capgo API host must not include query parameters or fragments");return`${$.origin}${V1($.pathname)}`}async function MO(D,$=!0,J){let F=await F8($),U=D?$2(D):F.hostApi,X=J?$2(J):D&&U!==F.hostApi?U:F.hostFilesApi;return{apiHost:U,filesHost:X}}async function C1(D){let $=await m$(D);if($){let J=wJD($);if(J)return J}return Q$(D)}async function oD(D,$){let J=($.method??"POST").toUpperCase(),F=await MO($.apiHost),U=$.useFilesHost?F.filesHost:F.apiHost,X=`${V1(U)}/${D.replace(/^\//,"")}`,Y=$.instrument!==!1&&SE()?kE(D.replace(/^\//,"")):fetch;try{let Q=await Y(X,{method:J,redirect:"error",headers:Q6({"Content-Type":"application/json",Authorization:$.apikey,capgkey:$.apikey,...$.apiVersion?{capgo_api:$.apiVersion}:{}}),body:J==="GET"||J==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!Q.ok)return{data:null,error:new $8(Q)};return{data:(Q.headers.get("content-type")??"").includes("application/json")?await Q.json().catch(()=>null):await Q.text().catch(()=>null),error:null}}catch(Q){return{data:null,error:Q instanceof Error?Q:Error(String(Q))}}}async function CvD(D,$=!0){return(await MO(D?.apiHost,$)).apiHost}async function uvD(D,$,J=!1,F,U){let X=kY("capgkey",D),Y=async()=>{await Yf(J,F,X);let K=await MO(void 0,J);if($&&!J)DD.info(`Using custom Capgo API ${K.apiHost}`);return{apikey:X,...K}};if(!$&&!U)return Y();let Q=RO(),q=$?$2($):Q.apiHost;return jJD({apiHost:q,filesHost:U??(q===Q.apiHost?Q.filesHost:void 0)},Y)}async function gvD(D,$,J={}){let{data:F,error:U}=await oD(`private/cli/members/2fa-status?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:J.apiHost});if(U)throw U;return F??[]}async function fvD(D,$,J={}){let{data:F,error:U}=await oD(`private/cli/members/password-policy?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:J.apiHost});if(U)throw U;return F??[]}function bX(D){try{if(!HD(D))return;return Z$(D,"utf8").trim()||void 0}catch{return}}function RJD(){let D=x1.CAPGO_TOKEN?.trim();if(D)return D;let $=bX(`${cg()}/.capgo`);if($)return $;return bX(".capgo")}function $A(D=!1,$=(J)=>DD.info(J)){let J=x1.CAPGO_TOKEN?.trim();if(J){if(!D)$("Use CAPGO_TOKEN environment variable");return J}let U=`${cg()}/.capgo`,X=bX(U);if(X){if(!D)$(`Use global API key ${U}`)}else if(U=".capgo",X=bX(U),X&&!D)$(`Use local API key ${U}`);if(!X){let Q=`No Capgo API key found. Run \`${uS()}\` first, then retry this command.`;throw DD.error(Q),new MD(Q)}return X}async function*EO(D){let $=await z3(D,{withFileTypes:!0});for(let J of $){let F=eD(D,J.name);if(J.isDirectory()&&!J.name.startsWith(".")&&!J.name.startsWith("node_modules")&&!J.name.startsWith("dist"))yield*EO(F);else yield F}}function xvD(D){let J=(D.endsWith(".br")?D.slice(0,-3):D).split(".").pop()?.toLowerCase()||"";return{html:"text/html",htm:"text/html",js:"application/javascript",mjs:"application/javascript",cjs:"application/javascript",css:"text/css",json:"application/json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",mp4:"video/mp4",webm:"video/webm",xml:"application/xml",txt:"text/plain",md:"text/markdown",pdf:"application/pdf",wasm:"application/wasm",map:"application/json"}[J]||"application/octet-stream"}function g1(D,$){return`${D}-${$?"ts":"js"}`}function f1(D,$){if(!$)DD.info(`Found ${D} project`)}function MJD(D){if(HD(eD(D,"angular.json")))return"angular";if(HD(eD(D,"nuxt.config.js"))||HD(eD(D,"nuxt.config.ts")))return"nuxtjs";if(HD(eD(D,"next.config.js"))||HD(eD(D,"next.config.mjs"))||HD(eD(D,"next.config.ts")))return"nextjs";if(HD(eD(D,"svelte.config.js"))||HD(eD(D,"svelte.config.ts")))return"sveltekit";if(HD(eD(D,"vue.config.js"))||HD(eD(D,"vue.config.ts")))return"vue"}function Qf(D){if(D.get("@angular/core"))return"angular";if(D.get("nuxt"))return"nuxtjs";if(D.get("next"))return"nextjs";if(D.get("@sveltejs/kit"))return"sveltekit";if(D.get("svelte"))return"svelte";if(D.get("vue"))return"vue";if(D.get("react"))return"react"}async function EJD(D,$){let J=HD(eD(D,"tsconfig.json")),F=MJD(D);if(F)return f1(F,$),g1(F,J);let U=eD(D,N0);if(!HD(U))return;let X=await SX(void 0,U),Y=Qf(X);if(!Y)return;return f1(Y,$),g1(Y,J)}function ZO(D,$){if(!$)return;let J=eD($);if(!D.includes(J))D.push(J)}function AJD(D){let $=D,J=J2.parse($).root;while(!0){if(HD(eD($,N0)))return $;if($===J)return;let F=l6($);if(F===$)return;$=F}}function vJD(D){let $=[],J=D?.split(",").map((F)=>F.trim()).filter(Boolean)[0];if(J)ZO($,l6(eD(J)));return ZO($,AJD(b$())),ZO($,i6(b$())),$}async function yvD(D){let $=b$(),J=!1,F=D?.quiet??!1;for(let X of vJD(D?.packageJsonPath)){let Y=await EJD(X,F);if(Y)return Y}let U=eD($,"tsconfig.json");if(HD(U))J=!0;for await(let X of EO($)){if(X.includes("angular.json"))return f1("angular",F),g1("angular",J);if(X.includes("nuxt.config.js")||X.includes("nuxt.config.ts"))return f1("nuxtjs",F),g1("nuxtjs",J);if(X.includes("next.config.js")||X.includes("next.config.mjs")||X.includes("next.config.ts"))return f1("nextjs",F),g1("nextjs",J);if(X.includes("svelte.config.js")||X.includes("svelte.config.ts"))return f1("sveltekit",F),g1("sveltekit",J);if(X.includes("vue.config.js")||X.includes("vue.config.ts"))return f1("vue",F),g1("vue",J);if(X.includes(N0)){let Y=l6(X),Q=await SX(Y),q=Qf(Q);if(q)return f1(q,F),g1(q,J)}}return"unknown"}function hvD(D,$,J=b$()){if(D==="angular-js"||D==="angular-ts")return $?"src/main.ts":"src/main.js";if(D==="nextjs-js"||D==="nextjs-ts")return $?"src/app/layout.tsx":"src/app/layout.js";if(D==="svelte-js"||D==="svelte-ts")return $?"src/main.ts":"src/main.js";if(D==="vue-js"||D==="vue-ts")return $?"src/main.ts":"src/main.js";if(D==="react-js"||D==="react-ts"){let F=$?"src/main.tsx":"src/main.js",U=$?"src/index.tsx":"src/index.js";if(HD(eD(J,F)))return F;return U}return null}async function mvD(D){let $=D.replace(/-(?:ts|js)$/,"");if($==="angular")return DD.info("Angular project detected"),"build";if($==="nuxtjs")return DD.info("Nuxtjs project detected"),"generate";if($==="nextjs"){if(DD.info("Nextjs project detected"),DD.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),DD.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),!await $1({message:"Do you want to continue?"}))throw DD.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}if($==="sveltekit"){if(DD.info("Sveltekit project detected"),DD.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),DD.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adapter"),!await $1({message:"Do you want to continue?"}))throw DD.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}return"build"}async function lvD(D=!1,$=b$()){let J=/(main|index)\.(ts|tsx|js|jsx)$/,F="",U=eD($),X=U.split("/").length;for await(let Y of EO(U))if(Y.split("/").length-X<=2&&J.test(Y)){if(F=Y,!D)DD.info(`Found main file here ${Y}`);break}return F}async function ivD(D,$,J,F){let U={app_id:$,name:J,version:0};try{let X=await oD("files/upload_link",{apikey:D,body:U,useFilesHost:!0,apiHost:F?.apiHost});if(X.error){if(X.error instanceof $8){let Y=await X.error.context.json().catch(()=>({}));DD.error(`Upload URL error: ${Y.status||JSON.stringify(Y)}`)}else DD.error(`Cannot get upload url: ${X.error.message}`);return""}return X.data?.url??""}catch(X){DD.error(`Cannot get upload url ${Q$(X)}`)}return""}async function*qf(D){let $=z3(D,{withFileTypes:!0});for(let J of $){let F=wD(D,J.name);if(J.isDirectory())yield*qf(F);else yield F}}function pvD(D,$="5.10.0",J="6.25.0",F="7.25.0"){if(D.major===5&&s1(D,t0($)))return!0;if(D.major===6&&s1(D,t0(J)))return!0;if(D.major===7&&s1(D,t0(F)))return!0;return!1}async function rvD(D){let $=[],J=[".DS_Store",".git",".gitignore","node_modules","package-lock.json","tsconfig.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json"];for await(let F of qf(D)){if(J.some((Q)=>F.includes(Q))){DD.info(`Ignoring file ${F}, please ensure you have only required files in your dist folder`);continue}let U=Z$(F);if(U.length===0){DD.info(`Ignoring empty file ${F}, please ensure you have only required files in your dist folder`);continue}let X=await NS(U,"sha256"),Y=pg(D,F);if(Y.startsWith("/"))Y=Y.substring(1);$.push({file:Y,hash:X})}return $}async function tvD(D){if(ng()==="win32")return bJD(D);else return TJD(D)}function TJD(D){let $=new LO.default;return $.addLocalFolder(D),$.toBuffer()}async function bJD(D){DD.info("Zipping file windows mode");let $=new LO.default,J=(F,U)=>{let X=z3(F);for(let Y of X){let Q=wD(F,Y),q=$JD(Q);if(q.isFile()){let K=Z$(Q);$.addFile(wD(U,Y).split(rg).join("/"),K)}else if(q.isDirectory())J(Q,wD(U,Y))}};return J(D,""),$.toBuffer()}function PJD(D){let $=jO();return`App ${D} does not exist, run first \`${$.runner} @capgo/cli app add ${D}\` to create it`}function SJD(D){let J=D?.originalResponse?.getBody?.(),F=D instanceof Error?D.message:String(D??"");return`${J??""} ${F}`.includes("app_not_found")}async function ovD(D,$,J,F,U,X,Y,Q){return new Promise((q,K)=>{PJ(D,{channel:"app",event:"App TUS upload",org_id:J,tracking_version:2,tags:{"app-id":F}}),new PX.Upload($,{endpoint:`${Y.hostFilesApi}/files/upload/attachments/`,chunkSize:Q,retryDelays:[...qJD],metadataForPartialUploads:{filename:`orgs/${J}/apps/${F}/${U}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${J}/apps/${F}/${U}.zip`,filetype:"application/zip"},headers:Q6({Authorization:D}),onError(G){if(DD.error(`Error uploading bundle: ${G.message}`),SJD(G)){K(Error(PJD(F)));return}if(G instanceof PX.DetailedError){let I=G.originalResponse?.getBody(),z=G.originalResponse?.getStatus(),Z=G.originalRequest?.getURL(),H=(()=>{try{let B=JSON.parse(I||'{"error": "unknown error"}');return B.status||B.error||B.message||"unknown error"}catch{return I||G.message}})();K(Error(`TUS upload failed (status ${z??"unknown"}, url ${Z??"unknown"}): ${H}`))}else K(Error(`TUS upload failed: ${G.message||G.toString()}`))},onProgress(G,I){let z=(G/I*100).toFixed(2);X.message(`Uploaded ${z}%`)},async onSuccess(){await PJ(D,{channel:"app",event:"App TUS done",org_id:J,tracking_version:2,tags:{"app-id":F}}).catch(),q(!0)}}).start()})}async function avD(D,$,J,F){let X=await oD("private/delete_failed_version",{apikey:D,method:"DELETE",body:{app_id:$,name:J},apiHost:F?.apiHost});if(X.error){if(X.error instanceof $8){let Y=await X.error.context.json().catch(()=>({}));throw Error(Y.status||Y.message||JSON.stringify(Y))}throw Error(X.error.message)}}async function svD(D,$,J,F,U){let X={app_id:$,name:J,manifest:F},Y=await bJ(()=>oD("private/set_manifest",{apikey:D,body:X,apiHost:U?.apiHost}));if(Y.error){if(Y.error instanceof $8){let Q=await Y.error.context.json().catch(()=>({}));throw Error(Q.error||Q.status||Q.message||JSON.stringify(Q))}throw Error(Y.error.message)}}async function PJ(D,$,J,F,U,X){let Y=Date.now();if((k9(x1.CAPGO_DISABLE_TELEMETRY)||k9(x1.CAPGO_DISABLE_POSTHOG))&&!$.notifyConsole)return;try{let q={};try{q=vE()}catch(Z){if(J)DD.error(`Failed to enrich event tags, sending caller tags only: ${Q$(Z)}`)}let K={...$,nonPersonTags:{...q,...$.nonPersonTags??{}}};if(J)DD.info(`Get remove config: for ${$.event}`);let W=U??(await Yf(!0,F)).hostApi;if(J)DD.info(`Sending analytics event: ${JSON.stringify(K)}`);let G=new AbortController,I=setTimeout(()=>G.abort(),1e4),z=F?typeof AbortSignal.any==="function"?AbortSignal.any([G.signal,F]):F:G.signal;try{B6("telemetry request started");let Z=await fetch(`${V1(W)}/private/events`,{method:"POST",body:JSON.stringify(K),headers:Q6({"Content-Type":"application/json",capgkey:D}),signal:z,redirect:X});if(B6("telemetry response received",{duration_ms:Date.now()-Y,status:Z.status}),clearTimeout(I),!Z.ok)throw Error(`HTTP error! status: ${Z.status}`);let H=await Z.json();if(H.error&&J)DD.error(`Failed to send analytics event: ${H.error}`)}finally{clearTimeout(I)}}catch(q){if(B6("telemetry request failed",{duration_ms:Date.now()-Y,error:zF(q)}),J)DD.error("Failed to send Stats event details:"),DD.error(Q$(q))}}function _JD(D){if(DD.error(`
259
+ `))}function MvD({silent:D=!1,stdinIsTTY:$=!!tg.isTTY,stdoutIsTTY:J=!!og.isTTY,ci:F=wO.isCI}={}){return!D&&$&&J&&!F}function IJD(D={}){let $=D.ci??wO.isCI,J=D.stdinIsTTY??!!tg.isTTY,F=D.stdoutIsTTY??!!og.isTTY,U=D.platform??ng(),X="display"in D?D.display:x1.DISPLAY;if($||!J||!F)return!1;if(U==="linux"&&!X)return!1;return!0}async function EvD(D){if(!IJD())return;try{await(await Promise.resolve().then(() => (vg(),Ag))).default(D)}catch($){if($?.code==="ENOENT")return}}function AvD(D){return gK(D)||fK(D)}function i6(D){if(gK(D))return HS(D);else if(fK(D))return BS(D);return D}function eg(D=i6(b$()),$=void 0){let J=$?.split(",")[0],F=J??wD(D,N0);if(!HD(F)){let X=J?`Package.json at ${F} does not exist`:`No package.json found at ${F}. Run this command from your project root (the folder that contains package.json), or pass --package-json <path> to point at it (for example in a monorepo).`;throw DD.error(X),Error(X)}let U=Z$(F);return JSON.parse(U)}function vvD(D=i6(b$()),$=void 0){return eg(D,$).scripts}function TvD(D=i6(b$()),$=void 0){return eg(D,$).version??""}function zJD(D){let $=D.replace("^","").replace("~","");if(i3($))try{let J=t0($);return FQ(J)}catch{return $}return $}async function bvD(D,$=b$(),J){let F=J?J.split(",").map((Y)=>Y.trim()).filter(Boolean):[],U=[],X=(Y)=>{let Q=eD(Y);if(!U.includes(Q))U.push(Q)};for(let Y of F){let Q=eD($,Y);if(HD(Q))X(l6(Q))}X(eD($)),X(b$());for(let Y of U)try{let Q=`${D}/package.json`,{createRequire:q}=await import("node:module"),W=q(wD(Y,"package.json")).resolve(Q),G=JSON.parse(Z$(W,"utf-8"));if(G.version)return G.version}catch{}for(let Y of U){let Q=Y,q=J2.parse(Q).root;while(Q!==q){let K=wD(Q,"node_modules",D,N0);if(HD(K))try{let G=JSON.parse(Z$(K,"utf-8"));if(G.version)return G.version}catch{}let W=l6(Q);if(W===Q)break;Q=W}}if(D==="@capgo/capacitor-updater"){let Y=null,Q=wD($,"ios","App","Podfile");if(HD(Q))try{let K=Z$(Q,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(K?.[1])Y=eD(wD($,"ios","App",K[1]))}catch{}if(!Y){let q=wD($,"android","capacitor.settings.gradle");if(HD(q))try{let W=Z$(q,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(W?.[1])Y=eD(wD($,"android",W[1])).replace(/\/android$/,"")}catch{}}if(Y){let q=wD(Y,N0);if(HD(q))try{let K=JSON.parse(Z$(q,"utf-8"));if(K.version)return K.version}catch{}}}try{let Y=J?J.split(",").map((K)=>K.trim()).filter(Boolean).join(","):J,q=(await SX($,Y)).get(D);if(q)return q}catch{}return null}async function SX(D=i6(b$()),$=void 0){let J=$?.split(",").map((X)=>X.trim()).filter(Boolean);if(J??=[wD(D,N0)],J){for(let X of J)if(!HD(X)){let Y=`Package.json at ${X} does not exist`;throw DD.error(Y),Error(Y)}}let F=new Map,{createRequire:U}=await import("node:module");for(let X of J){let Y=Z$(X),Q=JSON.parse(Y),q=l6(X),K=(W,G)=>{try{let H=U(wD(q,"package.json")).resolve(`${W}/package.json`),B=JSON.parse(Z$(H,"utf-8"));if(B.version)return B.version}catch{}let I=q,z=J2.parse(I).root;while(I!==z){let Z=wD(I,"node_modules",W,N0);if(HD(Z))try{let B=JSON.parse(Z$(Z,"utf-8"));if(B.version)return B.version}catch{}let H=l6(I);if(H===I)break;I=H}return zJD(G)};for(let W in Q.dependencies)F.set(W,K(W,Q.dependencies[W]));for(let W in Q.devDependencies)F.set(W,K(W,Q.devDependencies[W]))}return F}async function ZJD(D=i6(b$()),$=void 0){let J=$?.split(",").map((U)=>U.trim()).filter(Boolean);if(J??=[wD(D,N0)],J){for(let U of J)if(!HD(U)){let X=`Package.json at ${U} does not exist`;throw DD.error(X),Error(X)}}let F=new Map;for(let U of J){let X=Z$(U),Y=JSON.parse(X);for(let Q in Y.dependencies??{})if(typeof Y.dependencies[Q]==="string")F.set(Q,Y.dependencies[Q]);for(let Q in Y.devDependencies??{})if(typeof Y.devDependencies[Q]==="string")F.set(Q,Y.devDependencies[Q])}return F}function HJD(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&HD(D.path)}async function Df(D,$=!1){let J=BJD;try{let F=await D();if(!HJD(F)){if(!$)DD.error(J);throw new MD(J)}return F}catch(F){if(F instanceof MD)throw F;let U=Q$(F);if(!$)DD.error(`${J}: ${U}`);throw new MD(J,{cause:U})}}function _q(D=!1){return Df(cK,D)}function OJD(D=!1){return Df(nK,D)}async function NJD(D,$){let J=await OJD();if(J?.config)J.config.plugins??={},J.config.plugins.extConfig??={},J.config.plugins[D]??={},J.config.plugins[D]={...J.config.plugins[D],...$},await pK(D,J);return J}async function PvD(D){return NJD("CapacitorUpdater",D)}function hg(D,$){if(typeof $!=="string"||!$.trim())return;try{return $2($)}catch(J){throw new MD(`Invalid ${D} in capacitor config: ${J instanceof Error?J.message:String(J)}`)}}async function F8(D=!1){let $;try{$=await _q(D)}catch{return mg({host:yg,hostWeb:TX,hostFilesApi:HO,hostApi:BO})}let J=hg("localApi",$?.config?.plugins?.CapacitorUpdater?.localApi),F=hg("localApiFiles",$?.config?.plugins?.CapacitorUpdater?.localApiFiles),U={host:$?.config?.plugins?.CapacitorUpdater?.localHost||yg,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||TX,hostFilesApi:F??J??HO,hostApi:J??BO};if(!J&&$?.config?.plugins?.CapacitorUpdater?.localSupa&&!RO().apiHost&&!OO("CAPGO_API_HOST"))throw new MD("`localSupa` in capacitor.config is no longer supported. Set `localApi` to your Capgo API URL instead.");return mg(U)}function Ff(D){return{apiHost:D.apiHost?$2(D.apiHost):void 0,filesHost:D.filesHost?$2(D.filesHost):void 0}}function RO(){return Jf.getStore()??$f}function SvD(D){$f=Ff(D)}function jJD(D,$){return Jf.run(Ff(D),$)}function OO(D){let $=x1[D]?.trim();return $?$2($):void 0}function mg(D){let $=RO(),J=$.apiHost??OO("CAPGO_API_HOST"),F=$.filesHost??($.apiHost?void 0:OO("CAPGO_FILES_HOST"));if(J)D.hostApi=J,D.hostFilesApi=J;if(F)D.hostFilesApi=F;return D}function lg(D){return typeof D==="object"&&D!==null}function VJD(D){if(!lg(D))return!1;let $=D.capacitor;if(lg($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function LJD(D){if(HD(wD(D,"plugin.xml")))return!0;let $=wD(D,N0);if(!HD($))return!1;try{return VJD(JSON.parse(Z$($,"utf-8")))}catch{return!1}}function Xf(D,$){if($)return $;return D===BO||D===HO?RJD():void 0}async function Yf(D=!1,$,J){let F=(K)=>{let W={...K};return mE(W,void 0,D),W},U=await F8(D),X=U.hostApi,Y=ig.get(X);if(Y)return F(Y);let Q=zO.get(X);if(!$&&Q)return Q.then(F);let q=(async()=>{try{let K=Xf(X,J),W=await fetch(`${X}/private/config`,{...$?{signal:$}:{},redirect:"manual",headers:Q6(K?{capgkey:K}:void 0)});if(!W.ok)throw Error(`HTTP error! status: ${W.status}`);let I={...await W.json(),...U};return ig.set(X,I),{...I}}catch{if(!D)DD.info(`Local config ${Q$(U)}`);return{...U}}finally{if(!$)zO.delete(X)}})();if(!$)zO.set(X,q);return q.then(F)}async function _vD(D){let $=await F8();try{let J=Xf($.hostFilesApi,D),F=await fetch(`${$.hostFilesApi}/files/config`,{redirect:"manual",headers:Q6(J?{capgkey:J}:void 0)});if(!F.ok)throw Error(`HTTP error! status: ${F.status}`);return await F.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:YJD,maxChunkSize:QJD,alertUploadSize:XJD}}}function wJD(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function dg(D,$){let J=D.indexOf($);if(J<0)return D;return D.slice(J+$.length).replace(/^:\s*/,"").split(`
260
+ `)[0].trim()}async function kvD(D){let $=await m$(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let J=D instanceof Error?D.message:String(D??"");if(J.includes("CHANNEL_ZIP_REQUIRED"))return dg(J,"CHANNEL_ZIP_REQUIRED");if(J.includes("CHANNEL_DELTA_REQUIRED"))return dg(J,"CHANNEL_DELTA_REQUIRED");return null}function $2(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw new MD("Capgo API host must use HTTPS");let J=$.hostname==="localhost"||$.hostname==="127.0.0.1"||$.hostname==="[::1]";if($.protocol==="http:"&&!J)throw new MD("Capgo API host must use HTTPS (HTTP is only allowed for localhost)");if($.username||$.password)throw new MD("Capgo API host must not include credentials");if($.search||$.hash)throw new MD("Capgo API host must not include query parameters or fragments");return`${$.origin}${V1($.pathname)}`}async function MO(D,$=!0,J){let F=await F8($),U=D?$2(D):F.hostApi,X=J?$2(J):D&&U!==F.hostApi?U:F.hostFilesApi;return{apiHost:U,filesHost:X}}async function C1(D){let $=await m$(D);if($){let J=wJD($);if(J)return J}return Q$(D)}async function oD(D,$){let J=($.method??"POST").toUpperCase(),F=await MO($.apiHost),U=$.useFilesHost?F.filesHost:F.apiHost,X=`${V1(U)}/${D.replace(/^\//,"")}`,Y=$.instrument!==!1&&SE()?kE(D.replace(/^\//,"")):fetch;try{let Q=await Y(X,{method:J,redirect:"manual",headers:Q6({"Content-Type":"application/json",Authorization:$.apikey,capgkey:$.apikey,...$.apiVersion?{capgo_api:$.apiVersion}:{}}),body:J==="GET"||J==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!Q.ok)return{data:null,error:new $8(Q)};return{data:(Q.headers.get("content-type")??"").includes("application/json")?await Q.json().catch(()=>null):await Q.text().catch(()=>null),error:null}}catch(Q){return{data:null,error:Q instanceof Error?Q:Error(String(Q))}}}async function CvD(D,$=!0){return(await MO(D?.apiHost,$)).apiHost}async function uvD(D,$,J=!1,F,U){let X=kY("capgkey",D),Y=async()=>{await Yf(J,F,X);let K=await MO(void 0,J);if($&&!J)DD.info(`Using custom Capgo API ${K.apiHost}`);return{apikey:X,...K}};if(!$&&!U)return Y();let Q=RO(),q=$?$2($):Q.apiHost;return jJD({apiHost:q,filesHost:U??(q===Q.apiHost?Q.filesHost:void 0)},Y)}async function gvD(D,$,J={}){let{data:F,error:U}=await oD(`private/cli/members/2fa-status?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:J.apiHost});if(U)throw U;return F??[]}async function fvD(D,$,J={}){let{data:F,error:U}=await oD(`private/cli/members/password-policy?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:J.apiHost});if(U)throw U;return F??[]}function bX(D){try{if(!HD(D))return;return Z$(D,"utf8").trim()||void 0}catch{return}}function RJD(){let D=x1.CAPGO_TOKEN?.trim();if(D)return D;let $=bX(`${cg()}/.capgo`);if($)return $;return bX(".capgo")}function $A(D=!1,$=(J)=>DD.info(J)){let J=x1.CAPGO_TOKEN?.trim();if(J){if(!D)$("Use CAPGO_TOKEN environment variable");return J}let U=`${cg()}/.capgo`,X=bX(U);if(X){if(!D)$(`Use global API key ${U}`)}else if(U=".capgo",X=bX(U),X&&!D)$(`Use local API key ${U}`);if(!X){let Q=`No Capgo API key found. Run \`${uS()}\` first, then retry this command.`;throw DD.error(Q),new MD(Q)}return X}async function*EO(D){let $=await z3(D,{withFileTypes:!0});for(let J of $){let F=eD(D,J.name);if(J.isDirectory()&&!J.name.startsWith(".")&&!J.name.startsWith("node_modules")&&!J.name.startsWith("dist"))yield*EO(F);else yield F}}function xvD(D){let J=(D.endsWith(".br")?D.slice(0,-3):D).split(".").pop()?.toLowerCase()||"";return{html:"text/html",htm:"text/html",js:"application/javascript",mjs:"application/javascript",cjs:"application/javascript",css:"text/css",json:"application/json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",mp4:"video/mp4",webm:"video/webm",xml:"application/xml",txt:"text/plain",md:"text/markdown",pdf:"application/pdf",wasm:"application/wasm",map:"application/json"}[J]||"application/octet-stream"}function g1(D,$){return`${D}-${$?"ts":"js"}`}function f1(D,$){if(!$)DD.info(`Found ${D} project`)}function MJD(D){if(HD(eD(D,"angular.json")))return"angular";if(HD(eD(D,"nuxt.config.js"))||HD(eD(D,"nuxt.config.ts")))return"nuxtjs";if(HD(eD(D,"next.config.js"))||HD(eD(D,"next.config.mjs"))||HD(eD(D,"next.config.ts")))return"nextjs";if(HD(eD(D,"svelte.config.js"))||HD(eD(D,"svelte.config.ts")))return"sveltekit";if(HD(eD(D,"vue.config.js"))||HD(eD(D,"vue.config.ts")))return"vue"}function Qf(D){if(D.get("@angular/core"))return"angular";if(D.get("nuxt"))return"nuxtjs";if(D.get("next"))return"nextjs";if(D.get("@sveltejs/kit"))return"sveltekit";if(D.get("svelte"))return"svelte";if(D.get("vue"))return"vue";if(D.get("react"))return"react"}async function EJD(D,$){let J=HD(eD(D,"tsconfig.json")),F=MJD(D);if(F)return f1(F,$),g1(F,J);let U=eD(D,N0);if(!HD(U))return;let X=await SX(void 0,U),Y=Qf(X);if(!Y)return;return f1(Y,$),g1(Y,J)}function ZO(D,$){if(!$)return;let J=eD($);if(!D.includes(J))D.push(J)}function AJD(D){let $=D,J=J2.parse($).root;while(!0){if(HD(eD($,N0)))return $;if($===J)return;let F=l6($);if(F===$)return;$=F}}function vJD(D){let $=[],J=D?.split(",").map((F)=>F.trim()).filter(Boolean)[0];if(J)ZO($,l6(eD(J)));return ZO($,AJD(b$())),ZO($,i6(b$())),$}async function yvD(D){let $=b$(),J=!1,F=D?.quiet??!1;for(let X of vJD(D?.packageJsonPath)){let Y=await EJD(X,F);if(Y)return Y}let U=eD($,"tsconfig.json");if(HD(U))J=!0;for await(let X of EO($)){if(X.includes("angular.json"))return f1("angular",F),g1("angular",J);if(X.includes("nuxt.config.js")||X.includes("nuxt.config.ts"))return f1("nuxtjs",F),g1("nuxtjs",J);if(X.includes("next.config.js")||X.includes("next.config.mjs")||X.includes("next.config.ts"))return f1("nextjs",F),g1("nextjs",J);if(X.includes("svelte.config.js")||X.includes("svelte.config.ts"))return f1("sveltekit",F),g1("sveltekit",J);if(X.includes("vue.config.js")||X.includes("vue.config.ts"))return f1("vue",F),g1("vue",J);if(X.includes(N0)){let Y=l6(X),Q=await SX(Y),q=Qf(Q);if(q)return f1(q,F),g1(q,J)}}return"unknown"}function hvD(D,$,J=b$()){if(D==="angular-js"||D==="angular-ts")return $?"src/main.ts":"src/main.js";if(D==="nextjs-js"||D==="nextjs-ts")return $?"src/app/layout.tsx":"src/app/layout.js";if(D==="svelte-js"||D==="svelte-ts")return $?"src/main.ts":"src/main.js";if(D==="vue-js"||D==="vue-ts")return $?"src/main.ts":"src/main.js";if(D==="react-js"||D==="react-ts"){let F=$?"src/main.tsx":"src/main.js",U=$?"src/index.tsx":"src/index.js";if(HD(eD(J,F)))return F;return U}return null}async function mvD(D){let $=D.replace(/-(?:ts|js)$/,"");if($==="angular")return DD.info("Angular project detected"),"build";if($==="nuxtjs")return DD.info("Nuxtjs project detected"),"generate";if($==="nextjs"){if(DD.info("Nextjs project detected"),DD.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),DD.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),!await $1({message:"Do you want to continue?"}))throw DD.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}if($==="sveltekit"){if(DD.info("Sveltekit project detected"),DD.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),DD.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adapter"),!await $1({message:"Do you want to continue?"}))throw DD.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}return"build"}async function lvD(D=!1,$=b$()){let J=/(main|index)\.(ts|tsx|js|jsx)$/,F="",U=eD($),X=U.split("/").length;for await(let Y of EO(U))if(Y.split("/").length-X<=2&&J.test(Y)){if(F=Y,!D)DD.info(`Found main file here ${Y}`);break}return F}async function ivD(D,$,J,F){let U={app_id:$,name:J,version:0};try{let X=await oD("files/upload_link",{apikey:D,body:U,useFilesHost:!0,apiHost:F?.apiHost});if(X.error){if(X.error instanceof $8){let Y=await X.error.context.json().catch(()=>({}));DD.error(`Upload URL error: ${Y.status||JSON.stringify(Y)}`)}else DD.error(`Cannot get upload url: ${X.error.message}`);return""}return X.data?.url??""}catch(X){DD.error(`Cannot get upload url ${Q$(X)}`)}return""}async function*qf(D){let $=z3(D,{withFileTypes:!0});for(let J of $){let F=wD(D,J.name);if(J.isDirectory())yield*qf(F);else yield F}}function pvD(D,$="5.10.0",J="6.25.0",F="7.25.0"){if(D.major===5&&s1(D,t0($)))return!0;if(D.major===6&&s1(D,t0(J)))return!0;if(D.major===7&&s1(D,t0(F)))return!0;return!1}async function rvD(D){let $=[],J=[".DS_Store",".git",".gitignore","node_modules","package-lock.json","tsconfig.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json"];for await(let F of qf(D)){if(J.some((Q)=>F.includes(Q))){DD.info(`Ignoring file ${F}, please ensure you have only required files in your dist folder`);continue}let U=Z$(F);if(U.length===0){DD.info(`Ignoring empty file ${F}, please ensure you have only required files in your dist folder`);continue}let X=await NS(U,"sha256"),Y=pg(D,F);if(Y.startsWith("/"))Y=Y.substring(1);$.push({file:Y,hash:X})}return $}async function tvD(D){if(ng()==="win32")return bJD(D);else return TJD(D)}function TJD(D){let $=new LO.default;return $.addLocalFolder(D),$.toBuffer()}async function bJD(D){DD.info("Zipping file windows mode");let $=new LO.default,J=(F,U)=>{let X=z3(F);for(let Y of X){let Q=wD(F,Y),q=$JD(Q);if(q.isFile()){let K=Z$(Q);$.addFile(wD(U,Y).split(rg).join("/"),K)}else if(q.isDirectory())J(Q,wD(U,Y))}};return J(D,""),$.toBuffer()}function PJD(D){let $=jO();return`App ${D} does not exist, run first \`${$.runner} @capgo/cli app add ${D}\` to create it`}function SJD(D){let J=D?.originalResponse?.getBody?.(),F=D instanceof Error?D.message:String(D??"");return`${J??""} ${F}`.includes("app_not_found")}async function ovD(D,$,J,F,U,X,Y,Q){return new Promise((q,K)=>{PJ(D,{channel:"app",event:"App TUS upload",org_id:J,tracking_version:2,tags:{"app-id":F}}),new PX.Upload($,{endpoint:`${Y.hostFilesApi}/files/upload/attachments/`,chunkSize:Q,retryDelays:[...qJD],metadataForPartialUploads:{filename:`orgs/${J}/apps/${F}/${U}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${J}/apps/${F}/${U}.zip`,filetype:"application/zip"},headers:Q6({Authorization:D}),onError(G){if(DD.error(`Error uploading bundle: ${G.message}`),SJD(G)){K(Error(PJD(F)));return}if(G instanceof PX.DetailedError){let I=G.originalResponse?.getBody(),z=G.originalResponse?.getStatus(),Z=G.originalRequest?.getURL(),H=(()=>{try{let B=JSON.parse(I||'{"error": "unknown error"}');return B.status||B.error||B.message||"unknown error"}catch{return I||G.message}})();K(Error(`TUS upload failed (status ${z??"unknown"}, url ${Z??"unknown"}): ${H}`))}else K(Error(`TUS upload failed: ${G.message||G.toString()}`))},onProgress(G,I){let z=(G/I*100).toFixed(2);X.message(`Uploaded ${z}%`)},async onSuccess(){await PJ(D,{channel:"app",event:"App TUS done",org_id:J,tracking_version:2,tags:{"app-id":F}}).catch(),q(!0)}}).start()})}async function avD(D,$,J,F){let X=await oD("private/delete_failed_version",{apikey:D,method:"DELETE",body:{app_id:$,name:J},apiHost:F?.apiHost});if(X.error){if(X.error instanceof $8){let Y=await X.error.context.json().catch(()=>({}));throw Error(Y.status||Y.message||JSON.stringify(Y))}throw Error(X.error.message)}}async function svD(D,$,J,F,U){let X={app_id:$,name:J,manifest:F},Y=await bJ(()=>oD("private/set_manifest",{apikey:D,body:X,apiHost:U?.apiHost}));if(Y.error){if(Y.error instanceof $8){let Q=await Y.error.context.json().catch(()=>({}));throw Error(Q.error||Q.status||Q.message||JSON.stringify(Q))}throw Error(Y.error.message)}}async function PJ(D,$,J,F,U,X){let Y=Date.now();if((k9(x1.CAPGO_DISABLE_TELEMETRY)||k9(x1.CAPGO_DISABLE_POSTHOG))&&!$.notifyConsole)return;try{let q={};try{q=vE()}catch(Z){if(J)DD.error(`Failed to enrich event tags, sending caller tags only: ${Q$(Z)}`)}let K={...$,nonPersonTags:{...q,...$.nonPersonTags??{}}};if(J)DD.info(`Get remove config: for ${$.event}`);let W=U??(await Yf(!0,F)).hostApi;if(J)DD.info(`Sending analytics event: ${JSON.stringify(K)}`);let G=new AbortController,I=setTimeout(()=>G.abort(),1e4),z=F?typeof AbortSignal.any==="function"?AbortSignal.any([G.signal,F]):F:G.signal;try{B6("telemetry request started");let Z=await fetch(`${V1(W)}/private/events`,{method:"POST",body:JSON.stringify(K),headers:Q6({"Content-Type":"application/json",capgkey:D}),signal:z,redirect:X});if(B6("telemetry response received",{duration_ms:Date.now()-Y,status:Z.status}),clearTimeout(I),!Z.ok)throw Error(`HTTP error! status: ${Z.status}`);let H=await Z.json();if(H.error&&J)DD.error(`Failed to send analytics event: ${H.error}`)}finally{clearTimeout(I)}}catch(q){if(B6("telemetry request failed",{duration_ms:Date.now()-Y,error:zF(q)}),J)DD.error("Failed to send Stats event details:"),DD.error(Q$(q))}}function _JD(D){if(DD.error(`
261
261
  \uD83D\uDD10 Access Denied: Two-Factor Authentication Required`),DD.error("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"),D)DD.error(`
262
262
  The organization "${D}" requires all members to have 2FA enabled.`);else DD.error(`
263
263
  This organization requires all members to have 2FA enabled.`);throw DD.error(`
@@ -291,5 +291,5 @@ const ${K.map((W)=>`_${j0[W]} = ${j0[W]}`).join(", ")}
291
291
  `:""} ? ${H}.value ${_} ${v} : ${H}`}else if(L){N.start=B.start,N.end=B.end;let{prefix:u,operator:_}=B,y=u?_:"",v=u?"":_;return`${$.helperString(q7)}(${H})${$.isTS?` //@ts-ignore
292
292
  `:""} ? ${y}${H}.value${v} : ${y}${H}${v}`}else if(A)return H;else return C(H);else if(j==="props")return o.genPropsAccessExp(H);else if(j==="props-aliased")return o.genPropsAccessExp(Y.__propsAliases[H])}else if(j&&j.startsWith("setup")||j==="literal-const")return`$setup.${H}`;else if(j==="props-aliased")return`$props['${Y.__propsAliases[H]}']`;else if(j)return`$${j}.${H}`;return`_ctx.${H}`},q=D.content,K=D.ast;if(K===!1)return D;if(K===null||!K&&s6(q)){let H=$.identifiers[q],B=o.isGloballyAllowed(q),N=mKD(q);if(!J&&!H&&!N&&(!B||Y[q])){if(Oy(Y[q]))D.constType=1;D.content=Q(q)}else if(!H)if(N)D.constType=3;else D.constType=2;return D}if(!K){let H=F?` ${q} `:`(${q})${J?"=>{}":""}`;try{K=R3.parseExpression(H,{sourceType:"module",plugins:$.expressionPlugins})}catch(B){return $.onError(mD(46,D.loc,void 0,B.message)),D}}let W=[],G=[],I=Object.create($.identifiers);gy(K,(H,B,N,j,O)=>{if(dy(H,B))return;if(H.name.startsWith("_filter_"))return;let L=j&&lKD(H);if(L&&!O){if(lN(B)&&B.shorthand)H.prefix=`${H.name}: `;H.name=Q(H.name,B,H),W.push(H)}else{if(!(L&&O)&&(!B||B.type!=="CallExpression"&&B.type!=="NewExpression"&&B.type!=="MemberExpression"))H.isConstant=!0;W.push(H)}},!0,G,I);let z=[];W.sort((H,B)=>H.start-B.start),W.forEach((H,B)=>{let N=H.start-1,j=H.end-1,O=W[B-1],L=q.slice(O?O.end-1:0,N);if(L.length||H.prefix)z.push(L+(H.prefix||""));let A=q.slice(N,j);if(z.push(OD(H.name,!1,{start:EN(D.loc.start,A,N),end:EN(D.loc.start,A,j),source:A},H.isConstant?3:0)),B===W.length-1&&j<q.length)z.push(q.slice(j))});let Z;if(z.length)Z=_0(z,D.loc),Z.ast=K;else Z=D,Z.constType=3;return Z.identifiers=Object.keys(I),Z}function lKD(D){if(o.isGloballyAllowed(D.name))return!1;if(D.name==="require")return!1;return!0}function eN(D){if(o.isString(D))return D;else if(D.type===4)return D.content;else return D.children.map(eN).join("")}function Oy(D){return D==="setup-const"||D==="literal-const"}var iKD=sN(/^(?:if|else|else-if)$/,(D,$,J)=>{return zh(D,$,J,(F,U,X)=>{let Y=J.parent.children,Q=Y.indexOf(F),q=0;while(Q-->=0){let K=Y[Q];if(K&&K.type===9)q+=K.branches.length}return()=>{if(X)F.codegenNode=jy(U,q,J);else{let K=cKD(F.codegenNode);K.alternate=jy(U,q+F.branches.length-1,J)}}})});function zh(D,$,J,F){if($.name!=="else"&&(!$.exp||!$.exp.content.trim())){let U=$.exp?$.exp.loc:D.loc;J.onError(mD(28,$.loc)),$.exp=OD("true",!1,U)}if(J.prefixIdentifiers&&$.exp)$.exp=K0($.exp,J);if($.name==="if"){let U=Ny(D,$),X={type:9,loc:ZKD(D.loc),branches:[U]};if(J.replaceNode(X),F)return F(X,U,!0)}else{let U=J.parent.children,X=[],Y=U.indexOf(D);while(Y-->=-1){let Q=U[Y];if(Q&&oN(Q)){if(J.removeNode(Q),Q.type===3)X.unshift(Q);continue}if(Q&&Q.type===9){if(($.name==="else-if"||$.name==="else")&&Q.branches[Q.branches.length-1].condition===void 0)J.onError(mD(30,D.loc));J.removeNode();let q=Ny(D,$);if(X.length&&!(J.parent&&J.parent.type===1&&(J.parent.tag==="transition"||J.parent.tag==="Transition")))q.children=[...X,...q.children];{let W=q.userKey;if(W)Q.branches.forEach(({userKey:G})=>{if(dKD(G,W))J.onError(mD(29,q.userKey.loc))})}Q.branches.push(q);let K=F&&F(Q,q,!1);if(Z7(q,J),K)K();J.currentNode=null}else J.onError(mD(30,D.loc));break}}}function Ny(D,$){let J=D.tagType===3;return{type:10,loc:D.loc,condition:$.name==="else"?void 0:$.exp,children:J&&!q0(D,"for")?D.children:[D],userKey:W7(D,"key"),isTemplateIf:J}}function jy(D,$,J){if(D.condition)return JY(D.condition,Vy(D,$,J),y$(J.helper(P3),['"v-if"',"true"]));else return Vy(D,$,J)}function Vy(D,$,J){let{helper:F}=J,U=j$("key",OD(`${$}`,!1,V$,2)),{children:X}=D,Y=X[0];if(X.length!==1||Y.type!==1)if(X.length===1&&Y.type===11){let q=Y.codegenNode;return I7(q,U,J),q}else{let q=64;if(!D.isTemplateIf&&X.filter((K)=>K.type!==3).length===1)q|=2048;return v3(J,F(E3),k0([U]),X,q,void 0,void 0,!0,!1,!1,D.loc)}else{let q=Y.codegenNode,K=ry(q);if(K.type===13)wY(K,J);return I7(K,U,J),q}}function dKD(D,$){if(!D||D.type!==$.type)return!1;if(D.type===6){if(D.value.content!==$.value.content)return!1}else{let J=D.exp,F=$.exp;if(J.type!==F.type)return!1;if(J.type!==4||J.isStatic!==F.isStatic||J.content!==F.content)return!1}return!0}function cKD(D){while(!0)if(D.type===19)if(D.alternate.type===19)D=D.alternate;else return D;else if(D.type===20)D=D.value}var nKD=sN("for",(D,$,J)=>{let{helper:F,removeHelper:U}=J;return Zh(D,$,J,(X)=>{let Y=y$(F(HY),[X.source]),Q=b3(D),q=q0(D,"memo"),K=W7(D,"key",!1,!0),W=K&&K.type===7,G=K&&(K.type===6?K.value?OD(K.value.content,!0):void 0:K.exp),I=G?j$("key",G):null;{if(Q&&q)q.exp=K0(q.exp,J);if((Q||q)&&I&&W){if(G=K.exp=I.value=K0(I.value,J),q)J.vForMemoKeyedNodes.add(D)}}let z=X.source.type===4&&X.source.constType>0,Z=z?64:K?128:256;return X.codegenNode=v3(J,F(E3),void 0,Y,Z,void 0,void 0,!0,!z,!1,D.loc),()=>{let H,{children:B}=X;if(Q)D.children.some((O)=>{if(O.type===1){let L=W7(O,"key");if(L)return J.onError(mD(33,L.loc)),!0}});let N=B.length!==1||B[0].type!==1,j=G7(D)?D:Q&&D.children.length===1&&G7(D.children[0])?D.children[0]:null;if(j){if(H=j.codegenNode,Q&&I)I7(H,I,J)}else if(N)H=v3(J,F(E3),I?k0([I]):void 0,D.children,64,void 0,void 0,!0,void 0,!1);else{if(H=B[0].codegenNode,Q&&I)I7(H,I,J);if(H.isBlock!==!z)if(H.isBlock)U(r1),U(Z2(J.inSSR,H.isComponent));else U(z2(J.inSSR,H.isComponent));if(H.isBlock=!z,H.isBlock)F(r1),F(Z2(J.inSSR,H.isComponent));else F(z2(J.inSSR,H.isComponent))}if(q){let O=I2(XY(X.parseResult,[OD("_cached")]));O.body=_y([_0(["const _memo = (",q.exp,")"]),_0(["if (_cached && _cached.el",...G?[" && _cached.key === ",G]:[],` && ${J.helperString(yN)}(_cached, _memo)) return _cached`]),_0(["const _item = ",H]),OD("_item.memo = _memo"),OD("return _item")]),Y.arguments.push(O,OD("_cache"),OD(String(J.cached.length))),J.cached.push(null)}else Y.arguments.push(I2(XY(X.parseResult),H,!0))}})});function Zh(D,$,J,F){if(!$.exp){J.onError(mD(31,$.loc));return}let U=$.forParseResult;if(!U){J.onError(mD(32,$.loc));return}Dj(U,J);let{addIdentifiers:X,removeIdentifiers:Y,scopes:Q}=J,{source:q,value:K,key:W,index:G}=U,I={type:11,loc:$.loc,source:q,valueAlias:K,keyAlias:W,objectIndexAlias:G,parseResult:U,children:b3(D)?D.children:[D]};if(J.replaceNode(I),Q.vFor++,J.prefixIdentifiers)K&&X(K),W&&X(W),G&&X(G);let z=F&&F(I);return()=>{if(Q.vFor--,J.prefixIdentifiers)K&&Y(K),W&&Y(W),G&&Y(G);if(z)z()}}function Dj(D,$){if(D.finalized)return;if($.prefixIdentifiers){if(D.source=K0(D.source,$),D.key)D.key=K0(D.key,$,!0);if(D.index)D.index=K0(D.index,$,!0);if(D.value)D.value=K0(D.value,$,!0)}D.finalized=!0}function XY({value:D,key:$,index:J},F=[]){return pKD([D,$,J,...F])}function pKD(D){let $=D.length;while($--)if(D[$])break;return D.slice(0,$+1).map((J,F)=>J||OD("_".repeat(F+1),!1))}var Ly=OD("undefined",!1),Hh=(D,$)=>{if(D.type===1&&(D.tagType===1||D.tagType===3)){let J=q0(D,"slot");if(J){let F=J.exp;if($.prefixIdentifiers)F&&$.addIdentifiers(F);return $.scopes.vSlot++,()=>{if($.prefixIdentifiers)F&&$.removeIdentifiers(F);$.scopes.vSlot--}}}},Bh=(D,$)=>{let J;if(b3(D)&&D.props.some(EY)&&(J=q0(D,"for"))){let F=J.forParseResult;if(F){Dj(F,$);let{value:U,key:X,index:Y}=F,{addIdentifiers:Q,removeIdentifiers:q}=$;return U&&Q(U),X&&Q(X),Y&&Q(Y),()=>{U&&q(U),X&&q(X),Y&&q(Y)}}}},rKD=(D,$,J,F)=>I2(D,J,!1,!0,J.length?J[0].loc:F);function Oh(D,$,J=rKD){$.helper(VY);let{children:F,loc:U}=D,X=[],Y=[],Q=$.scopes.vSlot>0||$.scopes.vFor>0;if(!$.ssr&&$.prefixIdentifiers)Q=D.props.some((B)=>EY(B)&&(c$(B.arg,$.identifiers)||c$(B.exp,$.identifiers)))||F.some((B)=>c$(B,$.identifiers));let q=q0(D,"slot",!0);if(q){let{arg:B,exp:N}=q;if(B&&!Y6(B))Q=!0;X.push(j$(B||OD("default",!0),J(N,void 0,F,U)))}let K=!1,W=!1,G=[],I=new Set,z=0;for(let B=0;B<F.length;B++){let N=F[B],j;if(!b3(N)||!(j=q0(N,"slot",!0))){if(N.type!==3)G.push(N);continue}if(q){$.onError(mD(37,j.loc));break}K=!0;let{children:O,loc:L}=N,{arg:A=OD("default",!0),exp:E,loc:C}=j,u;if(Y6(A))u=A?A.content:"default";else Q=!0;let _=q0(N,"for"),y=J(E,_,O,L),v,i;if(v=q0(N,"if"))Q=!0,Y.push(JY(v.exp,pX(A,y,z++),Ly));else if(i=q0(N,/^else(?:-if)?$/,!0)){let c=B,n;while(c--)if(n=F[c],!oN(n))break;if(n&&b3(n)&&q0(n,/^(?:else-)?if$/)){let t=Y[Y.length-1];while(t.alternate.type===19)t=t.alternate;t.alternate=i.exp?JY(i.exp,pX(A,y,z++),Ly):pX(A,y,z++)}else $.onError(mD(30,i.loc))}else if(_){Q=!0;let c=_.forParseResult;if(c)Dj(c,$),Y.push(y$($.helper(HY),[c.source,I2(XY(c),pX(A,y),!0)]));else $.onError(mD(32,_.loc))}else{if(u){if(I.has(u)){$.onError(mD(38,C));continue}if(I.add(u),u==="default")W=!0}X.push(j$(A,y))}}if(!q){let B=(N,j)=>{let O=J(N,void 0,j,U);if($.compatConfig)O.isNonScopedSlot=!0;return j$("default",O)};if(!K)X.push(B(void 0,F));else if(G.length&&!G.every(AY))if(W)$.onError(mD(39,G[0].loc));else X.push(B(void 0,G))}let Z=Q?2:eX(D.children)?3:1,H=k0(X.concat(j$("_",OD(Z+` /* ${o.slotFlagsText[Z]} */`,!1))),U);if(Y.length)H=y$($.helper(xN),[H,n1(Y)]);return{slots:H,hasDynamicSlots:Q}}function pX(D,$,J){let F=[j$("name",D),j$("fn",$)];if(J!=null)F.push(j$("key",OD(String(J),!0)));return k0(F)}function eX(D){for(let $=0;$<D.length;$++){let J=D[$];switch(J.type){case 1:if(J.tagType===2||eX(J.children))return!0;break;case 9:if(eX(J.branches))return!0;break;case 10:case 11:if(eX(J.children))return!0;break}}return!1}var Nh=new WeakMap,jh=(D,$)=>{return function(){if(D=$.currentNode,!(D.type===1&&(D.tagType===0||D.tagType===1)))return;let{tag:F,props:U}=D,X=D.tagType===1,Y=X?Vh(D,$):`"${F}"`,Q=o.isObject(Y)&&Y.callee===GY,q,K,W=0,G,I,z,Z=Q||Y===M3||Y===QY||!X&&(F==="svg"||F==="foreignObject"||F==="math");if(U.length>0){let H=$j(D,$,void 0,X,Q);q=H.props,W=H.patchFlag,I=H.dynamicPropNames;let B=H.directives;if(z=B&&B.length?n1(B.map((N)=>Lh(N,$))):void 0,H.shouldUseBlock)Z=!0}if(D.children.length>0){if(Y===F7){if(Z=!0,W|=1024,D.children.length>1)$.onError(mD(47,{start:D.children[0].loc.start,end:D.children[D.children.length-1].loc.end,source:""}))}if(X&&Y!==M3&&Y!==F7){let{slots:B,hasDynamicSlots:N}=Oh(D,$);if(K=B,N)W|=1024}else if(D.children.length===1&&Y!==M3){let B=D.children[0],N=B.type,j=N===5||N===8;if(j&&C0(B,$)===0)W|=1;if(j||N===2)K=B;else K=D.children}else K=D.children}if(I&&I.length)G=oKD(I);D.codegenNode=v3($,Y,q,K,W===0?void 0:W,G,z,!!Z,!1,X,D.loc)}};function Vh(D,$,J=!1){let{tag:F}=D,U=_N(F),X=W7(D,"is",!1,!0);if(X){if(U||p1("COMPILER_IS_ON_ELEMENT",$)){let Q;if(X.type===6)Q=X.value&&OD(X.value.content,!0);else if(Q=X.exp,!Q)Q=OD("is",!1,X.arg.loc),Q=X.exp=K0(Q,$);if(Q)return y$($.helper(GY),[Q])}else if(X.type===6&&X.value.content.startsWith("vue:"))F=X.value.content.slice(4)}let Y=dN(F)||$.isBuiltInComponent(F);if(Y){if(!J)$.helper(Y);return Y}{let Q=SN(F,$);if(Q)return Q;let q=F.indexOf(".");if(q>0){let K=SN(F.slice(0,q),$);if(K)return K+F.slice(q)}}if($.selfName&&o.capitalize(o.camelize(F))===$.selfName)return $.helper(U7),$.components.add(F+"__self"),H2(F,"component");return $.helper(U7),$.components.add(F),H2(F,"component")}function SN(D,$){let J=$.bindingMetadata;if(!J||J.__isScriptSetup===!1)return;let F=o.camelize(D),U=o.capitalize(F),X=(K)=>{if(J[D]===K)return D;if(J[F]===K)return F;if(J[U]===K)return U},Y=X("setup-const")||X("setup-reactive-const")||X("literal-const");if(Y)return $.inline?Y:`$setup[${JSON.stringify(Y)}]`;let Q=X("setup-let")||X("setup-ref")||X("setup-maybe-ref");if(Q)return $.inline?`${$.helperString(Q7)}(${Q})`:`$setup[${JSON.stringify(Q)}]`;let q=X("props");if(q)return`${$.helperString(Q7)}(${$.inline?"__props":"$props"}[${JSON.stringify(q)}])`}function $j(D,$,J=D.props,F,U,X=!1){let{tag:Y,loc:Q,children:q}=D,K=[],W=[],G=[],I=q.length>0,z=!1,Z=0,H=!1,B=!1,N=!1,j=!1,O=!1,L=!1,A=[],E=(y)=>{if(K.length)W.push(k0(wy(K),Q)),K=[];if(y)W.push(y)},C=()=>{if($.scopes.vFor>0)K.push(j$(OD("ref_for",!0),OD("true")))},u=({key:y,value:v})=>{if(Y6(y)){let i=y.content,c=o.isOn(i);if(c&&(!F||U)&&i.toLowerCase()!=="onclick"&&i!=="onUpdate:modelValue"&&!o.isReservedProp(i))j=!0;if(c&&o.isReservedProp(i))L=!0;if(c&&v.type===14)v=v.arguments[0];if(v.type===20||(v.type===4||v.type===8)&&C0(v,$)>0)return;if(i==="ref")H=!0;else if(i==="class")B=!0;else if(i==="style")N=!0;else if(i!=="key"&&!A.includes(i))A.push(i);if(F&&(i==="class"||i==="style")&&!A.includes(i))A.push(i)}else O=!0};for(let y=0;y<J.length;y++){let v=J[y];if(v.type===6){let{loc:i,name:c,nameLoc:n,value:t}=v,R=!0;if(c==="ref"){if(H=!0,C(),t&&$.inline){let V=$.bindingMetadata[t.content];if(V==="setup-let"||V==="setup-ref"||V==="setup-maybe-ref")R=!1,K.push(j$(OD("ref_key",!0),OD(t.content,!0,t.loc)))}}if(c==="is"&&(_N(Y)||t&&t.content.startsWith("vue:")||p1("COMPILER_IS_ON_ELEMENT",$)))continue;K.push(j$(OD(c,!0,n),OD(t?t.content:"",R,t?t.loc:i)))}else{let{name:i,arg:c,exp:n,loc:t,modifiers:R}=v,V=i==="bind",w=i==="on";if(i==="slot"){if(!F)$.onError(mD(40,t));continue}if(i==="once"||i==="memo")continue;if(i==="is"||V&&c1(c,"is")&&(_N(Y)||p1("COMPILER_IS_ON_ELEMENT",$)))continue;if(w&&X)continue;if(V&&c1(c,"key")||w&&I&&c1(c,"vue:before-update"))z=!0;if(V&&c1(c,"ref"))C();if(!c&&(V||w)){if(O=!0,n)if(V){{if(E(),W.some((f)=>{if(f.type===15)return f.properties.some(({key:a})=>{if(a.type!==4||!a.isStatic)return!0;return a.content!=="class"&&a.content!=="style"&&!o.isOn(a.content)});else return!0}))T3("COMPILER_V_BIND_OBJECT_ORDER",$,t);if(p1("COMPILER_V_BIND_OBJECT_ORDER",$)){W.unshift(n);continue}}C(),E(),W.push(n)}else E({type:14,loc:t,callee:$.helper(jY),arguments:F?[n]:[n,"true"]});else $.onError(mD(V?34:35,t));continue}if(V&&R.some((x)=>x.content==="prop"))Z|=32;let b=$.directiveTransforms[i];if(b){let{props:x,needRuntime:f}=b(v,D,$);if(!X&&x.forEach(u),w&&c&&!Y6(c))E(k0(x,Q));else K.push(...x);if(f){if(G.push(v),o.isSymbol(f))Nh.set(v,f)}}else if(!o.isBuiltInDirective(i)){if(G.push(v),I)z=!0}}}let _=void 0;if(W.length)if(E(),W.length>1)_=y$($.helper(X7),W,Q);else _=W[0];else if(K.length)_=k0(wy(K),Q);if(O)Z|=16;else{if(B&&!F)Z|=2;if(N&&!F)Z|=4;if(A.length)Z|=8;if(j)Z|=32}if(!z&&(Z===0||Z===32)&&(H||L||G.length>0))Z|=512;if(!$.inSSR&&_)switch(_.type){case 15:let y=-1,v=-1,i=!1;for(let t=0;t<_.properties.length;t++){let R=_.properties[t].key;if(Y6(R)){if(R.content==="class")y=t;else if(R.content==="style")v=t}else if(!R.isHandlerKey)i=!0}let c=_.properties[y],n=_.properties[v];if(!i){if(c&&!Y6(c.value))c.value=y$($.helper(OY),[c.value]);if(n&&(N||n.value.type===4&&n.value.content.trim()[0]==="["||n.value.type===17))n.value=y$($.helper(NY),[n.value])}else _=y$($.helper(A3),[_]);break;case 14:break;default:_=y$($.helper(A3),[y$($.helper(S3),[_])]);break}return{props:_,directives:G,patchFlag:Z,dynamicPropNames:A,shouldUseBlock:z}}function wy(D){let $=new Map,J=[];for(let F=0;F<D.length;F++){let U=D[F];if(U.key.type===8||!U.key.isStatic){J.push(U);continue}let X=U.key.content,Y=$.get(X);if(Y){if(X==="style"||X==="class"||o.isOn(X))tKD(Y,U)}else $.set(X,U),J.push(U)}return J}function tKD(D,$){if(D.value.type===17)D.value.elements.push($.value);else D.value=n1([D.value,$.value],D.loc)}function Lh(D,$){let J=[],F=Nh.get(D);if(F)J.push($.helperString(F));else{let X=SN("v-"+D.name,$);if(X)J.push(X);else $.helper(IY),$.directives.add(D.name),J.push(H2(D.name,"directive"))}let{loc:U}=D;if(D.exp)J.push(D.exp);if(D.arg){if(!D.exp)J.push("void 0");J.push(D.arg)}if(Object.keys(D.modifiers).length){if(!D.arg){if(!D.exp)J.push("void 0");J.push("void 0")}let X=OD("true",!1,U);J.push(k0(D.modifiers.map((Y)=>j$(Y,X)),U))}return n1(J,D.loc)}function oKD(D){let $="[";for(let J=0,F=D.length;J<F;J++)if($+=JSON.stringify(D[J]),J<F-1)$+=", ";return $+"]"}function _N(D){return D==="component"||D==="Component"}var aKD=(D,$)=>{if(G7(D)){let{children:J,loc:F}=D,{slotName:U,slotProps:X}=wh(D,$),Y=[$.prefixIdentifiers?"_ctx.$slots":"$slots",U,"{}","undefined","true"],Q=2;if(X)Y[2]=X,Q=3;if(J.length)Y[3]=I2([],J,!1,!1,F),Q=4;if($.scopeId&&!$.slotted)Q=5;Y.splice(Q),D.codegenNode=y$($.helper(fN),Y,F)}};function wh(D,$){let J='"default"',F=void 0,U=[];for(let X=0;X<D.props.length;X++){let Y=D.props[X];if(Y.type===6){if(Y.value)if(Y.name==="name")J=JSON.stringify(Y.value.content);else Y.name=o.camelize(Y.name),U.push(Y)}else if(Y.name==="bind"&&c1(Y.arg,"name")){if(Y.exp)J=Y.exp;else if(Y.arg&&Y.arg.type===4){let Q=o.camelize(Y.arg.content);J=Y.exp=OD(Q,!1,Y.arg.loc),J=Y.exp=K0(Y.exp,$)}}else{if(Y.name==="bind"&&Y.arg&&Y6(Y.arg))Y.arg.content=o.camelize(Y.arg.content);U.push(Y)}}if(U.length>0){let{props:X,directives:Y}=$j(D,$,U,!1,!1);if(F=X,Y.length)$.onError(mD(36,Y[0].loc))}return{slotName:J,slotProps:F}}var Rh=(D,$,J,F)=>{let{loc:U,modifiers:X,arg:Y}=D;if(!D.exp&&!X.length)J.onError(mD(35,U));let Q;if(Y.type===4)if(Y.isStatic){let G=Y.content;if(G.startsWith("vnode"))J.onError(mD(52,Y.loc));if(G.startsWith("vue:"))G=`vnode-${G.slice(4)}`;let I=$.tagType!==0||G.startsWith("vnode")||!/[A-Z]/.test(G)?o.toHandlerKey(o.camelize(G)):`on:${G}`;Q=OD(I,!0,Y.loc)}else Q=_0([`${J.helperString($Y)}(`,Y,")"]);else Q=Y,Q.children.unshift(`${J.helperString($Y)}(`),Q.children.push(")");let q=D.exp;if(q&&!q.content.trim())q=void 0;let K=J.cacheHandlers&&!q&&!J.inVOnce;if(q){let G=nN(q,J),I=!(G||py(q,J)),z=q.content.includes(";");if(J.prefixIdentifiers){if(I&&J.addIdentifiers("$event"),q=D.exp=K0(q,J,!1,z),I&&J.removeIdentifiers("$event"),K=J.cacheHandlers&&!J.inVOnce&&!(q.type===4&&q.constType>0)&&!(G&&$.tagType===1)&&!c$(q,J.identifiers),K&&G)if(q.type===4)q.content=`${q.content} && ${q.content}(...args)`;else q.children=[...q.children," && ",...q.children,"(...args)"]}if(I||K&&G)q=_0([`${I?J.isTS?"($event: any)":"$event":`${J.isTS?`
293
293
  //@ts-ignore
294
- `:""}(...args)`} => ${z?"{":"("}`,q,z?"}":")"])}let W={props:[j$(Q,q||OD("() => {}",!1,U))]};if(F)W=F(W);if(K)W.props[0].value=J.cache(W.props[0].value);return W.props.forEach((G)=>G.key.isHandlerKey=!0),W},Mh=(D,$,J)=>{let{modifiers:F,loc:U}=D,X=D.arg,{exp:Y}=D;if(Y&&Y.type===4&&!Y.content.trim())return J.onError(mD(34,U)),{props:[j$(X,OD("",!0,U))]};if(X.type!==4)X.children.unshift("("),X.children.push(') || ""');else if(!X.isStatic)X.content=X.content?`${X.content} || ""`:'""';if(F.some((Q)=>Q.content==="camel"))if(X.type===4)if(X.isStatic)X.content=o.camelize(X.content);else X.content=`${J.helperString(DY)}(${X.content})`;else X.children.unshift(`${J.helperString(DY)}(`),X.children.push(")");if(!J.inSSR){if(F.some((Q)=>Q.content==="prop"))Ry(X,".");if(F.some((Q)=>Q.content==="attr"))Ry(X,"^")}return{props:[j$(X,Y)]}},Ry=(D,$)=>{if(D.type===4)if(D.isStatic)D.content=$+D.content;else D.content=`\`${$}\${${D.content}}\``;else D.children.unshift(`'${$}' + (`),D.children.push(")")},sKD=(D,$)=>{if(D.type===0||D.type===1||D.type===11||D.type===10)return()=>{let J=D.children,F=void 0,U=!1;for(let X=0;X<J.length;X++){let Y=J[X];if(rX(Y)){U=!0;for(let Q=X+1;Q<J.length;Q++){let q=J[Q];if(rX(q)){if(!F)F=J[X]=_0([Y],Y.loc);F.children.push(" + ",q),J.splice(Q,1),Q--}else{F=void 0;break}}}}if(!U||J.length===1&&(D.type===0||D.type===1&&D.tagType===0&&!D.props.find((X)=>X.type===7&&!$.directiveTransforms[X.name])&&D.tag!=="template"))return;for(let X=0;X<J.length;X++){let Y=J[X];if(rX(Y)||Y.type===8){let Q=[];if(Y.type!==2||Y.content!==" ")Q.push(Y);if(!$.ssr&&C0(Y,$)===0)Q.push(`1 /* ${o.PatchFlagNames[1]} */`);J[X]={type:12,content:Y,loc:Y.loc,codegenNode:y$($.helper(WY),Q)}}}}},My=new WeakSet,eKD=(D,$)=>{if(D.type===1&&q0(D,"once",!0)){if(My.has(D)||$.inVOnce||$.inSSR)return;return My.add(D),$.inVOnce=!0,$.helper(Y7),()=>{$.inVOnce=!1;let J=$.currentNode;if(J.codegenNode)J.codegenNode=$.cache(J.codegenNode,!0,!0)}}},Eh=(D,$,J)=>{let{exp:F,arg:U}=D;if(!F)return J.onError(mD(41,D.loc)),L3();let X=F.loc.source.trim(),Y=F.type===4?F.content:X,Q=J.bindingMetadata[X];if(Q==="props"||Q==="props-aliased")return J.onError(mD(44,F.loc)),L3();if(Q==="literal-const"||Q==="setup-const")return J.onError(mD(45,F.loc)),L3();let q=J.inline&&(Q==="setup-let"||Q==="setup-ref"||Q==="setup-maybe-ref");if(!Y.trim()||!nN(F,J)&&!q)return J.onError(mD(42,F.loc)),L3();if(J.prefixIdentifiers&&s6(Y)&&J.identifiers[Y])return J.onError(mD(43,F.loc)),L3();let K=U?U:OD("modelValue",!0),W=U?Y6(U)?`onUpdate:${o.camelize(U.content)}`:_0(['"onUpdate:" + ',U]):"onUpdate:modelValue",G,I=J.isTS?"($event: any)":"$event";if(q)if(Q==="setup-ref")G=_0([`${I} => ((`,OD(X,!1,F.loc),").value = $event)"]);else{let Z=Q==="setup-let"?`${X} = $event`:"null";G=_0([`${I} => (${J.helperString(q7)}(${X}) ? (`,OD(X,!1,F.loc),`).value = $event : ${Z})`])}else G=_0([`${I} => ((`,F,") = $event)"]);let z=[j$(K,D.exp),j$(W,G)];if(J.prefixIdentifiers&&!J.inVOnce&&J.cacheHandlers&&!c$(F,J.identifiers))z[1].value=J.cache(z[1].value);if(D.modifiers.length&&$.tagType===1){let Z=D.modifiers.map((B)=>B.content).map((B)=>(s6(B)?B:JSON.stringify(B))+": true").join(", "),H=U?Y6(U)?`${U.content}Modifiers`:_0([U,' + "Modifiers"']):"modelModifiers";z.push(j$(H,OD(`{ ${Z} }`,!1,D.loc,2)))}return L3(z)};function L3(D=[]){return{props:D}}var DWD=/[\w).+\-_$\]]/,$WD=(D,$)=>{if(!p1("COMPILER_FILTERS",$))return;if(D.type===5)YY(D.content,$);else if(D.type===1)D.props.forEach((J)=>{if(J.type===7&&J.name!=="for"&&J.exp)YY(J.exp,$)})};function YY(D,$){if(D.type===4)Ey(D,$);else for(let J=0;J<D.children.length;J++){let F=D.children[J];if(typeof F!=="object")continue;if(F.type===4)Ey(F,$);else if(F.type===8)YY(F,$);else if(F.type===5)YY(F.content,$)}}function Ey(D,$){let J=D.content,F=!1,U=!1,X=!1,Y=!1,Q=0,q=0,K=0,W=0,G,I,z,Z,H=[];for(z=0;z<J.length;z++)if(I=G,G=J.charCodeAt(z),F){if(G===39&&I!==92)F=!1}else if(U){if(G===34&&I!==92)U=!1}else if(X){if(G===96&&I!==92)X=!1}else if(Y){if(G===47&&I!==92)Y=!1}else if(G===124&&J.charCodeAt(z+1)!==124&&J.charCodeAt(z-1)!==124&&!Q&&!q&&!K)if(Z===void 0)W=z+1,Z=J.slice(0,z).trim();else B();else{switch(G){case 34:U=!0;break;case 39:F=!0;break;case 96:X=!0;break;case 40:K++;break;case 41:K--;break;case 91:q++;break;case 93:q--;break;case 123:Q++;break;case 125:Q--;break}if(G===47){let N=z-1,j;for(;N>=0;N--)if(j=J.charAt(N),j!==" ")break;if(!j||!DWD.test(j))Y=!0}}if(Z===void 0)Z=J.slice(0,z).trim();else if(W!==0)B();function B(){H.push(J.slice(W,z).trim()),W=z+1}if(H.length){K7("COMPILER_FILTERS",$,D.loc);for(z=0;z<H.length;z++)Z=JWD(Z,H[z],$);D.content=Z,D.ast=void 0}}function JWD(D,$,J){J.helper(zY);let F=$.indexOf("(");if(F<0)return J.filters.add($),`${H2($,"filter")}(${D})`;else{let U=$.slice(0,F),X=$.slice(F+1);return J.filters.add(U),`${H2(U,"filter")}(${D}${X!==")"?","+X:X}`}}var Ay=new WeakSet,FWD=(D,$)=>{if(D.type===1){let J=q0(D,"memo");if(!J||Ay.has(D)||$.inSSR)return;return Ay.add(D),()=>{let F=D.codegenNode||$.currentNode.codegenNode;if(F&&F.type===13){if(D.tagType!==1)wY(F,$);D.codegenNode=y$($.helper(LY),[J.exp,I2(void 0,F),"_cache",String($.cached.length)]),$.cached.push(null)}}}},Ah=(D,$)=>{if(D.type===1){for(let J of D.props)if(J.type===7&&J.name==="bind"&&(!J.exp||!1)&&J.arg){let F=J.arg;if(F.type!==4||!F.isStatic)$.onError(mD(53,F.loc)),J.exp=OD("",!0,F.loc);else{let U=o.camelize(F.content);if(cN.test(U[0])||U[0]==="-")J.exp=OD(U,!1,F.loc)}}}};function vh(D){return[[Ah,eKD,iKD,FWD,nKD,$WD,...D?[Bh,Ih]:[],aKD,jh,Hh,sKD],{on:Rh,bind:Mh,model:Eh}]}function UWD(D,$={}){let J=$.onError||hN,F=$.mode==="module",U=$.prefixIdentifiers===!0||F;if(!U&&$.cacheHandlers)J(mD(50));if($.scopeId&&!F)J(mD(51));let X=o.extend({},$,{prefixIdentifiers:U}),Y=o.isString(D)?Dh(D,X):D,[Q,q]=vh(U);if($.isTS){let{expressionPlugins:K}=$;if(!K||!K.includes("typescript"))$.expressionPlugins=[...K||[],"typescript"]}return Yh(Y,o.extend({},X,{nodeTransforms:[...Q,...$.nodeTransforms||[]],directiveTransforms:o.extend({},q,$.directiveTransforms||{})})),Qh(Y,X)}var XWD={DATA:"data",PROPS:"props",PROPS_ALIASED:"props-aliased",SETUP_LET:"setup-let",SETUP_CONST:"setup-const",SETUP_REACTIVE_CONST:"setup-reactive-const",SETUP_MAYBE_REF:"setup-maybe-ref",SETUP_REF:"setup-ref",OPTIONS:"options",LITERAL_CONST:"literal-const"},YWD=()=>({props:[]});Th.generateCodeFrame=o.generateCodeFrame;Th.BASE_TRANSITION=kN;Th.BindingTypes=XWD;Th.CAMELIZE=DY;Th.CAPITALIZE=vy;Th.CREATE_BLOCK=CN;Th.CREATE_COMMENT=P3;Th.CREATE_ELEMENT_BLOCK=uN;Th.CREATE_ELEMENT_VNODE=KY;Th.CREATE_SLOTS=xN;Th.CREATE_STATIC=gN;Th.CREATE_TEXT=WY;Th.CREATE_VNODE=qY;Th.CompilerDeprecationTypes=pqD;Th.ConstantTypes=hqD;Th.ElementTypes=yqD;Th.ErrorCodes=tqD;Th.FRAGMENT=E3;Th.GUARD_REACTIVE_PROPS=S3;Th.IS_MEMO_SAME=yN;Th.IS_REF=q7;Th.KEEP_ALIVE=F7;Th.MERGE_PROPS=X7;Th.NORMALIZE_CLASS=OY;Th.NORMALIZE_PROPS=A3;Th.NORMALIZE_STYLE=NY;Th.Namespaces=fqD;Th.NodeTypes=xqD;Th.OPEN_BLOCK=r1;Th.POP_SCOPE_ID=by;Th.PUSH_SCOPE_ID=Ty;Th.RENDER_LIST=HY;Th.RENDER_SLOT=fN;Th.RESOLVE_COMPONENT=U7;Th.RESOLVE_DIRECTIVE=IY;Th.RESOLVE_DYNAMIC_COMPONENT=GY;Th.RESOLVE_FILTER=zY;Th.SET_BLOCK_TRACKING=Y7;Th.SUSPENSE=QY;Th.TELEPORT=M3;Th.TO_DISPLAY_STRING=BY;Th.TO_HANDLERS=jY;Th.TO_HANDLER_KEY=$Y;Th.TS_NODE_TYPES=iN;Th.UNREF=Q7;Th.WITH_CTX=VY;Th.WITH_DIRECTIVES=ZY;Th.WITH_MEMO=LY;Th.advancePositionWithClone=EN;Th.advancePositionWithMutation=pN;Th.assert=AN;Th.baseCompile=UWD;Th.baseParse=Dh;Th.buildDirectiveArgs=Lh;Th.buildProps=$j;Th.buildSlots=Oh;Th.checkCompatEnabled=T3;Th.convertToBlock=wY;Th.createArrayExpression=n1;Th.createAssignmentExpression=dqD;Th.createBlockStatement=_y;Th.createCacheExpression=Sy;Th.createCallExpression=y$;Th.createCompilerError=mD;Th.createCompoundExpression=_0;Th.createConditionalExpression=JY;Th.createForLoopParams=XY;Th.createFunctionExpression=I2;Th.createIfStatement=iqD;Th.createInterpolation=mqD;Th.createObjectExpression=k0;Th.createObjectProperty=j$;Th.createReturnStatement=nqD;Th.createRoot=Py;Th.createSequenceExpression=cqD;Th.createSimpleExpression=OD;Th.createStructuralDirectiveTransform=sN;Th.createTemplateLiteral=lqD;Th.createTransformContext=Xh;Th.createVNodeCall=v3;Th.errorMessages=uy;Th.extractIdentifiers=X6;Th.findDir=q0;Th.findProp=W7;Th.forAliasRE=ty;Th.generate=Qh;Th.getBaseTransformPreset=vh;Th.getConstantType=C0;Th.getMemoedVNodeCall=ry;Th.getVNodeBlockHelper=Z2;Th.getVNodeHelper=z2;Th.hasDynamicKeyVBind=FKD;Th.hasScopeRef=c$;Th.helperNameMap=j0;Th.injectProp=I7;Th.isAllWhitespace=tN;Th.isCommentOrWhitespace=oN;Th.isCoreComponent=dN;Th.isFnExpression=py;Th.isFnExpressionBrowser=JKD;Th.isFnExpressionNode=ny;Th.isFunctionType=iy;Th.isInDestructureAssignment=UY;Th.isInNewExpression=xy;Th.isMemberExpression=nN;Th.isMemberExpressionBrowser=DKD;Th.isMemberExpressionNode=cy;Th.isReferencedIdentifier=fy;Th.isSimpleIdentifier=s6;Th.isSlotOutlet=G7;Th.isStaticArgOf=c1;Th.isStaticExp=Y6;Th.isStaticProperty=lN;Th.isStaticPropertyKey=dy;Th.isTemplateNode=b3;Th.isText=rX;Th.isVPre=vN;Th.isVSlot=EY;Th.isWhitespaceText=AY;Th.locStub=V$;Th.noopDirectiveTransform=YWD;Th.processExpression=K0;Th.processFor=Zh;Th.processIf=zh;Th.processSlotOutlet=wh;Th.registerRuntimeHelpers=gqD;Th.resolveComponentType=Vh;Th.stringifyExpression=eN;Th.toValidAssetId=H2;Th.trackSlotScopes=Hh;Th.trackVForSlotScopes=Bh;Th.transform=Yh;Th.transformBind=Mh;Th.transformElement=jh;Th.transformExpression=Ih;Th.transformModel=Eh;Th.transformOn=Rh;Th.transformVBindShorthand=Ah;Th.traverseNode=Z7;Th.unwrapTSNode=RY;Th.validFirstIdentCharRE=cN;Th.walkBlockDeclarations=mN;Th.walkFunctionParams=yy;Th.walkIdentifiers=gy;Th.warnDeprecation=K7});var lh=k((PY)=>{Object.defineProperty(PY,"__esModule",{value:!0});var LD=bh(),bD=_O(),Jj=Symbol("vModelRadio"),Fj=Symbol("vModelCheckbox"),Uj=Symbol("vModelText"),Xj=Symbol("vModelSelect"),bY=Symbol("vModelDynamic"),Yj=Symbol("vOnModifiersGuard"),Qj=Symbol("vOnKeysGuard"),qj=Symbol("vShow"),SY=Symbol("Transition"),Kj=Symbol("TransitionGroup");LD.registerRuntimeHelpers({[Jj]:"vModelRadio",[Fj]:"vModelCheckbox",[Uj]:"vModelText",[Xj]:"vModelSelect",[bY]:"vModelDynamic",[Yj]:"withModifiers",[Qj]:"withKeys",[qj]:"vShow",[SY]:"Transition",[Kj]:"TransitionGroup"});var Wj={parseMode:"html",isVoidTag:bD.isVoidTag,isNativeTag:(D)=>bD.isHTMLTag(D)||bD.isSVGTag(D)||bD.isMathMLTag(D),isPreTag:(D)=>D==="pre",isIgnoreNewlineTag:(D)=>D==="pre"||D==="textarea",decodeEntities:void 0,isBuiltInComponent:(D)=>{if(D==="Transition"||D==="transition")return SY;else if(D==="TransitionGroup"||D==="transition-group")return Kj},getNamespace(D,$,J){let F=$?$.ns:J;if($&&F===2){if($.tag==="annotation-xml"){if(D==="svg")return 1;if($.props.some((U)=>U.type===6&&U.name==="encoding"&&U.value!=null&&(U.value.content==="text/html"||U.value.content==="application/xhtml+xml")))F=0}else if(/^m(?:[ions]|text)$/.test($.tag)&&D!=="mglyph"&&D!=="malignmark")F=0}else if($&&F===1){if($.tag==="foreignObject"||$.tag==="desc"||$.tag==="title")F=0}if(F===0){if(D==="svg")return 1;if(D==="math")return 2}return F}},gh=(D)=>{if(D.type===1)D.props.forEach(($,J)=>{if($.type===6&&$.name==="style"&&$.value)D.props[J]={type:7,name:"bind",arg:LD.createSimpleExpression("style",!0,$.loc),exp:dID($.value.content,$.loc),modifiers:[],loc:$.loc}})},dID=(D,$)=>{let J=bD.parseStringStyle(D);return LD.createSimpleExpression(JSON.stringify(J),!1,$,3)};function n0(D,$){return LD.createCompilerError(D,$,fh)}var cID={X_V_HTML_NO_EXPRESSION:54,"54":"X_V_HTML_NO_EXPRESSION",X_V_HTML_WITH_CHILDREN:55,"55":"X_V_HTML_WITH_CHILDREN",X_V_TEXT_NO_EXPRESSION:56,"56":"X_V_TEXT_NO_EXPRESSION",X_V_TEXT_WITH_CHILDREN:57,"57":"X_V_TEXT_WITH_CHILDREN",X_V_MODEL_ON_INVALID_ELEMENT:58,"58":"X_V_MODEL_ON_INVALID_ELEMENT",X_V_MODEL_ARG_ON_ELEMENT:59,"59":"X_V_MODEL_ARG_ON_ELEMENT",X_V_MODEL_ON_FILE_INPUT_ELEMENT:60,"60":"X_V_MODEL_ON_FILE_INPUT_ELEMENT",X_V_MODEL_UNNECESSARY_VALUE:61,"61":"X_V_MODEL_UNNECESSARY_VALUE",X_V_SHOW_NO_EXPRESSION:62,"62":"X_V_SHOW_NO_EXPRESSION",X_TRANSITION_INVALID_CHILDREN:63,"63":"X_TRANSITION_INVALID_CHILDREN",X_IGNORED_SIDE_EFFECT_TAG:64,"64":"X_IGNORED_SIDE_EFFECT_TAG",__EXTEND_POINT__:65,"65":"__EXTEND_POINT__"},fh={[54]:"v-html is missing expression.",[55]:"v-html will override element children.",[56]:"v-text is missing expression.",[57]:"v-text will override element children.",[58]:"v-model can only be used on <input>, <textarea> and <select> elements.",[59]:"v-model argument is not supported on plain elements.",[60]:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",[61]:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",[62]:"v-show is missing expression.",[63]:"<Transition> expects exactly one child element or component.",[64]:"Tags with side effect (<script> and <style>) are ignored in client component templates."},nID=(D,$,J)=>{let{exp:F,loc:U}=D;if(!F)J.onError(n0(54,U));if($.children.length)J.onError(n0(55,U)),$.children.length=0;return{props:[LD.createObjectProperty(LD.createSimpleExpression("innerHTML",!0,U),F||LD.createSimpleExpression("",!0))]}},pID=(D,$,J)=>{let{exp:F,loc:U}=D;if(!F)J.onError(n0(56,U));if($.children.length)J.onError(n0(57,U)),$.children.length=0;return{props:[LD.createObjectProperty(LD.createSimpleExpression("textContent",!0),F?LD.getConstantType(F,J)>0?F:LD.createCallExpression(J.helperString(LD.TO_DISPLAY_STRING),[F],U):LD.createSimpleExpression("",!0))]}},rID=(D,$,J)=>{let F=LD.transformModel(D,$,J);if(!F.props.length||$.tagType===1)return F;if(D.arg)J.onError(n0(59,D.arg.loc));function U(){let Q=LD.findDir($,"bind");if(Q&&LD.isStaticArgOf(Q.arg,"value"))J.onError(n0(61,Q.loc))}let{tag:X}=$,Y=J.isCustomElement(X);if(X==="input"||X==="textarea"||X==="select"||Y){let Q=Uj,q=!1;if(X==="input"||Y){let K=LD.findProp($,"type");if(K){if(K.type===7)Q=bY;else if(K.value)switch(K.value.content){case"radio":Q=Jj;break;case"checkbox":Q=Fj;break;case"file":q=!0,J.onError(n0(60,D.loc));break;default:U();break}}else if(LD.hasDynamicKeyVBind($))Q=bY;else U()}else if(X==="select")Q=Xj;else U();if(!q)F.needRuntime=J.helper(Q)}else J.onError(n0(58,D.loc));return F.props=F.props.filter((Q)=>!(Q.key.type===4&&Q.key.content==="modelValue")),F},tID=bD.makeMap("passive,once,capture"),oID=bD.makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),aID=bD.makeMap("left,right"),xh=bD.makeMap("onkeyup,onkeydown,onkeypress"),sID=(D,$,J,F)=>{let U=[],X=[],Y=[];for(let Q=0;Q<$.length;Q++){let q=$[Q].content;if(q==="native"&&LD.checkCompatEnabled("COMPILER_V_ON_NATIVE",J,F))Y.push(q);else if(tID(q))Y.push(q);else if(aID(q))if(LD.isStaticExp(D))if(xh(D.content.toLowerCase()))U.push(q);else X.push(q);else U.push(q),X.push(q);else if(oID(q))X.push(q);else U.push(q)}return{keyModifiers:U,nonKeyModifiers:X,eventOptionModifiers:Y}},Ph=(D,$)=>{return LD.isStaticExp(D)&&D.content.toLowerCase()==="onclick"?LD.createSimpleExpression($,!0):D.type!==4?LD.createCompoundExpression(["(",D,`) === "onClick" ? "${$}" : (`,D,")"]):D},eID=(D,$,J)=>{return LD.transformOn(D,$,J,(F)=>{let{modifiers:U}=D;if(!U.length)return F;let{key:X,value:Y}=F.props[0],{keyModifiers:Q,nonKeyModifiers:q,eventOptionModifiers:K}=sID(X,U,J,D.loc);if(q.includes("right"))X=Ph(X,"onContextmenu");if(q.includes("middle"))X=Ph(X,"onMouseup");if(q.length)Y=LD.createCallExpression(J.helper(Yj),[Y,JSON.stringify(q)]);if(Q.length&&(!LD.isStaticExp(X)||xh(X.content.toLowerCase())))Y=LD.createCallExpression(J.helper(Qj),[Y,JSON.stringify(Q)]);if(K.length){let W=K.map(bD.capitalize).join("");X=LD.isStaticExp(X)?LD.createSimpleExpression(`${X.content}${W}`,!0):LD.createCompoundExpression(["(",X,`) + "${W}"`])}return{props:[LD.createObjectProperty(X,Y)]}})},DzD=(D,$,J)=>{let{exp:F,loc:U}=D;if(!F)J.onError(n0(62,U));return{props:[],needRuntime:J.helper(qj)}},$zD=(D,$)=>{if(D.type===1&&D.tagType===1){if($.isBuiltInComponent(D.tag)===SY)return()=>{if(!D.children.length)return;if(yh(D))$.onError(n0(63,{start:D.children[0].loc.start,end:D.children[D.children.length-1].loc.end,source:""}));let F=D.children[0];if(F.type===1){for(let U of F.props)if(U.type===7&&U.name==="show")D.props.push({type:6,name:"persisted",nameLoc:D.loc,value:void 0,loc:D.loc})}}}};function yh(D){let $=D.children=D.children.filter((F)=>!LD.isCommentOrWhitespace(F)),J=$[0];return $.length!==1||J.type===11||J.type===9&&J.branches.some(yh)}var JzD=/__VUE_EXP_START__(.*?)__VUE_EXP_END__/g,FzD=(D,$,J)=>{if($.scopes.vSlot>0)return;let F=J.type===1&&J.codegenNode&&J.codegenNode.type===13&&J.codegenNode.children&&!bD.isArray(J.codegenNode.children)&&J.codegenNode.children.type===20,U=0,X=0,Y=[],Q=(K)=>{if(U>=20||X>=5){let W=LD.createCallExpression($.helper(LD.CREATE_STATIC),[JSON.stringify(Y.map((I)=>Gj(I,$)).join("")).replace(JzD,'" + $1 + "'),String(Y.length)]),G=Y.length-1;if(F)D.splice(K-Y.length,Y.length,W);else if(Y[0].codegenNode.value=W,Y.length>1){D.splice(K-Y.length+1,G);let I=$.cached.indexOf(Y[Y.length-1].codegenNode);if(I>-1){for(let z=I;z<$.cached.length;z++){let Z=$.cached[z];if(Z)Z.index-=G}$.cached.splice(I-G+1,G)}}return G}return 0},q=0;for(;q<D.length;q++){let K=D[q];if(F||UzD(K)){let G=QzD(K);if(G){U+=G[0],X+=G[1],Y.push(K);continue}}q-=Q(q),U=0,X=0,Y.length=0}Q(q)},UzD=(D)=>{if((D.type===1&&D.tagType===0||D.type===12)&&D.codegenNode&&D.codegenNode.type===20)return D.codegenNode},XzD=/^(?:data|aria)-/,Sh=(D,$)=>{return($===0?bD.isKnownHtmlAttr(D):$===1?bD.isKnownSvgAttr(D):$===2?bD.isKnownMathMLAttr(D):!1)||XzD.test(D)},YzD=bD.makeMap("caption,thead,tr,th,tbody,td,tfoot,colgroup,col");function QzD(D){if(D.type===1&&YzD(D.tag))return!1;if(D.type===1&&LD.findDir(D,"once",!0))return!1;if(D.type===12)return[1,0];let $=1,J=D.props.length>0?1:0,F=!1,U=()=>{return F=!0,!1};function X(Y){let Q=Y.tag==="option"&&Y.ns===0;for(let q=0;q<Y.props.length;q++){let K=Y.props[q];if(K.type===6&&!Sh(K.name,Y.ns))return U();if(K.type===7&&K.name==="bind"){if(K.arg&&(K.arg.type===8||K.arg.isStatic&&!Sh(K.arg.content,Y.ns)))return U();if(K.exp&&(K.exp.type===8||K.exp.constType<3))return U();if(Q&&LD.isStaticArgOf(K.arg,"value")&&K.exp&&!K.exp.isStatic)return U()}}for(let q=0;q<Y.children.length;q++){$++;let K=Y.children[q];if(K.type===1){if(K.props.length>0)J++;if(X(K),F)return!1}}return!0}return X(D)?[$,J]:!1}function Gj(D,$){if(bD.isString(D))return D;if(bD.isSymbol(D))return"";switch(D.type){case 1:return qzD(D,$);case 2:return bD.escapeHtml(D.content);case 3:return`<!--${bD.escapeHtml(D.content)}-->`;case 5:return bD.escapeHtml(bD.toDisplayString(O2(D.content)));case 8:return bD.escapeHtml(O2(D));case 12:return Gj(D.content,$);default:return""}}function qzD(D,$){let J=`<${D.tag}`,F="";for(let U=0;U<D.props.length;U++){let X=D.props[U];if(X.type===6){if(J+=` ${X.name}`,X.value)J+=`="${bD.escapeHtml(X.value.content)}"`}else if(X.type===7){if(X.name==="bind"){let Y=X.exp;if(Y.content[0]==="_"){J+=` ${X.arg.content}="__VUE_EXP_START__${Y.content}__VUE_EXP_END__"`;continue}if(bD.isBooleanAttr(X.arg.content)&&Y.content==="false")continue;let Q=O2(Y);if(Q!=null){let q=X.arg&&X.arg.content;if(q==="class")Q=bD.normalizeClass(Q);else if(q==="style")Q=bD.stringifyStyle(bD.normalizeStyle(Q));J+=` ${X.arg.content}="${bD.escapeHtml(Q)}"`}}else if(X.name==="html")F=O2(X.exp);else if(X.name==="text")F=bD.escapeHtml(bD.toDisplayString(O2(X.exp)))}}if($.scopeId)J+=` ${$.scopeId}`;if(J+=">",F)J+=F;else for(let U=0;U<D.children.length;U++)J+=Gj(D.children[U],$);if(!bD.isVoidTag(D.tag))J+=`</${D.tag}>`;return J}function O2(D){if(D.type===4)return Function(`return (${D.content})`)();else{let $="";return D.children.forEach((J)=>{if(bD.isString(J)||bD.isSymbol(J))return;if(J.type===2)$+=J.content;else if(J.type===5)$+=bD.toDisplayString(O2(J.content));else $+=O2(J)}),$}}var KzD=(D,$)=>{if(D.type===1&&D.tagType===0&&(D.tag==="script"||D.tag==="style"))$.onError(n0(64,D.loc)),$.removeNode()};function WzD(D,$){if(D==="template")return!0;if(D in _h)return _h[D].has($);if($ in kh)return kh[$].has(D);if(D in Ch){if(Ch[D].has($))return!1}if($ in uh){if(uh[$].has(D))return!1}return!0}var k3=new Set(["h1","h2","h3","h4","h5","h6"]),B2=new Set([]),_h={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:B2,iframe:B2,option:B2,textarea:B2,style:B2,title:B2},kh={html:B2,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},Ch={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},uh={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:k3,h2:k3,h3:k3,h4:k3,h5:k3,h6:k3},GzD=(D,$)=>{if(D.type===1&&D.tagType===0&&$.parent&&$.parent.type===1&&$.parent.tagType===0&&!WzD($.parent.tag,D.tag)){let J=SyntaxError(`<${D.tag}> cannot be child of <${$.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);J.loc=D.loc,$.onWarn(J)}},hh=[gh,$zD,GzD],mh={cloak:LD.noopDirectiveTransform,html:nID,text:pID,model:rID,on:eID,show:DzD};function IzD(D,$={}){return LD.baseCompile(D,bD.extend({},Wj,$,{nodeTransforms:[KzD,...hh,...$.nodeTransforms||[]],directiveTransforms:bD.extend({},mh,$.directiveTransforms||{}),transformHoist:FzD}))}function zzD(D,$={}){return LD.baseParse(D,bD.extend({},Wj,$))}PY.DOMDirectiveTransforms=mh;PY.DOMErrorCodes=cID;PY.DOMErrorMessages=fh;PY.DOMNodeTransforms=hh;PY.TRANSITION=SY;PY.TRANSITION_GROUP=Kj;PY.V_MODEL_CHECKBOX=Fj;PY.V_MODEL_DYNAMIC=bY;PY.V_MODEL_RADIO=Jj;PY.V_MODEL_SELECT=Xj;PY.V_MODEL_TEXT=Uj;PY.V_ON_WITH_KEYS=Qj;PY.V_ON_WITH_MODIFIERS=Yj;PY.V_SHOW=qj;PY.compile=IzD;PY.createDOMCompilerError=n0;PY.parse=zzD;PY.parserOptions=Wj;PY.transformStyle=gh;Object.keys(LD).forEach(function(D){if(D!=="default"&&!Object.prototype.hasOwnProperty.call(PY,D))PY[D]=LD[D]})});import{exit as czD}from"node:process";import{workerData as nzD}from"node:worker_threads";B7();U8();rK();import{parentPort as zf}from"node:worker_threads";async function Zf(D,$){let{project:J,apiHost:F,apikey:U,command:X,attemptId:Y}=D;Mj(X);let Q=(z,Z,H={})=>{zf?.postMessage({type:"onboarding-analytics",payload:{channel:$.channel,event:z,tracking_version:2,timestamp:new Date(Z),tags:{app_id:J.appId},nonPersonTags:{attempt_id:Y,command_path:X,...H}}})},q=Date.now();Q("scan_started",q);let K=q,W="error",G="not_attempted",I;try{if(B6("local scan started",{scan:$.step}),W=$.scan(J),K=Date.now(),B6("local scan finished",{scan:$.step,result:W,duration_ms:K-q}),W!=="found")return;G="failed";let z=Date.now();B6("step update started",{scan:$.step});let Z=await fetch(`${V1(F)}/app/${encodeURIComponent(J.appId)}`,{method:"PUT",headers:Q6({"Content-Type":"application/json",Authorization:U,capgkey:U}),body:JSON.stringify({onboarding:{steps:{[$.step]:{status:"done"}}}}),redirect:"error"});if(B6("step update finished",{scan:$.step,status:Z.status,duration_ms:Date.now()-z}),I=Z.status,G=Z.ok?"success":"rejected",Z.ok)zf?.postMessage({type:"onboarding-step",step:$.step});await Z.body?.cancel()}catch(z){throw B6("local check failed",{scan:$.step,error:zF(z)}),z}finally{if(W==="error")K=Date.now();Q("scan_ended",K,{result:W,duration_ms:K-q,todo_report_status:G,...I===void 0?{}:{todo_report_http_status:I}})}}var H7=g0(lh(),1);import{existsSync as ih,readdirSync as kzD,readFileSync as CzD,realpathSync as uzD,statSync as gzD}from"node:fs";import{basename as fzD,dirname as ah,extname as dh,isAbsolute as xzD,join as ch,relative as sh,resolve as yzD,sep as Ij}from"node:path";import uD from"typescript";var zj="@capgo/capacitor-updater",nh=/\.(?:[cm]?[jt]sx?|vue)$/,ph=/^(?:\..*|node_modules|dist|build|www|coverage|android|ios|test|tests|__tests__|__mocks__|fixtures|__fixtures__|e2e|cypress|playwright|scripts)$/,hzD=/\.(?:test|spec|d)\.[cm]?[jt]sx?$|^capacitor\.config\./;function rh(D,$){let J=sh(D,$);return!xzD(J)&&J!==".."&&!J.startsWith(`..${Ij}`)}function mzD(D){let $=uD.findConfigFile(D,uD.sys.fileExists);if(!$)return{};let J=uD.readConfigFile($,uD.sys.readFile);if(J.error)return{};return uD.parseJsonConfigFileContent({...J.config,files:[],include:[]},uD.sys,ah($)).options}function lzD(D){return H7.parse(D,{parseMode:"sfc",onError:(J)=>{throw J}}).children.flatMap((J)=>{if(J.type!==H7.NodeTypes.ELEMENT||J.tag!=="script")return[];return J.children.flatMap((F)=>F.type===H7.NodeTypes.TEXT?[F.content]:[])}).join(`
294
+ `:""}(...args)`} => ${z?"{":"("}`,q,z?"}":")"])}let W={props:[j$(Q,q||OD("() => {}",!1,U))]};if(F)W=F(W);if(K)W.props[0].value=J.cache(W.props[0].value);return W.props.forEach((G)=>G.key.isHandlerKey=!0),W},Mh=(D,$,J)=>{let{modifiers:F,loc:U}=D,X=D.arg,{exp:Y}=D;if(Y&&Y.type===4&&!Y.content.trim())return J.onError(mD(34,U)),{props:[j$(X,OD("",!0,U))]};if(X.type!==4)X.children.unshift("("),X.children.push(') || ""');else if(!X.isStatic)X.content=X.content?`${X.content} || ""`:'""';if(F.some((Q)=>Q.content==="camel"))if(X.type===4)if(X.isStatic)X.content=o.camelize(X.content);else X.content=`${J.helperString(DY)}(${X.content})`;else X.children.unshift(`${J.helperString(DY)}(`),X.children.push(")");if(!J.inSSR){if(F.some((Q)=>Q.content==="prop"))Ry(X,".");if(F.some((Q)=>Q.content==="attr"))Ry(X,"^")}return{props:[j$(X,Y)]}},Ry=(D,$)=>{if(D.type===4)if(D.isStatic)D.content=$+D.content;else D.content=`\`${$}\${${D.content}}\``;else D.children.unshift(`'${$}' + (`),D.children.push(")")},sKD=(D,$)=>{if(D.type===0||D.type===1||D.type===11||D.type===10)return()=>{let J=D.children,F=void 0,U=!1;for(let X=0;X<J.length;X++){let Y=J[X];if(rX(Y)){U=!0;for(let Q=X+1;Q<J.length;Q++){let q=J[Q];if(rX(q)){if(!F)F=J[X]=_0([Y],Y.loc);F.children.push(" + ",q),J.splice(Q,1),Q--}else{F=void 0;break}}}}if(!U||J.length===1&&(D.type===0||D.type===1&&D.tagType===0&&!D.props.find((X)=>X.type===7&&!$.directiveTransforms[X.name])&&D.tag!=="template"))return;for(let X=0;X<J.length;X++){let Y=J[X];if(rX(Y)||Y.type===8){let Q=[];if(Y.type!==2||Y.content!==" ")Q.push(Y);if(!$.ssr&&C0(Y,$)===0)Q.push(`1 /* ${o.PatchFlagNames[1]} */`);J[X]={type:12,content:Y,loc:Y.loc,codegenNode:y$($.helper(WY),Q)}}}}},My=new WeakSet,eKD=(D,$)=>{if(D.type===1&&q0(D,"once",!0)){if(My.has(D)||$.inVOnce||$.inSSR)return;return My.add(D),$.inVOnce=!0,$.helper(Y7),()=>{$.inVOnce=!1;let J=$.currentNode;if(J.codegenNode)J.codegenNode=$.cache(J.codegenNode,!0,!0)}}},Eh=(D,$,J)=>{let{exp:F,arg:U}=D;if(!F)return J.onError(mD(41,D.loc)),L3();let X=F.loc.source.trim(),Y=F.type===4?F.content:X,Q=J.bindingMetadata[X];if(Q==="props"||Q==="props-aliased")return J.onError(mD(44,F.loc)),L3();if(Q==="literal-const"||Q==="setup-const")return J.onError(mD(45,F.loc)),L3();let q=J.inline&&(Q==="setup-let"||Q==="setup-ref"||Q==="setup-maybe-ref");if(!Y.trim()||!nN(F,J)&&!q)return J.onError(mD(42,F.loc)),L3();if(J.prefixIdentifiers&&s6(Y)&&J.identifiers[Y])return J.onError(mD(43,F.loc)),L3();let K=U?U:OD("modelValue",!0),W=U?Y6(U)?`onUpdate:${o.camelize(U.content)}`:_0(['"onUpdate:" + ',U]):"onUpdate:modelValue",G,I=J.isTS?"($event: any)":"$event";if(q)if(Q==="setup-ref")G=_0([`${I} => ((`,OD(X,!1,F.loc),").value = $event)"]);else{let Z=Q==="setup-let"?`${X} = $event`:"null";G=_0([`${I} => (${J.helperString(q7)}(${X}) ? (`,OD(X,!1,F.loc),`).value = $event : ${Z})`])}else G=_0([`${I} => ((`,F,") = $event)"]);let z=[j$(K,D.exp),j$(W,G)];if(J.prefixIdentifiers&&!J.inVOnce&&J.cacheHandlers&&!c$(F,J.identifiers))z[1].value=J.cache(z[1].value);if(D.modifiers.length&&$.tagType===1){let Z=D.modifiers.map((B)=>B.content).map((B)=>(s6(B)?B:JSON.stringify(B))+": true").join(", "),H=U?Y6(U)?`${U.content}Modifiers`:_0([U,' + "Modifiers"']):"modelModifiers";z.push(j$(H,OD(`{ ${Z} }`,!1,D.loc,2)))}return L3(z)};function L3(D=[]){return{props:D}}var DWD=/[\w).+\-_$\]]/,$WD=(D,$)=>{if(!p1("COMPILER_FILTERS",$))return;if(D.type===5)YY(D.content,$);else if(D.type===1)D.props.forEach((J)=>{if(J.type===7&&J.name!=="for"&&J.exp)YY(J.exp,$)})};function YY(D,$){if(D.type===4)Ey(D,$);else for(let J=0;J<D.children.length;J++){let F=D.children[J];if(typeof F!=="object")continue;if(F.type===4)Ey(F,$);else if(F.type===8)YY(F,$);else if(F.type===5)YY(F.content,$)}}function Ey(D,$){let J=D.content,F=!1,U=!1,X=!1,Y=!1,Q=0,q=0,K=0,W=0,G,I,z,Z,H=[];for(z=0;z<J.length;z++)if(I=G,G=J.charCodeAt(z),F){if(G===39&&I!==92)F=!1}else if(U){if(G===34&&I!==92)U=!1}else if(X){if(G===96&&I!==92)X=!1}else if(Y){if(G===47&&I!==92)Y=!1}else if(G===124&&J.charCodeAt(z+1)!==124&&J.charCodeAt(z-1)!==124&&!Q&&!q&&!K)if(Z===void 0)W=z+1,Z=J.slice(0,z).trim();else B();else{switch(G){case 34:U=!0;break;case 39:F=!0;break;case 96:X=!0;break;case 40:K++;break;case 41:K--;break;case 91:q++;break;case 93:q--;break;case 123:Q++;break;case 125:Q--;break}if(G===47){let N=z-1,j;for(;N>=0;N--)if(j=J.charAt(N),j!==" ")break;if(!j||!DWD.test(j))Y=!0}}if(Z===void 0)Z=J.slice(0,z).trim();else if(W!==0)B();function B(){H.push(J.slice(W,z).trim()),W=z+1}if(H.length){K7("COMPILER_FILTERS",$,D.loc);for(z=0;z<H.length;z++)Z=JWD(Z,H[z],$);D.content=Z,D.ast=void 0}}function JWD(D,$,J){J.helper(zY);let F=$.indexOf("(");if(F<0)return J.filters.add($),`${H2($,"filter")}(${D})`;else{let U=$.slice(0,F),X=$.slice(F+1);return J.filters.add(U),`${H2(U,"filter")}(${D}${X!==")"?","+X:X}`}}var Ay=new WeakSet,FWD=(D,$)=>{if(D.type===1){let J=q0(D,"memo");if(!J||Ay.has(D)||$.inSSR)return;return Ay.add(D),()=>{let F=D.codegenNode||$.currentNode.codegenNode;if(F&&F.type===13){if(D.tagType!==1)wY(F,$);D.codegenNode=y$($.helper(LY),[J.exp,I2(void 0,F),"_cache",String($.cached.length)]),$.cached.push(null)}}}},Ah=(D,$)=>{if(D.type===1){for(let J of D.props)if(J.type===7&&J.name==="bind"&&(!J.exp||!1)&&J.arg){let F=J.arg;if(F.type!==4||!F.isStatic)$.onError(mD(53,F.loc)),J.exp=OD("",!0,F.loc);else{let U=o.camelize(F.content);if(cN.test(U[0])||U[0]==="-")J.exp=OD(U,!1,F.loc)}}}};function vh(D){return[[Ah,eKD,iKD,FWD,nKD,$WD,...D?[Bh,Ih]:[],aKD,jh,Hh,sKD],{on:Rh,bind:Mh,model:Eh}]}function UWD(D,$={}){let J=$.onError||hN,F=$.mode==="module",U=$.prefixIdentifiers===!0||F;if(!U&&$.cacheHandlers)J(mD(50));if($.scopeId&&!F)J(mD(51));let X=o.extend({},$,{prefixIdentifiers:U}),Y=o.isString(D)?Dh(D,X):D,[Q,q]=vh(U);if($.isTS){let{expressionPlugins:K}=$;if(!K||!K.includes("typescript"))$.expressionPlugins=[...K||[],"typescript"]}return Yh(Y,o.extend({},X,{nodeTransforms:[...Q,...$.nodeTransforms||[]],directiveTransforms:o.extend({},q,$.directiveTransforms||{})})),Qh(Y,X)}var XWD={DATA:"data",PROPS:"props",PROPS_ALIASED:"props-aliased",SETUP_LET:"setup-let",SETUP_CONST:"setup-const",SETUP_REACTIVE_CONST:"setup-reactive-const",SETUP_MAYBE_REF:"setup-maybe-ref",SETUP_REF:"setup-ref",OPTIONS:"options",LITERAL_CONST:"literal-const"},YWD=()=>({props:[]});Th.generateCodeFrame=o.generateCodeFrame;Th.BASE_TRANSITION=kN;Th.BindingTypes=XWD;Th.CAMELIZE=DY;Th.CAPITALIZE=vy;Th.CREATE_BLOCK=CN;Th.CREATE_COMMENT=P3;Th.CREATE_ELEMENT_BLOCK=uN;Th.CREATE_ELEMENT_VNODE=KY;Th.CREATE_SLOTS=xN;Th.CREATE_STATIC=gN;Th.CREATE_TEXT=WY;Th.CREATE_VNODE=qY;Th.CompilerDeprecationTypes=pqD;Th.ConstantTypes=hqD;Th.ElementTypes=yqD;Th.ErrorCodes=tqD;Th.FRAGMENT=E3;Th.GUARD_REACTIVE_PROPS=S3;Th.IS_MEMO_SAME=yN;Th.IS_REF=q7;Th.KEEP_ALIVE=F7;Th.MERGE_PROPS=X7;Th.NORMALIZE_CLASS=OY;Th.NORMALIZE_PROPS=A3;Th.NORMALIZE_STYLE=NY;Th.Namespaces=fqD;Th.NodeTypes=xqD;Th.OPEN_BLOCK=r1;Th.POP_SCOPE_ID=by;Th.PUSH_SCOPE_ID=Ty;Th.RENDER_LIST=HY;Th.RENDER_SLOT=fN;Th.RESOLVE_COMPONENT=U7;Th.RESOLVE_DIRECTIVE=IY;Th.RESOLVE_DYNAMIC_COMPONENT=GY;Th.RESOLVE_FILTER=zY;Th.SET_BLOCK_TRACKING=Y7;Th.SUSPENSE=QY;Th.TELEPORT=M3;Th.TO_DISPLAY_STRING=BY;Th.TO_HANDLERS=jY;Th.TO_HANDLER_KEY=$Y;Th.TS_NODE_TYPES=iN;Th.UNREF=Q7;Th.WITH_CTX=VY;Th.WITH_DIRECTIVES=ZY;Th.WITH_MEMO=LY;Th.advancePositionWithClone=EN;Th.advancePositionWithMutation=pN;Th.assert=AN;Th.baseCompile=UWD;Th.baseParse=Dh;Th.buildDirectiveArgs=Lh;Th.buildProps=$j;Th.buildSlots=Oh;Th.checkCompatEnabled=T3;Th.convertToBlock=wY;Th.createArrayExpression=n1;Th.createAssignmentExpression=dqD;Th.createBlockStatement=_y;Th.createCacheExpression=Sy;Th.createCallExpression=y$;Th.createCompilerError=mD;Th.createCompoundExpression=_0;Th.createConditionalExpression=JY;Th.createForLoopParams=XY;Th.createFunctionExpression=I2;Th.createIfStatement=iqD;Th.createInterpolation=mqD;Th.createObjectExpression=k0;Th.createObjectProperty=j$;Th.createReturnStatement=nqD;Th.createRoot=Py;Th.createSequenceExpression=cqD;Th.createSimpleExpression=OD;Th.createStructuralDirectiveTransform=sN;Th.createTemplateLiteral=lqD;Th.createTransformContext=Xh;Th.createVNodeCall=v3;Th.errorMessages=uy;Th.extractIdentifiers=X6;Th.findDir=q0;Th.findProp=W7;Th.forAliasRE=ty;Th.generate=Qh;Th.getBaseTransformPreset=vh;Th.getConstantType=C0;Th.getMemoedVNodeCall=ry;Th.getVNodeBlockHelper=Z2;Th.getVNodeHelper=z2;Th.hasDynamicKeyVBind=FKD;Th.hasScopeRef=c$;Th.helperNameMap=j0;Th.injectProp=I7;Th.isAllWhitespace=tN;Th.isCommentOrWhitespace=oN;Th.isCoreComponent=dN;Th.isFnExpression=py;Th.isFnExpressionBrowser=JKD;Th.isFnExpressionNode=ny;Th.isFunctionType=iy;Th.isInDestructureAssignment=UY;Th.isInNewExpression=xy;Th.isMemberExpression=nN;Th.isMemberExpressionBrowser=DKD;Th.isMemberExpressionNode=cy;Th.isReferencedIdentifier=fy;Th.isSimpleIdentifier=s6;Th.isSlotOutlet=G7;Th.isStaticArgOf=c1;Th.isStaticExp=Y6;Th.isStaticProperty=lN;Th.isStaticPropertyKey=dy;Th.isTemplateNode=b3;Th.isText=rX;Th.isVPre=vN;Th.isVSlot=EY;Th.isWhitespaceText=AY;Th.locStub=V$;Th.noopDirectiveTransform=YWD;Th.processExpression=K0;Th.processFor=Zh;Th.processIf=zh;Th.processSlotOutlet=wh;Th.registerRuntimeHelpers=gqD;Th.resolveComponentType=Vh;Th.stringifyExpression=eN;Th.toValidAssetId=H2;Th.trackSlotScopes=Hh;Th.trackVForSlotScopes=Bh;Th.transform=Yh;Th.transformBind=Mh;Th.transformElement=jh;Th.transformExpression=Ih;Th.transformModel=Eh;Th.transformOn=Rh;Th.transformVBindShorthand=Ah;Th.traverseNode=Z7;Th.unwrapTSNode=RY;Th.validFirstIdentCharRE=cN;Th.walkBlockDeclarations=mN;Th.walkFunctionParams=yy;Th.walkIdentifiers=gy;Th.warnDeprecation=K7});var lh=k((PY)=>{Object.defineProperty(PY,"__esModule",{value:!0});var LD=bh(),bD=_O(),Jj=Symbol("vModelRadio"),Fj=Symbol("vModelCheckbox"),Uj=Symbol("vModelText"),Xj=Symbol("vModelSelect"),bY=Symbol("vModelDynamic"),Yj=Symbol("vOnModifiersGuard"),Qj=Symbol("vOnKeysGuard"),qj=Symbol("vShow"),SY=Symbol("Transition"),Kj=Symbol("TransitionGroup");LD.registerRuntimeHelpers({[Jj]:"vModelRadio",[Fj]:"vModelCheckbox",[Uj]:"vModelText",[Xj]:"vModelSelect",[bY]:"vModelDynamic",[Yj]:"withModifiers",[Qj]:"withKeys",[qj]:"vShow",[SY]:"Transition",[Kj]:"TransitionGroup"});var Wj={parseMode:"html",isVoidTag:bD.isVoidTag,isNativeTag:(D)=>bD.isHTMLTag(D)||bD.isSVGTag(D)||bD.isMathMLTag(D),isPreTag:(D)=>D==="pre",isIgnoreNewlineTag:(D)=>D==="pre"||D==="textarea",decodeEntities:void 0,isBuiltInComponent:(D)=>{if(D==="Transition"||D==="transition")return SY;else if(D==="TransitionGroup"||D==="transition-group")return Kj},getNamespace(D,$,J){let F=$?$.ns:J;if($&&F===2){if($.tag==="annotation-xml"){if(D==="svg")return 1;if($.props.some((U)=>U.type===6&&U.name==="encoding"&&U.value!=null&&(U.value.content==="text/html"||U.value.content==="application/xhtml+xml")))F=0}else if(/^m(?:[ions]|text)$/.test($.tag)&&D!=="mglyph"&&D!=="malignmark")F=0}else if($&&F===1){if($.tag==="foreignObject"||$.tag==="desc"||$.tag==="title")F=0}if(F===0){if(D==="svg")return 1;if(D==="math")return 2}return F}},gh=(D)=>{if(D.type===1)D.props.forEach(($,J)=>{if($.type===6&&$.name==="style"&&$.value)D.props[J]={type:7,name:"bind",arg:LD.createSimpleExpression("style",!0,$.loc),exp:dID($.value.content,$.loc),modifiers:[],loc:$.loc}})},dID=(D,$)=>{let J=bD.parseStringStyle(D);return LD.createSimpleExpression(JSON.stringify(J),!1,$,3)};function n0(D,$){return LD.createCompilerError(D,$,fh)}var cID={X_V_HTML_NO_EXPRESSION:54,"54":"X_V_HTML_NO_EXPRESSION",X_V_HTML_WITH_CHILDREN:55,"55":"X_V_HTML_WITH_CHILDREN",X_V_TEXT_NO_EXPRESSION:56,"56":"X_V_TEXT_NO_EXPRESSION",X_V_TEXT_WITH_CHILDREN:57,"57":"X_V_TEXT_WITH_CHILDREN",X_V_MODEL_ON_INVALID_ELEMENT:58,"58":"X_V_MODEL_ON_INVALID_ELEMENT",X_V_MODEL_ARG_ON_ELEMENT:59,"59":"X_V_MODEL_ARG_ON_ELEMENT",X_V_MODEL_ON_FILE_INPUT_ELEMENT:60,"60":"X_V_MODEL_ON_FILE_INPUT_ELEMENT",X_V_MODEL_UNNECESSARY_VALUE:61,"61":"X_V_MODEL_UNNECESSARY_VALUE",X_V_SHOW_NO_EXPRESSION:62,"62":"X_V_SHOW_NO_EXPRESSION",X_TRANSITION_INVALID_CHILDREN:63,"63":"X_TRANSITION_INVALID_CHILDREN",X_IGNORED_SIDE_EFFECT_TAG:64,"64":"X_IGNORED_SIDE_EFFECT_TAG",__EXTEND_POINT__:65,"65":"__EXTEND_POINT__"},fh={[54]:"v-html is missing expression.",[55]:"v-html will override element children.",[56]:"v-text is missing expression.",[57]:"v-text will override element children.",[58]:"v-model can only be used on <input>, <textarea> and <select> elements.",[59]:"v-model argument is not supported on plain elements.",[60]:"v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",[61]:"Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",[62]:"v-show is missing expression.",[63]:"<Transition> expects exactly one child element or component.",[64]:"Tags with side effect (<script> and <style>) are ignored in client component templates."},nID=(D,$,J)=>{let{exp:F,loc:U}=D;if(!F)J.onError(n0(54,U));if($.children.length)J.onError(n0(55,U)),$.children.length=0;return{props:[LD.createObjectProperty(LD.createSimpleExpression("innerHTML",!0,U),F||LD.createSimpleExpression("",!0))]}},pID=(D,$,J)=>{let{exp:F,loc:U}=D;if(!F)J.onError(n0(56,U));if($.children.length)J.onError(n0(57,U)),$.children.length=0;return{props:[LD.createObjectProperty(LD.createSimpleExpression("textContent",!0),F?LD.getConstantType(F,J)>0?F:LD.createCallExpression(J.helperString(LD.TO_DISPLAY_STRING),[F],U):LD.createSimpleExpression("",!0))]}},rID=(D,$,J)=>{let F=LD.transformModel(D,$,J);if(!F.props.length||$.tagType===1)return F;if(D.arg)J.onError(n0(59,D.arg.loc));function U(){let Q=LD.findDir($,"bind");if(Q&&LD.isStaticArgOf(Q.arg,"value"))J.onError(n0(61,Q.loc))}let{tag:X}=$,Y=J.isCustomElement(X);if(X==="input"||X==="textarea"||X==="select"||Y){let Q=Uj,q=!1;if(X==="input"||Y){let K=LD.findProp($,"type");if(K){if(K.type===7)Q=bY;else if(K.value)switch(K.value.content){case"radio":Q=Jj;break;case"checkbox":Q=Fj;break;case"file":q=!0,J.onError(n0(60,D.loc));break;default:U();break}}else if(LD.hasDynamicKeyVBind($))Q=bY;else U()}else if(X==="select")Q=Xj;else U();if(!q)F.needRuntime=J.helper(Q)}else J.onError(n0(58,D.loc));return F.props=F.props.filter((Q)=>!(Q.key.type===4&&Q.key.content==="modelValue")),F},tID=bD.makeMap("passive,once,capture"),oID=bD.makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),aID=bD.makeMap("left,right"),xh=bD.makeMap("onkeyup,onkeydown,onkeypress"),sID=(D,$,J,F)=>{let U=[],X=[],Y=[];for(let Q=0;Q<$.length;Q++){let q=$[Q].content;if(q==="native"&&LD.checkCompatEnabled("COMPILER_V_ON_NATIVE",J,F))Y.push(q);else if(tID(q))Y.push(q);else if(aID(q))if(LD.isStaticExp(D))if(xh(D.content.toLowerCase()))U.push(q);else X.push(q);else U.push(q),X.push(q);else if(oID(q))X.push(q);else U.push(q)}return{keyModifiers:U,nonKeyModifiers:X,eventOptionModifiers:Y}},Ph=(D,$)=>{return LD.isStaticExp(D)&&D.content.toLowerCase()==="onclick"?LD.createSimpleExpression($,!0):D.type!==4?LD.createCompoundExpression(["(",D,`) === "onClick" ? "${$}" : (`,D,")"]):D},eID=(D,$,J)=>{return LD.transformOn(D,$,J,(F)=>{let{modifiers:U}=D;if(!U.length)return F;let{key:X,value:Y}=F.props[0],{keyModifiers:Q,nonKeyModifiers:q,eventOptionModifiers:K}=sID(X,U,J,D.loc);if(q.includes("right"))X=Ph(X,"onContextmenu");if(q.includes("middle"))X=Ph(X,"onMouseup");if(q.length)Y=LD.createCallExpression(J.helper(Yj),[Y,JSON.stringify(q)]);if(Q.length&&(!LD.isStaticExp(X)||xh(X.content.toLowerCase())))Y=LD.createCallExpression(J.helper(Qj),[Y,JSON.stringify(Q)]);if(K.length){let W=K.map(bD.capitalize).join("");X=LD.isStaticExp(X)?LD.createSimpleExpression(`${X.content}${W}`,!0):LD.createCompoundExpression(["(",X,`) + "${W}"`])}return{props:[LD.createObjectProperty(X,Y)]}})},DzD=(D,$,J)=>{let{exp:F,loc:U}=D;if(!F)J.onError(n0(62,U));return{props:[],needRuntime:J.helper(qj)}},$zD=(D,$)=>{if(D.type===1&&D.tagType===1){if($.isBuiltInComponent(D.tag)===SY)return()=>{if(!D.children.length)return;if(yh(D))$.onError(n0(63,{start:D.children[0].loc.start,end:D.children[D.children.length-1].loc.end,source:""}));let F=D.children[0];if(F.type===1){for(let U of F.props)if(U.type===7&&U.name==="show")D.props.push({type:6,name:"persisted",nameLoc:D.loc,value:void 0,loc:D.loc})}}}};function yh(D){let $=D.children=D.children.filter((F)=>!LD.isCommentOrWhitespace(F)),J=$[0];return $.length!==1||J.type===11||J.type===9&&J.branches.some(yh)}var JzD=/__VUE_EXP_START__(.*?)__VUE_EXP_END__/g,FzD=(D,$,J)=>{if($.scopes.vSlot>0)return;let F=J.type===1&&J.codegenNode&&J.codegenNode.type===13&&J.codegenNode.children&&!bD.isArray(J.codegenNode.children)&&J.codegenNode.children.type===20,U=0,X=0,Y=[],Q=(K)=>{if(U>=20||X>=5){let W=LD.createCallExpression($.helper(LD.CREATE_STATIC),[JSON.stringify(Y.map((I)=>Gj(I,$)).join("")).replace(JzD,'" + $1 + "'),String(Y.length)]),G=Y.length-1;if(F)D.splice(K-Y.length,Y.length,W);else if(Y[0].codegenNode.value=W,Y.length>1){D.splice(K-Y.length+1,G);let I=$.cached.indexOf(Y[Y.length-1].codegenNode);if(I>-1){for(let z=I;z<$.cached.length;z++){let Z=$.cached[z];if(Z)Z.index-=G}$.cached.splice(I-G+1,G)}}return G}return 0},q=0;for(;q<D.length;q++){let K=D[q];if(F||UzD(K)){let G=QzD(K);if(G){U+=G[0],X+=G[1],Y.push(K);continue}}q-=Q(q),U=0,X=0,Y.length=0}Q(q)},UzD=(D)=>{if((D.type===1&&D.tagType===0||D.type===12)&&D.codegenNode&&D.codegenNode.type===20)return D.codegenNode},XzD=/^(?:data|aria)-/,Sh=(D,$)=>{return($===0?bD.isKnownHtmlAttr(D):$===1?bD.isKnownSvgAttr(D):$===2?bD.isKnownMathMLAttr(D):!1)||XzD.test(D)},YzD=bD.makeMap("caption,thead,tr,th,tbody,td,tfoot,colgroup,col");function QzD(D){if(D.type===1&&YzD(D.tag))return!1;if(D.type===1&&LD.findDir(D,"once",!0))return!1;if(D.type===12)return[1,0];let $=1,J=D.props.length>0?1:0,F=!1,U=()=>{return F=!0,!1};function X(Y){let Q=Y.tag==="option"&&Y.ns===0;for(let q=0;q<Y.props.length;q++){let K=Y.props[q];if(K.type===6&&!Sh(K.name,Y.ns))return U();if(K.type===7&&K.name==="bind"){if(K.arg&&(K.arg.type===8||K.arg.isStatic&&!Sh(K.arg.content,Y.ns)))return U();if(K.exp&&(K.exp.type===8||K.exp.constType<3))return U();if(Q&&LD.isStaticArgOf(K.arg,"value")&&K.exp&&!K.exp.isStatic)return U()}}for(let q=0;q<Y.children.length;q++){$++;let K=Y.children[q];if(K.type===1){if(K.props.length>0)J++;if(X(K),F)return!1}}return!0}return X(D)?[$,J]:!1}function Gj(D,$){if(bD.isString(D))return D;if(bD.isSymbol(D))return"";switch(D.type){case 1:return qzD(D,$);case 2:return bD.escapeHtml(D.content);case 3:return`<!--${bD.escapeHtml(D.content)}-->`;case 5:return bD.escapeHtml(bD.toDisplayString(O2(D.content)));case 8:return bD.escapeHtml(O2(D));case 12:return Gj(D.content,$);default:return""}}function qzD(D,$){let J=`<${D.tag}`,F="";for(let U=0;U<D.props.length;U++){let X=D.props[U];if(X.type===6){if(J+=` ${X.name}`,X.value)J+=`="${bD.escapeHtml(X.value.content)}"`}else if(X.type===7){if(X.name==="bind"){let Y=X.exp;if(Y.content[0]==="_"){J+=` ${X.arg.content}="__VUE_EXP_START__${Y.content}__VUE_EXP_END__"`;continue}if(bD.isBooleanAttr(X.arg.content)&&Y.content==="false")continue;let Q=O2(Y);if(Q!=null){let q=X.arg&&X.arg.content;if(q==="class")Q=bD.normalizeClass(Q);else if(q==="style")Q=bD.stringifyStyle(bD.normalizeStyle(Q));J+=` ${X.arg.content}="${bD.escapeHtml(Q)}"`}}else if(X.name==="html")F=O2(X.exp);else if(X.name==="text")F=bD.escapeHtml(bD.toDisplayString(O2(X.exp)))}}if($.scopeId)J+=` ${$.scopeId}`;if(J+=">",F)J+=F;else for(let U=0;U<D.children.length;U++)J+=Gj(D.children[U],$);if(!bD.isVoidTag(D.tag))J+=`</${D.tag}>`;return J}function O2(D){if(D.type===4)return Function(`return (${D.content})`)();else{let $="";return D.children.forEach((J)=>{if(bD.isString(J)||bD.isSymbol(J))return;if(J.type===2)$+=J.content;else if(J.type===5)$+=bD.toDisplayString(O2(J.content));else $+=O2(J)}),$}}var KzD=(D,$)=>{if(D.type===1&&D.tagType===0&&(D.tag==="script"||D.tag==="style"))$.onError(n0(64,D.loc)),$.removeNode()};function WzD(D,$){if(D==="template")return!0;if(D in _h)return _h[D].has($);if($ in kh)return kh[$].has(D);if(D in Ch){if(Ch[D].has($))return!1}if($ in uh){if(uh[$].has(D))return!1}return!0}var k3=new Set(["h1","h2","h3","h4","h5","h6"]),B2=new Set([]),_h={head:new Set(["base","basefront","bgsound","link","meta","title","noscript","noframes","style","script","template"]),optgroup:new Set(["option"]),select:new Set(["optgroup","option","hr"]),table:new Set(["caption","colgroup","tbody","tfoot","thead"]),tr:new Set(["td","th"]),colgroup:new Set(["col"]),tbody:new Set(["tr"]),thead:new Set(["tr"]),tfoot:new Set(["tr"]),script:B2,iframe:B2,option:B2,textarea:B2,style:B2,title:B2},kh={html:B2,body:new Set(["html"]),head:new Set(["html"]),td:new Set(["tr"]),colgroup:new Set(["table"]),caption:new Set(["table"]),tbody:new Set(["table"]),tfoot:new Set(["table"]),col:new Set(["colgroup"]),th:new Set(["tr"]),thead:new Set(["table"]),tr:new Set(["tbody","thead","tfoot"]),dd:new Set(["dl","div"]),dt:new Set(["dl","div"]),figcaption:new Set(["figure"]),summary:new Set(["details"]),area:new Set(["map"])},Ch={p:new Set(["address","article","aside","blockquote","center","details","dialog","dir","div","dl","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","menu","ol","p","pre","section","table","ul"]),svg:new Set(["b","blockquote","br","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","hr","i","img","li","menu","meta","ol","p","pre","ruby","s","small","span","strong","sub","sup","table","u","ul","var"])},uh={a:new Set(["a"]),button:new Set(["button"]),dd:new Set(["dd","dt"]),dt:new Set(["dd","dt"]),form:new Set(["form"]),li:new Set(["li"]),h1:k3,h2:k3,h3:k3,h4:k3,h5:k3,h6:k3},GzD=(D,$)=>{if(D.type===1&&D.tagType===0&&$.parent&&$.parent.type===1&&$.parent.tagType===0&&!WzD($.parent.tag,D.tag)){let J=SyntaxError(`<${D.tag}> cannot be child of <${$.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);J.loc=D.loc,$.onWarn(J)}},hh=[gh,$zD,GzD],mh={cloak:LD.noopDirectiveTransform,html:nID,text:pID,model:rID,on:eID,show:DzD};function IzD(D,$={}){return LD.baseCompile(D,bD.extend({},Wj,$,{nodeTransforms:[KzD,...hh,...$.nodeTransforms||[]],directiveTransforms:bD.extend({},mh,$.directiveTransforms||{}),transformHoist:FzD}))}function zzD(D,$={}){return LD.baseParse(D,bD.extend({},Wj,$))}PY.DOMDirectiveTransforms=mh;PY.DOMErrorCodes=cID;PY.DOMErrorMessages=fh;PY.DOMNodeTransforms=hh;PY.TRANSITION=SY;PY.TRANSITION_GROUP=Kj;PY.V_MODEL_CHECKBOX=Fj;PY.V_MODEL_DYNAMIC=bY;PY.V_MODEL_RADIO=Jj;PY.V_MODEL_SELECT=Xj;PY.V_MODEL_TEXT=Uj;PY.V_ON_WITH_KEYS=Qj;PY.V_ON_WITH_MODIFIERS=Yj;PY.V_SHOW=qj;PY.compile=IzD;PY.createDOMCompilerError=n0;PY.parse=zzD;PY.parserOptions=Wj;PY.transformStyle=gh;Object.keys(LD).forEach(function(D){if(D!=="default"&&!Object.prototype.hasOwnProperty.call(PY,D))PY[D]=LD[D]})});import{exit as czD}from"node:process";import{workerData as nzD}from"node:worker_threads";B7();U8();rK();import{parentPort as zf}from"node:worker_threads";async function Zf(D,$){let{project:J,apiHost:F,apikey:U,command:X,attemptId:Y}=D;Mj(X);let Q=(z,Z,H={})=>{zf?.postMessage({type:"onboarding-analytics",payload:{channel:$.channel,event:z,tracking_version:2,timestamp:new Date(Z),tags:{app_id:J.appId},nonPersonTags:{attempt_id:Y,command_path:X,...H}}})},q=Date.now();Q("scan_started",q);let K=q,W="error",G="not_attempted",I;try{if(B6("local scan started",{scan:$.step}),W=$.scan(J),K=Date.now(),B6("local scan finished",{scan:$.step,result:W,duration_ms:K-q}),W!=="found")return;G="failed";let z=Date.now();B6("step update started",{scan:$.step});let Z=await fetch(`${V1(F)}/app/${encodeURIComponent(J.appId)}`,{method:"PUT",headers:Q6({"Content-Type":"application/json",Authorization:U,capgkey:U}),body:JSON.stringify({onboarding:{steps:{[$.step]:{status:"done"}}}}),redirect:"manual"});if(B6("step update finished",{scan:$.step,status:Z.status,duration_ms:Date.now()-z}),I=Z.status,G=Z.ok?"success":"rejected",Z.ok)zf?.postMessage({type:"onboarding-step",step:$.step});await Z.body?.cancel()}catch(z){throw B6("local check failed",{scan:$.step,error:zF(z)}),z}finally{if(W==="error")K=Date.now();Q("scan_ended",K,{result:W,duration_ms:K-q,todo_report_status:G,...I===void 0?{}:{todo_report_http_status:I}})}}var H7=g0(lh(),1);import{existsSync as ih,readdirSync as kzD,readFileSync as CzD,realpathSync as uzD,statSync as gzD}from"node:fs";import{basename as fzD,dirname as ah,extname as dh,isAbsolute as xzD,join as ch,relative as sh,resolve as yzD,sep as Ij}from"node:path";import uD from"typescript";var zj="@capgo/capacitor-updater",nh=/\.(?:[cm]?[jt]sx?|vue)$/,ph=/^(?:\..*|node_modules|dist|build|www|coverage|android|ios|test|tests|__tests__|__mocks__|fixtures|__fixtures__|e2e|cypress|playwright|scripts)$/,hzD=/\.(?:test|spec|d)\.[cm]?[jt]sx?$|^capacitor\.config\./;function rh(D,$){let J=sh(D,$);return!xzD(J)&&J!==".."&&!J.startsWith(`..${Ij}`)}function mzD(D){let $=uD.findConfigFile(D,uD.sys.fileExists);if(!$)return{};let J=uD.readConfigFile($,uD.sys.readFile);if(J.error)return{};return uD.parseJsonConfigFileContent({...J.config,files:[],include:[]},uD.sys,ah($)).options}function lzD(D){return H7.parse(D,{parseMode:"sfc",onError:(J)=>{throw J}}).children.flatMap((J)=>{if(J.type!==H7.NodeTypes.ELEMENT||J.tag!=="script")return[];return J.children.flatMap((F)=>F.type===H7.NodeTypes.TEXT?[F.content]:[])}).join(`
295
295
  `)}function izD(D){for(let $=D.parent;$;$=$.parent)if(uD.isImportDeclaration($))return $;return}function th(D){let $=izD(D);return!!$&&uD.isStringLiteral($.moduleSpecifier)&&$.moduleSpecifier.text===zj&&!$.importClause?.isTypeOnly}function oh(D,$){if(uD.isIdentifier(D))return!!$.getSymbolAtLocation(D)?.declarations?.some((J)=>{if(uD.isImportSpecifier(J))return!J.isTypeOnly&&(J.propertyName??J.name).text==="CapacitorUpdater"&&th(J);if(!uD.isBindingElement(J)||!uD.isObjectBindingPattern(J.parent))return!1;let F=J.parent.parent,U=J.propertyName??J.name;if(!uD.isIdentifier(U)||U.text!=="CapacitorUpdater"||!uD.isVariableDeclaration(F))return!1;let X=F.initializer;return!!X&&uD.isCallExpression(X)&&uD.isIdentifier(X.expression)&&X.expression.text==="require"&&!$.getSymbolAtLocation(X.expression)&&X.arguments.length===1&&uD.isStringLiteral(X.arguments[0])&&X.arguments[0].text===zj&&uD.isVariableDeclarationList(F.parent)&&!!(F.parent.flags&uD.NodeFlags.Const)});if(uD.isPropertyAccessExpression(D)&&D.name.text==="CapacitorUpdater"&&uD.isIdentifier(D.expression))return!!$.getSymbolAtLocation(D.expression)?.declarations?.some((J)=>uD.isNamespaceImport(J)&&th(J));return!1}function dzD(D,$){function J(F){if(uD.isCallExpression(F)){let U=F.expression;if(uD.isPropertyAccessExpression(U)&&U.name.text==="notifyAppReady"&&oh(U.expression,$))return!0;if(uD.isElementAccessExpression(U)&&uD.isStringLiteral(U.argumentExpression)&&U.argumentExpression.text==="notifyAppReady"&&oh(U.expression,$))return!0}return uD.forEachChild(F,J)??!1}return J(D)}function eh(D){try{let q=function(H){if(Q(),!nh.test(H)||hzD.test(fzD(H)))return;let B=uzD(H);if(U.has(B)||!rh(D.workspaceRoot,B)||sh(D.workspaceRoot,B).split(Ij).some((E)=>ph.test(E))||D.webDir&&D.webDir!==D.dir&&rh(D.webDir,B))return;U.add(B);let N=gzD(B).size;if(N>1048576)throw Error("Source file too large");Y+=N,Q();let j=CzD(B,"utf8"),O=B.split(Ij).join("/"),L=dh(B)===".vue"?`${O}.tsx`:O,A=dh(B)===".vue"?lzD(j):j;J.set(L,A),F.set(L,B)},K=function(H){Q();for(let B of kzD(H,{withFileTypes:!0})){let N=ch(H,B.name);if(B.isDirectory()){if(!ph.test(B.name)&&!ih(ch(N,"package.json")))K(N)}else if(B.isFile())q(N)}},$=Date.now()+5000,J=new Map,F=new Map,U=new Set,X=mzD(D.dir),Y=0,Q=()=>{if(Date.now()>$||U.size>1e4||Y>20971520)throw Error("Source scan budget exceeded")};K(D.dir);for(let[H,B]of J){Q();let N=F.get(H);for(let j of uD.preProcessFile(B,!0,!0).importedFiles){let O=j.fileName;if(O===zj)continue;let L=uD.resolveModuleName(O,N,X,uD.sys).resolvedModule?.resolvedFileName??(O.startsWith(".")&&nh.test(O)?yzD(ah(N),O):void 0);if(L&&ih(L))q(L)}}let W={allowJs:!0,noLib:!0,noResolve:!0,types:[],jsx:uD.JsxEmit.Preserve},G=uD.createCompilerHost(W);G.getSourceFile=(H,B)=>{let N=J.get(H);return N===void 0?void 0:uD.createSourceFile(H,N,B,!0)};let I=uD.createProgram([...J.keys()],W,G),z=I.getTypeChecker(),Z=!1;for(let H of I.getSourceFiles()){if(Q(),I.getSyntacticDiagnostics(H).length){Z=!0;continue}if(dzD(H,z))return"found"}return Z?"unknown":"not_found"}catch{return"unknown"}}Zf(nzD,{channel:"notify-app-ready",step:"add_code",scan:eh}).catch(()=>{}).finally(()=>czD(0));