"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class EncodeURIComponent extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['text'],
            o: ['uri'],
        }, {}, system, _ids_1.ID_ENCODE_URI_COMPONENT);
    }
    f({ text }, done) {
        const { api: { uri: { encodeURIComponent }, }, } = this.__system;
        let uri;
        try {
            uri = encodeURIComponent(text);
        }
        catch (err) {
            done(undefined, err.message);
            return;
        }
        done({ uri });
    }
}
exports.default = EncodeURIComponent;
//# sourceMappingURL=index.js.map