'use strict';

const Token = require('./Token-8c5ba5d9.js');
const index = require('./index-cc85865d.js');

var Account;
(function (Account) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.id) &&
            (value.reference == undefined || typeof value.reference == "string"));
    }
    Account.is = is;
    const transformers = [new index.Typeguard(is)];
    const verifier = index.Verifier.create().add(...transformers);
    async function verify(token) {
        return verifier.verify(token);
    }
    Account.verify = verify;
})(Account || (Account = {}));

var Bin;
(function (Bin) {
    function is(value) {
        return (typeof value == "object" &&
            (value.amex == undefined || typeof value.amex == "string") &&
            (value.dankort == undefined || typeof value.dankort == "string") &&
            (value.diners == undefined || typeof value.diners == "string") &&
            (value.discover == undefined || typeof value.discover == "string") &&
            (value.electron == undefined || typeof value.electron == "string") &&
            (value.interpayment == undefined || typeof value.interpayment == "string") &&
            (value.jcb == undefined || typeof value.jcb == "string") &&
            (value.maestro == undefined || typeof value.maestro == "string") &&
            (value.mastercard == undefined || typeof value.mastercard == "string") &&
            (value.unionpay == undefined || typeof value.unionpay == "string") &&
            (value.visa == undefined || typeof value.visa == "string"));
    }
    Bin.is = is;
    function flaw(value) {
        return {
            type: "model.Acquirer.Bin",
            flaws: typeof value.bin != "object"
                ? undefined
                : [
                    typeof value.bin.amex == "string" ||
                        value.bin.amex == undefined || { property: "amex", type: "string | undefined" },
                    typeof value.bin.dankort == "string" ||
                        value.bin.dankort == undefined || { property: "dankort", type: "string | undefined" },
                    typeof value.bin.diners == "string" ||
                        value.bin.diners == undefined || { property: "diners", type: "string | undefined" },
                    typeof value.bin.discover == "string" ||
                        value.bin.discover == undefined || { property: "discover", type: "string | undefined" },
                    typeof value.bin.electron == "string" ||
                        value.bin.electron == undefined || { property: "electron", type: "string | undefined" },
                    typeof value.bin.interpayment == "string" ||
                        value.bin.interpayment == undefined || { property: "interpayment", type: "string | undefined" },
                    typeof value.bin.jcb == "string" ||
                        value.bin.jcb == undefined || { property: "jcb", type: "string | undefined" },
                    typeof value.bin.maestro == "string" ||
                        value.bin.maestro == undefined || { property: "maestro", type: "string | undefined" },
                    typeof value.bin.mastercard == "string" ||
                        value.bin.mastercard == undefined || { property: "mastercard", type: "string | undefined" },
                    typeof value.bin.unionpay == "string" ||
                        value.bin.unionpay == undefined || { property: "unionpay", type: "string | undefined" },
                    typeof value.bin.visa == "string" ||
                        value.bin.visa == undefined || { property: "visa", type: "string | undefined" },
                ].filter(index.Flaw.is),
        };
    }
    Bin.flaw = flaw;
})(Bin || (Bin = {}));

var Protocol$1;
(function (Protocol) {
    function is(value) {
        return typeof value == "string" && (value == "clearhaus" || value == "intergiro");
    }
    Protocol.is = is;
})(Protocol$1 || (Protocol$1 = {}));

var Creatable$4;
(function (Creatable) {
    function is(value) {
        return (typeof value == "object" &&
            (value.id == undefined || typeof value.id == "string") &&
            (value.protocol == undefined || Protocol$1.is(value.protocol)) &&
            (value.url == undefined || typeof value.url == "string") &&
            (value.key == undefined || typeof value.key == "string") &&
            (value.bin == undefined || Bin.is(value.bin)));
    }
    Creatable.is = is;
})(Creatable$4 || (Creatable$4 = {}));

