import { ConvertDocumentWithPandocBrowserInputModel, ConvertDocumentWithPandocBrowserOutputModel, } 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 convertDocumentWithPandocBrowser(source) {
    const input = ConvertDocumentWithPandocBrowserInputModel.parse(source);
    switch (input.handle) {
        case 'remote':
            return await convertDocumentWithPandocBrowserRemote(input);
        default:
            return await convertDocumentWithPandocBrowserLocal(input);
    }
}
export async function convertDocumentWithPandocBrowserRemote(input) {
    const request = buildFormDataRequestToConvert(input);
    const content = await resolveWorkFileAsBlob(request);
    return ConvertDocumentWithPandocBrowserOutputModel.parse({
        file: {
            content,
        },
    });
}
export async function convertDocumentWithPandocBrowserLocal(input) {
    throw kink('task_not_implemented', {
        task: 'convertDocumentWithPandocBrowserLocal',
    });
}
//# sourceMappingURL=browser.js.map