const categoryMatchers = [
    ["cameras", [/Camera$/, /^PerspectiveCamera$/, /^OrthographicCamera$/, /^CubeCamera$/]],
    ["lights", [/Light$/, /^AmbientLight$/, /^DirectionalLight$/, /^PointLight$/, /^SpotLight$/, /^HemisphereLight$/, /^RectAreaLight/]],
    ["materials", [/Material$/, /^Mesh.*Material$/, /^Line.*Material$/, /^PointsMaterial$/, /^SpriteMaterial$/, /^ShaderMaterial$/]],
    ["geometries", [/Geometry$/, /^BufferGeometry$/, /^BoxGeometry$/, /^SphereGeometry$/, /^PlaneGeometry$/, /^CylinderGeometry$/, /^Torus/]],
    ["textures", [/Texture$/, /^DataTexture$/, /^CubeTexture$/, /^CanvasTexture$/, /^VideoTexture$/, /^FramebufferTexture$/]],
    ["animation", [/Animation/, /^KeyframeTrack$/, /^Skeleton$/, /^SkinnedMesh$/, /^Bone$/, /^PropertyBinding$/, /^PropertyMixer$/]],
    ["helpers", [/Helper$/, /^AxesHelper$/, /^GridHelper$/, /^CameraHelper$/]],
    ["renderers", [/Renderer$/, /^WebGL/, /^Render/]],
    ["webxr", [/XR/, /^WebXR/]],
    ["math", [/^Vector/, /^Matrix/, /^Quaternion$/, /^Euler$/, /^Color$/, /^Box/, /^Sphere$/, /^Ray$/, /^Plane$/, /^Frustum$/, /^MathUtils$/, /^Spherical$/, /^Cylindrical$/]],
    ["core", [/^Object3D$/, /^Scene$/, /^Mesh$/, /^Group$/, /^BufferAttribute$/, /^Instanced/, /^Raycaster$/, /^Layers$/, /^Clock$/, /^EventDispatcher$/]]
];
export const REQUIRED_THREE_API_CATEGORIES = [
    "core",
    "math",
    "cameras",
    "lights",
    "materials",
    "geometries",
    "textures",
    "loaders",
    "controls",
    "postprocessing",
    "animation",
    "helpers",
    "renderers",
    "webxr",
    "examples"
];
export const THREE_EXAMPLES_INVENTORY = [
    ...exampleEntries("loaders", [
        "GLTFLoader", "DRACOLoader", "KTX2Loader", "OBJLoader", "MTLLoader", "FBXLoader", "ColladaLoader", "PLYLoader", "STLLoader",
        "SVGLoader", "RGBELoader", "EXRLoader", "HDRCubeTextureLoader", "TextureLoader", "CubeTextureLoader", "LUTCubeLoader", "TGALoader", "VOXLoader"
    ]),
    ...exampleEntries("controls", [
        "OrbitControls", "MapControls", "TrackballControls", "FlyControls", "FirstPersonControls", "PointerLockControls", "DragControls",
        "TransformControls", "ArcballControls", "DeviceOrientationControls"
    ]),
    ...exampleEntries("postprocessing", [
        "EffectComposer", "RenderPass", "ShaderPass", "UnrealBloomPass", "SSAOPass", "TAARenderPass", "SMAAPass", "FXAAShader", "BokehPass",
        "OutlinePass", "FilmPass", "AfterimagePass", "GlitchPass", "DotScreenPass", "LUTPass"
    ]),
    ...exampleEntries("webxr", [
        "VRButton",
        "ARButton",
        "XRButton",
        "XRControllerModelFactory",
        "XRHandModelFactory",
        "OculusHandModel",
        "XRPlanes",
        "WebXRManager"
    ]),
    ...exampleEntries("examples", [
        "webgl_animation_skinning_blending", "webgl_animation_keyframes", "webgl_loader_gltf", "webgl_loader_obj_mtl",
        "webgl_materials_physical_clearcoat", "webgl_materials_envmaps_hdr", "webgl_postprocessing_unreal_bloom", "webgl_postprocessing_dof",
        "webgl_instancing_performance", "webgl_interactive_raycasting_points", "webgl_geometry_terrain", "webgl_shaders_ocean",
        "webgl_points_sprites", "webgl_lines_fat", "webgl_morphtargets", "webgl_shadowmap_pcss", "webgl_lights_rectarealight",
        "webgl_clipping", "webgl_multiple_rendertargets", "webgl2_materials_texture3d", "webgl2_multisampled_renderbuffers",
        "webxr_vr_ballshooter", "webxr_ar_cones"
    ])
];
export function buildThreeApiInventory(threeVersion, threeExportNames) {
    const entries = [
        ...[...threeExportNames].sort().map((name) => ({
            name,
            category: categorizeThreeExport(name),
            source: "three",
            importPath: "three"
        })),
        ...THREE_EXAMPLES_INVENTORY
    ];
    const categories = Object.fromEntries(REQUIRED_THREE_API_CATEGORIES.map((category) => [
        category,
        entries.filter((entry) => entry.category === category).length
    ]));
    return {
        threeVersion,
        generatedFromPackage: "three",
        entries,
        categories
    };
}
export function categorizeThreeExport(name) {
    for (const [category, matchers] of categoryMatchers) {
        if (matchers.some((matcher) => matcher.test(name)))
            return category;
    }
    return "core";
}
function exampleEntries(category, names) {
    return names.map((name) => ({
        name,
        category,
        source: "three/examples",
        importPath: `three/examples/jsm/${category}/${name}.js`
    }));
}
//# sourceMappingURL=ThreeApiInventory.js.map