import { ConvertLatexWithPdfLatexBrowserInputModel, ConvertLatexWithPdfLatexBrowserOutputModel, } from '../../../../../code/type/index.js';
import { buildFormDataRequestToConvert } from '../../shared.js';
import { resolveWorkFileAsBlob } from '../../../../../code/tool/shared/work.js';
import kink from '../../../../../code/tool/shared/kink.js';
export async function convertLatexWithPdfLatexBrowser(source) {
    const input = ConvertLatexWithPdfLatexBrowserInputModel.parse(source);
    switch (input.handle) {
        case 'remote':
            return await convertLatexWithPdfLatexBrowserRemote(input);
        default:
            return await convertLatexWithPdfLatexBrowserLocal(input);
    }
}
export async function convertLatexWithPdfLatexBrowserRemote(input) {
    const request = buildFormDataRequestToConvert(input);
    const content = await resolveWorkFileAsBlob(request);
    return ConvertLatexWithPdfLatexBrowserOutputModel.parse({
        file: {
            content,
        },
    });
}
export async function convertLatexWithPdfLatexBrowserLocal(input) {
    throw kink('task_not_implemented', {
        task: 'convertLatexWithPdfLatexBrowserLocal',
    });
}
//# sourceMappingURL=browser.js.map