"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Semifunctional_1 = require("../../../../../Class/Semifunctional");
const _ids_1 = require("../../../../_ids");
class Pop extends Semifunctional_1.Semifunctional {
    constructor(system) {
        super({
            fi: ['a', 'any'],
            fo: ['last'],
            i: [],
            o: ['done'],
        }, {
            input: {
                a: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_POP_0);
    }
    async f({ a }, done, fail) {
        let last;
        try {
            last = await a.pop();
        }
        catch (err) {
            fail(err.message);
            return;
        }
        done({ last });
    }
    b() {
        this._output.done.push(true);
    }
}
exports.default = Pop;
//# sourceMappingURL=index.js.map