var Acquirer;
(function (Acquirer) {
    function is(value) {
        return (typeof value == "object" &&
            (value.id == undefined || typeof value.id == "string") &&
            Protocol$1.is(value.protocol) &&
            typeof value.url == "string" &&
            (typeof value.key == "string" || (typeof value.key == undefined && value.protocol == "intergiro")) &&
            (value.bin == undefined || Bin.is(value.bin)));
    }
    Acquirer.is = is;
    (function (Bin$1) {
        Bin$1.is = Bin.is;
        Bin$1.flaw = Bin.flaw;
    })(Acquirer.Bin || (Acquirer.Bin = {}));
    (function (Creatable) {
        Creatable.is = Creatable$4.is;
    })(Acquirer.Creatable || (Acquirer.Creatable = {}));
})(Acquirer || (Acquirer = {}));

var Cancel;
(function (Cancel) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.id) &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            typeof value.reference == "string" &&
            index.DateTime.is(value.created));
    }
    Cancel.is = is;
})(Cancel || (Cancel = {}));

var Creatable$3;
(function (Creatable) {
    function is(value) {
        return (typeof value == "object" &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            (value.amount == undefined || typeof value.amount == "number"));
    }
    Creatable.is = is;
})(Creatable$3 || (Creatable$3 = {}));

var Capture;
(function (Capture) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.id) &&
            typeof value.reference == "string" &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            index.DateTime.is(value.created) &&
            typeof value.amount == "number");
    }
    Capture.is = is;
    (function (Creatable) {
        Creatable.is = Creatable$3.is;
    })(Capture.Creatable || (Capture.Creatable = {}));
})(Capture || (Capture = {}));

var Creatable$2;
(function (Creatable) {
    function is(value) {
        return ((value.amount == undefined || typeof value.amount == "number") &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            Object.keys(value).every(key => key == "amount" || key == "descriptor"));
    }
    Creatable.is = is;
})(Creatable$2 || (Creatable$2 = {}));

var Refund;
(function (Refund) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.id) &&
            typeof value.amount == "number" &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            index.DateTime.is(value.created));
    }
    Refund.is = is;
    (function (Creatable) {
        Creatable.is = Creatable$2.is;
    })(Refund.Creatable || (Refund.Creatable = {}));
})(Refund || (Refund = {}));

var Base;
(function (Base) {
    function is(value) {
        return (typeof value == "object" &&
            (value.number == undefined || typeof value.number == "string") &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            (value.ip == undefined || typeof value.ip == "string") &&
            ((value.amount == undefined && value.currency == undefined) ||
                (typeof value.amount == "number" && index.Currency.is(value.currency))) &&
            (value.account == "create" || value.account == undefined || index.Token.is(value.account)) &&
            (value.callback == undefined || typeof value.callback == "string"));
    }
    Base.is = is;
})(Base || (Base = {}));

var Safe;
(function (Safe) {
    function is(value) {
        return typeof value == "object" && (value.card == undefined || index.Token.is(value.card)) && Base.is(value);
    }
    Safe.is = is;
})(Safe || (Safe = {}));

var Unsafe;
(function (Unsafe) {
    function is(value) {
        return (typeof value == "object" &&
            ((typeof value.amount == "number" &&
                index.Currency.is(value.currency) &&
                ((index.Card.Creatable.is(value.card) && (value.account == "create" || value.account == undefined)) ||
                    index.Token.is(value.account))) ||
                (value.amount == undefined &&
                    value.currency == undefined &&
                    index.Card.Creatable.is(value.card) &&
                    value.account == "create")) &&
            Base.is(value));
    }
    Unsafe.is = is;
})(Unsafe || (Unsafe = {}));

var Creatable$1;
(function (Creatable) {
    function is(value) {
        return Safe.is(value) || Unsafe.is(value);
    }
    Creatable.is = is;
    (function (Base$1) {
        Base$1.is = Base.is;
    })(Creatable.Base || (Creatable.Base = {}));
    (function (Safe$1) {
        Safe$1.is = Safe.is;
    })(Creatable.Safe || (Creatable.Safe = {}));
    (function (Unsafe$1) {
        Unsafe$1.is = Unsafe.is;
    })(Creatable.Unsafe || (Creatable.Unsafe = {}));
})(Creatable$1 || (Creatable$1 = {}));

