"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.javascriptWebBlockedByFrameworkPackage = javascriptWebBlockedByFrameworkPackage;
const package_json_1 = require("../../utils/package-json");
const utils_1 = require("../javascript-web/utils");
const vue_powered_docs_site_1 = require("./vue-powered-docs-site");
/**
 * When true, the JavaScript (Web) fallback should not claim this project:
 * a more specific browser integration already applies.
 *
 * Some stacks still declare a framework package for unrelated reasons (e.g.
 * VitePress lists `vue`); those are handled via per-package exceptions below.
 */
function javascriptWebBlockedByFrameworkPackage(packageJson) {
    for (const frameworkPkg of utils_1.FRAMEWORK_PACKAGES) {
        if (!(0, package_json_1.hasPackageInstalled)(frameworkPkg, packageJson))
            continue;
        if (allowsJavascriptWebDespiteFrameworkSignal(frameworkPkg, packageJson)) {
            continue;
        }
        return true;
    }
    return false;
}
function allowsJavascriptWebDespiteFrameworkSignal(frameworkPkg, packageJson) {
    switch (frameworkPkg) {
        case 'vue':
            return (0, vue_powered_docs_site_1.isVuePoweredDocsSite)(packageJson);
        default:
            return false;
    }
}
