"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../../Class/Functional");
const Image_1 = require("../../../../../../wrap/Image");
const _ids_1 = require("../../../../../_ids");
class Image0 extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['src'],
            o: ['image'],
        }, {
            output: {
                image: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_IMAGE);
    }
    async f({ src }, done) {
        const { api: { window: { Image }, }, } = this.__system;
        const image_ = new Image();
        image_.src = src;
        const image = (0, Image_1.wrapImage)(image_, this.__system);
        image_.onload = () => {
            done({
                image,
            });
        };
    }
}
exports.default = Image0;
//# sourceMappingURL=index.js.map