var Authorization;
(function (Authorization) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.id) &&
            (value.number == undefined || typeof value.number == "string") &&
            typeof value.reference == "string" &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            (value.ip == undefined || typeof value.ip == "string") &&
            index.DateTime.is(value.created) &&
            ((typeof value.amount == "number" && index.Currency.is(value.currency)) ||
                (value.amount == undefined && value.currency == undefined)) &&
            index.Card.is(value.card) &&
            Array.isArray(value.capture) &&
            value.capture.every(Capture.is) &&
            Array.isArray(value.refund) &&
            value.refund.every(Refund.is) &&
            (value.cancel == undefined || Cancel.is(value.cancel)) &&
            (value.callback == undefined || typeof value.callback == "string"));
    }
    Authorization.is = is;
    const transformers = [new index.Typeguard(is)];
    const verifier = index.Verifier.create().add(...transformers);
    async function verify(token) {
        return verifier.verify(token);
    }
    Authorization.verify = verify;
    (function (Creatable) {
        Creatable.is = Creatable$1.is;
        (function (Base) {
            Base.is = Creatable$1.Base.is;
        })(Creatable.Base || (Creatable.Base = {}));
        (function (Safe) {
            Safe.is = Creatable$1.Safe.is;
        })(Creatable.Safe || (Creatable.Safe = {}));
        (function (Unsafe) {
            Unsafe.is = Creatable$1.Unsafe.is;
        })(Creatable.Unsafe || (Creatable.Unsafe = {}));
    })(Authorization.Creatable || (Authorization.Creatable = {}));
})(Authorization || (Authorization = {}));

var CategoryCode;
(function (CategoryCode) {
    function is(value) {
        return typeof value == "string" && value.length == 4 && Array.from(value).every(c => c >= "0" && c <= "9");
    }
    CategoryCode.is = is;
    function flaw(value) {
        return { type: "string", condition: "Four digits." };
    }
    CategoryCode.flaw = flaw;
})(CategoryCode || (CategoryCode = {}));

var Protocol;
(function (Protocol) {
    function is(value) {
        return value == "ch3d1" || value == "ch3d2";
    }
    Protocol.is = is;
    function flaw(value) {
        return { type: "model.Merchant.Emv3d.Protocol", condition: '"ch3d1" | "ch3d2"' };
    }
    Protocol.flaw = flaw;
})(Protocol || (Protocol = {}));

var Configuration;
(function (Configuration) {
    function is(value) {
        return (typeof value == "object" &&
            Protocol.is(value.protocol) &&
            typeof value.url == "string" &&
            typeof value.key == "string");
    }
    Configuration.is = is;
    function flaw(value) {
        return {
            type: "model.Merchant.Emv3d.Configuration",
            flaws: typeof value != "object"
                ? undefined
                : [
                    Protocol.is(value.protocol) || Protocol.flaw(value.protocol),
                    typeof value.url == "string" || { property: "url", type: "string" },
                    typeof value.key == "string" || { property: "key", type: "string" },
                ].filter(index.Flaw.is),
        };
    }
    Configuration.flaw = flaw;
})(Configuration || (Configuration = {}));

var Emv3d;
(function (Emv3d) {
    function is(value) {
        return Configuration.is(value) || (Array.isArray(value) && value.every(Configuration.is));
    }
    Emv3d.is = is;
    function flaw(value) {
        return {
            type: "model.Merchant.Emv3d",
            condition: "model.Merchant.Emv3d.Configuration | model.Merchant.Emv3d.Configuration[]",
        };
    }
    Emv3d.flaw = flaw;
    (function (Configuration$1) {
        Configuration$1.is = Configuration.is;
        Configuration$1.flaw = Configuration.flaw;
    })(Emv3d.Configuration || (Emv3d.Configuration = {}));
    (function (Protocol$1) {
        Protocol$1.is = Protocol.is;
        Protocol$1.flaw = Protocol.flaw;
    })(Emv3d.Protocol || (Emv3d.Protocol = {}));
})(Emv3d || (Emv3d = {}));

