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