"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Holder_1 = require("../../../../../Class/Holder");
const Blob_1 = require("../../../../../wrap/Blob");
const _ids_1 = require("../../../../_ids");
class ToBlob extends Holder_1.Holder {
    constructor(system) {
        super({
            fi: ['res', 'any'],
            fo: ['blob'],
            i: [],
            o: [],
        }, {
            input: {
                res: {
                    ref: true,
                },
            },
            output: {
                blob: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_TO_BLOB_0);
    }
    async f({ res }, done) {
        let blob_;
        try {
            blob_ = await res.toBlob();
        }
        catch (err) {
            done(undefined, err.message.toLowerCase());
            return;
        }
        const blob = (0, Blob_1.wrapBlob)(blob_, this.__system);
        done({ blob });
    }
}
exports.default = ToBlob;
//# sourceMappingURL=index.js.map