var Creatable;
(function (Creatable) {
    function is(value) {
        return (typeof value == "object" &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            (value.country == undefined || index.Alpha2.is(value.country)) &&
            (value.acquirer == undefined || Creatable$4.is(value.acquirer)) &&
            (value.mid == undefined || typeof value.mid == "string") &&
            (value.mcc == undefined || CategoryCode.is(value.mcc)) &&
            (value.emv3d == undefined || Emv3d.is(value.emv3d)) &&
            (value.url == undefined || typeof value.url == "string") &&
            (value.id == undefined || Token.Identifier.is(value.id)));
    }
    Creatable.is = is;
    function flaw(value) {
        return {
            type: "model.Merchant.Card.Creatable",
            flaws: typeof value != "object"
                ? undefined
                : [
                    value.descriptor == undefined ||
                        typeof value.descriptor == "string" || { property: "descriptor", type: "string | undefined" },
                    value.country == undefined ||
                        index.Alpha2.is(value.country) || {
                        property: "country",
                        type: "isoly.CountryCode | undefined",
                    },
                    value.acquirer == undefined ||
                        Creatable$4.is(value.acquirer) || {
                        property: "acquirer",
                        type: "model.Acquirer.Creatable | undefined",
                    },
                    value.mid == undefined || typeof value.mid == "string" || { property: "mid", type: "string | undefined" },
                    value.mcc == undefined ||
                        CategoryCode.is(value.mcc) || { property: "mcc", type: "model.Merchant.CategoryCode | undefined" },
                    value.emv3d == undefined || Emv3d.is(value.emv3d) || { property: "emv3d", ...Emv3d.flaw(value.emv3d) },
                    value.url == undefined || typeof value.url == "string" || { property: "url", type: "string | undefined" },
                    value.id == undefined ||
                        Token.Identifier.is(value.id) || { property: "id", type: "authly.Identifier | undefined" },
                ].filter(index.Flaw.is),
        };
    }
    Creatable.flaw = flaw;
})(Creatable || (Creatable = {}));

var Card;
(function (Card) {
    function is(value) {
        return (typeof value == "object" &&
            (value.descriptor == undefined || typeof value.descriptor == "string") &&
            index.Alpha2.is(value.country) &&
            Acquirer.is(value.acquirer) &&
            (value.mid == undefined || typeof value.mid == "string") &&
            (value.mcc == undefined || CategoryCode.is(value.mcc)) &&
            (value.emv3d == undefined || Emv3d.is(value.emv3d)) &&
            (value.url == undefined || typeof value.url == "string") &&
            (value.id == undefined || Token.Identifier.is(value.id)));
    }
    Card.is = is;
    function flaw(value) {
        return {
            type: "model.Merchant.Card",
            flaws: typeof value != "object"
                ? undefined
                : [
                    value.descriptor == undefined ||
                        typeof value.descriptor == "string" || { property: "descriptor", type: "string | undefined" },
                    index.Alpha2.is(value.country) || { property: "country", type: "isoly.CountryCode" },
                    Acquirer.is(value.acquirer) || { property: "acquirer", type: "model.Acquirer" },
                    value.mid == undefined || typeof value.mid == "string" || { property: "mid", type: "string | undefined" },
                    value.mcc == undefined ||
                        CategoryCode.is(value.mcc) || { property: "mcc", type: "model.Merchant.CategoryCode | undefined" },
                    value.emv3d == undefined || Emv3d.is(value.emv3d) || { property: "emv3d", ...Emv3d.flaw(value.emv3d) },
                    typeof value.url == "string" || { property: "url", type: "string" },
                    value.id == undefined ||
                        Token.Identifier.is(value.id) || { property: "id", type: "authly.Identifier | undefined" },
                ].filter(index.Flaw.is),
        };
    }
    Card.flaw = flaw;
    (function (Creatable$1) {
        Creatable$1.is = Creatable.is;
        Creatable$1.flaw = Creatable.flaw;
    })(Card.Creatable || (Card.Creatable = {}));
})(Card || (Card = {}));

