"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PURL_Type = exports.Interop = exports.Categories = void 0;
exports.getManifestData = getManifestData;
/** @fileoverview Main entry point for socket-registry package. */
// Type definitions
var Categories;
(function (Categories) {
    Categories["CLEANUP"] = "cleanup";
    Categories["LEVELUP"] = "levelup";
    Categories["SPEEDUP"] = "speedup";
    Categories["TUNEUP"] = "tuneup";
})(Categories || (exports.Categories = Categories = {}));
var Interop;
(function (Interop) {
    Interop["BROWSERIFY"] = "browserify";
    Interop["CJS"] = "cjs";
    Interop["ESM"] = "esm";
})(Interop || (exports.Interop = Interop = {}));
// Based on SocketPURL_Type from socket-sdk-js
var PURL_Type;
(function (PURL_Type) {
    PURL_Type["APK"] = "apk";
    PURL_Type["BITBUCKET"] = "bitbucket";
    PURL_Type["COCOAPODS"] = "cocoapods";
    PURL_Type["CARGO"] = "cargo";
    PURL_Type["CHROME"] = "chrome";
    PURL_Type["COMPOSER"] = "composer";
    PURL_Type["CONAN"] = "conan";
    PURL_Type["CONDA"] = "conda";
    PURL_Type["CRAN"] = "cran";
    PURL_Type["DEB"] = "deb";
    PURL_Type["DOCKER"] = "docker";
    PURL_Type["GEM"] = "gem";
    PURL_Type["GENERIC"] = "generic";
    PURL_Type["GITHUB"] = "github";
    PURL_Type["GOLANG"] = "golang";
    PURL_Type["HACKAGE"] = "hackage";
    PURL_Type["HEX"] = "hex";
    PURL_Type["HUGGINGFACE"] = "huggingface";
    PURL_Type["MAVEN"] = "maven";
    PURL_Type["MLFLOW"] = "mlflow";
    PURL_Type["NPM"] = "npm";
    PURL_Type["NUGET"] = "nuget";
    PURL_Type["QPKG"] = "qpkg";
    PURL_Type["OCI"] = "oci";
    PURL_Type["PUB"] = "pub";
    PURL_Type["PYPI"] = "pypi";
    PURL_Type["RPM"] = "rpm";
    PURL_Type["SWID"] = "swid";
    PURL_Type["SWIFT"] = "swift";
    PURL_Type["UNKNOWN"] = "unknown";
})(PURL_Type || (exports.PURL_Type = PURL_Type = {}));
// Main functionality
let _PackageURL;
/*@__NO_SIDE_EFFECTS__*/
function getPackageURL() {
    if (_PackageURL === undefined) {
        // The 'packageurl-js' package is browser safe.
        const packageUrlJs = /*@__PURE__*/ require('./external/@socketregistry/packageurl-js');
        _PackageURL = packageUrlJs.PackageURL;
    }
    return _PackageURL;
}
function getManifestData(eco, sockRegPkgName) {
    const registryManifest = /*@__PURE__*/ require('../manifest.json');
    if (eco) {
        const entries = registryManifest[eco];
        return sockRegPkgName
            ? entries?.find(({ 0: purlStr }) => getPackageURL().fromString(purlStr).name === sockRegPkgName)?.[1]
            : entries;
    }
    return registryManifest;
}
// Export ALL_CAPS constants
// Use wildcard re-export to avoid triggering lazy getters at module load time.
// This compiles to __exportStar which creates getter functions that are only
// invoked when someone actually accesses the properties. Previously, we had a
// default export using spread operator (...constants) which triggered all lazy
// getters immediately. Since no code uses the default export, we removed it to
// preserve lazy evaluation semantics.
// eslint-disable-next-line import-x/export
__exportStar(require("./lib/constants"), exports);
