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