{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/utils/oauth/load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAarD,eAAO,MAAM,kBAAkB,0BAC+D,CAAC;AAE/F,eAAO,MAAM,oBAAoB,0BACoE,CAAC;AAEtG,eAAO,MAAM,sBAAsB,0BACwE,CAAC","sourcesContent":["import type { OAuthAuth } from \"../../auth/types.ts\";\n\n/**\n * Loads an OAuth flow module through a variable specifier so bundlers cannot\n * follow the import into Node-only flow code (`node:http` callback servers,\n * `node:crypto` PKCE). The `.ts`/`.js` rewrite keeps the trick working from\n * both source and built output.\n */\nconst importOAuthModule = (specifier: string): Promise<unknown> => {\n\tconst runtimeSpecifier = import.meta.url.endsWith(\".js\") ? specifier.replace(/\\.ts$/, \".js\") : specifier;\n\treturn import(runtimeSpecifier);\n};\n\nexport const loadAnthropicOAuth = async (): Promise<OAuthAuth> =>\n\t((await importOAuthModule(\"./anthropic.ts\")) as { anthropicOAuth: OAuthAuth }).anthropicOAuth;\n\nexport const loadOpenAICodexOAuth = async (): Promise<OAuthAuth> =>\n\t((await importOAuthModule(\"./openai-codex.ts\")) as { openaiCodexOAuth: OAuthAuth }).openaiCodexOAuth;\n\nexport const loadGitHubCopilotOAuth = async (): Promise<OAuthAuth> =>\n\t((await importOAuthModule(\"./github-copilot.ts\")) as { githubCopilotOAuth: OAuthAuth }).githubCopilotOAuth;\n"]}