@capgo/cli 8.28.2 → 8.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/dist/src/sdk.js +1 -1
- package/dist/src/types/supabase.types.d.ts +3 -0
- package/dist/src/utils.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91,7 +91,7 @@ Expecting one of '${B.join("', '")}'`);if(this._lifeCycleHooks[A])this._lifeCycl
|
|
|
91
91
|
`),this.outputHelp({error:!0});let B=Q||{},$=B.exitCode||1,J=B.code||"commander.error";this._exit($,J,A)}_parseOptionsEnv(){this.options.forEach((A)=>{if(A.envVar&&A.envVar in j$.env){let Q=A.attributeName();if(this.getOptionValue(Q)===void 0||["default","config","env"].includes(this.getOptionValueSource(Q)))if(A.required||A.optional)this.emit(`optionEnv:${A.name()}`,j$.env[A.envVar]);else this.emit(`optionEnv:${A.name()}`)}})}_parseOptionsImplied(){let A=new kDQ(this.options),Q=(B)=>{return this.getOptionValue(B)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(B))};this.options.filter((B)=>B.implied!==void 0&&Q(B.attributeName())&&A.valueFromOption(this.getOptionValue(B.attributeName()),B)).forEach((B)=>{Object.keys(B.implied).filter(($)=>!Q($)).forEach(($)=>{this.setOptionValueWithSource($,B.implied[$],"implied")})})}missingArgument(A){let Q=`error: missing required argument '${A}'`;this.error(Q,{code:"commander.missingArgument"})}optionMissingArgument(A){let Q=`error: option '${A.flags}' argument missing`;this.error(Q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(A){let Q=`error: required option '${A.flags}' not specified`;this.error(Q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(A,Q){let B=(Y)=>{let X=Y.attributeName(),G=this.getOptionValue(X),K=this.options.find((Z)=>Z.negate&&X===Z.attributeName()),W=this.options.find((Z)=>!Z.negate&&X===Z.attributeName());if(K&&(K.presetArg===void 0&&G===!1||K.presetArg!==void 0&&G===K.presetArg))return K;return W||Y},$=(Y)=>{let X=B(Y),G=X.attributeName();if(this.getOptionValueSource(G)==="env")return`environment variable '${X.envVar}'`;return`option '${X.flags}'`},J=`error: ${$(A)} cannot be used with ${$(Q)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption(A){if(this._allowUnknownOption)return;let Q="";if(A.startsWith("--")&&this._showSuggestionAfterError){let $=[],J=this;do{let Y=J.createHelp().visibleOptions(J).filter((X)=>X.long).map((X)=>X.long);$=$.concat(Y),J=J.parent}while(J&&!J._enablePositionalOptions);Q=yMA(A,$)}let B=`error: unknown option '${A}'${Q}`;this.error(B,{code:"commander.unknownOption"})}_excessArguments(A){if(this._allowExcessArguments)return;let Q=this.registeredArguments.length,B=Q===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Q} argument${B} but got ${A.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let A=this.args[0],Q="";if(this._showSuggestionAfterError){let $=[];this.createHelp().visibleCommands(this).forEach((J)=>{if($.push(J.name()),J.alias())$.push(J.alias())}),Q=yMA(A,$)}let B=`error: unknown command '${A}'${Q}`;this.error(B,{code:"commander.unknownCommand"})}version(A,Q,B){if(A===void 0)return this._version;this._version=A,Q=Q||"-V, --version",B=B||"output the version number";let $=this.createOption(Q,B);return this._versionOptionName=$.attributeName(),this._registerOption($),this.on("option:"+$.name(),()=>{this._outputConfiguration.writeOut(`${A}
|
|
92
92
|
`),this._exit(0,"commander.version",A)}),this}description(A,Q){if(A===void 0&&Q===void 0)return this._description;if(this._description=A,Q)this._argsDescription=Q;return this}summary(A){if(A===void 0)return this._summary;return this._summary=A,this}alias(A){if(A===void 0)return this._aliases[0];let Q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Q=this.commands[this.commands.length-1];if(A===Q._name)throw Error("Command alias can't be the same as its name");let B=this.parent?._findCommand(A);if(B){let $=[B.name()].concat(B.aliases()).join("|");throw Error(`cannot add alias '${A}' to command '${this.name()}' as already have command '${$}'`)}return Q._aliases.push(A),this}aliases(A){if(A===void 0)return this._aliases;return A.forEach((Q)=>this.alias(Q)),this}usage(A){if(A===void 0){if(this._usage)return this._usage;let Q=this.registeredArguments.map((B)=>{return _DQ(B)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Q:[]).join(" ")}return this._usage=A,this}name(A){if(A===void 0)return this._name;return this._name=A,this}helpGroup(A){if(A===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=A,this}commandsGroup(A){if(A===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=A,this}optionsGroup(A){if(A===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=A,this}_initOptionGroup(A){if(this._defaultOptionGroup&&!A.helpGroupHeading)A.helpGroup(this._defaultOptionGroup)}_initCommandGroup(A){if(this._defaultCommandGroup&&!A.helpGroup())A.helpGroup(this._defaultCommandGroup)}nameFromFilename(A){return this._name=gD.basename(A,gD.extname(A)),this}executableDir(A){if(A===void 0)return this._executableDir;return this._executableDir=A,this}helpInformation(A){let Q=this.createHelp(),B=this._getOutputContext(A);Q.prepareContext({error:B.error,helpWidth:B.helpWidth,outputHasColors:B.hasColors});let $=Q.formatHelp(this,Q);if(B.hasColors)return $;return this._outputConfiguration.stripColor($)}_getOutputContext(A){A=A||{};let Q=!!A.error,B,$,J;if(Q)B=(X)=>this._outputConfiguration.writeErr(X),$=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else B=(X)=>this._outputConfiguration.writeOut(X),$=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Q,write:(X)=>{if(!$)X=this._outputConfiguration.stripColor(X);return B(X)},hasColors:$,helpWidth:J}}outputHelp(A){let Q;if(typeof A==="function")Q=A,A=void 0;let B=this._getOutputContext(A),$={error:B.error,write:B.write,command:this};this._getCommandAndAncestors().reverse().forEach((Y)=>Y.emit("beforeAllHelp",$)),this.emit("beforeHelp",$);let J=this.helpInformation({error:B.error});if(Q){if(J=Q(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(B.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",$),this._getCommandAndAncestors().forEach((Y)=>Y.emit("afterAllHelp",$))}helpOption(A,Q){if(typeof A==="boolean"){if(A){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(A??"-h, --help",Q??"display help for command"),A||Q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(A){return this._helpOption=A,this._initOptionGroup(A),this}help(A){this.outputHelp(A);let Q=Number(j$.exitCode??0);if(Q===0&&A&&typeof A!=="function"&&A.error)Q=1;this._exit(Q,"commander.help","(outputHelp)")}addHelpText(A,Q){let B=["beforeAll","before","after","afterAll"];if(!B.includes(A))throw Error(`Unexpected value for position to addHelpText.
|
|
93
93
|
Expecting one of '${B.join("', '")}'`);let $=`${A}Help`;return this.on($,(J)=>{let Y;if(typeof Q==="function")Y=Q({error:J.error,command:J.command});else Y=Q;if(Y)J.write(`${Y}
|
|
94
|
-
`)}),this}_outputHelpIfRequested(A){let Q=this._getHelpOption();if(Q&&A.find(($)=>Q.is($)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function gMA(A){return A.map((Q)=>{if(!Q.startsWith("--inspect"))return Q;let B,$="127.0.0.1",J="9229",Y;if((Y=Q.match(/^(--inspect(-brk)?)$/))!==null)B=Y[1];else if((Y=Q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=Y[1],/^\d+$/.test(Y[3]))J=Y[3];else $=Y[3];else if((Y=Q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=Y[1],$=Y[3],J=Y[4];if(B&&J!=="0")return`${B}=${$}:${parseInt(J)+1}`;return Q})}function Z8A(){if(j$.env.NO_COLOR||j$.env.FORCE_COLOR==="0"||j$.env.FORCE_COLOR==="false")return!1;if(j$.env.FORCE_COLOR||j$.env.CLICOLOR_FORCE!==void 0)return!0;return}SDQ.Command=H8A;SDQ.useColor=Z8A});var dMA=t((yDQ)=>{var{Argument:mMA}=bu(),{Command:D8A}=hMA(),{CommanderError:vDQ,InvalidArgumentError:uMA}=CP(),{Help:fDQ}=X8A(),{Option:cMA}=G8A();yDQ.program=new D8A;yDQ.createCommand=(A)=>new D8A(A);yDQ.createOption=(A,Q)=>new cMA(A,Q);yDQ.createArgument=(A,Q)=>new mMA(A,Q);yDQ.Command=D8A;yDQ.Option=cMA;yDQ.Argument=mMA;yDQ.Help=fDQ;yDQ.CommanderError=vDQ;yDQ.InvalidArgumentError=uMA;yDQ.InvalidOptionArgumentError=uMA});var C4;var XK=vA(()=>{C4={name:"@capgo/cli",type:"module",version:"8.28.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:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test: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","test:credentials":"bun test/test-credentials.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test: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 run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && 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-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:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && 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:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && 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:organization-set-api-host","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.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:organization-set-api-host":"bun test/test-organization-set-api-host.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@rrweb/types":"^2.0.1","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","happy-dom":"^20.10.4",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6","rrweb-snapshot":"^2.0.1","string-width":"^8.2.1"},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.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});function rDQ(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function sDQ(A){if(A instanceof Error)return A.message;if(typeof A==="string")return A;return""}function MP(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=rDQ(A);if(Q!==void 0){if(Q===401)return"unauthorized";if(Q===403)return"forbidden";if(Q===404)return"not_found";if(Q===413)return"payload_too_large";if(Q>=500)return"server_error"}let B=sDQ(A).toLowerCase();if(/econnrefused|enotfound|fetch failed|network|socket|dns/.test(B))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(B))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(B))return"validation_error";return"unknown"}function pMA(A){if(A===401)return"unauthorized";if(A===403)return"forbidden";if(A===404)return"not_found";if(A===408||A===504)return"timeout";if(A===413)return"payload_too_large";if(A===429)return"rate_limited";if(A===400||A===422)return"validation_error";if(A>=500)return"server_error";return"unknown"}import{AsyncLocalStorage as eDQ}from"node:async_hooks";function EL(A,Q){return oMA.run(A,()=>Promise.resolve(Q()))}function AqQ(){return oMA.getStore()}function NP(){aMA=!0}function rMA(){return aMA}function tMA(A){sMA=A}function nMA(A){try{sMA?.(A)}catch{}}function ANA(A,Q){let B;try{B=new URL(A).pathname}catch{B=A.split("?")[0]}let $="/functions/v1/",J=B.indexOf($);if(J>=0){let W=B.slice(J+$.length).replace(/^\/+|\/+$/g,"");return W?`${Q} functions:${W}`:`${Q} functions`}let Y="/rest/v1/",X=B.indexOf(Y),G=X>=0?B.slice(X+Y.length):B.replace(/^\//,"");if(G.startsWith("rpc/"))return`rpc:${G.slice(4).split("/")[0]}`;let K=G.split("/")[0]||B;return`${Q} ${K}`}function QqQ(A){let Q=A?.headers;if(!Q)return;let B=Q.get;if(typeof B==="function")return B.call(Q,"capgkey")??void 0;if(Array.isArray(Q))return Q.find(([$])=>$.toLowerCase()==="capgkey")?.[1];return Q.capgkey}function QNA(){return async(Q,B)=>{let $=(B?.method??"GET").toUpperCase(),J=typeof Q==="string"?Q:Q instanceof URL?Q.href:Q.url,Y=AqQ(),X=QqQ(B),G=Date.now();try{let K=await globalThis.fetch(Q,B);return nMA({url:J,method:$,status:K.status,ok:K.ok,durationMs:Date.now()-G,source:Y,apikey:X}),K}catch(K){throw nMA({url:J,method:$,status:0,ok:!1,durationMs:Date.now()-G,source:Y,apikey:X,error:K}),K}}}var oMA,aMA=!1,sMA,eMA=5000;var LP=vA(()=>{oMA=new eDQ});import{homedir as BNA,platform as BqQ,release as $qQ}from"node:os";import{arch as JqQ,cwd as $NA,env as GO,version as YqQ}from"node:process";function xW(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function WqQ(){if(xW(GO.CAPGO_DISABLE_TELEMETRY)||xW(GO.CAPGO_DISABLE_POSTHOG))return;return GO.CAPGO_CLI_POSTHOG_API_KEY?.trim()||GO.POSTHOG_API_KEY?.trim()||GqQ}function ZqQ(A){let Q=A.replace(/\/+$/,"");if(Q.endsWith("/i/v0/e"))return`${Q}/`;let B=Q.replace(/\/capture$/,"/");return new URL("i/v0/e/",B.endsWith("/")?B:`${B}/`).toString()}function HqQ(A){if(A instanceof Error)return{cause:A.cause,message:A.message,name:A.name||"Error",stack:A.stack};if(typeof A==="string")return{message:A,name:"Error",stack:void 0};try{return{message:JSON.stringify(A)??String(A),name:"Error",stack:void 0}}catch{return{message:String(A),name:"Error",stack:void 0}}}function DqQ(A){let Q=A,B=$NA(),$=BNA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function qqQ(A){let Q=A,B=$NA(),$=BNA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){2,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function FqQ(A,Q){let B=A?.split(`
|
|
94
|
+
`)}),this}_outputHelpIfRequested(A){let Q=this._getHelpOption();if(Q&&A.find(($)=>Q.is($)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function gMA(A){return A.map((Q)=>{if(!Q.startsWith("--inspect"))return Q;let B,$="127.0.0.1",J="9229",Y;if((Y=Q.match(/^(--inspect(-brk)?)$/))!==null)B=Y[1];else if((Y=Q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(B=Y[1],/^\d+$/.test(Y[3]))J=Y[3];else $=Y[3];else if((Y=Q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)B=Y[1],$=Y[3],J=Y[4];if(B&&J!=="0")return`${B}=${$}:${parseInt(J)+1}`;return Q})}function Z8A(){if(j$.env.NO_COLOR||j$.env.FORCE_COLOR==="0"||j$.env.FORCE_COLOR==="false")return!1;if(j$.env.FORCE_COLOR||j$.env.CLICOLOR_FORCE!==void 0)return!0;return}SDQ.Command=H8A;SDQ.useColor=Z8A});var dMA=t((yDQ)=>{var{Argument:mMA}=bu(),{Command:D8A}=hMA(),{CommanderError:vDQ,InvalidArgumentError:uMA}=CP(),{Help:fDQ}=X8A(),{Option:cMA}=G8A();yDQ.program=new D8A;yDQ.createCommand=(A)=>new D8A(A);yDQ.createOption=(A,Q)=>new cMA(A,Q);yDQ.createArgument=(A,Q)=>new mMA(A,Q);yDQ.Command=D8A;yDQ.Option=cMA;yDQ.Argument=mMA;yDQ.Help=fDQ;yDQ.CommanderError=vDQ;yDQ.InvalidArgumentError=uMA;yDQ.InvalidOptionArgumentError=uMA});var C4;var XK=vA(()=>{C4={name:"@capgo/cli",type:"module",version:"8.29.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test: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","test:credentials":"bun test/test-credentials.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test: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 run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && 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-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:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && 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:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && 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:organization-set-api-host","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.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:organization-set-api-host":"bun test/test-organization-set-api-host.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@rrweb/types":"^2.0.1","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","happy-dom":"^20.10.4",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6","rrweb-snapshot":"^2.0.1","string-width":"^8.2.1"},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.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});function rDQ(A){if(A&&typeof A==="object"&&"status"in A){let Q=A.status;if(typeof Q==="number")return Q}return}function sDQ(A){if(A instanceof Error)return A.message;if(typeof A==="string")return A;return""}function MP(A){if(A&&typeof A==="object"&&"code"in A){let $=A.code;if(typeof $==="string"&&$.startsWith("commander."))return"commander"}let Q=rDQ(A);if(Q!==void 0){if(Q===401)return"unauthorized";if(Q===403)return"forbidden";if(Q===404)return"not_found";if(Q===413)return"payload_too_large";if(Q>=500)return"server_error"}let B=sDQ(A).toLowerCase();if(/econnrefused|enotfound|fetch failed|network|socket|dns/.test(B))return"network_error";if(/timed out|timeout|etimedout|aborted/.test(B))return"timeout";if(/invalid|must be|required|not allowed|malformed|validation/.test(B))return"validation_error";return"unknown"}function pMA(A){if(A===401)return"unauthorized";if(A===403)return"forbidden";if(A===404)return"not_found";if(A===408||A===504)return"timeout";if(A===413)return"payload_too_large";if(A===429)return"rate_limited";if(A===400||A===422)return"validation_error";if(A>=500)return"server_error";return"unknown"}import{AsyncLocalStorage as eDQ}from"node:async_hooks";function EL(A,Q){return oMA.run(A,()=>Promise.resolve(Q()))}function AqQ(){return oMA.getStore()}function NP(){aMA=!0}function rMA(){return aMA}function tMA(A){sMA=A}function nMA(A){try{sMA?.(A)}catch{}}function ANA(A,Q){let B;try{B=new URL(A).pathname}catch{B=A.split("?")[0]}let $="/functions/v1/",J=B.indexOf($);if(J>=0){let W=B.slice(J+$.length).replace(/^\/+|\/+$/g,"");return W?`${Q} functions:${W}`:`${Q} functions`}let Y="/rest/v1/",X=B.indexOf(Y),G=X>=0?B.slice(X+Y.length):B.replace(/^\//,"");if(G.startsWith("rpc/"))return`rpc:${G.slice(4).split("/")[0]}`;let K=G.split("/")[0]||B;return`${Q} ${K}`}function QqQ(A){let Q=A?.headers;if(!Q)return;let B=Q.get;if(typeof B==="function")return B.call(Q,"capgkey")??void 0;if(Array.isArray(Q))return Q.find(([$])=>$.toLowerCase()==="capgkey")?.[1];return Q.capgkey}function QNA(){return async(Q,B)=>{let $=(B?.method??"GET").toUpperCase(),J=typeof Q==="string"?Q:Q instanceof URL?Q.href:Q.url,Y=AqQ(),X=QqQ(B),G=Date.now();try{let K=await globalThis.fetch(Q,B);return nMA({url:J,method:$,status:K.status,ok:K.ok,durationMs:Date.now()-G,source:Y,apikey:X}),K}catch(K){throw nMA({url:J,method:$,status:0,ok:!1,durationMs:Date.now()-G,source:Y,apikey:X,error:K}),K}}}var oMA,aMA=!1,sMA,eMA=5000;var LP=vA(()=>{oMA=new eDQ});import{homedir as BNA,platform as BqQ,release as $qQ}from"node:os";import{arch as JqQ,cwd as $NA,env as GO,version as YqQ}from"node:process";function xW(A){return A==="1"||A?.toLowerCase()==="true"||A?.toLowerCase()==="yes"}function WqQ(){if(xW(GO.CAPGO_DISABLE_TELEMETRY)||xW(GO.CAPGO_DISABLE_POSTHOG))return;return GO.CAPGO_CLI_POSTHOG_API_KEY?.trim()||GO.POSTHOG_API_KEY?.trim()||GqQ}function ZqQ(A){let Q=A.replace(/\/+$/,"");if(Q.endsWith("/i/v0/e"))return`${Q}/`;let B=Q.replace(/\/capture$/,"/");return new URL("i/v0/e/",B.endsWith("/")?B:`${B}/`).toString()}function HqQ(A){if(A instanceof Error)return{cause:A.cause,message:A.message,name:A.name||"Error",stack:A.stack};if(typeof A==="string")return{message:A,name:"Error",stack:void 0};try{return{message:JSON.stringify(A)??String(A),name:"Error",stack:void 0}}catch{return{message:String(A),name:"Error",stack:void 0}}}function DqQ(A){let Q=A,B=$NA(),$=BNA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q}function qqQ(A){let Q=A,B=$NA(),$=BNA();if(B)Q=Q.replaceAll(B,"<cwd>");if($)Q=Q.replaceAll($,"~");return Q.replace(/<cwd>\/[^\s"',)]+/g,"<cwd>/<path>").replace(/~\/[^\s"',)]+/g,"~/<path>").replace(/[\w.%+-]+@[\w.-]+\.[A-Z]{2,}/gi,"<email>").replace(/(https?:\/\/)([^/\s:@]+):([^/\s@]+)@/gi,"$1<redacted>@").replace(/\b[a-z][\w-]*(?:\.[\w-]+){2,}\b/gi,"<app_id>").replace(/\b[a-z]:\\[^\s"',)]+/gi,"<path>").replace(/(^|[\s"'(])\/[^\s"',)]+/g,"$1<path>").replace(/(--(?:token|api[-_]?key|key|password|secret|private[-_]?key|jwt|session|auth)(?:=|\s+))("[^"]+"|'[^']+'|\S+)/gi,"$1<redacted>").replace(/\b((?:token|api[-_]?key|password|secret|authorization)\s*[:=]\s*)[^\s,;]+/gi,"$1<redacted>")}function FqQ(A,Q){let B=A?.split(`
|
|
95
95
|
`).slice(1).map(($)=>{let J=$.trim(),Y=J.startsWith("at ")?J.slice(3):J,X=Q,G=Y,K=Y.lastIndexOf(" (");if(K!==-1&&Y.endsWith(")"))X=Y.slice(0,K).trim()||Q,G=Y.slice(K+2,-1);else{let q=Y.lastIndexOf(" "),F=q===-1?"":Y.slice(q+1);if(/:\d+:\d+$/.test(F))X=Y.slice(0,q).trim()||Q,G=F}let W=G.lastIndexOf(":"),Z=W===-1?-1:G.lastIndexOf(":",W-1);if(W===-1||Z===-1)return{function:Q,platform:"custom",lang:"javascript"};return{function:X,filename:DqQ(G.slice(0,Z)),lineno:Number.parseInt(G.slice(Z+1,W),10),colno:Number.parseInt(G.slice(W+1),10),platform:"custom",lang:"javascript"}}).filter(Boolean);return B&&B.length>0?B:[{function:Q,platform:"custom",lang:"javascript"}]}function UqQ(A){if(!A||typeof A!=="object"||!("code"in A))return;let{code:Q}=A;return typeof Q==="string"?Q:void 0}function JNA(A){return!UqQ(A)?.startsWith("commander.")}function yu(A){let Q=[],B=A;while(B?.parent){let $=B.name();if($)Q.push($);B=B.parent}return Q.reverse().join(" ")||"unknown"}async function q8A(A){let Q=WqQ();if(!Q)return!1;let B=GO.CAPGO_CLI_POSTHOG_API_HOST?.trim()||GO.POSTHOG_API_HOST?.trim()||XqQ,$;try{$=ZqQ(B)}catch{return!1}let J=HqQ(A.error),Y=qqQ(J.message),X=`cli:${C4.version}:${A.functionName}`,G=FqQ(J.stack,A.functionName),K=G[0],W=[X,A.kind,J.name||"Error",K?.function||A.functionName,K&&"filename"in K?K.filename:"unknown",String(A.status??1)].join(":"),Z={token:Q,event:"$exception",properties:{distinct_id:X,$exception_list:[{type:J.name||"Error",value:Y,mechanism:{handled:!0,synthetic:!1},stacktrace:{type:"raw",frames:G}}],$exception_fingerprint:W,architecture:JqQ,cli_version:C4.version,error_kind:A.kind,function_name:A.functionName,is_ci:Boolean(GO.CI),node_version:YqQ,os_platform:BqQ(),os_release:$qQ(),runtime:"cli",status:A.status},timestamp:new Date().toISOString()};try{let q=new AbortController,F=setTimeout(()=>q.abort(),KqQ);try{return(await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z),signal:q.signal})).ok}finally{clearTimeout(F)}}catch{return!1}}var XqQ="https://eu.i.posthog.com/i/v0/e/",GqQ="phc_NXDyDajQaTQVwb25DEhIVZfxVUn4R0Y348Z7vWYHZUi",KqQ=1500;var VP=vA(()=>{XK()});import{existsSync as GX}from"fs";var PF=(A=".",Q="unknown")=>{let B=`${A}/bun.lockb`,$=`${A}/bun.lock`,J=`${A}/pnpm-lock.yaml`,Y=`${A}/shrinkwrap.yaml`,X=`${A}/yarn.lock`,G=`${A}/package-lock.json`,K=`${A}/npm-shrinkwrap.json`;if(GX(B)||GX($))return"bun";if(GX(J)||GX(Y))return"pnpm";if(GX(X))return"yarn";if(GX(G)||GX(K))return"npm";return Q},gu=(A=PF(),Q=!1)=>{switch(A){case"bun":return Q?"bun install":"install";case"pnpm":return Q?"pnpm install":"install";case"yarn":return Q?"yarn install":"install";case"npm":return Q?"npm install":"install";case"unknown":return Q?"unknown unknown":"unknown";default:return Q?"npm install":"install"}},YNA=(A=".",Q="npx")=>{let B=`${A}/bun.lockb`,$=`${A}/bun.lock`,J=`${A}/pnpm-lock.yaml`,Y=`${A}/shrinkwrap.yaml`,X=`${A}/yarn.lock`,G=`${A}/package-lock.json`,K=`${A}/npm-shrinkwrap.json`;if(GX(B)||GX($))return"bunx";if(GX(J)||GX(Y))return"pnpm exec";if(GX(X))return"yarn dlx";if(GX(G)||GX(K))return"npx";return Q};var F8A=()=>{};function hu(A,Q){if(isNaN(A)||isNaN(Q))throw Error("Cannot compare against non-numbers");return A===Q?0:A<Q?-1:1}function KNA(A=[],Q=[]){if(A.length&&!Q.length)return-1;if(!A.length&&Q.length)return 1;return 0}function mu(A=[],Q=[]){let B=Math.max(A.length,Q.length);for(let $=0;$<B;$++){let J=A[$],Y=Q[$];if(J===void 0&&Y===void 0)return 0;if(Y===void 0)return 1;if(J===void 0)return-1;if(typeof J==="string"&&typeof Y==="number")return 1;if(typeof J==="number"&&typeof Y==="string")return-1;if(J<Y)return-1;if(J>Y)return 1}return 0}function z8A(A){return typeof A==="number"&&!Number.isNaN(A)&&(!Number.isFinite(A)||0<=A&&A<=Number.MAX_SAFE_INTEGER)}function KX(A){return A.split(".").filter(Boolean).map((Q)=>{if(CqQ.test(Q)){let B=Number(Q);if(z8A(B))return B}return Q})}function qH(A){return A.split(".").filter(Boolean)}function cu(A,Q){let B=Number(A);if(!z8A(B))throw TypeError(Q);return B}function hD(A){return Number.isNaN(A.major)&&Number.isNaN(A.minor)&&Number.isNaN(A.patch)&&(A.prerelease===void 0||A.prerelease.length===0)&&(A.build===void 0||A.build.length===0)}var RL="0|[1-9]\\d*",zqQ="\\d*[a-zA-Z-][a-zA-Z0-9-]*",IqQ,XNA,WNA,GNA="[0-9A-Za-z-]+",ZNA,HNA,DNA,qNA="(?:<|>)?=?",OqQ="x|X|\\*",U8A,uu,FNA,UNA,I8A=256,CqQ;var WG=vA(()=>{IqQ=`(?<major>${RL})\\.(?<minor>${RL})\\.(?<patch>${RL})`,XNA=`(?:${RL}|${zqQ})`,WNA=`(?:-(?<prerelease>${XNA}(?:\\.${XNA})*))`,ZNA=`(?:\\+(?<buildmetadata>${GNA}(?:\\.${GNA})*))`,HNA=`v?${IqQ}${WNA}?${ZNA}?`,DNA=new RegExp(`^${HNA}$`),U8A=`${RL}|${OqQ}`,uu=`[v=\\s]*(?<major>${U8A})(?:\\.(?<minor>${U8A})(?:\\.(?<patch>${U8A})${WNA}?${ZNA}?)?)?`,FNA=new RegExp(`^(?<operator>~>?|\\^|${qNA})\\s*${uu}$`),UNA=new RegExp(`^(?<operator>${qNA})\\s*(${HNA})$|^$`);CqQ=new RegExp(`^${RL}$`)});function tY(A,Q){if(A===Q)return 0;return hu(A.major,Q.major)||hu(A.minor,Q.minor)||hu(A.patch,Q.patch)||KNA(A.prerelease,Q.prerelease)||mu(A.prerelease,Q.prerelease)}var GK=vA(()=>{WG()});function zNA(A,Q){let B=A.prerelease?.length||Q.prerelease?.length;if(A.major!==Q.major)return B?"premajor":"major";if(A.minor!==Q.minor)return B?"preminor":"minor";if(A.patch!==Q.patch)return B?"prepatch":"patch";if(mu(A.prerelease,Q.prerelease)!==0)return"prerelease"}var INA=vA(()=>{WG()});function O8A(A){return A.toFixed(0)}function I5(A){let Q=O8A(A.major),B=O8A(A.minor),$=O8A(A.patch),J=A.prerelease?.join(".")??"",Y=A.build?.join(".")??"";return[[`${Q}.${B}.${$}`,J].filter((K)=>K).join("-"),Y].filter((K)=>K).join("+")}function MqQ(A,Q){if(hD(Q))return!0;let B=tY(A,Q);switch(Q.operator){case"=":case void 0:return B===0;case"!=":return B!==0;case">":return B>0;case"<":return B<0;case">=":return B>=0;case"<=":return B<=0}}function du(A,Q){for(let B of Q)if(!MqQ(A,B))return!1;if(!A.prerelease?.length)return!0;for(let B of Q){if(hD(B))continue;if(!B.prerelease?.length)continue;let{major:$,minor:J,patch:Y}=B;if(A.major===$&&A.minor===J&&A.patch===Y)return!0}return!1}var lu=vA(()=>{WG();GK()});function EP(A,Q){return Q.some((B)=>du(A,B))}var RP=vA(()=>{lu()});function NqQ(A=[]){let Q=[...A],B=Q.length;while(B>=0){let $=Q[B];if(typeof $==="number"){Q[B]=$+1;break}B-=1}if(B===-1)Q.push(0);return Q}function jP(A=[],Q){let B=NqQ(A);if(!Q)return B;let $=KX(Q);if($.every((J)=>typeof J==="string")){if($.every((J,Y)=>J===B[Y])&&typeof B[$.length]==="number")return B;$=[...$,0]}return $}function TF(A,Q,B={}){let $=B.build!==void 0?qH(B.build):A.build??[];switch(Q){case"premajor":return{major:A.major+1,minor:0,patch:0,prerelease:jP(A.prerelease,B.prerelease),build:$};case"preminor":return{major:A.major,minor:A.minor+1,patch:0,prerelease:jP(A.prerelease,B.prerelease),build:$};case"prepatch":return{major:A.major,minor:A.minor,patch:A.patch+1,prerelease:jP(A.prerelease,B.prerelease),build:$};case"prerelease":{let Y=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:Y,prerelease:jP(A.prerelease,B.prerelease),build:$}}case"major":return{major:(A.prerelease??[]).length===0||A.minor!==0||A.patch!==0?A.major+1:A.major,minor:0,patch:0,prerelease:[],build:$};case"minor":{let Y=(A.prerelease??[]).length===0||A.patch!==0?A.minor+1:A.minor;return{major:A.major,minor:Y,patch:0,prerelease:[],build:$}}case"patch":{let Y=(A.prerelease??[]).length===0?A.patch+1:A.patch;return{major:A.major,minor:A.minor,patch:Y,prerelease:[],build:$}}case"pre":return{major:A.major,minor:A.minor,patch:A.patch,prerelease:jP(A.prerelease,B.prerelease),build:$};default:throw TypeError(`Cannot increment version: invalid argument ${Q}`)}}var ONA=vA(()=>{WG()});var pu,jL;var wP=vA(()=>{pu={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},jL={operator:void 0,...pu}});var C8A=vA(()=>{wP();WG()});function M8A(A,Q){return tY(A,Q)>0}var N8A=vA(()=>{GK()});var CNA=vA(()=>{RP();N8A()});function ZG(A,Q){return tY(A,Q)<0}var L8A=vA(()=>{GK()});var MNA=vA(()=>{RP();L8A()});function LqQ(A){let B=A.match(UNA)?.groups;if(!B)return null;let{operator:$}=B;return{operator:$||void 0,...pu}}function S4(A){return!A||A.toLowerCase()==="x"||A==="*"}function VqQ(A){if(S4(A.major))return;if(S4(A.minor))return{operator:">=",major:+A.major,minor:0,patch:0,prerelease:[],build:[]};if(S4(A.patch))return{operator:">=",major:+A.major,minor:+A.minor,patch:0,prerelease:[],build:[]};return{operator:">=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:A.prerelease?KX(A.prerelease):[],build:[]}}function EqQ(A){if(S4(A.major))return;if(S4(A.minor))return{operator:"<",major:+A.major+1,minor:0,patch:0,prerelease:[],build:[]};if(S4(A.patch))return{operator:"<",major:+A.major,minor:+A.minor+1,patch:0,prerelease:[],build:[]};if(A.prerelease)return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:KX(A.prerelease),build:[]};return{operator:"<=",major:+A.major,minor:+A.minor,patch:+A.patch,prerelease:[],build:[]}}function RqQ(A){let Q=A.match(new RegExp(`^${uu}`)),B=Q?.groups;if(!B)return null;let $=Q[0].length,J=A.slice($).match(/^\s+-\s+/);if(!J)return null;let Y=J[0].length,G=A.slice($+Y).match(new RegExp(`^${uu}\\s*$`))?.groups,K=VqQ(B),W=EqQ(G);return[K,W].filter(Boolean)}function jqQ(A){let Q=S4(A.major),B=S4(A.minor),$=S4(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[jL];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($){if(J===0)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J+1,minor:0,patch:0}]}let G=KX(A.prerelease??"");if(J===0){if(Y===0)return[{operator:">=",major:J,minor:Y,patch:X,prerelease:G},{operator:"<",major:J,minor:Y,patch:X+1}];return[{operator:">=",major:J,minor:Y,patch:X,prerelease:G},{operator:"<",major:J,minor:Y+1,patch:0}]}return[{operator:">=",major:J,minor:Y,patch:X,prerelease:G},{operator:"<",major:J+1,minor:0,patch:0}]}function wqQ(A){let Q=S4(A.major),B=S4(A.minor),$=S4(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[jL];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];let G=KX(A.prerelease??"");return[{operator:">=",major:J,minor:Y,patch:X,prerelease:G},{operator:"<",major:J,minor:Y+1,patch:0}]}function _qQ(A){let Q=S4(A.major),B=S4(A.minor),$=S4(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B){if($)return[{operator:"<",major:J,minor:0,patch:0}];return[{operator:"<",major:J,minor:0,patch:0}]}if($)return[{operator:"<",major:J,minor:Y,patch:0}];let G=KX(A.prerelease??""),K=qH(A.build??"");return[{operator:"<",major:J,minor:Y,patch:X,prerelease:G,build:K}]}function PqQ(A){let Q=S4(A.minor),B=S4(A.patch),$=+A.major,J=+A.minor,Y=+A.patch;if(Q)return[{operator:"<",major:$+1,minor:0,patch:0}];if(B)return[{operator:"<",major:$,minor:J+1,patch:0}];let X=KX(A.prerelease??""),G=qH(A.build??"");return[{operator:"<=",major:$,minor:J,patch:Y,prerelease:X,build:G}]}function TqQ(A){let Q=S4(A.major),B=S4(A.minor),$=S4(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[{operator:"<",major:0,minor:0,patch:0}];if(B)return[{operator:">=",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y+1,patch:0}];let G=KX(A.prerelease??""),K=qH(A.build??"");return[{operator:">",major:J,minor:Y,patch:X,prerelease:G,build:K}]}function kqQ(A){let Q=S4(A.major),B=S4(A.minor),$=S4(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[jL];if(B)return[{operator:">=",major:J,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0}];let G=KX(A.prerelease??""),K=qH(A.build??"");return[{operator:">=",major:J,minor:Y,patch:X,prerelease:G,build:K}]}function SqQ(A){let Q=S4(A.major),B=S4(A.minor),$=S4(A.patch),J=+A.major,Y=+A.minor,X=+A.patch;if(Q)return[jL];if(B)return[{operator:">=",major:J,minor:0,patch:0},{operator:"<",major:J+1,minor:0,patch:0}];if($)return[{operator:">=",major:J,minor:Y,patch:0},{operator:"<",major:J,minor:Y+1,patch:0}];let G=KX(A.prerelease??""),K=qH(A.build??"");return[{operator:A.operator==="="?"=":void 0,major:J,minor:Y,patch:X,prerelease:G,build:K}]}function xqQ(A){let Q=A.match(FNA)?.groups;if(!Q)return LqQ(A);switch(Q.operator){case"^":return jqQ(Q);case"~":case"~>":return wqQ(Q);case"<":return _qQ(Q);case"<=":return PqQ(Q);case">":return TqQ(Q);case">=":return kqQ(Q);default:return SqQ(Q)}}function bqQ(A){return A.split(/\s+/).flatMap(xqQ)}function iu(A){let Q=A.replaceAll(/(?<=[<>=~^])(\s+)/g,"").split(/\s*\|\|\s*/).map((B)=>RqQ(B)||bqQ(B));if(Q.some((B)=>B.includes(null)))throw TypeError(`Cannot parse version range: range "${A}" is invalid`);return Q}var V8A=vA(()=>{WG();wP()});function G1(A){if(typeof A!=="string")throw TypeError(`Cannot parse version as version must be a string: received ${typeof A}`);if(A.length>I8A)throw TypeError(`Cannot parse version as version length is too long: length is ${A.length}, max length is ${I8A}`);A=A.trim();let Q=A.match(DNA)?.groups;if(!Q)throw TypeError(`Cannot parse version: ${A}`);let B=cu(Q.major,`Cannot parse version ${A}: invalid major version`),$=cu(Q.minor,`Cannot parse version ${A}: invalid minor version`),J=cu(Q.patch,`Cannot parse version ${A}: invalid patch version`),Y=Q.prerelease?KX(Q.prerelease):[],X=Q.buildmetadata?qH(Q.buildmetadata):[];return{major:B,minor:$,patch:J,prerelease:Y,build:X}}var nu=vA(()=>{WG();WG()});function NNA(A,Q){let B=A.operator,$=Q.operator;if(B===void 0){if(hD(A))return!0;return EP(A,[[Q]])}if($===void 0){if(hD(Q))return!0;return EP(Q,[[A]])}let J=tY(A,Q);return(B===">="||B===">")&&($===">="||$===">")||(B==="<="||B==="<")&&($==="<="||$==="<")||J===0&&((B===">="||B==="<=")&&($===">="||$==="<="))||J===-1&&(B===">="||B===">")&&($==="<="||$==="<")||J===1&&(B==="<="||B==="<")&&($===">="||$===">")}function vqQ(A){return A.every((Q)=>{return Q.some((B)=>fqQ(B))})}function fqQ(A){for(let Q=0;Q<A.length-1;Q++){let B=A[Q];for(let $ of A.slice(Q+1))if(!NNA(B,$))return!1}return!0}function LNA(A,Q){return vqQ([A,Q])&&A.some((B)=>{return Q.some(($)=>{return B.every((J)=>{return $.every((Y)=>NNA(J,Y))})})})}var VNA=vA(()=>{WG();GK();RP()});var ENA=vA(()=>{V8A()});var RNA=vA(()=>{wP();wP();C8A()});function _P(A){try{return G1(A),!0}catch{return!1}}var jNA=vA(()=>{nu()});var wNA=vA(()=>{nu()});var _NA=vA(()=>{WG()});var PNA=vA(()=>{GK()});var TNA=vA(()=>{GK()});var kNA=vA(()=>{lu();WG();GK()});function E8A(A,Q){return tY(A,Q)>=0}var SNA=vA(()=>{GK()});var xNA=vA(()=>{lu();WG();GK()});var bNA=vA(()=>{GK()});var bW=vA(()=>{GK();INA();RP();ONA();C8A();CNA();MNA();V8A();nu();VNA();ENA();RNA();jNA();wNA();_NA();PNA();TNA();N8A();kNA();SNA();L8A();xNA();bNA()});var WX=t((S_0,ru)=>{var vNA,fNA,yNA,gNA,hNA,mNA,uNA,cNA,dNA,lNA,pNA,iNA,nNA,ou,R8A,oNA,aNA,rNA,wL,sNA,tNA,eNA,ALA,QLA,BLA,$LA,JLA,YLA,au,XLA,GLA,KLA;(function(A){var Q=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function($){A(B(Q,B($)))});else if(typeof ru==="object"&&typeof S_0==="object")A(B(Q,B(S_0)));else A(B(Q));function B($,J){if($!==Q)if(typeof Object.create==="function")Object.defineProperty($,"__esModule",{value:!0});else $.__esModule=!0;return function(Y,X){return $[Y]=J?J(Y,X):X}}})(function(A){var Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,X){Y.__proto__=X}||function(Y,X){for(var G in X)if(Object.prototype.hasOwnProperty.call(X,G))Y[G]=X[G]};vNA=function(Y,X){if(typeof X!=="function"&&X!==null)throw TypeError("Class extends value "+String(X)+" is not a constructor or null");Q(Y,X);function G(){this.constructor=Y}Y.prototype=X===null?Object.create(X):(G.prototype=X.prototype,new G)},fNA=Object.assign||function(Y){for(var X,G=1,K=arguments.length;G<K;G++){X=arguments[G];for(var W in X)if(Object.prototype.hasOwnProperty.call(X,W))Y[W]=X[W]}return Y},yNA=function(Y,X){var G={};for(var K in Y)if(Object.prototype.hasOwnProperty.call(Y,K)&&X.indexOf(K)<0)G[K]=Y[K];if(Y!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var W=0,K=Object.getOwnPropertySymbols(Y);W<K.length;W++)if(X.indexOf(K[W])<0&&Object.prototype.propertyIsEnumerable.call(Y,K[W]))G[K[W]]=Y[K[W]]}return G},gNA=function(Y,X,G,K){var W=arguments.length,Z=W<3?X:K===null?K=Object.getOwnPropertyDescriptor(X,G):K,q;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")Z=Reflect.decorate(Y,X,G,K);else for(var F=Y.length-1;F>=0;F--)if(q=Y[F])Z=(W<3?q(Z):W>3?q(X,G,Z):q(X,G))||Z;return W>3&&Z&&Object.defineProperty(X,G,Z),Z},hNA=function(Y,X){return function(G,K){X(G,K,Y)}},mNA=function(Y,X,G,K,W,Z){function q(T){if(T!==void 0&&typeof T!=="function")throw TypeError("Function expected");return T}var F=K.kind,U=F==="getter"?"get":F==="setter"?"set":"value",z=!X&&Y?K.static?Y:Y.prototype:null,I=X||(z?Object.getOwnPropertyDescriptor(z,K.name):{}),C,V=!1;for(var E=G.length-1;E>=0;E--){var M={};for(var N in K)M[N]=N==="access"?{}:K[N];for(var N in K.access)M.access[N]=K.access[N];M.addInitializer=function(T){if(V)throw TypeError("Cannot add initializers after decoration has completed");Z.push(q(T||null))};var R=(0,G[E])(F==="accessor"?{get:I.get,set:I.set}:I[U],M);if(F==="accessor"){if(R===void 0)continue;if(R===null||typeof R!=="object")throw TypeError("Object expected");if(C=q(R.get))I.get=C;if(C=q(R.set))I.set=C;if(C=q(R.init))W.unshift(C)}else if(C=q(R))if(F==="field")W.unshift(C);else I[U]=C}if(z)Object.defineProperty(z,K.name,I);V=!0},uNA=function(Y,X,G){var K=arguments.length>2;for(var W=0;W<X.length;W++)G=K?X[W].call(Y,G):X[W].call(Y);return K?G:void 0},cNA=function(Y){return typeof Y==="symbol"?Y:"".concat(Y)},dNA=function(Y,X,G){if(typeof X==="symbol")X=X.description?"[".concat(X.description,"]"):"";return Object.defineProperty(Y,"name",{configurable:!0,value:G?"".concat(G," ",X):X})},lNA=function(Y,X){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(Y,X)},pNA=function(Y,X,G,K){function W(Z){return Z instanceof G?Z:new G(function(q){q(Z)})}return new(G||(G=Promise))(function(Z,q){function F(I){try{z(K.next(I))}catch(C){q(C)}}function U(I){try{z(K.throw(I))}catch(C){q(C)}}function z(I){I.done?Z(I.value):W(I.value).then(F,U)}z((K=K.apply(Y,X||[])).next())})},iNA=function(Y,X){var G={label:0,sent:function(){if(Z[0]&1)throw Z[1];return Z[1]},trys:[],ops:[]},K,W,Z,q=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return q.next=F(0),q.throw=F(1),q.return=F(2),typeof Symbol==="function"&&(q[Symbol.iterator]=function(){return this}),q;function F(z){return function(I){return U([z,I])}}function U(z){if(K)throw TypeError("Generator is already executing.");while(q&&(q=0,z[0]&&(G=0)),G)try{if(K=1,W&&(Z=z[0]&2?W.return:z[0]?W.throw||((Z=W.return)&&Z.call(W),0):W.next)&&!(Z=Z.call(W,z[1])).done)return Z;if(W=0,Z)z=[z[0]&2,Z.value];switch(z[0]){case 0:case 1:Z=z;break;case 4:return G.label++,{value:z[1],done:!1};case 5:G.label++,W=z[1],z=[0];continue;case 7:z=G.ops.pop(),G.trys.pop();continue;default:if((Z=G.trys,!(Z=Z.length>0&&Z[Z.length-1]))&&(z[0]===6||z[0]===2)){G=0;continue}if(z[0]===3&&(!Z||z[1]>Z[0]&&z[1]<Z[3])){G.label=z[1];break}if(z[0]===6&&G.label<Z[1]){G.label=Z[1],Z=z;break}if(Z&&G.label<Z[2]){G.label=Z[2],G.ops.push(z);break}if(Z[2])G.ops.pop();G.trys.pop();continue}z=X.call(Y,G)}catch(I){z=[6,I],W=0}finally{K=Z=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}},nNA=function(Y,X){for(var G in Y)if(G!=="default"&&!Object.prototype.hasOwnProperty.call(X,G))au(X,Y,G)},au=Object.create?function(Y,X,G,K){if(K===void 0)K=G;var W=Object.getOwnPropertyDescriptor(X,G);if(!W||("get"in W?!X.__esModule:W.writable||W.configurable))W={enumerable:!0,get:function(){return X[G]}};Object.defineProperty(Y,K,W)}:function(Y,X,G,K){if(K===void 0)K=G;Y[K]=X[G]},ou=function(Y){var X=typeof Symbol==="function"&&Symbol.iterator,G=X&&Y[X],K=0;if(G)return G.call(Y);if(Y&&typeof Y.length==="number")return{next:function(){if(Y&&K>=Y.length)Y=void 0;return{value:Y&&Y[K++],done:!Y}}};throw TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")},R8A=function(Y,X){var G=typeof Symbol==="function"&&Y[Symbol.iterator];if(!G)return Y;var K=G.call(Y),W,Z=[],q;try{while((X===void 0||X-- >0)&&!(W=K.next()).done)Z.push(W.value)}catch(F){q={error:F}}finally{try{if(W&&!W.done&&(G=K.return))G.call(K)}finally{if(q)throw q.error}}return Z},oNA=function(){for(var Y=[],X=0;X<arguments.length;X++)Y=Y.concat(R8A(arguments[X]));return Y},aNA=function(){for(var Y=0,X=0,G=arguments.length;X<G;X++)Y+=arguments[X].length;for(var K=Array(Y),W=0,X=0;X<G;X++)for(var Z=arguments[X],q=0,F=Z.length;q<F;q++,W++)K[W]=Z[q];return K},rNA=function(Y,X,G){if(G||arguments.length===2){for(var K=0,W=X.length,Z;K<W;K++)if(Z||!(K in X)){if(!Z)Z=Array.prototype.slice.call(X,0,K);Z[K]=X[K]}}return Y.concat(Z||Array.prototype.slice.call(X))},wL=function(Y){return this instanceof wL?(this.v=Y,this):new wL(Y)},sNA=function(Y,X,G){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var K=G.apply(Y,X||[]),W,Z=[];return W=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),F("next"),F("throw"),F("return",q),W[Symbol.asyncIterator]=function(){return this},W;function q(E){return function(M){return Promise.resolve(M).then(E,C)}}function F(E,M){if(K[E]){if(W[E]=function(N){return new Promise(function(R,T){Z.push([E,N,R,T])>1||U(E,N)})},M)W[E]=M(W[E])}}function U(E,M){try{z(K[E](M))}catch(N){V(Z[0][3],N)}}function z(E){E.value instanceof wL?Promise.resolve(E.value.v).then(I,C):V(Z[0][2],E)}function I(E){U("next",E)}function C(E){U("throw",E)}function V(E,M){if(E(M),Z.shift(),Z.length)U(Z[0][0],Z[0][1])}},tNA=function(Y){var X,G;return X={},K("next"),K("throw",function(W){throw W}),K("return"),X[Symbol.iterator]=function(){return this},X;function K(W,Z){X[W]=Y[W]?function(q){return(G=!G)?{value:wL(Y[W](q)),done:!1}:Z?Z(q):q}:Z}},eNA=function(Y){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var X=Y[Symbol.asyncIterator],G;return X?X.call(Y):(Y=typeof ou==="function"?ou(Y):Y[Symbol.iterator](),G={},K("next"),K("throw"),K("return"),G[Symbol.asyncIterator]=function(){return this},G);function K(Z){G[Z]=Y[Z]&&function(q){return new Promise(function(F,U){q=Y[Z](q),W(F,U,q.done,q.value)})}}function W(Z,q,F,U){Promise.resolve(U).then(function(z){Z({value:z,done:F})},q)}},ALA=function(Y,X){if(Object.defineProperty)Object.defineProperty(Y,"raw",{value:X});else Y.raw=X;return Y};var B=Object.create?function(Y,X){Object.defineProperty(Y,"default",{enumerable:!0,value:X})}:function(Y,X){Y.default=X},$=function(Y){return $=Object.getOwnPropertyNames||function(X){var G=[];for(var K in X)if(Object.prototype.hasOwnProperty.call(X,K))G[G.length]=K;return G},$(Y)};QLA=function(Y){if(Y&&Y.__esModule)return Y;var X={};if(Y!=null){for(var G=$(Y),K=0;K<G.length;K++)if(G[K]!=="default")au(X,Y,G[K])}return B(X,Y),X},BLA=function(Y){return Y&&Y.__esModule?Y:{default:Y}},$LA=function(Y,X,G,K){if(G==="a"&&!K)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?Y!==X||!K:!X.has(Y))throw TypeError("Cannot read private member from an object whose class did not declare it");return G==="m"?K:G==="a"?K.call(Y):K?K.value:X.get(Y)},JLA=function(Y,X,G,K,W){if(K==="m")throw TypeError("Private method is not writable");if(K==="a"&&!W)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?Y!==X||!W:!X.has(Y))throw TypeError("Cannot write private member to an object whose class did not declare it");return K==="a"?W.call(Y,G):W?W.value=G:X.set(Y,G),G},YLA=function(Y,X){if(X===null||typeof X!=="object"&&typeof X!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof Y==="function"?X===Y:Y.has(X)},XLA=function(Y,X,G){if(X!==null&&X!==void 0){if(typeof X!=="object"&&typeof X!=="function")throw TypeError("Object expected.");var K,W;if(G){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");K=X[Symbol.asyncDispose]}if(K===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(K=X[Symbol.dispose],G)W=K}if(typeof K!=="function")throw TypeError("Object not disposable.");if(W)K=function(){try{W.call(this)}catch(Z){return Promise.reject(Z)}};Y.stack.push({value:X,dispose:K,async:G})}else if(G)Y.stack.push({async:!0});return X};var J=typeof SuppressedError==="function"?SuppressedError:function(Y,X,G){var K=Error(G);return K.name="SuppressedError",K.error=Y,K.suppressed=X,K};GLA=function(Y){function X(Z){Y.error=Y.hasError?new J(Z,Y.error,"An error was suppressed during disposal."):Z,Y.hasError=!0}var G,K=0;function W(){while(G=Y.stack.pop())try{if(!G.async&&K===1)return K=0,Y.stack.push(G),Promise.resolve().then(W);if(G.dispose){var Z=G.dispose.call(G.value);if(G.async)return K|=2,Promise.resolve(Z).then(W,function(q){return X(q),W()})}else K|=1}catch(q){X(q)}if(K===1)return Y.hasError?Promise.reject(Y.error):Promise.resolve();if(Y.hasError)throw Y.error}return W()},KLA=function(Y,X){if(typeof Y==="string"&&/^\.\.?\//.test(Y))return Y.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(G,K,W,Z,q){return K?X?".jsx":".js":W&&(!Z||!q)?G:W+Z+"."+q.toLowerCase()+"js"});return Y},A("__extends",vNA),A("__assign",fNA),A("__rest",yNA),A("__decorate",gNA),A("__param",hNA),A("__esDecorate",mNA),A("__runInitializers",uNA),A("__propKey",cNA),A("__setFunctionName",dNA),A("__metadata",lNA),A("__awaiter",pNA),A("__generator",iNA),A("__exportStar",nNA),A("__createBinding",au),A("__values",ou),A("__read",R8A),A("__spread",oNA),A("__spreadArrays",aNA),A("__spreadArray",rNA),A("__await",wL),A("__asyncGenerator",sNA),A("__asyncDelegator",tNA),A("__asyncValues",eNA),A("__makeTemplateObject",ALA),A("__importStar",QLA),A("__importDefault",BLA),A("__classPrivateFieldGet",$LA),A("__classPrivateFieldSet",JLA),A("__classPrivateFieldIn",YLA),A("__addDisposableResource",XLA),A("__disposeResources",GLA),A("__rewriteRelativeImportExtension",KLA)})});var HLA=t((WLA)=>{Object.defineProperty(WLA,"__esModule",{value:!0});WLA.resolveFetch=void 0;var yqQ=(A)=>{if(A)return(...Q)=>A(...Q);return(...Q)=>fetch(...Q)};WLA.resolveFetch=yqQ});var j8A=t((zLA)=>{Object.defineProperty(zLA,"__esModule",{value:!0});zLA.FunctionRegion=zLA.FunctionsHttpError=zLA.FunctionsRelayError=zLA.FunctionsFetchError=zLA.FunctionsError=void 0;class PP extends Error{constructor(A,Q="FunctionsError",B){super(A);this.name=Q,this.context=B}toJSON(){return{name:this.name,message:this.message,context:this.context}}}zLA.FunctionsError=PP;class qLA extends PP{constructor(A){super("Failed to send a request to the Edge Function","FunctionsFetchError",A)}}zLA.FunctionsFetchError=qLA;class FLA extends PP{constructor(A){super("Relay Error invoking the Edge Function","FunctionsRelayError",A)}}zLA.FunctionsRelayError=FLA;class ULA extends PP{constructor(A){super("Edge Function returned a non-2xx status code","FunctionsHttpError",A)}}zLA.FunctionsHttpError=ULA;var DLA;(function(A){A.Any="any",A.ApNortheast1="ap-northeast-1",A.ApNortheast2="ap-northeast-2",A.ApSouth1="ap-south-1",A.ApSoutheast1="ap-southeast-1",A.ApSoutheast2="ap-southeast-2",A.CaCentral1="ca-central-1",A.EuCentral1="eu-central-1",A.EuWest1="eu-west-1",A.EuWest2="eu-west-2",A.EuWest3="eu-west-3",A.SaEast1="sa-east-1",A.UsEast1="us-east-1",A.UsWest1="us-west-1",A.UsWest2="us-west-2"})(DLA||(zLA.FunctionRegion=DLA={}))});var NLA=t((CLA)=>{Object.defineProperty(CLA,"__esModule",{value:!0});CLA.FunctionsClient=void 0;var cqQ=WX(),dqQ=HLA(),_L=j8A();class OLA{constructor(A,{headers:Q={},customFetch:B,region:$=_L.FunctionRegion.Any}={}){this.url=A,this.headers=Q,this.region=$,this.fetch=(0,dqQ.resolveFetch)(B)}setAuth(A){this.headers.Authorization=`Bearer ${A}`}invoke(A){return cqQ.__awaiter(this,arguments,void 0,function*(Q,B={}){var $;let J,Y;try{let{headers:X,method:G,body:K,signal:W,timeout:Z}=B,q={},{region:F}=B;if(!F)F=this.region;let U=new URL(`${this.url}/${Q}`);if(F&&F!=="any")q["x-region"]=F,U.searchParams.set("forceFunctionRegion",F);let z;if(K&&(X&&!Object.prototype.hasOwnProperty.call(X,"Content-Type")||!X))if(typeof Blob<"u"&&K instanceof Blob||K instanceof ArrayBuffer)q["Content-Type"]="application/octet-stream",z=K;else if(typeof K==="string")q["Content-Type"]="text/plain",z=K;else if(typeof FormData<"u"&&K instanceof FormData)z=K;else q["Content-Type"]="application/json",z=JSON.stringify(K);else if(K&&typeof K!=="string"&&!(typeof Blob<"u"&&K instanceof Blob)&&!(K instanceof ArrayBuffer)&&!(typeof FormData<"u"&&K instanceof FormData))z=JSON.stringify(K);else z=K;let I=W;if(Z)if(Y=new AbortController,J=setTimeout(()=>Y.abort(),Z),W)I=Y.signal,W.addEventListener("abort",()=>Y.abort());else I=Y.signal;let C=yield this.fetch(U.toString(),{method:G||"POST",headers:Object.assign(Object.assign(Object.assign({},q),this.headers),X),body:z,signal:I}).catch((N)=>{throw new _L.FunctionsFetchError(N)}),V=C.headers.get("x-relay-error");if(V&&V==="true")throw new _L.FunctionsRelayError(C);if(!C.ok)throw new _L.FunctionsHttpError(C);let E=(($=C.headers.get("Content-Type"))!==null&&$!==void 0?$:"text/plain").split(";")[0].trim(),M;if(E==="application/json")M=yield C.json();else if(E==="application/octet-stream"||E==="application/pdf")M=yield C.blob();else if(E==="text/event-stream")M=C;else if(E==="multipart/form-data")M=yield C.formData();else M=yield C.text();return{data:M,error:null,response:C}}catch(X){return{data:null,error:X,response:X instanceof _L.FunctionsHttpError||X instanceof _L.FunctionsRelayError?X.context:void 0}}finally{if(J)clearTimeout(J)}})}}CLA.FunctionsClient=OLA});var LLA=t((kF)=>{Object.defineProperty(kF,"__esModule",{value:!0});kF.FunctionRegion=kF.FunctionsRelayError=kF.FunctionsHttpError=kF.FunctionsFetchError=kF.FunctionsError=kF.FunctionsClient=void 0;var lqQ=NLA();Object.defineProperty(kF,"FunctionsClient",{enumerable:!0,get:function(){return lqQ.FunctionsClient}});var TP=j8A();Object.defineProperty(kF,"FunctionsError",{enumerable:!0,get:function(){return TP.FunctionsError}});Object.defineProperty(kF,"FunctionsFetchError",{enumerable:!0,get:function(){return TP.FunctionsFetchError}});Object.defineProperty(kF,"FunctionsHttpError",{enumerable:!0,get:function(){return TP.FunctionsHttpError}});Object.defineProperty(kF,"FunctionsRelayError",{enumerable:!0,get:function(){return TP.FunctionsRelayError}});Object.defineProperty(kF,"FunctionRegion",{enumerable:!0,get:function(){return TP.FunctionRegion}})});function ELA(A,Q){return new Promise((B)=>{if(Q===null||Q===void 0?void 0:Q.aborted){B();return}let $=setTimeout(()=>{Q===null||Q===void 0||Q.removeEventListener("abort",J),B()},A);function J(){clearTimeout($),B()}Q===null||Q===void 0||Q.addEventListener("abort",J)})}function nqQ(A,Q,B,$){if(!$||B>=3)return!1;if(!wLA.includes(A))return!1;if(!iqQ.includes(Q))return!1;return!0}function kP(A){return kP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},kP(A)}function sqQ(A,Q){if(kP(A)!="object"||!A)return A;var B=A[Symbol.toPrimitive];if(B!==void 0){var $=B.call(A,Q||"default");if(kP($)!="object")return $;throw TypeError("@@toPrimitive must return a primitive value.")}return(Q==="string"?String:Number)(A)}function tqQ(A){var Q=sqQ(A,"string");return kP(Q)=="symbol"?Q:Q+""}function eqQ(A,Q,B){return(Q=tqQ(Q))in A?Object.defineProperty(A,Q,{value:B,enumerable:!0,configurable:!0,writable:!0}):A[Q]=B,A}function jLA(A,Q){var B=Object.keys(A);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(A);Q&&($=$.filter(function(J){return Object.getOwnPropertyDescriptor(A,J).enumerable})),B.push.apply(B,$)}return B}function su(A){for(var Q=1;Q<arguments.length;Q++){var B=arguments[Q]!=null?arguments[Q]:{};Q%2?jLA(Object(B),!0).forEach(function($){eqQ(A,$,B[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(B)):jLA(Object(B)).forEach(function($){Object.defineProperty(A,$,Object.getOwnPropertyDescriptor(B,$))})}return A}var VLA=(A)=>Math.min(1000*2**A,30000),iqQ,wLA,w8A,oqQ=class{constructor(A){var Q,B,$,J,Y;if(this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=A.method,this.url=A.url,this.headers=new Headers(A.headers),this.schema=A.schema,this.body=A.body,this.shouldThrowOnError=(Q=A.shouldThrowOnError)!==null&&Q!==void 0?Q:!1,this.signal=A.signal,this.isMaybeSingle=(B=A.isMaybeSingle)!==null&&B!==void 0?B:!1,this.shouldStripNulls=($=A.shouldStripNulls)!==null&&$!==void 0?$:!1,this.urlLengthLimit=(J=A.urlLengthLimit)!==null&&J!==void 0?J:8000,this.retryEnabled=(Y=A.retry)!==null&&Y!==void 0?Y:!0,A.fetch)this.fetch=A.fetch;else this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(A,Q){return this.headers=new Headers(this.headers),this.headers.set(A,Q),this}retry(A){return this.retryEnabled=A,this}then(A,Q){var B=this;if(this.schema===void 0);else if(["GET","HEAD"].includes(this.method))this.headers.set("Accept-Profile",this.schema);else this.headers.set("Content-Profile",this.schema);if(this.method!=="GET"&&this.method!=="HEAD")this.headers.set("Content-Type","application/json");if(this.shouldStripNulls){let X=this.headers.get("Accept");if(X==="application/vnd.pgrst.object+json")this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped");else if(!X||X==="application/json")this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let $=this.fetch,Y=(async()=>{let X=0;while(!0){let W={};if(B.headers.forEach((q,F)=>{W[F]=q}),X>0)W["X-Retry-Count"]=String(X);let Z;try{Z=await $(B.url.toString(),{method:B.method,headers:W,body:JSON.stringify(B.body,(q,F)=>typeof F==="bigint"?F.toString():F),signal:B.signal})}catch(q){if((q===null||q===void 0?void 0:q.name)==="AbortError"||(q===null||q===void 0?void 0:q.code)==="ABORT_ERR")throw q;if(!wLA.includes(B.method))throw q;if(B.retryEnabled&&X<3){let F=VLA(X);X++,await ELA(F,B.signal);continue}throw q}if(nqQ(B.method,Z.status,X,B.retryEnabled)){var G,K;let q=(G=(K=Z.headers)===null||K===void 0?void 0:K.get("Retry-After"))!==null&&G!==void 0?G:null,F=q!==null?Math.max(0,parseInt(q,10)||0)*1000:VLA(X);await Z.text(),X++,await ELA(F,B.signal);continue}return await B.processResponse(Z)}})();if(!this.shouldThrowOnError)Y=Y.catch((X)=>{var G;let K="",W="",Z="",q=X===null||X===void 0?void 0:X.cause;if(q){var F,U,z,I;let E=(F=q===null||q===void 0?void 0:q.message)!==null&&F!==void 0?F:"",M=(U=q===null||q===void 0?void 0:q.code)!==null&&U!==void 0?U:"";if(K=`${(z=X===null||X===void 0?void 0:X.name)!==null&&z!==void 0?z:"FetchError"}: ${X===null||X===void 0?void 0:X.message}`,K+=`
|
|
96
96
|
|
|
97
97
|
Caused by: ${(I=q===null||q===void 0?void 0:q.name)!==null&&I!==void 0?I:"Error"}: ${E}`,M)K+=` (${M})`;if(q===null||q===void 0?void 0:q.stack)K+=`
|
package/dist/package.json
CHANGED
package/dist/src/sdk.js
CHANGED
|
@@ -123,7 +123,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
123
123
|
`)}),D.__defineSetter__("stack",function(J){return[J].concat(D.stack).join(`
|
|
124
124
|
|
|
125
125
|
`)}),D}});var cm=A((KM$,dm)=>{var j9=a("constants"),EP0=process.cwd,y3=null,RP0=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!y3)y3=EP0.call(process);return y3};try{process.cwd()}catch($){}if(typeof process.chdir==="function"){if(f3=process.chdir,process.chdir=function($){y3=null,f3.call(process,$)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,f3)}var f3;dm.exports=AP0;function AP0($){if(j9.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))D($);if(!$.lutimes)J($);if($.chown=Y($.chown),$.fchown=Y($.fchown),$.lchown=Y($.lchown),$.chmod=X($.chmod),$.fchmod=X($.fchmod),$.lchmod=X($.lchmod),$.chownSync=Z($.chownSync),$.fchownSync=Z($.fchownSync),$.lchownSync=Z($.lchownSync),$.chmodSync=Q($.chmodSync),$.fchmodSync=Q($.fchmodSync),$.lchmodSync=Q($.lchmodSync),$.stat=F($.stat),$.fstat=F($.fstat),$.lstat=F($.lstat),$.statSync=U($.statSync),$.fstatSync=U($.fstatSync),$.lstatSync=U($.lstatSync),$.chmod&&!$.lchmod)$.lchmod=function(q,W,z){if(z)process.nextTick(z)},$.lchmodSync=function(){};if($.chown&&!$.lchown)$.lchown=function(q,W,z,H){if(H)process.nextTick(H)},$.lchownSync=function(){};if(RP0==="win32")$.rename=typeof $.rename!=="function"?$.rename:function(q){function W(z,H,O){var V=Date.now(),N=0;q(z,H,function L(E){if(E&&(E.code==="EACCES"||E.code==="EPERM"||E.code==="EBUSY")&&Date.now()-V<60000){if(setTimeout(function(){$.stat(H,function(K,w){if(K&&K.code==="ENOENT")q(z,H,L);else O(E)})},N),N<100)N+=10;return}if(O)O(E)})}if(Object.setPrototypeOf)Object.setPrototypeOf(W,q);return W}($.rename);$.read=typeof $.read!=="function"?$.read:function(q){function W(z,H,O,V,N,L){var E;if(L&&typeof L==="function"){var K=0;E=function(w,M,R){if(w&&w.code==="EAGAIN"&&K<10)return K++,q.call($,z,H,O,V,N,E);L.apply(this,arguments)}}return q.call($,z,H,O,V,N,E)}if(Object.setPrototypeOf)Object.setPrototypeOf(W,q);return W}($.read),$.readSync=typeof $.readSync!=="function"?$.readSync:function(q){return function(W,z,H,O,V){var N=0;while(!0)try{return q.call($,W,z,H,O,V)}catch(L){if(L.code==="EAGAIN"&&N<10){N++;continue}throw L}}}($.readSync);function D(q){q.lchmod=function(W,z,H){q.open(W,j9.O_WRONLY|j9.O_SYMLINK,z,function(O,V){if(O){if(H)H(O);return}q.fchmod(V,z,function(N){q.close(V,function(L){if(H)H(N||L)})})})},q.lchmodSync=function(W,z){var H=q.openSync(W,j9.O_WRONLY|j9.O_SYMLINK,z),O=!0,V;try{V=q.fchmodSync(H,z),O=!1}finally{if(O)try{q.closeSync(H)}catch(N){}else q.closeSync(H)}return V}}function J(q){if(j9.hasOwnProperty("O_SYMLINK")&&q.futimes)q.lutimes=function(W,z,H,O){q.open(W,j9.O_SYMLINK,function(V,N){if(V){if(O)O(V);return}q.futimes(N,z,H,function(L){q.close(N,function(E){if(O)O(L||E)})})})},q.lutimesSync=function(W,z,H){var O=q.openSync(W,j9.O_SYMLINK),V,N=!0;try{V=q.futimesSync(O,z,H),N=!1}finally{if(N)try{q.closeSync(O)}catch(L){}else q.closeSync(O)}return V};else if(q.futimes)q.lutimes=function(W,z,H,O){if(O)process.nextTick(O)},q.lutimesSync=function(){}}function X(q){if(!q)return q;return function(W,z,H){return q.call($,W,z,function(O){if(G(O))O=null;if(H)H.apply(this,arguments)})}}function Q(q){if(!q)return q;return function(W,z){try{return q.call($,W,z)}catch(H){if(!G(H))throw H}}}function Y(q){if(!q)return q;return function(W,z,H,O){return q.call($,W,z,H,function(V){if(G(V))V=null;if(O)O.apply(this,arguments)})}}function Z(q){if(!q)return q;return function(W,z,H){try{return q.call($,W,z,H)}catch(O){if(!G(O))throw O}}}function F(q){if(!q)return q;return function(W,z,H){if(typeof z==="function")H=z,z=null;function O(V,N){if(N){if(N.uid<0)N.uid+=4294967296;if(N.gid<0)N.gid+=4294967296}if(H)H.apply(this,arguments)}return z?q.call($,W,z,O):q.call($,W,O)}}function U(q){if(!q)return q;return function(W,z){var H=z?q.call($,W,z):q.call($,W);if(H){if(H.uid<0)H.uid+=4294967296;if(H.gid<0)H.gid+=4294967296}return H}}function G(q){if(!q)return!0;if(q.code==="ENOSYS")return!0;var W=!process.getuid||process.getuid()!==0;if(W){if(q.code==="EINVAL"||q.code==="EPERM")return!0}return!1}}});var im=A((NM$,nm)=>{var lm=a("stream").Stream;nm.exports=IP0;function IP0($){return{ReadStream:D,WriteStream:J};function D(X,Q){if(!(this instanceof D))return new D(X,Q);lm.call(this);var Y=this;this.path=X,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Q=Q||{};var Z=Object.keys(Q);for(var F=0,U=Z.length;F<U;F++){var G=Z[F];this[G]=Q[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Y._read()});return}$.open(this.path,this.flags,this.mode,function(q,W){if(q){Y.emit("error",q),Y.readable=!1;return}Y.fd=W,Y.emit("open",W),Y._read()})}function J(X,Q){if(!(this instanceof J))return new J(X,Q);lm.call(this),this.path=X,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Q=Q||{};var Y=Object.keys(Q);for(var Z=0,F=Y.length;Z<F;Z++){var U=Y[Z];this[U]=Q[U]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=$.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var rm=A((wM$,pm)=>{pm.exports=CP0;var jP0=Object.getPrototypeOf||function($){return $.__proto__};function CP0($){if($===null||typeof $!=="object")return $;if($ instanceof Object)var D={__proto__:jP0($)};else var D=Object.create(null);return Object.getOwnPropertyNames($).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor($,J))}),D}});var k1=A((MM$,rM)=>{var C1=a("fs"),TP0=cm(),PP0=im(),SP0=rm(),h3=a("util"),WD,g3;if(typeof Symbol==="function"&&typeof Symbol.for==="function")WD=Symbol.for("graceful-fs.queue"),g3=Symbol.for("graceful-fs.previous");else WD="___graceful-fs.queue",g3="___graceful-fs.previous";function xP0(){}function tm($,D){Object.defineProperty($,WD,{get:function(){return D}})}var YJ=xP0;if(h3.debuglog)YJ=h3.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))YJ=function(){var $=h3.format.apply(h3,arguments);$="GFS4: "+$.split(/\n/).join(`
|
|
126
|
-
GFS4: `),console.error($)};if(!C1[WD]){if(nM=global[WD]||[],tm(C1,nM),C1.close=function($){function D(J,X){return $.call(C1,J,function(Q){if(!Q)om();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty(D,g3,{value:$}),D}(C1.close),C1.closeSync=function($){function D(J){$.apply(C1,arguments),om()}return Object.defineProperty(D,g3,{value:$}),D}(C1.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){YJ(C1[WD]),a("assert").equal(C1[WD].length,0)})}var nM;if(!global[WD])tm(global,C1[WD]);rM.exports=iM(SP0(C1));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!C1.__patched)rM.exports=iM(C1),C1.__patched=!0;function iM($){TP0($),$.gracefulify=iM,$.createReadStream=M,$.createWriteStream=R;var D=$.readFile;$.readFile=J;function J(I,_,x){if(typeof _==="function")x=_,_=null;return l(I,_,x);function l(c,D0,h,j){return D(c,D0,function(C){if(C&&(C.code==="EMFILE"||C.code==="ENFILE"))qX([l,[c,D0,h],C,j||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var X=$.writeFile;$.writeFile=Q;function Q(I,_,x,l){if(typeof x==="function")l=x,x=null;return c(I,_,x,l);function c(D0,h,j,C,u){return X(D0,h,j,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=Z;function Z(I,_,x,l){if(typeof x==="function")l=x,x=null;return c(I,_,x,l);function c(D0,h,j,C,u){return Y(D0,h,j,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var F=$.copyFile;if(F)$.copyFile=U;function U(I,_,x,l){if(typeof x==="function")l=x,x=0;return c(I,_,x,l);function c(D0,h,j,C,u){return F(D0,h,j,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var G=$.readdir;$.readdir=W;var q=/^v[0-5]\./;function W(I,_,x){if(typeof _==="function")x=_,_=null;var l=q.test(process.version)?function(h,j,C,u){return G(h,c(h,j,C,u))}:function(h,j,C,u){return G(h,j,c(h,j,C,u))};return l(I,_,x);function c(D0,h,j,C){return function(u,g){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))qX([l,[D0,h,j],u,C||Date.now(),Date.now()]);else{if(g&&g.sort)g.sort();if(typeof j==="function")j.call(this,u,g)}}}}if(process.version.substr(0,4)==="v0.8"){var z=PP0($);L=z.ReadStream,K=z.WriteStream}var H=$.ReadStream;if(H)L.prototype=Object.create(H.prototype),L.prototype.open=E;var O=$.WriteStream;if(O)K.prototype=Object.create(O.prototype),K.prototype.open=w;Object.defineProperty($,"ReadStream",{get:function(){return L},set:function(I){L=I},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return K},set:function(I){K=I},enumerable:!0,configurable:!0});var V=L;Object.defineProperty($,"FileReadStream",{get:function(){return V},set:function(I){V=I},enumerable:!0,configurable:!0});var N=K;Object.defineProperty($,"FileWriteStream",{get:function(){return N},set:function(I){N=I},enumerable:!0,configurable:!0});function L(I,_){if(this instanceof L)return H.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function E(){var I=this;v(I.path,I.flags,I.mode,function(_,x){if(_){if(I.autoClose)I.destroy();I.emit("error",_)}else I.fd=x,I.emit("open",x),I.read()})}function K(I,_){if(this instanceof K)return O.apply(this,arguments),this;else return K.apply(Object.create(K.prototype),arguments)}function w(){var I=this;v(I.path,I.flags,I.mode,function(_,x){if(_)I.destroy(),I.emit("error",_);else I.fd=x,I.emit("open",x)})}function M(I,_){return new $.ReadStream(I,_)}function R(I,_){return new $.WriteStream(I,_)}var S=$.open;$.open=v;function v(I,_,x,l){if(typeof x==="function")l=x,x=null;return c(I,_,x,l);function c(D0,h,j,C,u){return S(D0,h,j,function(g,p){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}return $}function qX($){YJ("ENQUEUE",$[0].name,$[1]),C1[WD].push($),pM()}var b3;function om(){var $=Date.now();for(var D=0;D<C1[WD].length;++D)if(C1[WD][D].length>2)C1[WD][D][3]=$,C1[WD][D][4]=$;pM()}function pM(){if(clearTimeout(b3),b3=void 0,C1[WD].length===0)return;var $=C1[WD].shift(),D=$[0],J=$[1],X=$[2],Q=$[3],Y=$[4];if(Q===void 0)YJ("RETRY",D.name,J),D.apply(null,J);else if(Date.now()-Q>=60000){YJ("TIMEOUT",D.name,J);var Z=J.pop();if(typeof Z==="function")Z.call(null,X)}else{var F=Date.now()-Y,U=Math.max(Y-Q,1),G=Math.min(U*1.2,100);if(F>=G)YJ("RETRY",D.name,J),D.apply(null,J.concat([Q]));else C1[WD].push($)}if(b3===void 0)b3=setTimeout(pM,0)}});var sm=A((LM$,am)=>{function d6($,D){if(typeof D==="boolean")D={forever:D};if(this._originalTimeouts=JSON.parse(JSON.stringify($)),this._timeouts=$,this._options=D||{},this._maxRetryTime=D&&D.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}am.exports=d6;d6.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};d6.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};d6.prototype.retry=function($){if(this._timeout)clearTimeout(this._timeout);if(!$)return!1;var D=new Date().getTime();if($&&D-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push($);var J=this._timeouts.shift();if(J===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),J=this._timeouts.shift();else return!1;var X=this,Q=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},J);if(this._options.unref)Q.unref();return!0};d6.prototype.attempt=function($,D){if(this._fn=$,D){if(D.timeout)this._operationTimeout=D.timeout;if(D.cb)this._operationTimeoutCb=D.cb}var J=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){J._operationTimeoutCb()},J._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};d6.prototype.try=function($){console.log("Using RetryOperation.try() is deprecated"),this.attempt($)};d6.prototype.start=function($){console.log("Using RetryOperation.start() is deprecated"),this.attempt($)};d6.prototype.start=d6.prototype.try;d6.prototype.errors=function(){return this._errors};d6.prototype.attempts=function(){return this._attempts};d6.prototype.mainError=function(){if(this._errors.length===0)return null;var $={},D=null,J=0;for(var X=0;X<this._errors.length;X++){var Q=this._errors[X],Y=Q.message,Z=($[Y]||0)+1;if($[Y]=Z,Z>=J)D=Q,J=Z}return D}});var $d=A((_P0)=>{var vP0=sm();_P0.operation=function($){var D=_P0.timeouts($);return new vP0(D,{forever:$&&$.forever,unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})};_P0.timeouts=function($){if($ instanceof Array)return[].concat($);var D={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var J in $)D[J]=$[J];if(D.minTimeout>D.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var Q=0;Q<D.retries;Q++)X.push(this.createTimeout(Q,D));if($&&$.forever&&!X.length)X.push(this.createTimeout(Q,D));return X.sort(function(Y,Z){return Y-Z}),X};_P0.createTimeout=function($,D){var J=D.randomize?Math.random()+1:1,X=Math.round(J*D.minTimeout*Math.pow(D.factor,$));return X=Math.min(X,D.maxTimeout),X};_P0.wrap=function($,D,J){if(D instanceof Array)J=D,D=null;if(!J){J=[];for(var X in $)if(typeof $[X]==="function")J.push(X)}for(var Q=0;Q<J.length;Q++){var Y=J[Q],Z=$[Y];$[Y]=function(U){var G=_P0.operation(D),q=Array.prototype.slice.call(arguments,1),W=q.pop();q.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();W.apply(this,arguments)}),G.attempt(function(){U.apply($,q)})}.bind($,Z),$[Y].options=D}}});var Dd=A((EM$,m3)=>{m3.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")m3.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")m3.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var l3=A((RM$,zX)=>{var L1=global.process,ZJ=function($){return $&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function"};if(!ZJ(L1))zX.exports=function(){return function(){}};else{if(oM=a("assert"),FJ=Dd(),tM=/^win/i.test(L1.platform),WX=a("events"),typeof WX!=="function")WX=WX.EventEmitter;if(L1.__signal_exit_emitter__)o1=L1.__signal_exit_emitter__;else o1=L1.__signal_exit_emitter__=new WX,o1.count=0,o1.emitted={};if(!o1.infinite)o1.setMaxListeners(1/0),o1.infinite=!0;zX.exports=function($,D){if(!ZJ(global.process))return function(){};if(oM.equal(typeof $,"function","a callback must be provided for exit handler"),UJ===!1)d3();var J="exit";if(D&&D.alwaysLast)J="afterexit";var X=function(){if(o1.removeListener(J,$),o1.listeners("exit").length===0&&o1.listeners("afterexit").length===0)cZ()};return o1.on(J,$),X},cZ=function(){if(!UJ||!ZJ(global.process))return;UJ=!1,FJ.forEach(function(D){try{L1.removeListener(D,lZ[D])}catch(J){}}),L1.emit=nZ,L1.reallyExit=c3,o1.count-=1},zX.exports.unload=cZ,C9=function(D,J,X){if(o1.emitted[D])return;o1.emitted[D]=!0,o1.emit(D,J,X)},lZ={},FJ.forEach(function($){lZ[$]=function(){if(!ZJ(global.process))return;var J=L1.listeners($);if(J.length===o1.count){if(cZ(),C9("exit",null,$),C9("afterexit",null,$),tM&&$==="SIGHUP")$="SIGINT";L1.kill(L1.pid,$)}}}),zX.exports.signals=function(){return FJ},UJ=!1,d3=function(){if(UJ||!ZJ(global.process))return;UJ=!0,o1.count+=1,FJ=FJ.filter(function(D){try{return L1.on(D,lZ[D]),!0}catch(J){return!1}}),L1.emit=sM,L1.reallyExit=aM},zX.exports.load=d3,c3=L1.reallyExit,aM=function(D){if(!ZJ(global.process))return;L1.exitCode=D||0,C9("exit",L1.exitCode,null),C9("afterexit",L1.exitCode,null),c3.call(L1,L1.exitCode)},nZ=L1.emit,sM=function(D,J){if(D==="exit"&&ZJ(global.process)){if(J!==void 0)L1.exitCode=J;var X=nZ.apply(this,arguments);return C9("exit",L1.exitCode,null),C9("afterexit",L1.exitCode,null),X}else return nZ.apply(this,arguments)}}var oM,FJ,tM,WX,o1,cZ,C9,lZ,UJ,d3,c3,aM,nZ,sM});var Xd=A((bP0,eM)=>{var Jd=Symbol();function fP0($,D,J){let X=D[Jd];if(X)return D.stat($,(Y,Z)=>{if(Y)return J(Y);J(null,Z.mtime,X)});let Q=new Date(Math.ceil(Date.now()/1000)*1000+5);D.utimes($,Q,Q,(Y)=>{if(Y)return J(Y);D.stat($,(Z,F)=>{if(Z)return J(Z);let U=F.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(D,Jd,{value:U}),J(null,F.mtime,U)})})}function hP0($){let D=Date.now();if($==="s")D=Math.ceil(D/1000)*1000;return new Date(D)}bP0.probe=fP0;bP0.getMtime=hP0});var Ud=A((rP0,pZ)=>{var dP0=a("path"),JL=k1(),cP0=$d(),lP0=l3(),Qd=Xd(),g8={};function iZ($,D){return D.lockfilePath||`${$}.lock`}function XL($,D,J){if(!D.realpath)return J(null,dP0.resolve($));D.fs.realpath($,J)}function DL($,D,J){let X=iZ($,D);D.fs.mkdir(X,(Q)=>{if(!Q)return Qd.probe(X,D.fs,(Y,Z,F)=>{if(Y)return D.fs.rmdir(X,()=>{}),J(Y);J(null,Z,F)});if(Q.code!=="EEXIST")return J(Q);if(D.stale<=0)return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:$}));D.fs.stat(X,(Y,Z)=>{if(Y){if(Y.code==="ENOENT")return DL($,{...D,stale:0},J);return J(Y)}if(!Yd(Z,D))return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:$}));Zd($,D,(F)=>{if(F)return J(F);DL($,{...D,stale:0},J)})})})}function Yd($,D){return $.mtime.getTime()<Date.now()-D.stale}function Zd($,D,J){D.fs.rmdir(iZ($,D),(X)=>{if(X&&X.code!=="ENOENT")return J(X);J()})}function n3($,D){let J=g8[$];if(J.updateTimeout)return;if(J.updateDelay=J.updateDelay||D.update,J.updateTimeout=setTimeout(()=>{J.updateTimeout=null,D.fs.stat(J.lockfilePath,(X,Q)=>{let Y=J.lastUpdate+D.stale<Date.now();if(X){if(X.code==="ENOENT"||Y)return $L($,J,Object.assign(X,{code:"ECOMPROMISED"}));return J.updateDelay=1000,n3($,D)}if(J.mtime.getTime()!==Q.mtime.getTime())return $L($,J,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let F=Qd.getMtime(J.mtimePrecision);D.fs.utimes(J.lockfilePath,F,F,(U)=>{let G=J.lastUpdate+D.stale<Date.now();if(J.released)return;if(U){if(U.code==="ENOENT"||G)return $L($,J,Object.assign(U,{code:"ECOMPROMISED"}));return J.updateDelay=1000,n3($,D)}J.mtime=F,J.lastUpdate=Date.now(),J.updateDelay=null,n3($,D)})})},J.updateDelay),J.updateTimeout.unref)J.updateTimeout.unref()}function $L($,D,J){if(D.released=!0,D.updateTimeout)clearTimeout(D.updateTimeout);if(g8[$]===D)delete g8[$];D.options.onCompromised(J)}function nP0($,D,J){D={stale:1e4,update:null,realpath:!0,retries:0,fs:JL,onCompromised:(X)=>{throw X},...D},D.retries=D.retries||0,D.retries=typeof D.retries==="number"?{retries:D.retries}:D.retries,D.stale=Math.max(D.stale||0,2000),D.update=D.update==null?D.stale/2:D.update||0,D.update=Math.max(Math.min(D.update,D.stale/2),1000),XL($,D,(X,Q)=>{if(X)return J(X);let Y=cP0.operation(D.retries);Y.attempt(()=>{DL(Q,D,(Z,F,U)=>{if(Y.retry(Z))return;if(Z)return J(Y.mainError());let G=g8[Q]={lockfilePath:iZ(Q,D),mtime:F,mtimePrecision:U,options:D,lastUpdate:Date.now()};n3(Q,D),J(null,(q)=>{if(G.released)return q&&q(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Fd(Q,{...D,realpath:!1},q)})})})})}function Fd($,D,J){D={fs:JL,realpath:!0,...D},XL($,D,(X,Q)=>{if(X)return J(X);let Y=g8[Q];if(!Y)return J(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Y.updateTimeout&&clearTimeout(Y.updateTimeout),Y.released=!0,delete g8[Q],Zd(Q,D,J)})}function iP0($,D,J){D={stale:1e4,realpath:!0,fs:JL,...D},D.stale=Math.max(D.stale||0,2000),XL($,D,(X,Q)=>{if(X)return J(X);D.fs.stat(iZ(Q,D),(Y,Z)=>{if(Y)return Y.code==="ENOENT"?J(null,!1):J(Y);return J(null,!Yd(Z,D))})})}function pP0(){return g8}lP0(()=>{for(let $ in g8){let D=g8[$].options;try{D.fs.rmdirSync(iZ($,D))}catch(J){}}});rP0.lock=nP0;rP0.unlock=Fd;rP0.check=iP0;rP0.getLocks=pP0});var qd=A((AM$,Gd)=>{var eP0=k1();function $S0($){let D=["mkdir","realpath","stat","rmdir","utimes"],J={...$};return D.forEach((X)=>{J[X]=(...Q)=>{let Y=Q.pop(),Z;try{Z=$[`${X}Sync`](...Q)}catch(F){return Y(F)}Y(null,Z)}}),J}function DS0($){return(...D)=>new Promise((J,X)=>{D.push((Q,Y)=>{if(Q)X(Q);else J(Y)}),$(...D)})}function JS0($){return(...D)=>{let J,X;if(D.push((Q,Y)=>{J=Q,X=Y}),$(...D),J)throw J;return X}}function XS0($){if($={...$},$.fs=$S0($.fs||eP0),typeof $.retries==="number"&&$.retries>0||$.retries&&typeof $.retries.retries==="number"&&$.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return $}Gd.exports={toPromise:DS0,toSync:JS0,toSyncOptions:XS0}});var zd=A((IM$,T9)=>{var HX=Ud(),{toPromise:i3,toSync:p3,toSyncOptions:QL}=qd();async function Wd($,D){let J=await i3(HX.lock)($,D);return i3(J)}function QS0($,D){let J=p3(HX.lock)($,QL(D));return p3(J)}function YS0($,D){return i3(HX.unlock)($,D)}function ZS0($,D){return p3(HX.unlock)($,QL(D))}function FS0($,D){return i3(HX.check)($,D)}function US0($,D){return p3(HX.check)($,QL(D))}T9.exports=Wd;T9.exports.lock=Wd;T9.exports.unlock=YS0;T9.exports.lockSync=QS0;T9.exports.unlockSync=ZS0;T9.exports.check=FS0;T9.exports.checkSync=US0});var Md=A((Nd)=>{Object.defineProperty(Nd,"__esModule",{value:!0});Nd.canStoreURLs=Nd.FileUrlStorage=void 0;var Hd=a("fs"),GS0=WS0(mm()),Od=qS0(zd());function Kd($){if(typeof WeakMap!="function")return null;var D=new WeakMap,J=new WeakMap;return(Kd=function(X){return X?J:D})($)}function qS0($,D){if(!D&&$&&$.__esModule)return $;if($===null||typeof $!="object"&&typeof $!="function")return{default:$};var J=Kd(D);if(J&&J.has($))return J.get($);var X={__proto__:null},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in $)if(Y!=="default"&&{}.hasOwnProperty.call($,Y)){var Z=Q?Object.getOwnPropertyDescriptor($,Y):null;Z&&(Z.get||Z.set)?Object.defineProperty(X,Y,Z):X[Y]=$[Y]}return X.default=$,J&&J.set($,X),X}function WS0($){return $&&$.__esModule?$:{default:$}}function rZ($){return rZ=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},rZ($)}function zS0($,D){if(!($ instanceof D))throw TypeError("Cannot call a class as a function")}function Vd($,D){for(var J=0;J<D.length;J++){var X=D[J];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty($,OS0(X.key),X)}}function HS0($,D,J){if(D)Vd($.prototype,D);if(J)Vd($,J);return Object.defineProperty($,"prototype",{writable:!1}),$}function OS0($){var D=VS0($,"string");return rZ(D)=="symbol"?D:D+""}function VS0($,D){if(rZ($)!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var X=J.call($,D||"default");if(rZ(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}var jM$=Nd.canStoreURLs=!0,CM$=Nd.FileUrlStorage=function(){function $(D){zS0(this,$),this.path=D}return HS0($,[{key:"findAllUploads",value:function(){var J=this;return new Promise(function(X,Q){J._getItems("tus::",function(Y,Z){if(Y)Q(Y);else X(Z)})})}},{key:"findUploadsByFingerprint",value:function(J){var X=this;return new Promise(function(Q,Y){X._getItems("tus::".concat(J),function(Z,F){if(Z)Y(Z);else Q(F)})})}},{key:"removeUpload",value:function(J){var X=this;return new Promise(function(Q,Y){X._removeItem(J,function(Z){if(Z)Y(Z);else Q()})})}},{key:"addUpload",value:function(J,X){var Q=this,Y=Math.round(Math.random()*1000000000000),Z="tus::".concat(J,"::").concat(Y);return new Promise(function(F,U){Q._setItem(Z,X,function(G){if(G)U(G);else F(Z)})})}},{key:"_setItem",value:function(J,X,Q){var Y=this;Od.lock(this.path,this._lockfileOptions()).then(function(Z){Q=Y._releaseAndCb(Z,Q),Y._getData(function(F,U){if(F){Q(F);return}U[J]=X,Y._writeData(U,function(G){return Q(G)})})}).catch(Q)}},{key:"_getItems",value:function(J,X){this._getData(function(Q,Y){if(Q){X(Q);return}var Z=Object.keys(Y).filter(function(F){return F.startsWith(J)}).map(function(F){var U=Y[F];return U.urlStorageKey=F,U});X(null,Z)})}},{key:"_removeItem",value:function(J,X){var Q=this;Od.lock(this.path,this._lockfileOptions()).then(function(Y){X=Q._releaseAndCb(Y,X),Q._getData(function(Z,F){if(Z){X(Z);return}delete F[J],Q._writeData(F,function(U){return X(U)})})}).catch(X)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(J,X){return function(Q){if(Q){J().then(function(){return X(Q)}).catch(function(Y){return X((0,GS0.default)([Q,Y]))});return}J().then(X).catch(X)}}},{key:"_writeData",value:function(J,X){var Q={encoding:"utf8",mode:432,flag:"w"};(0,Hd.writeFile)(this.path,JSON.stringify(J),Q,function(Y){return X(Y)})}},{key:"_getData",value:function(J){(0,Hd.readFile)(this.path,"utf8",function(X,Q){if(X){if(X.code==="ENOENT")J(null,{});else J(X);return}try{Q=!Q.trim().length?{}:JSON.parse(Q)}catch(Y){J(Y);return}J(null,Q)})}}])}()});var o3=A((P9)=>{Object.defineProperty(P9,"__esModule",{value:!0});Object.defineProperty(P9,"DefaultHttpStack",{enumerable:!0,get:function(){return Rd.default}});Object.defineProperty(P9,"DetailedError",{enumerable:!0,get:function(){return NS0.default}});Object.defineProperty(P9,"FileUrlStorage",{enumerable:!0,get:function(){return Ad.FileUrlStorage}});Object.defineProperty(P9,"StreamSource",{enumerable:!0,get:function(){return ES0.default}});P9.Upload=void 0;Object.defineProperty(P9,"canStoreURLs",{enumerable:!0,get:function(){return Ad.canStoreURLs}});P9.defaultOptions=void 0;Object.defineProperty(P9,"enableDebugLog",{enumerable:!0,get:function(){return wS0.enableDebugLog}});P9.isSupported=void 0;var NS0=GJ(QM()),wS0=YM(),MS0=GJ(zb()),YL=GJ(nb()),LS0=GJ(Wg()),BS0=GJ(Kg()),Rd=GJ(vg()),ES0=GJ(KM()),Ad=Md();function GJ($){return $&&$.__esModule?$:{default:$}}function VX($){return VX=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},VX($)}function RS0($,D){if(!($ instanceof D))throw TypeError("Cannot call a class as a function")}function Ld($,D){for(var J=0;J<D.length;J++){var X=D[J];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty($,jd(X.key),X)}}function AS0($,D,J){if(D)Ld($.prototype,D);if(J)Ld($,J);return Object.defineProperty($,"prototype",{writable:!1}),$}function IS0($,D,J){return D=r3(D),jS0($,Id()?Reflect.construct(D,J||[],r3($).constructor):D.apply($,J))}function jS0($,D){if(D&&(VX(D)==="object"||typeof D==="function"))return D;else if(D!==void 0)throw TypeError("Derived constructors may only return object or undefined");return CS0($)}function CS0($){if($===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return $}function Id(){try{var $=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(D){}return(Id=function(){return!!$})()}function r3($){return r3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(J){return J.__proto__||Object.getPrototypeOf(J)},r3($)}function TS0($,D){if(typeof D!=="function"&&D!==null)throw TypeError("Super expression must either be null or a function");if($.prototype=Object.create(D&&D.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),Object.defineProperty($,"prototype",{writable:!1}),D)ZL($,D)}function ZL($,D){return ZL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,Q){return X.__proto__=Q,X},ZL($,D)}function Bd($,D){var J=Object.keys($);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols($);D&&(X=X.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),J.push.apply(J,X)}return J}function OX($){for(var D=1;D<arguments.length;D++){var J=arguments[D]!=null?arguments[D]:{};D%2?Bd(Object(J),!0).forEach(function(X){PS0($,X,J[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Bd(Object(J)).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(J,X))})}return $}function PS0($,D,J){if(D=jd(D),D in $)Object.defineProperty($,D,{value:J,enumerable:!0,configurable:!0,writable:!0});else $[D]=J;return $}function jd($){var D=SS0($,"string");return VX(D)=="symbol"?D:D+""}function SS0($,D){if(VX($)!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var X=J.call($,D||"default");if(VX(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}var Ed=P9.defaultOptions=OX(OX({},YL.default.defaultOptions),{},{httpStack:new Rd.default,fileReader:new LS0.default,urlStorage:new MS0.default,fingerprint:BS0.default}),PM$=P9.Upload=function($){function D(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return RS0(this,D),X=OX(OX({},Ed),X),IS0(this,D,[J,X])}return TS0(D,$),AS0(D,null,[{key:"terminate",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Q=OX(OX({},Ed),Q),YL.default.terminate(X,Q)}}])}(YL.default),SM$=P9.isSupported=!0});var zD;var m8=s(()=>{zD={name:"@capgo/cli",type:"module",version:"8.28.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:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test: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","test:credentials":"bun test/test-credentials.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test: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 run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && 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-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:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && 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:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && 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:organization-set-api-host","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.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:organization-set-api-host":"bun test/test-organization-set-api-host.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@rrweb/types":"^2.0.1","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","happy-dom":"^20.10.4",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6","rrweb-snapshot":"^2.0.1","string-width":"^8.2.1"},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.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});import{platform as vS0,release as _S0}from"node:os";import{arch as kS0,version as uS0}from"node:process";function FL(){return Sd}function UL(){let $={cli_version:zD.version,node_version:uS0,os_platform:vS0(),os_arch:kS0,os_release:_S0(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:oZ.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:Sd};if(oZ.name)$.ci_provider=oZ.name;return $}var oZ,Sd="cli";var GL=s(()=>{m8();oZ=R$(aw(),1)});import{AsyncLocalStorage as yS0}from"node:async_hooks";function KX($,D){return vd.run($,()=>Promise.resolve(D()))}function fS0(){return vd.getStore()}function _d(){return hS0}function ud($){kd=$}function xd($){try{kd?.($)}catch{}}function fd($,D){let J;try{J=new URL($).pathname}catch{J=$.split("?")[0]}let X="/functions/v1/",Q=J.indexOf(X);if(Q>=0){let G=J.slice(Q+X.length).replace(/^\/+|\/+$/g,"");return G?`${D} functions:${G}`:`${D} functions`}let Y="/rest/v1/",Z=J.indexOf(Y),F=Z>=0?J.slice(Z+Y.length):J.replace(/^\//,"");if(F.startsWith("rpc/"))return`rpc:${F.slice(4).split("/")[0]}`;let U=F.split("/")[0]||J;return`${D} ${U}`}function bS0($){let D=$?.headers;if(!D)return;let J=D.get;if(typeof J==="function")return J.call(D,"capgkey")??void 0;if(Array.isArray(D))return D.find(([X])=>X.toLowerCase()==="capgkey")?.[1];return D.capgkey}function hd(){return async(D,J)=>{let X=(J?.method??"GET").toUpperCase(),Q=typeof D==="string"?D:D instanceof URL?D.href:D.url,Y=fS0(),Z=bS0(J),F=Date.now();try{let U=await globalThis.fetch(D,J);return xd({url:Q,method:X,status:U.status,ok:U.ok,durationMs:Date.now()-F,source:Y,apikey:Z}),U}catch(U){throw xd({url:Q,method:X,status:0,ok:!1,durationMs:Date.now()-F,source:Y,apikey:Z,error:U}),U}}}var vd,hS0=!1,kd,yd=5000;var t3=s(()=>{vd=new yS0});function bd($,D){let X=["normal","bold","dim","italic","underline","strikethrough"].indexOf($),Q="\x1B[";return"\x1B["+X+"m"+D+"\x1B[0m"}var C6;var gd=s(()=>{C6=class C6{title=null;headers=[];rows=[];static narrowTheme={top:["╔","═","╤","╗"],row:["║"," ","│","║"],div:["╟","─","┼","╢"],bot:["╚","═","╧","╝"]};static wideTheme={top:["╔═","═","═╤═","═╗"],row:["║ "," "," │ "," ║"],div:["╟─","─","─┼─","─╢"],bot:["╚═","═","═╧═","═╝"]};static roundTheme={top:["╭─","─","─┬─","─╮"],row:["│ "," "," │ "," │"],div:["├─","─","─┼─","─┤"],bot:["╰─","─","─┴─","─╯"]};theme=C6.wideTheme;columnWidth(){let $=[this.headers,...this.rows].filter((J)=>J.length>0),D=$[0].map((J)=>this.cast(J).length);for(let J of $.slice(1))for(let X=0;X<D.length;X++){let Q=this.cast(J[X]).length;if(Q>D[X])D[X]=Q}return D}cast($){if(typeof $==="object")return"obj";if($!==void 0&&typeof $.toString==="function")return $.toString();else return""}renderTitle(){return"[ "+this.title+" ]"}renderLine($){let D=this.columnWidth();return $[0]+D.map((J)=>$[1].repeat(J)).join($[2])+$[3]}renderCell($,D,J=!1){let X=this.cast($),Q=J?bd("bold",X):X,Y=D-X.length,Z=this.theme.row[1];switch(typeof $){case"number":return Z.repeat(Y)+Q;case"string":return Q+Z.repeat(Y);case"boolean":case"object":return Z.repeat(Math.ceil(Y/2))+bd("italic",X)+Z.repeat(Math.floor(Y/2));default:return Z.repeat(Y)}}renderRow($,D=!1){let J=this.theme.row,X=this.columnWidth();return J[0]+$.map((Q,Y)=>this.renderCell(Q,X[Y],D)).join(J[2])+J[3]}toString(){let $=this.theme,D=this.headers.length>0,J=this.rows.length>0;return[this.title?this.renderTitle():"",D||J?this.renderLine($.top):"",D?this.renderRow(this.headers,!0):"",D&&J?this.renderLine($.div):"",...this.rows.map((X)=>this.renderRow(X)),D||J?this.renderLine($.bot):""].filter((X)=>X.length>0).join(`
|
|
126
|
+
GFS4: `),console.error($)};if(!C1[WD]){if(nM=global[WD]||[],tm(C1,nM),C1.close=function($){function D(J,X){return $.call(C1,J,function(Q){if(!Q)om();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty(D,g3,{value:$}),D}(C1.close),C1.closeSync=function($){function D(J){$.apply(C1,arguments),om()}return Object.defineProperty(D,g3,{value:$}),D}(C1.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){YJ(C1[WD]),a("assert").equal(C1[WD].length,0)})}var nM;if(!global[WD])tm(global,C1[WD]);rM.exports=iM(SP0(C1));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!C1.__patched)rM.exports=iM(C1),C1.__patched=!0;function iM($){TP0($),$.gracefulify=iM,$.createReadStream=M,$.createWriteStream=R;var D=$.readFile;$.readFile=J;function J(I,_,x){if(typeof _==="function")x=_,_=null;return l(I,_,x);function l(c,D0,h,j){return D(c,D0,function(C){if(C&&(C.code==="EMFILE"||C.code==="ENFILE"))qX([l,[c,D0,h],C,j||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var X=$.writeFile;$.writeFile=Q;function Q(I,_,x,l){if(typeof x==="function")l=x,x=null;return c(I,_,x,l);function c(D0,h,j,C,u){return X(D0,h,j,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=Z;function Z(I,_,x,l){if(typeof x==="function")l=x,x=null;return c(I,_,x,l);function c(D0,h,j,C,u){return Y(D0,h,j,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var F=$.copyFile;if(F)$.copyFile=U;function U(I,_,x,l){if(typeof x==="function")l=x,x=0;return c(I,_,x,l);function c(D0,h,j,C,u){return F(D0,h,j,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var G=$.readdir;$.readdir=W;var q=/^v[0-5]\./;function W(I,_,x){if(typeof _==="function")x=_,_=null;var l=q.test(process.version)?function(h,j,C,u){return G(h,c(h,j,C,u))}:function(h,j,C,u){return G(h,j,c(h,j,C,u))};return l(I,_,x);function c(D0,h,j,C){return function(u,g){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))qX([l,[D0,h,j],u,C||Date.now(),Date.now()]);else{if(g&&g.sort)g.sort();if(typeof j==="function")j.call(this,u,g)}}}}if(process.version.substr(0,4)==="v0.8"){var z=PP0($);L=z.ReadStream,K=z.WriteStream}var H=$.ReadStream;if(H)L.prototype=Object.create(H.prototype),L.prototype.open=E;var O=$.WriteStream;if(O)K.prototype=Object.create(O.prototype),K.prototype.open=w;Object.defineProperty($,"ReadStream",{get:function(){return L},set:function(I){L=I},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return K},set:function(I){K=I},enumerable:!0,configurable:!0});var V=L;Object.defineProperty($,"FileReadStream",{get:function(){return V},set:function(I){V=I},enumerable:!0,configurable:!0});var N=K;Object.defineProperty($,"FileWriteStream",{get:function(){return N},set:function(I){N=I},enumerable:!0,configurable:!0});function L(I,_){if(this instanceof L)return H.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function E(){var I=this;v(I.path,I.flags,I.mode,function(_,x){if(_){if(I.autoClose)I.destroy();I.emit("error",_)}else I.fd=x,I.emit("open",x),I.read()})}function K(I,_){if(this instanceof K)return O.apply(this,arguments),this;else return K.apply(Object.create(K.prototype),arguments)}function w(){var I=this;v(I.path,I.flags,I.mode,function(_,x){if(_)I.destroy(),I.emit("error",_);else I.fd=x,I.emit("open",x)})}function M(I,_){return new $.ReadStream(I,_)}function R(I,_){return new $.WriteStream(I,_)}var S=$.open;$.open=v;function v(I,_,x,l){if(typeof x==="function")l=x,x=null;return c(I,_,x,l);function c(D0,h,j,C,u){return S(D0,h,j,function(g,p){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))qX([c,[D0,h,j,C],g,u||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}return $}function qX($){YJ("ENQUEUE",$[0].name,$[1]),C1[WD].push($),pM()}var b3;function om(){var $=Date.now();for(var D=0;D<C1[WD].length;++D)if(C1[WD][D].length>2)C1[WD][D][3]=$,C1[WD][D][4]=$;pM()}function pM(){if(clearTimeout(b3),b3=void 0,C1[WD].length===0)return;var $=C1[WD].shift(),D=$[0],J=$[1],X=$[2],Q=$[3],Y=$[4];if(Q===void 0)YJ("RETRY",D.name,J),D.apply(null,J);else if(Date.now()-Q>=60000){YJ("TIMEOUT",D.name,J);var Z=J.pop();if(typeof Z==="function")Z.call(null,X)}else{var F=Date.now()-Y,U=Math.max(Y-Q,1),G=Math.min(U*1.2,100);if(F>=G)YJ("RETRY",D.name,J),D.apply(null,J.concat([Q]));else C1[WD].push($)}if(b3===void 0)b3=setTimeout(pM,0)}});var sm=A((LM$,am)=>{function d6($,D){if(typeof D==="boolean")D={forever:D};if(this._originalTimeouts=JSON.parse(JSON.stringify($)),this._timeouts=$,this._options=D||{},this._maxRetryTime=D&&D.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}am.exports=d6;d6.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};d6.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};d6.prototype.retry=function($){if(this._timeout)clearTimeout(this._timeout);if(!$)return!1;var D=new Date().getTime();if($&&D-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push($);var J=this._timeouts.shift();if(J===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),J=this._timeouts.shift();else return!1;var X=this,Q=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},J);if(this._options.unref)Q.unref();return!0};d6.prototype.attempt=function($,D){if(this._fn=$,D){if(D.timeout)this._operationTimeout=D.timeout;if(D.cb)this._operationTimeoutCb=D.cb}var J=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){J._operationTimeoutCb()},J._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};d6.prototype.try=function($){console.log("Using RetryOperation.try() is deprecated"),this.attempt($)};d6.prototype.start=function($){console.log("Using RetryOperation.start() is deprecated"),this.attempt($)};d6.prototype.start=d6.prototype.try;d6.prototype.errors=function(){return this._errors};d6.prototype.attempts=function(){return this._attempts};d6.prototype.mainError=function(){if(this._errors.length===0)return null;var $={},D=null,J=0;for(var X=0;X<this._errors.length;X++){var Q=this._errors[X],Y=Q.message,Z=($[Y]||0)+1;if($[Y]=Z,Z>=J)D=Q,J=Z}return D}});var $d=A((_P0)=>{var vP0=sm();_P0.operation=function($){var D=_P0.timeouts($);return new vP0(D,{forever:$&&$.forever,unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})};_P0.timeouts=function($){if($ instanceof Array)return[].concat($);var D={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var J in $)D[J]=$[J];if(D.minTimeout>D.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var Q=0;Q<D.retries;Q++)X.push(this.createTimeout(Q,D));if($&&$.forever&&!X.length)X.push(this.createTimeout(Q,D));return X.sort(function(Y,Z){return Y-Z}),X};_P0.createTimeout=function($,D){var J=D.randomize?Math.random()+1:1,X=Math.round(J*D.minTimeout*Math.pow(D.factor,$));return X=Math.min(X,D.maxTimeout),X};_P0.wrap=function($,D,J){if(D instanceof Array)J=D,D=null;if(!J){J=[];for(var X in $)if(typeof $[X]==="function")J.push(X)}for(var Q=0;Q<J.length;Q++){var Y=J[Q],Z=$[Y];$[Y]=function(U){var G=_P0.operation(D),q=Array.prototype.slice.call(arguments,1),W=q.pop();q.push(function(z){if(G.retry(z))return;if(z)arguments[0]=G.mainError();W.apply(this,arguments)}),G.attempt(function(){U.apply($,q)})}.bind($,Z),$[Y].options=D}}});var Dd=A((EM$,m3)=>{m3.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")m3.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")m3.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var l3=A((RM$,zX)=>{var L1=global.process,ZJ=function($){return $&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function"};if(!ZJ(L1))zX.exports=function(){return function(){}};else{if(oM=a("assert"),FJ=Dd(),tM=/^win/i.test(L1.platform),WX=a("events"),typeof WX!=="function")WX=WX.EventEmitter;if(L1.__signal_exit_emitter__)o1=L1.__signal_exit_emitter__;else o1=L1.__signal_exit_emitter__=new WX,o1.count=0,o1.emitted={};if(!o1.infinite)o1.setMaxListeners(1/0),o1.infinite=!0;zX.exports=function($,D){if(!ZJ(global.process))return function(){};if(oM.equal(typeof $,"function","a callback must be provided for exit handler"),UJ===!1)d3();var J="exit";if(D&&D.alwaysLast)J="afterexit";var X=function(){if(o1.removeListener(J,$),o1.listeners("exit").length===0&&o1.listeners("afterexit").length===0)cZ()};return o1.on(J,$),X},cZ=function(){if(!UJ||!ZJ(global.process))return;UJ=!1,FJ.forEach(function(D){try{L1.removeListener(D,lZ[D])}catch(J){}}),L1.emit=nZ,L1.reallyExit=c3,o1.count-=1},zX.exports.unload=cZ,C9=function(D,J,X){if(o1.emitted[D])return;o1.emitted[D]=!0,o1.emit(D,J,X)},lZ={},FJ.forEach(function($){lZ[$]=function(){if(!ZJ(global.process))return;var J=L1.listeners($);if(J.length===o1.count){if(cZ(),C9("exit",null,$),C9("afterexit",null,$),tM&&$==="SIGHUP")$="SIGINT";L1.kill(L1.pid,$)}}}),zX.exports.signals=function(){return FJ},UJ=!1,d3=function(){if(UJ||!ZJ(global.process))return;UJ=!0,o1.count+=1,FJ=FJ.filter(function(D){try{return L1.on(D,lZ[D]),!0}catch(J){return!1}}),L1.emit=sM,L1.reallyExit=aM},zX.exports.load=d3,c3=L1.reallyExit,aM=function(D){if(!ZJ(global.process))return;L1.exitCode=D||0,C9("exit",L1.exitCode,null),C9("afterexit",L1.exitCode,null),c3.call(L1,L1.exitCode)},nZ=L1.emit,sM=function(D,J){if(D==="exit"&&ZJ(global.process)){if(J!==void 0)L1.exitCode=J;var X=nZ.apply(this,arguments);return C9("exit",L1.exitCode,null),C9("afterexit",L1.exitCode,null),X}else return nZ.apply(this,arguments)}}var oM,FJ,tM,WX,o1,cZ,C9,lZ,UJ,d3,c3,aM,nZ,sM});var Xd=A((bP0,eM)=>{var Jd=Symbol();function fP0($,D,J){let X=D[Jd];if(X)return D.stat($,(Y,Z)=>{if(Y)return J(Y);J(null,Z.mtime,X)});let Q=new Date(Math.ceil(Date.now()/1000)*1000+5);D.utimes($,Q,Q,(Y)=>{if(Y)return J(Y);D.stat($,(Z,F)=>{if(Z)return J(Z);let U=F.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(D,Jd,{value:U}),J(null,F.mtime,U)})})}function hP0($){let D=Date.now();if($==="s")D=Math.ceil(D/1000)*1000;return new Date(D)}bP0.probe=fP0;bP0.getMtime=hP0});var Ud=A((rP0,pZ)=>{var dP0=a("path"),JL=k1(),cP0=$d(),lP0=l3(),Qd=Xd(),g8={};function iZ($,D){return D.lockfilePath||`${$}.lock`}function XL($,D,J){if(!D.realpath)return J(null,dP0.resolve($));D.fs.realpath($,J)}function DL($,D,J){let X=iZ($,D);D.fs.mkdir(X,(Q)=>{if(!Q)return Qd.probe(X,D.fs,(Y,Z,F)=>{if(Y)return D.fs.rmdir(X,()=>{}),J(Y);J(null,Z,F)});if(Q.code!=="EEXIST")return J(Q);if(D.stale<=0)return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:$}));D.fs.stat(X,(Y,Z)=>{if(Y){if(Y.code==="ENOENT")return DL($,{...D,stale:0},J);return J(Y)}if(!Yd(Z,D))return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:$}));Zd($,D,(F)=>{if(F)return J(F);DL($,{...D,stale:0},J)})})})}function Yd($,D){return $.mtime.getTime()<Date.now()-D.stale}function Zd($,D,J){D.fs.rmdir(iZ($,D),(X)=>{if(X&&X.code!=="ENOENT")return J(X);J()})}function n3($,D){let J=g8[$];if(J.updateTimeout)return;if(J.updateDelay=J.updateDelay||D.update,J.updateTimeout=setTimeout(()=>{J.updateTimeout=null,D.fs.stat(J.lockfilePath,(X,Q)=>{let Y=J.lastUpdate+D.stale<Date.now();if(X){if(X.code==="ENOENT"||Y)return $L($,J,Object.assign(X,{code:"ECOMPROMISED"}));return J.updateDelay=1000,n3($,D)}if(J.mtime.getTime()!==Q.mtime.getTime())return $L($,J,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let F=Qd.getMtime(J.mtimePrecision);D.fs.utimes(J.lockfilePath,F,F,(U)=>{let G=J.lastUpdate+D.stale<Date.now();if(J.released)return;if(U){if(U.code==="ENOENT"||G)return $L($,J,Object.assign(U,{code:"ECOMPROMISED"}));return J.updateDelay=1000,n3($,D)}J.mtime=F,J.lastUpdate=Date.now(),J.updateDelay=null,n3($,D)})})},J.updateDelay),J.updateTimeout.unref)J.updateTimeout.unref()}function $L($,D,J){if(D.released=!0,D.updateTimeout)clearTimeout(D.updateTimeout);if(g8[$]===D)delete g8[$];D.options.onCompromised(J)}function nP0($,D,J){D={stale:1e4,update:null,realpath:!0,retries:0,fs:JL,onCompromised:(X)=>{throw X},...D},D.retries=D.retries||0,D.retries=typeof D.retries==="number"?{retries:D.retries}:D.retries,D.stale=Math.max(D.stale||0,2000),D.update=D.update==null?D.stale/2:D.update||0,D.update=Math.max(Math.min(D.update,D.stale/2),1000),XL($,D,(X,Q)=>{if(X)return J(X);let Y=cP0.operation(D.retries);Y.attempt(()=>{DL(Q,D,(Z,F,U)=>{if(Y.retry(Z))return;if(Z)return J(Y.mainError());let G=g8[Q]={lockfilePath:iZ(Q,D),mtime:F,mtimePrecision:U,options:D,lastUpdate:Date.now()};n3(Q,D),J(null,(q)=>{if(G.released)return q&&q(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));Fd(Q,{...D,realpath:!1},q)})})})})}function Fd($,D,J){D={fs:JL,realpath:!0,...D},XL($,D,(X,Q)=>{if(X)return J(X);let Y=g8[Q];if(!Y)return J(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Y.updateTimeout&&clearTimeout(Y.updateTimeout),Y.released=!0,delete g8[Q],Zd(Q,D,J)})}function iP0($,D,J){D={stale:1e4,realpath:!0,fs:JL,...D},D.stale=Math.max(D.stale||0,2000),XL($,D,(X,Q)=>{if(X)return J(X);D.fs.stat(iZ(Q,D),(Y,Z)=>{if(Y)return Y.code==="ENOENT"?J(null,!1):J(Y);return J(null,!Yd(Z,D))})})}function pP0(){return g8}lP0(()=>{for(let $ in g8){let D=g8[$].options;try{D.fs.rmdirSync(iZ($,D))}catch(J){}}});rP0.lock=nP0;rP0.unlock=Fd;rP0.check=iP0;rP0.getLocks=pP0});var qd=A((AM$,Gd)=>{var eP0=k1();function $S0($){let D=["mkdir","realpath","stat","rmdir","utimes"],J={...$};return D.forEach((X)=>{J[X]=(...Q)=>{let Y=Q.pop(),Z;try{Z=$[`${X}Sync`](...Q)}catch(F){return Y(F)}Y(null,Z)}}),J}function DS0($){return(...D)=>new Promise((J,X)=>{D.push((Q,Y)=>{if(Q)X(Q);else J(Y)}),$(...D)})}function JS0($){return(...D)=>{let J,X;if(D.push((Q,Y)=>{J=Q,X=Y}),$(...D),J)throw J;return X}}function XS0($){if($={...$},$.fs=$S0($.fs||eP0),typeof $.retries==="number"&&$.retries>0||$.retries&&typeof $.retries.retries==="number"&&$.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return $}Gd.exports={toPromise:DS0,toSync:JS0,toSyncOptions:XS0}});var zd=A((IM$,T9)=>{var HX=Ud(),{toPromise:i3,toSync:p3,toSyncOptions:QL}=qd();async function Wd($,D){let J=await i3(HX.lock)($,D);return i3(J)}function QS0($,D){let J=p3(HX.lock)($,QL(D));return p3(J)}function YS0($,D){return i3(HX.unlock)($,D)}function ZS0($,D){return p3(HX.unlock)($,QL(D))}function FS0($,D){return i3(HX.check)($,D)}function US0($,D){return p3(HX.check)($,QL(D))}T9.exports=Wd;T9.exports.lock=Wd;T9.exports.unlock=YS0;T9.exports.lockSync=QS0;T9.exports.unlockSync=ZS0;T9.exports.check=FS0;T9.exports.checkSync=US0});var Md=A((Nd)=>{Object.defineProperty(Nd,"__esModule",{value:!0});Nd.canStoreURLs=Nd.FileUrlStorage=void 0;var Hd=a("fs"),GS0=WS0(mm()),Od=qS0(zd());function Kd($){if(typeof WeakMap!="function")return null;var D=new WeakMap,J=new WeakMap;return(Kd=function(X){return X?J:D})($)}function qS0($,D){if(!D&&$&&$.__esModule)return $;if($===null||typeof $!="object"&&typeof $!="function")return{default:$};var J=Kd(D);if(J&&J.has($))return J.get($);var X={__proto__:null},Q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Y in $)if(Y!=="default"&&{}.hasOwnProperty.call($,Y)){var Z=Q?Object.getOwnPropertyDescriptor($,Y):null;Z&&(Z.get||Z.set)?Object.defineProperty(X,Y,Z):X[Y]=$[Y]}return X.default=$,J&&J.set($,X),X}function WS0($){return $&&$.__esModule?$:{default:$}}function rZ($){return rZ=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},rZ($)}function zS0($,D){if(!($ instanceof D))throw TypeError("Cannot call a class as a function")}function Vd($,D){for(var J=0;J<D.length;J++){var X=D[J];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty($,OS0(X.key),X)}}function HS0($,D,J){if(D)Vd($.prototype,D);if(J)Vd($,J);return Object.defineProperty($,"prototype",{writable:!1}),$}function OS0($){var D=VS0($,"string");return rZ(D)=="symbol"?D:D+""}function VS0($,D){if(rZ($)!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var X=J.call($,D||"default");if(rZ(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}var jM$=Nd.canStoreURLs=!0,CM$=Nd.FileUrlStorage=function(){function $(D){zS0(this,$),this.path=D}return HS0($,[{key:"findAllUploads",value:function(){var J=this;return new Promise(function(X,Q){J._getItems("tus::",function(Y,Z){if(Y)Q(Y);else X(Z)})})}},{key:"findUploadsByFingerprint",value:function(J){var X=this;return new Promise(function(Q,Y){X._getItems("tus::".concat(J),function(Z,F){if(Z)Y(Z);else Q(F)})})}},{key:"removeUpload",value:function(J){var X=this;return new Promise(function(Q,Y){X._removeItem(J,function(Z){if(Z)Y(Z);else Q()})})}},{key:"addUpload",value:function(J,X){var Q=this,Y=Math.round(Math.random()*1000000000000),Z="tus::".concat(J,"::").concat(Y);return new Promise(function(F,U){Q._setItem(Z,X,function(G){if(G)U(G);else F(Z)})})}},{key:"_setItem",value:function(J,X,Q){var Y=this;Od.lock(this.path,this._lockfileOptions()).then(function(Z){Q=Y._releaseAndCb(Z,Q),Y._getData(function(F,U){if(F){Q(F);return}U[J]=X,Y._writeData(U,function(G){return Q(G)})})}).catch(Q)}},{key:"_getItems",value:function(J,X){this._getData(function(Q,Y){if(Q){X(Q);return}var Z=Object.keys(Y).filter(function(F){return F.startsWith(J)}).map(function(F){var U=Y[F];return U.urlStorageKey=F,U});X(null,Z)})}},{key:"_removeItem",value:function(J,X){var Q=this;Od.lock(this.path,this._lockfileOptions()).then(function(Y){X=Q._releaseAndCb(Y,X),Q._getData(function(Z,F){if(Z){X(Z);return}delete F[J],Q._writeData(F,function(U){return X(U)})})}).catch(X)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(J,X){return function(Q){if(Q){J().then(function(){return X(Q)}).catch(function(Y){return X((0,GS0.default)([Q,Y]))});return}J().then(X).catch(X)}}},{key:"_writeData",value:function(J,X){var Q={encoding:"utf8",mode:432,flag:"w"};(0,Hd.writeFile)(this.path,JSON.stringify(J),Q,function(Y){return X(Y)})}},{key:"_getData",value:function(J){(0,Hd.readFile)(this.path,"utf8",function(X,Q){if(X){if(X.code==="ENOENT")J(null,{});else J(X);return}try{Q=!Q.trim().length?{}:JSON.parse(Q)}catch(Y){J(Y);return}J(null,Q)})}}])}()});var o3=A((P9)=>{Object.defineProperty(P9,"__esModule",{value:!0});Object.defineProperty(P9,"DefaultHttpStack",{enumerable:!0,get:function(){return Rd.default}});Object.defineProperty(P9,"DetailedError",{enumerable:!0,get:function(){return NS0.default}});Object.defineProperty(P9,"FileUrlStorage",{enumerable:!0,get:function(){return Ad.FileUrlStorage}});Object.defineProperty(P9,"StreamSource",{enumerable:!0,get:function(){return ES0.default}});P9.Upload=void 0;Object.defineProperty(P9,"canStoreURLs",{enumerable:!0,get:function(){return Ad.canStoreURLs}});P9.defaultOptions=void 0;Object.defineProperty(P9,"enableDebugLog",{enumerable:!0,get:function(){return wS0.enableDebugLog}});P9.isSupported=void 0;var NS0=GJ(QM()),wS0=YM(),MS0=GJ(zb()),YL=GJ(nb()),LS0=GJ(Wg()),BS0=GJ(Kg()),Rd=GJ(vg()),ES0=GJ(KM()),Ad=Md();function GJ($){return $&&$.__esModule?$:{default:$}}function VX($){return VX=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},VX($)}function RS0($,D){if(!($ instanceof D))throw TypeError("Cannot call a class as a function")}function Ld($,D){for(var J=0;J<D.length;J++){var X=D[J];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty($,jd(X.key),X)}}function AS0($,D,J){if(D)Ld($.prototype,D);if(J)Ld($,J);return Object.defineProperty($,"prototype",{writable:!1}),$}function IS0($,D,J){return D=r3(D),jS0($,Id()?Reflect.construct(D,J||[],r3($).constructor):D.apply($,J))}function jS0($,D){if(D&&(VX(D)==="object"||typeof D==="function"))return D;else if(D!==void 0)throw TypeError("Derived constructors may only return object or undefined");return CS0($)}function CS0($){if($===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return $}function Id(){try{var $=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(D){}return(Id=function(){return!!$})()}function r3($){return r3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(J){return J.__proto__||Object.getPrototypeOf(J)},r3($)}function TS0($,D){if(typeof D!=="function"&&D!==null)throw TypeError("Super expression must either be null or a function");if($.prototype=Object.create(D&&D.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),Object.defineProperty($,"prototype",{writable:!1}),D)ZL($,D)}function ZL($,D){return ZL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,Q){return X.__proto__=Q,X},ZL($,D)}function Bd($,D){var J=Object.keys($);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols($);D&&(X=X.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),J.push.apply(J,X)}return J}function OX($){for(var D=1;D<arguments.length;D++){var J=arguments[D]!=null?arguments[D]:{};D%2?Bd(Object(J),!0).forEach(function(X){PS0($,X,J[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Bd(Object(J)).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(J,X))})}return $}function PS0($,D,J){if(D=jd(D),D in $)Object.defineProperty($,D,{value:J,enumerable:!0,configurable:!0,writable:!0});else $[D]=J;return $}function jd($){var D=SS0($,"string");return VX(D)=="symbol"?D:D+""}function SS0($,D){if(VX($)!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var X=J.call($,D||"default");if(VX(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)($)}var Ed=P9.defaultOptions=OX(OX({},YL.default.defaultOptions),{},{httpStack:new Rd.default,fileReader:new LS0.default,urlStorage:new MS0.default,fingerprint:BS0.default}),PM$=P9.Upload=function($){function D(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return RS0(this,D),X=OX(OX({},Ed),X),IS0(this,D,[J,X])}return TS0(D,$),AS0(D,null,[{key:"terminate",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Q=OX(OX({},Ed),Q),YL.default.terminate(X,Q)}}])}(YL.default),SM$=P9.isSupported=!0});var zD;var m8=s(()=>{zD={name:"@capgo/cli",type:"module",version:"8.29.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test: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","test:credentials":"bun test/test-credentials.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test: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 run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && 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-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:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && 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:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && 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:organization-set-api-host","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.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:organization-set-api-host":"bun test/test-organization-set-api-host.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@rrweb/types":"^2.0.1","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","happy-dom":"^20.10.4",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6","rrweb-snapshot":"^2.0.1","string-width":"^8.2.1"},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.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});import{platform as vS0,release as _S0}from"node:os";import{arch as kS0,version as uS0}from"node:process";function FL(){return Sd}function UL(){let $={cli_version:zD.version,node_version:uS0,os_platform:vS0(),os_arch:kS0,os_release:_S0(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:oZ.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:Sd};if(oZ.name)$.ci_provider=oZ.name;return $}var oZ,Sd="cli";var GL=s(()=>{m8();oZ=R$(aw(),1)});import{AsyncLocalStorage as yS0}from"node:async_hooks";function KX($,D){return vd.run($,()=>Promise.resolve(D()))}function fS0(){return vd.getStore()}function _d(){return hS0}function ud($){kd=$}function xd($){try{kd?.($)}catch{}}function fd($,D){let J;try{J=new URL($).pathname}catch{J=$.split("?")[0]}let X="/functions/v1/",Q=J.indexOf(X);if(Q>=0){let G=J.slice(Q+X.length).replace(/^\/+|\/+$/g,"");return G?`${D} functions:${G}`:`${D} functions`}let Y="/rest/v1/",Z=J.indexOf(Y),F=Z>=0?J.slice(Z+Y.length):J.replace(/^\//,"");if(F.startsWith("rpc/"))return`rpc:${F.slice(4).split("/")[0]}`;let U=F.split("/")[0]||J;return`${D} ${U}`}function bS0($){let D=$?.headers;if(!D)return;let J=D.get;if(typeof J==="function")return J.call(D,"capgkey")??void 0;if(Array.isArray(D))return D.find(([X])=>X.toLowerCase()==="capgkey")?.[1];return D.capgkey}function hd(){return async(D,J)=>{let X=(J?.method??"GET").toUpperCase(),Q=typeof D==="string"?D:D instanceof URL?D.href:D.url,Y=fS0(),Z=bS0(J),F=Date.now();try{let U=await globalThis.fetch(D,J);return xd({url:Q,method:X,status:U.status,ok:U.ok,durationMs:Date.now()-F,source:Y,apikey:Z}),U}catch(U){throw xd({url:Q,method:X,status:0,ok:!1,durationMs:Date.now()-F,source:Y,apikey:Z,error:U}),U}}}var vd,hS0=!1,kd,yd=5000;var t3=s(()=>{vd=new yS0});function bd($,D){let X=["normal","bold","dim","italic","underline","strikethrough"].indexOf($),Q="\x1B[";return"\x1B["+X+"m"+D+"\x1B[0m"}var C6;var gd=s(()=>{C6=class C6{title=null;headers=[];rows=[];static narrowTheme={top:["╔","═","╤","╗"],row:["║"," ","│","║"],div:["╟","─","┼","╢"],bot:["╚","═","╧","╝"]};static wideTheme={top:["╔═","═","═╤═","═╗"],row:["║ "," "," │ "," ║"],div:["╟─","─","─┼─","─╢"],bot:["╚═","═","═╧═","═╝"]};static roundTheme={top:["╭─","─","─┬─","─╮"],row:["│ "," "," │ "," │"],div:["├─","─","─┼─","─┤"],bot:["╰─","─","─┴─","─╯"]};theme=C6.wideTheme;columnWidth(){let $=[this.headers,...this.rows].filter((J)=>J.length>0),D=$[0].map((J)=>this.cast(J).length);for(let J of $.slice(1))for(let X=0;X<D.length;X++){let Q=this.cast(J[X]).length;if(Q>D[X])D[X]=Q}return D}cast($){if(typeof $==="object")return"obj";if($!==void 0&&typeof $.toString==="function")return $.toString();else return""}renderTitle(){return"[ "+this.title+" ]"}renderLine($){let D=this.columnWidth();return $[0]+D.map((J)=>$[1].repeat(J)).join($[2])+$[3]}renderCell($,D,J=!1){let X=this.cast($),Q=J?bd("bold",X):X,Y=D-X.length,Z=this.theme.row[1];switch(typeof $){case"number":return Z.repeat(Y)+Q;case"string":return Q+Z.repeat(Y);case"boolean":case"object":return Z.repeat(Math.ceil(Y/2))+bd("italic",X)+Z.repeat(Math.floor(Y/2));default:return Z.repeat(Y)}}renderRow($,D=!1){let J=this.theme.row,X=this.columnWidth();return J[0]+$.map((Q,Y)=>this.renderCell(Q,X[Y],D)).join(J[2])+J[3]}toString(){let $=this.theme,D=this.headers.length>0,J=this.rows.length>0;return[this.title?this.renderTitle():"",D||J?this.renderLine($.top):"",D?this.renderRow(this.headers,!0):"",D&&J?this.renderLine($.div):"",...this.rows.map((X)=>this.renderRow(X)),D||J?this.renderLine($.bot):""].filter((X)=>X.length>0).join(`
|
|
127
127
|
`)}}});var NX=s(()=>{gd()});async function a3($){try{let J=`https://registry.npmjs.org/${encodeURIComponent($.toLowerCase())}`,X=await fetch(J,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!X.ok)return null;return(await X.json())["dist-tags"]?.latest||null}catch{return null}}async function gS0(){let $=await a3("@capgo/cli")??"",D=$?.split(".")[0]??"";return{currentVersion:zD.version,latestVersion:$,isOutdated:!!$&&$!==zD.version,majorVersion:D}}async function Y1(){let{isOutdated:$,currentVersion:D,latestVersion:J,majorVersion:X}=await gS0();if($)B.warning(`\uD83D\uDEA8 You are using @capgo/cli@${D} it's not the latest version.
|
|
128
128
|
Please use @capgo/cli@${J}" or @capgo/cli@${X} to keep up to date with the latest features and bug fixes.`)}var fD=s(()=>{X$();m8()});async function md($,D,J,X,Q,Y="✅",Z){await l0(J,{channel:$,event:X,icon:Y,org_id:D,tracking_version:2,...Q||Z?{tags:{...Q?{"app-id":Q}:{},...Z}}:{},notify:!1})}var dd=s(()=>{X$();NX();fD();s0()});var qL=A((sM$,cd)=>{var wX=1000,MX=wX*60,LX=MX*60,qJ=LX*24,mS0=qJ*7,dS0=qJ*365.25;cd.exports=function($,D){D=D||{};var J=typeof $;if(J==="string"&&$.length>0)return cS0($);else if(J==="number"&&isFinite($))return D.long?nS0($):lS0($);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify($))};function cS0($){if($=String($),$.length>100)return;var D=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec($);if(!D)return;var J=parseFloat(D[1]),X=(D[2]||"ms").toLowerCase();switch(X){case"years":case"year":case"yrs":case"yr":case"y":return J*dS0;case"weeks":case"week":case"w":return J*mS0;case"days":case"day":case"d":return J*qJ;case"hours":case"hour":case"hrs":case"hr":case"h":return J*LX;case"minutes":case"minute":case"mins":case"min":case"m":return J*MX;case"seconds":case"second":case"secs":case"sec":case"s":return J*wX;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return J;default:return}}function lS0($){var D=Math.abs($);if(D>=qJ)return Math.round($/qJ)+"d";if(D>=LX)return Math.round($/LX)+"h";if(D>=MX)return Math.round($/MX)+"m";if(D>=wX)return Math.round($/wX)+"s";return $+"ms"}function nS0($){var D=Math.abs($);if(D>=qJ)return s3($,D,qJ,"day");if(D>=LX)return s3($,D,LX,"hour");if(D>=MX)return s3($,D,MX,"minute");if(D>=wX)return s3($,D,wX,"second");return $+" ms"}function s3($,D,J,X){var Q=D>=J*1.5;return Math.round($/J)+" "+X+(Q?"s":"")}});var WL=A((eM$,ld)=>{function iS0($){J.debug=J,J.default=J,J.coerce=U,J.disable=Z,J.enable=Q,J.enabled=F,J.humanize=qL(),J.destroy=G,Object.keys($).forEach((q)=>{J[q]=$[q]}),J.names=[],J.skips=[],J.formatters={};function D(q){let W=0;for(let z=0;z<q.length;z++)W=(W<<5)-W+q.charCodeAt(z),W|=0;return J.colors[Math.abs(W)%J.colors.length]}J.selectColor=D;function J(q){let W,z=null,H,O;function V(...N){if(!V.enabled)return;let L=V,E=Number(new Date),K=E-(W||E);if(L.diff=K,L.prev=W,L.curr=E,W=E,N[0]=J.coerce(N[0]),typeof N[0]!=="string")N.unshift("%O");let w=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(R,S)=>{if(R==="%%")return"%";w++;let v=J.formatters[S];if(typeof v==="function"){let I=N[w];R=v.call(L,I),N.splice(w,1),w--}return R}),J.formatArgs.call(L,N),(L.log||J.log).apply(L,N)}if(V.namespace=q,V.useColors=J.useColors(),V.color=J.selectColor(q),V.extend=X,V.destroy=J.destroy,Object.defineProperty(V,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(z!==null)return z;if(H!==J.namespaces)H=J.namespaces,O=J.enabled(q);return O},set:(N)=>{z=N}}),typeof J.init==="function")J.init(V);return V}function X(q,W){let z=J(this.namespace+(typeof W>"u"?":":W)+q);return z.log=this.log,z}function Q(q){J.save(q),J.namespaces=q,J.names=[],J.skips=[];let W=(typeof q==="string"?q:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let z of W)if(z[0]==="-")J.skips.push(z.slice(1));else J.names.push(z)}function Y(q,W){let z=0,H=0,O=-1,V=0;while(z<q.length)if(H<W.length&&(W[H]===q[z]||W[H]==="*"))if(W[H]==="*")O=H,V=z,H++;else z++,H++;else if(O!==-1)H=O+1,V++,z=V;else return!1;while(H<W.length&&W[H]==="*")H++;return H===W.length}function Z(){let q=[...J.names,...J.skips.map((W)=>"-"+W)].join(",");return J.enable(""),q}function F(q){for(let W of J.skips)if(Y(q,W))return!1;for(let W of J.names)if(Y(q,W))return!0;return!1}function U(q){if(q instanceof Error)return q.stack||q.message;return q}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return J.enable(J.load()),J}ld.exports=iS0});var id=A((nd,e3)=>{nd.formatArgs=rS0;nd.save=oS0;nd.load=tS0;nd.useColors=pS0;nd.storage=aS0();nd.destroy=(()=>{let $=!1;return()=>{if(!$)$=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();nd.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function pS0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let $;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&($=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt($[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function rS0($){if($[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+$[0]+(this.useColors?"%c ":" ")+"+"+e3.exports.humanize(this.diff),!this.useColors)return;let D="color: "+this.color;$.splice(1,0,D,"color: inherit");let J=0,X=0;$[0].replace(/%[a-zA-Z%]/g,(Q)=>{if(Q==="%%")return;if(J++,Q==="%c")X=J}),$.splice(X,0,D)}nd.log=console.debug||console.log||(()=>{});function oS0($){try{if($)nd.storage.setItem("debug",$);else nd.storage.removeItem("debug")}catch(D){}}function tS0(){let $;try{$=nd.storage.getItem("debug")||nd.storage.getItem("DEBUG")}catch(D){}if(!$&&typeof process<"u"&&"env"in process)$=process.env.DEBUG;return $}function aS0(){try{return localStorage}catch($){}}e3.exports=WL()(nd);var{formatters:sS0}=e3.exports;sS0.j=function($){try{return JSON.stringify($)}catch(D){return"[UnexpectedJSONParseError]: "+D.message}}});var rd=A((DL$,pd)=>{pd.exports=($,D=process.argv)=>{let J=$.startsWith("-")?"":$.length===1?"-":"--",X=D.indexOf(J+$),Q=D.indexOf("--");return X!==-1&&(Q===-1||X<Q)}});var ad=A((JL$,td)=>{var Zx0=a("os"),od=a("tty"),c6=rd(),{env:$D}=process,S9;if(c6("no-color")||c6("no-colors")||c6("color=false")||c6("color=never"))S9=0;else if(c6("color")||c6("colors")||c6("color=true")||c6("color=always"))S9=1;if("FORCE_COLOR"in $D)if($D.FORCE_COLOR==="true")S9=1;else if($D.FORCE_COLOR==="false")S9=0;else S9=$D.FORCE_COLOR.length===0?1:Math.min(parseInt($D.FORCE_COLOR,10),3);function zL($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function HL($,D){if(S9===0)return 0;if(c6("color=16m")||c6("color=full")||c6("color=truecolor"))return 3;if(c6("color=256"))return 2;if($&&!D&&S9===void 0)return 0;let J=S9||0;if($D.TERM==="dumb")return J;if(process.platform==="win32"){let X=Zx0.release().split(".");if(Number(X[0])>=10&&Number(X[2])>=10586)return Number(X[2])>=14931?3:2;return 1}if("CI"in $D){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((X)=>(X in $D))||$D.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in $D)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($D.TEAMCITY_VERSION)?1:0;if($D.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $D){let X=parseInt(($D.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($D.TERM_PROGRAM){case"iTerm.app":return X>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test($D.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($D.TERM))return 1;if("COLORTERM"in $D)return 1;return J}function Fx0($){let D=HL($,$&&$.isTTY);return zL(D)}td.exports={supportsColor:Fx0,stdout:zL(HL(!0,od.isatty(1))),stderr:zL(HL(!0,od.isatty(2)))}});var Dc=A((ed,DW)=>{var Ux0=a("tty"),$W=a("util");ed.init=Vx0;ed.log=zx0;ed.formatArgs=qx0;ed.save=Hx0;ed.load=Ox0;ed.useColors=Gx0;ed.destroy=$W.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ed.colors=[6,2,3,4,5,1];try{let $=ad();if($&&($.stderr||$).level>=2)ed.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch($){}ed.inspectOpts=Object.keys(process.env).filter(($)=>{return/^debug_/i.test($)}).reduce(($,D)=>{let J=D.substring(6).toLowerCase().replace(/_([a-z])/g,(Q,Y)=>{return Y.toUpperCase()}),X=process.env[D];if(/^(yes|on|true|enabled)$/i.test(X))X=!0;else if(/^(no|off|false|disabled)$/i.test(X))X=!1;else if(X==="null")X=null;else X=Number(X);return $[J]=X,$},{});function Gx0(){return"colors"in ed.inspectOpts?Boolean(ed.inspectOpts.colors):Ux0.isatty(process.stderr.fd)}function qx0($){let{namespace:D,useColors:J}=this;if(J){let X=this.color,Q="\x1B[3"+(X<8?X:"8;5;"+X),Y=` ${Q};1m${D} \x1B[0m`;$[0]=Y+$[0].split(`
|
|
129
129
|
`).join(`
|
|
@@ -1596,6 +1596,7 @@ export type Database = {
|
|
|
1596
1596
|
updates: number;
|
|
1597
1597
|
updates_external: number | null;
|
|
1598
1598
|
updates_last_month: number | null;
|
|
1599
|
+
upgrade_rate_12m: number;
|
|
1599
1600
|
upgraded_orgs: number;
|
|
1600
1601
|
trial_extended_orgs: number;
|
|
1601
1602
|
trial_extended_subscribed_orgs: number;
|
|
@@ -1687,6 +1688,7 @@ export type Database = {
|
|
|
1687
1688
|
updates: number;
|
|
1688
1689
|
updates_external?: number | null;
|
|
1689
1690
|
updates_last_month?: number | null;
|
|
1691
|
+
upgrade_rate_12m?: number;
|
|
1690
1692
|
upgraded_orgs?: number;
|
|
1691
1693
|
trial_extended_orgs?: number;
|
|
1692
1694
|
trial_extended_subscribed_orgs?: number;
|
|
@@ -1778,6 +1780,7 @@ export type Database = {
|
|
|
1778
1780
|
updates?: number;
|
|
1779
1781
|
updates_external?: number | null;
|
|
1780
1782
|
updates_last_month?: number | null;
|
|
1783
|
+
upgrade_rate_12m?: number;
|
|
1781
1784
|
upgraded_orgs?: number;
|
|
1782
1785
|
trial_extended_orgs?: number;
|
|
1783
1786
|
trial_extended_subscribed_orgs?: number;
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1678,6 +1678,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
1678
1678
|
updates: number;
|
|
1679
1679
|
updates_external: number | null;
|
|
1680
1680
|
updates_last_month: number | null;
|
|
1681
|
+
upgrade_rate_12m: number;
|
|
1681
1682
|
upgraded_orgs: number;
|
|
1682
1683
|
trial_extended_orgs: number;
|
|
1683
1684
|
trial_extended_subscribed_orgs: number;
|
|
@@ -1769,6 +1770,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
1769
1770
|
updates: number;
|
|
1770
1771
|
updates_external?: number | null;
|
|
1771
1772
|
updates_last_month?: number | null;
|
|
1773
|
+
upgrade_rate_12m?: number;
|
|
1772
1774
|
upgraded_orgs?: number;
|
|
1773
1775
|
trial_extended_orgs?: number;
|
|
1774
1776
|
trial_extended_subscribed_orgs?: number;
|
|
@@ -1860,6 +1862,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
1860
1862
|
updates?: number;
|
|
1861
1863
|
updates_external?: number | null;
|
|
1862
1864
|
updates_last_month?: number | null;
|
|
1865
|
+
upgrade_rate_12m?: number;
|
|
1863
1866
|
upgraded_orgs?: number;
|
|
1864
1867
|
trial_extended_orgs?: number;
|
|
1865
1868
|
trial_extended_subscribed_orgs?: number;
|