"use strict";
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.activate = void 0;
const vscode = require("vscode");
const github_1 = require("./github");
function activate(context) {
    context.subscriptions.push(new github_1.GitHubAuthenticationProvider(context, github_1.AuthProviderType.github));
    let githubEnterpriseAuthProvider;
    if (vscode.workspace.getConfiguration().get('github-enterprise.uri')) {
        githubEnterpriseAuthProvider = new github_1.GitHubAuthenticationProvider(context, github_1.AuthProviderType.githubEnterprise);
        context.subscriptions.push(githubEnterpriseAuthProvider);
    }
    context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async (e) => {
        if (e.affectsConfiguration('github-enterprise.uri')) {
            if (!githubEnterpriseAuthProvider && vscode.workspace.getConfiguration().get('github-enterprise.uri')) {
                githubEnterpriseAuthProvider = new github_1.GitHubAuthenticationProvider(context, github_1.AuthProviderType.githubEnterprise);
                context.subscriptions.push(githubEnterpriseAuthProvider);
            }
        }
    }));
}
exports.activate = activate;
//# sourceMappingURL=extension.js.map