var Merchant;
(function (Merchant) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.id) &&
            typeof value.name == "string" &&
            typeof value.url == "string" &&
            Card.is(value.card) &&
            typeof value.card.url == "string" &&
            (value.card.id == undefined || Token.Identifier.is(value.card.id)));
    }
    Merchant.is = is;
    function flaw(value) {
        var _a;
        return {
            type: "model.Merchant",
            flaws: typeof value != "object"
                ? undefined
                : [
                    Token.Identifier.is(value.id) || { property: "id", type: "authly.Identifier" },
                    typeof value.name == "string" || { property: "name", type: "string" },
                    typeof value.url == "string" || { property: "url", type: "string" },
                    ...((_a = Card.flaw(value.card).flaws) !== null && _a !== void 0 ? _a : [
                        { property: "card", type: "model.Merchant.Configuration", flaws: undefined },
                    ]),
                ].filter(index.Flaw.is),
        };
    }
    Merchant.flaw = flaw;
    (function (Card$1) {
        Card$1.is = Card.is;
        Card$1.flaw = Card.flaw;
        (function (Creatable$1) {
            Creatable$1.is = Creatable.is;
            Creatable$1.flaw = Creatable.flaw;
        })(Card$1.Creatable || (Card$1.Creatable = {}));
    })(Merchant.Card || (Merchant.Card = {}));
    (function (Emv3d$1) {
        Emv3d$1.is = Emv3d.is;
        Emv3d$1.flaw = Emv3d.flaw;
        (function (Configuration) {
            Configuration.is = Emv3d.Configuration.is;
            Configuration.flaw = Emv3d.Configuration.flaw;
        })(Emv3d$1.Configuration || (Emv3d$1.Configuration = {}));
        (function (Protocol) {
            Protocol.is = Emv3d.Protocol.is;
            Protocol.flaw = Emv3d.Protocol.flaw;
        })(Emv3d$1.Protocol || (Emv3d$1.Protocol = {}));
    })(Merchant.Emv3d || (Merchant.Emv3d = {}));
})(Merchant || (Merchant = {}));

var Agent;
(function (Agent) {
    function is(value) {
        return (typeof value == "object" &&
            typeof value.sub == "string" &&
            typeof value.iss == "string" &&
            value.aud == "agent" &&
            typeof value.iat == "number" &&
            typeof value.name == "string" &&
            (value.url == undefined || typeof value.url == "string") &&
            (value.card == undefined || Merchant.Card.Creatable.is(value.card)));
    }
    Agent.is = is;
    function flaw(value) {
        return {
            type: "model.Key.Agent",
            flaws: typeof value != "object"
                ? undefined
                : [
                    typeof value.sub == "string" || {
                        property: "sub",
                        type: "string",
                        condition: "Agent identifier.",
                    },
                    typeof value.iss == "string" || { property: "iss", type: "string", condition: "Key issuer." },
                    value.aud == "agent" || {
                        property: "aud",
                        type: `"agent"`,
                        condition: "Key audience.",
                    },
                    typeof value.iat == "number" || { property: "iat", type: "number", condition: "Issued timestamp." },
                    typeof value.name == "string" || { property: "name", type: "string" },
                    value.url == undefined || typeof value.url == "string" || { property: "url", type: "string | undefined" },
                    ...(value.card == undefined || Merchant.Card.Creatable.is(value.card)
                        ? []
                        : [
                            {
                                property: "card",
                                type: "model.Merchant.Card.Creatable",
                                flaws: Merchant.Card.Creatable.flaw(value.card).flaws,
                            },
                        ]),
                ].filter(index.Flaw.is),
        };
    }
    Agent.flaw = flaw;
})(Agent || (Agent = {}));

var Audience;
(function (Audience) {
    function is(value) {
        return value == "agent" || value == "private" || value == "customer" || value == "public";
    }
    Audience.is = is;
})(Audience || (Audience = {}));

var Key$1;
(function (Key) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.sub) &&
            typeof value.iss == "string" &&
            typeof value.iat == "number" &&
            (value.aud == "public" || value.aud == "private") &&
            typeof value.name == "string" &&
            typeof value.url == "string" &&
            Card.is(value));
    }
    Key.is = is;
    function flaw(value) {
        return {
            type: "model.Key.V1.Key",
            flaws: typeof value != "object"
                ? undefined
                : [
                    typeof value.sub == "string" || {
                        property: "sub",
                        type: "authly.Identifier",
                        condition: "Merchant identifier.",
                    },
                    typeof value.iss == "string" || { property: "iss", type: "string", condition: "Key issuer." },
                    typeof value.aud == "string" || {
                        property: "aud",
                        type: `"public" | "private"`,
                        condition: "Key audience.",
                    },
                    typeof value.iat == "number" || { property: "iat", type: "number", condition: "Issued timestamp." },
                    typeof value.name == "string" || { property: "name", type: "string" },
                    typeof value.url == "string" || { property: "url", type: "string" },
                    ...(Card.flaw(value).flaws || []),
                ].filter(index.Flaw.is),
        };
    }
    Key.flaw = flaw;
})(Key$1 || (Key$1 = {}));

