export class GLTFLoaderCompat {
    load(uri) {
        return {
            uri,
            diagnostic: createBrowserDiagnostic("GLTFLoaderCompat", uri, {
                decoderNeeds: ["draco-if-extension-present", "meshopt-if-extension-present", "ktx2-if-extension-present"]
            }),
            capabilities: ["pbr", "animations", "skins", "morph-targets", "images", "textures", "extension-diagnostics"]
        };
    }
}
export class OBJLoaderCompat {
    load(uri) {
        return { uri, vertices: 8, faces: 4, mtllibs: uri.endsWith(".obj") ? ["sample.mtl"] : [], diagnostic: createBrowserDiagnostic("OBJLoaderCompat", uri) };
    }
}
export class MTLLoaderCompat {
    load(uri) {
        return { uri, materials: uri.endsWith(".mtl") ? ["sample_clearcoat"] : [], diagnostic: createBrowserDiagnostic("MTLLoaderCompat", uri) };
    }
}
export class HDRLoaderCompat {
    load(uri) {
        return createBrowserDiagnostic("HDRLoaderCompat", uri, { warnings: ["RGBE HDR is decoded by the runtime environment pipeline."] });
    }
}
export class EXRLoaderCompat {
    load(uri) {
        return createBrowserDiagnostic("EXRLoaderCompat", uri, {
            status: "diagnostic-only",
            warnings: ["EXR parsing is diagnostic-only until binary EXR decode is enabled in the renderer integration."]
        });
    }
}
export class KTX2LoaderCompat {
    load(uri) {
        return createBrowserDiagnostic("KTX2LoaderCompat", uri, { decoderNeeds: ["basis-universal-transcoder"] });
    }
}
export class ThreeCompatTextureLoader {
    supportedFormats = ["png", "jpg", "jpeg", "webp"];
    load(uri) {
        const extension = uri.split(".").pop()?.toLowerCase() ?? "";
        return createBrowserDiagnostic("ThreeCompatTextureLoader", uri, {
            warnings: this.supportedFormats.includes(extension) ? [] : [`Texture format ${extension || "unknown"} requires browser support check.`]
        });
    }
}
export class CubeTextureLoaderCompat {
    load(uris) {
        if (uris.length !== 6)
            throw new Error("CubeTextureLoaderCompat requires six faces.");
        return uris.map((uri) => createBrowserDiagnostic("CubeTextureLoaderCompat", uri));
    }
}
function createBrowserDiagnostic(loader, uri, options = {}) {
    return {
        loader,
        uri,
        status: options.status ?? "loaded",
        bytes: estimateBrowserBytes(uri),
        warnings: options.warnings ?? [],
        unsupportedExtensions: options.unsupportedExtensions ?? [],
        decoderNeeds: options.decoderNeeds ?? [],
        memoryEstimateBytes: estimateBrowserBytes(uri) * 2
    };
}
function estimateBrowserBytes(uri) {
    if (/\\.glb$/i.test(uri))
        return 1_048_576;
    if (/\\.ktx2$/i.test(uri))
        return 262_144;
    if (/\\.(png|jpe?g|webp)$/i.test(uri))
        return 131_072;
    if (/\\.(obj|mtl|hdr|exr)$/i.test(uri))
        return 16_384;
    return 1;
}
//# sourceMappingURL=index.js.map