"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Holder_1 = require("../../../Class/Holder");
const FormData_1 = require("../../../wrap/FormData");
const _ids_1 = require("../../_ids");
class FormData_ extends Holder_1.Holder {
    constructor(system) {
        super({
            fi: ['data'],
            fo: ['form'],
            i: [],
            o: [],
        }, {
            output: {
                form: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_FORM_DATA);
        this.__ = ['U'];
    }
    f(i, done) {
        const { data } = i;
        const form_ = new FormData();
        for (const key in data) {
            if (data.hasOwnProperty(key)) {
                const value = data[key];
                form_.append(key, value);
            }
        }
        const form = (0, FormData_1.wrapFormData)(form_, this.__system);
        done({
            form,
        });
    }
}
exports.default = FormData_;
//# sourceMappingURL=index.js.map