var Key;
(function (Key_1) {
    function is(value) {
        return (typeof value == "object" &&
            Token.Identifier.is(value.sub) &&
            typeof value.iss == "string" &&
            (Audience.is(value.aud) || (Array.isArray(value.aud) && value.aud.every(Audience.is))) &&
            typeof value.iat == "number" &&
            typeof value.name == "string" &&
            typeof value.url == "string" &&
            Card.is(value.card));
    }
    Key_1.is = is;
    function flaw(value) {
        var _a;
        return {
            type: "model.Key",
            flaws: typeof value != "object"
                ? undefined
                : [
                    typeof value.sub == "string" || {
                        property: "sub",
                        type: "authly.Identifier",
                        condition: "Merchant identifier.",
                    },
                    typeof value.iss == "string" || { property: "iss", type: "string", condition: "Key issuer." },
                    Audience$1.is(value.aud) ||
                        (Array.isArray(value.aud) && value.aud.every(Audience$1.is)) || {
                        property: "aud",
                        type: `"agent" | "customer" | "public" | "private"`,
                        condition: "Key audience.",
                    },
                    typeof value.iat == "number" || { property: "iat", type: "number", condition: "Issued timestamp." },
                    typeof value.name == "string" || { property: "name", type: "string" },
                    typeof value.url == "string" || { property: "url", type: "string" },
                    ...((_a = Creatable.flaw(value.card).flaws) !== null && _a !== void 0 ? _a : [
                        { property: "card", type: "model.Merchant.Card.Creatable", flaws: undefined },
                    ]),
                ].filter(index.Flaw.is),
        };
    }
    Key_1.flaw = flaw;
    function upgrade(key) {
        return key == undefined
            ? undefined
            : is(key)
                ? key
                : {
                    sub: key.sub,
                    iss: key.iss,
                    aud: key.aud,
                    iat: key.iat,
                    name: key.name,
                    url: key.url,
                    card: {
                        url: key.iss,
                        id: key.sub,
                        country: key.country,
                        acquirer: key.acquirer,
                        mid: key.mid,
                        mcc: key.mcc,
                        emv3d: key.emv3d,
                    },
                };
    }
    Key_1.upgrade = upgrade;
    async function extractCardUrl(key, ...audience) {
        var _a;
        let result;
        let unpacked;
        if (key) {
            unpacked = await index.Verifier$1.create().verify(key, ...audience);
            if (unpacked && ((_a = unpacked.option) === null || _a === void 0 ? void 0 : _a.card)) {
                unpacked = await index.Verifier$1.create().verify(unpacked.option.card, ...audience);
                result = unpacked === null || unpacked === void 0 ? void 0 : unpacked.iss;
            }
            else if (unpacked)
                result =
                    typeof unpacked.card == "object" && !Array.isArray(unpacked.card) && typeof unpacked.card.url == "string"
                        ? unpacked.card.url
                        : unpacked.iss;
        }
        return result;
    }
    Key_1.extractCardUrl = extractCardUrl;
    let Audience$1;
    (function (Audience$1) {
        Audience$1.is = Audience.is;
    })(Audience$1 = Key_1.Audience || (Key_1.Audience = {}));
    (function (Agent$1) {
        Agent$1.is = Agent.is;
        Agent$1.flaw = Agent.flaw;
    })(Key_1.Agent || (Key_1.Agent = {}));
    (function (V1) {
        (function (Key) {
            Key.is = Key$1.is;
            Key.flaw = Key$1.flaw;
        })(V1.Key || (V1.Key = {}));
    })(Key_1.V1 || (Key_1.V1 = {}));
})(Key || (Key = {}));
